-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
Avoid conditional directives that split up parts of statements. #3106
Conversation
check_lun = (lun < 1); | ||
#endif | ||
if (check_lun) | ||
{ |
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.
No newline here
I am not sure we have a lot of these, but you are right! |
There only a few across the source files and some of them in third party code with similar patterns, such as: |
#endif | ||
) | ||
if (checker) | ||
{ |
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.
No newline here as well
Umm... Shouldn't we be leaving the 3rd-party libs alone? It's not our job to change them, and would likely cause massive conflicts should we update them. |
Avoid conditional directives that split up parts of statements.
Kilrah is right, we change thirdparties to the minimum, but at least the first fix is in some code already modified. |
A suggestion to compile entire statements and expressions, as suggested by code style guidelines from the Linux Kernel and practitioners.
It might improve code understanding, maintainability and error-proneness.