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

Extra checking to prevent loop counter from wrapping around (backport #1766) #1787

Merged
merged 6 commits into from
Jul 25, 2021

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 17, 2021

This is an automatic backport of pull request #1766 done by Mergify.
Cherry-pick of 1b204d9 has failed:

On branch mergify/bp/main/pr-1766
Your branch is ahead of 'origin/main' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 1b204d9b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   src/actions.cpp
	modified:   src/exif.cpp
	modified:   src/iptc.cpp
	modified:   src/preview.cpp
	modified:   src/types.cpp
	modified:   src/xmpsidecar.cpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/basicio.cpp
	both modified:   src/convert.cpp
	both modified:   src/exiv2.cpp
	both modified:   src/tags_int.cpp
	both modified:   src/tiffcomposite_int.cpp
	both modified:   src/tiffvisitor_int.cpp
	both modified:   src/xmp.cpp

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.io/

@codecov
Copy link

codecov bot commented Jul 18, 2021

Codecov Report

Merging #1787 (eb2782e) into main (6373fe3) will increase coverage by 0.01%.
The diff coverage is 79.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1787      +/-   ##
==========================================
+ Coverage   67.49%   67.51%   +0.01%     
==========================================
  Files         151      151              
  Lines       20815    20868      +53     
==========================================
+ Hits        14050    14088      +38     
- Misses       6765     6780      +15     
Impacted Files Coverage Δ
src/basicio.cpp 56.76% <0.00%> (+0.07%) ⬆️
src/exif.cpp 76.10% <0.00%> (ø)
src/xmpsidecar.cpp 85.00% <0.00%> (ø)
src/iptc.cpp 75.72% <80.00%> (-0.34%) ⬇️
src/actions.cpp 74.14% <100.00%> (ø)
src/convert.cpp 69.32% <100.00%> (ø)
src/crwimage_int.cpp 87.85% <100.00%> (+0.66%) ⬆️
src/exiv2.cpp 65.99% <100.00%> (-0.04%) ⬇️
src/preview.cpp 57.46% <100.00%> (ø)
src/tags_int.cpp 87.20% <100.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6373fe3...eb2782e. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Jul 18, 2021

This pull request fixes 1 alert when merging eb2782e into 82057a6 - view on LGTM.com

fixed alerts:

  • 1 for Comparison of narrow type with wide type in loop condition

@hassec hassec added the bug label Jul 25, 2021
@hassec
Copy link
Member

hassec commented Jul 25, 2021

Thanks for fixing the conflicts @kevinbackhouse! 👍

I've approved, so feel free to merge.
Not crucial for this PR, but I think when we modify code we should try to not use long anymore and move towards platform independent fixed size types, just to avoid problems. What do you think?

@kevinbackhouse
Copy link
Collaborator

@hassec: yes, I would also like to stop using long. I think that's going to be a tricky project though, because we're going to need to change it systematically throughout the codebase. So for these bugfixes, I thought it would be better to just use the APIs as they are now. For example, count() currently returns a long, so it's better to use long for the loop-variable until we change the return type of count() to something like size_t.

@kevinbackhouse kevinbackhouse merged commit 944e68f into main Jul 25, 2021
@mergify mergify bot deleted the mergify/bp/main/pr-1766 branch July 25, 2021 18:54
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