-
Notifications
You must be signed in to change notification settings - Fork 415
Apply camelCase naming to variables for PRs #7681 and #7772 #7825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
|
jenkins build all |
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