Skip to content

Conversation

@harship04
Copy link

Update variable names to camelCase per OMR coding standards

It resolves naming inconsistencies introduced in:

PR #7681: Add an API for system processes
PR #7772: Extend SystemProcesses API implementation to AIX

@harship04 harship04 requested a review from babsingh as a code owner July 5, 2025 16:40
@harship04
Copy link
Author

@babsingh Could you please confirm if my variable name updates are sufficient, or if any further changes are needed

* A helper function to fully read a file.
*/
static intptr_t
read_fully(struct OMRPortLibrary *portLibrary, intptr_t file, char **data, uintptr_t *size)
Copy link
Contributor

Choose a reason for hiding this comment

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

  • This function should follow camel case naming, as per the coding standard.
  • Please add a Doxygen-style function comment describing its purpose and parameters: reference.
  • A function prototype should also be added at the top of the file.

You can use the existing copyEnvToBuffer function in this file as a reference for all three points.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
read_fully(struct OMRPortLibrary *portLibrary, intptr_t file, char **data, uintptr_t *size)
readFully(struct OMRPortLibrary *portLibrary, intptr_t file, char **data, uintptr_t *size)

Copy link
Contributor

Choose a reason for hiding this comment

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

I will merge this PR as it fully addresses the variable naming issue. For the comment regarding the local static function, feel free to address it in a separate PR.

Copy link
Author

@harship04 harship04 Jul 7, 2025

Choose a reason for hiding this comment

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

I will merge this PR as it fully addresses the variable naming issue. For the comment regarding the local static function, feel free to address it in a separate PR.

@babsingh
Okay, I’ll create a separate follow-up PR regarding the local static function

Copy link
Contributor

Choose a reason for hiding this comment

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

function prototype should also be added at the top of the file

@babsingh Why did you suggest that? From my perspective it only adds to maintenance costs (by having two places to update instead of just one).

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand that maintaining both a prototype and a definition can add a bit of overhead. That said, I suggested including the prototype to stay consistent with the rest of the file and with what’s been expected in past code reviews. Having prototypes at the top helps improve readability, makes the file easier to navigate as it grows, and provides an early check for declaration-definition mismatches that can aid maintainability.

Copy link
Contributor

Choose a reason for hiding this comment

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

When a forward declaration is not needed (and thus omitted), there's no possibility for a declaration-definition mismatch (because there's only the definition).

Some of the existing prototypes may be needed (if the function used before it is defined), but I think they should be added only when that is the case. I expect many are unnecessary and only serve to increase maintenance costs. Suggesting that declarations be added when they are not need is bad advice, in my opinion.

Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, all static functions in this file have prototypes, even when they are defined before use. I suggested adding the prototype here mainly for consistency with that pattern and past review expectations. It is more about readability and maintainability than functional need.

Your logic is sound, and I'm open to your approach; but applying it to just this one function would introduce inconsistency in the file.

Copy link
Contributor

Choose a reason for hiding this comment

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

In my view, the suggestion should have been to eliminate unnecessary forward declarations rather than add a new one: the result would still have been consistent (and reduced future work).

Copy link
Contributor

Choose a reason for hiding this comment

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

That is a fair point; reducing unnecessary declarations can help cut down on maintenance effort, and I agree it is worth considering. That said, the scope of this PR was limited, so I chose to follow the existing pattern rather than introduce inconsistency for just one function.

A broader cleanup would remove some of the structure currently provided by having all prototypes in one place, which helps with readability and file navigation, especially in larger files. If we decide to go that route, I would suggest doing it as a separate, intentional refactor so the trade-offs are clear.

@babsingh
Copy link
Contributor

babsingh commented Jul 7, 2025

jenkins build all

@babsingh babsingh merged commit dc71510 into eclipse-omr:master Jul 7, 2025
12 of 13 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.

4 participants