Skip to content

Conversation

@enzoevers
Copy link
Owner

No description provided.

@enzoevers enzoevers linked an issue Jun 5, 2025 that may be closed by this pull request
@enzoevers enzoevers requested a review from Copilot June 5, 2025 08:49

This comment was marked as outdated.

@enzoevers enzoevers force-pushed the make-scripts-run-via-all-terminals branch 2 times, most recently from c475d95 to 2e8b49f Compare June 5, 2025 11:35
@enzoevers enzoevers requested a review from Copilot June 5, 2025 11:36

This comment was marked as outdated.

@enzoevers enzoevers force-pushed the make-scripts-run-via-all-terminals branch 4 times, most recently from 8b58657 to a91c5b6 Compare June 7, 2025 09:37
@enzoevers
Copy link
Owner Author

enzoevers commented Jun 7, 2025

All tests and benchmarks pass with commit a91c5b6 in

  • Windows bash shell (MINGW64 / Git bash)
  • Command Prompt
  • Power Shell

@enzoevers enzoevers force-pushed the make-scripts-run-via-all-terminals branch from a91c5b6 to 6d146da Compare June 7, 2025 11:40
@enzoevers enzoevers marked this pull request as ready for review June 7, 2025 11:40
@enzoevers enzoevers requested a review from Copilot June 7, 2025 11:40
@enzoevers enzoevers changed the title wip: normilize path separators Normilize path separators Jun 7, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces functions to normalize file path separators and updates both the implementation and tests accordingly.

  • Added new functions IsPathNormalized and NormailizePathSeparatorsInPlace in FileUtils.h and implemented them in FileUtils.c.
  • Updated main.c to utilize the new normalization function when processing input paths.
  • Expanded the test suite in TestFileUtils.c to cover both normalized and unnormalized path cases.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
CoDeLib/include/CoDeLib/FileUtils/FileUtils.h Added declarations for path normalization functions.
CoDeLib/FileUtils/src/FileUtils.c Implemented the normalization functions and integrated them into other APIs.
CoDeLib/Test/src/main.c Updated usage of path normalization for processing input paths.
CoDeLib/Test/src/TestFileUtils.c Added test cases to validate path normalization behavior.
Comments suppressed due to low confidence (1)

CoDeLib/include/CoDeLib/FileUtils/FileUtils.h:28

  • Consider renaming 'NormailizePathSeparatorsInPlace' to 'NormalizePathSeparatorsInPlace' to correct the spelling and improve clarity.
char *NormailizePathSeparatorsInPlace(char *pPath);

return false;
}

for (size_t i = 0; i < strlen(pPath); ++i) {
Copy link

Copilot AI Jun 7, 2025

Choose a reason for hiding this comment

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

Store the result of strlen(pPath) in a local variable before the loop to avoid multiple calls during iteration.

Suggested change
for (size_t i = 0; i < strlen(pPath); ++i) {
size_t pathLength = strlen(pPath);
for (size_t i = 0; i < pathLength; ++i) {

Copilot uses AI. Check for mistakes.
return NULL;
}

for (size_t i = 0; i < strlen(pPath); ++i) {
Copy link

Copilot AI Jun 7, 2025

Choose a reason for hiding this comment

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

Storing the length of pPath in a variable before iterating can improve performance by preventing repeated calls to strlen.

Suggested change
for (size_t i = 0; i < strlen(pPath); ++i) {
size_t pathLength = strlen(pPath);
for (size_t i = 0; i < pathLength; ++i) {

Copilot uses AI. Check for mistakes.
@enzoevers
Copy link
Owner Author

Tests and benchmark from 6d146da also pass on the Zybo.

@enzoevers enzoevers merged commit dac3892 into main Jun 7, 2025
21 checks passed
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.

Make all script be runnable on all terminals

2 participants