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

checks: Indent most of C code #2544

Merged
merged 1 commit into from
Aug 27, 2022
Merged

Conversation

wenzeslaus
Copy link
Member

Indents most of C and C++ code except for what is reported by indent as issues.

Indents most of C and C++ code except for what is reported by indent as issues.
D_text_size(hsize * xincr, vsize * yincr);
G_debug(3, "text size initialized to [%.1f,%.1f]",
hsize * xincr, vsize * yincr);
D_text_size(hsize * xincr, vsize * yincr);

Check failure

Code scanning / CodeQL

Multiplication result converted to larger type

Multiplication result may overflow 'float' before it is converted to 'double'.
D_text_size(hsize * xincr, vsize * yincr);
G_debug(3, "text size initialized to [%.1f,%.1f]",
hsize * xincr, vsize * yincr);
D_text_size(hsize * xincr, vsize * yincr);

Check failure

Code scanning / CodeQL

Multiplication result converted to larger type

Multiplication result may overflow 'float' before it is converted to 'double'.
@wenzeslaus
Copy link
Member Author

wenzeslaus commented Aug 27, 2022

How to deal with conflicts this creates in PRs with C code?

Indent your code:

./utils/grass_indent.sh db/drivers/mysql/create_table.c

Commit the change:

git commit -m "Indent PR code" db/drivers/mysql/create_table.c

Update upstream/main branch:

git fetch upstream

Merge into your branch upstream/main:

git merge --strategy=recursive --strategy-option=ours upstream/main

@wenzeslaus wenzeslaus requested a review from neteler August 27, 2022 15:53
@wenzeslaus
Copy link
Member Author

CodeQL fails with issues which already exist. The rest runs.

@wenzeslaus wenzeslaus added add to git-blame-ignore-revs Once merged, add to .git-blame-ignore-revs C Related code is in C labels Aug 27, 2022
@wenzeslaus
Copy link
Member Author

This leaves out all directories which indent reports errors for.

@wenzeslaus wenzeslaus merged commit 40b5982 into OSGeo:main Aug 27, 2022
@wenzeslaus wenzeslaus deleted the indent-all-c branch August 27, 2022 16:12
@neteler neteler removed their request for review August 27, 2022 18:07
@neteler
Copy link
Member

neteler commented Aug 27, 2022

@wenzeslaus wenzeslaus added this to the 8.3.0 milestone Aug 28, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
Indents most of the C and C++ code except for what is reported by indent as issues.
neteler added a commit to neteler/grass that referenced this pull request Nov 10, 2022
Selected r.kappa indentation update from OSGeo#2544

(needed for backport r.kappa fixes in OSGeo#2573)
neteler added a commit that referenced this pull request Nov 10, 2022
Selected r.kappa indentation update from #2544

(needed for backport of r.kappa fixes in #2573)
@nilason nilason removed the add to git-blame-ignore-revs Once merged, add to .git-blame-ignore-revs label Jan 2, 2023
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
Indents most of the C and C++ code except for what is reported by indent as issues.
@wenzeslaus wenzeslaus changed the title Indent most of C code checks: Indent most of C code Jun 6, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Indents most of the C and C++ code except for what is reported by indent as issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants