Skip to content

edslib runtime lib improved portability#114

Open
mabeh19 wants to merge 2 commits into
nasa:devfrom
mabeh19:dev
Open

edslib runtime lib improved portability#114
mabeh19 wants to merge 2 commits into
nasa:devfrom
mabeh19:dev

Conversation

@mabeh19
Copy link
Copy Markdown

@mabeh19 mabeh19 commented May 13, 2026

Describe the contribution
Removed non standard C library headers, replaced strcasecmp with local helper function.

Testing performed
Built on Windows using VS2026, cmake and MSVC
Built on Linux using cmake and gcc

Tested new local helper against strcasecmp. See end of PR for list of comparisons
Checked with CppCheck with flags --enable=all --check-level=exhaustive

Expected behavior changes
No impact to behavior.

System(s) tested on
Windows 11 Home 25H2, build 26200.8246
Xubuntu 24.04.3 LTS x86_64 VMWare Virtual machine, kernel 6.17.0-22-generic

Contributor Info - All information REQUIRED for consideration of pull request
Mathias Ingeman Behrens, Personal

Tested comparisons

  1. "abc", "ABC"
  2. "a1A", "A1a"
  3. "123", "123"
  4. "", ""
  5. "abc", "abd"
  6. "abc", "cba"
  7. "1", "1234"
  8. "1234", "1"
  9. "trU", "true"
  10. "truee", "true"

Copy link
Copy Markdown
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

int32_t Result = 0;
int32_t Char1 = 0;
int32_t Char2 = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Char1 and Char2 should be int here as opposed to int32_t (this is the type needed for ctype.h macros)
Also remove init to 0 because its done later from string data (static analysis will complain about this)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good observation, has been adjusted accordingly


Char1 = (int32_t)String1[Index];
Char2 = (int32_t)String2[Index];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this before the "if" and then compare Char1 and Char2 rather than String1[Index] (more readable, I think)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Has been cleaned up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants