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

Added braces to C #4618

Merged
merged 3 commits into from
May 13, 2020
Merged

Added braces to C #4618

merged 3 commits into from
May 13, 2020

Conversation

radarhere
Copy link
Member

See #4493

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Would it be ok not to rebase/force push until approved? It'll be easier to review single additional commits later. Thanks!

if (has_data) {\
yproj[y] = 1;\
}\
}
Copy link
Member

Choose a reason for hiding this comment

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

Just a note.

Before:
Visually, both if blocks are indented as if they are both in the for loop.

But it wouldn't make sense for both to be in the for loop, so it was functionally correct before, and the change makes it clearer.

src/libImaging/JpegEncode.c Outdated Show resolved Hide resolved
@hugovk
Copy link
Member

hugovk commented May 10, 2020

A few other elses (some may be false positives):

grep -r " else$" . --include "*.c"
./src/libImaging/BoxBlur.c:    else
./src/libImaging/BoxBlur.c:    else
./src/libImaging/BoxBlur.c:    else
./src/libImaging/RawEncode.c:        } else
./src/libImaging/JpegEncode.c:            } else
./src/libImaging/XbmEncode.c:                } else
./src/libImaging/GifDecode.c:    } else
./src/_webp.c:        } else
./src/_webp.c:        } else

The ifs are harder to grep, this finds some plus many false positives:

grep -r " if.*[^{]$" . --include "*.c"

radarhere and others added 2 commits May 11, 2020 07:19
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@radarhere
Copy link
Member Author

Ok, I've done a pass over the code using your grep commands, and pushed the commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants