Skip to content
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

Merged
merged 4 commits into from Nov 26, 2015
Merged

Avoid conditional directives that split up parts of statements. #3106

merged 4 commits into from Nov 26, 2015

Conversation

ghost
Copy link

@ghost ghost commented Nov 25, 2015

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.

check_lun = (lun < 1);
#endif
if (check_lun)
{
Copy link
Member

Choose a reason for hiding this comment

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

No newline here

@bsongis
Copy link
Member

bsongis commented Nov 25, 2015

I am not sure we have a lot of these, but you are right!

@ghost
Copy link
Author

ghost commented Nov 25, 2015

There only a few across the source files and some of them in third party code with similar patterns, such as:

#endif
)
if (checker)
{
Copy link
Member

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

@kilrah
Copy link
Member

kilrah commented Nov 26, 2015

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.
Cases in our own code then why not.

bsongis added a commit that referenced this pull request Nov 26, 2015
Avoid conditional directives that split up parts of statements.
@bsongis bsongis merged commit 89a9eb4 into opentx:master Nov 26, 2015
@bsongis
Copy link
Member

bsongis commented Nov 26, 2015

Kilrah is right, we change thirdparties to the minimum, but at least the first fix is in some code already modified.

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.

None yet

3 participants