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

Change return type of BasicIo::tell() to size_t #2251

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

kevinbackhouse
Copy link
Collaborator

This is another step towards eliminating the long type from the codebase. The main change is to change the return type of BasicIo::tell() to size_t. Previously, FileIo::tell() could return a negative number as an error code, so I have replaced that with an enforce in the implementation of FileIo::tell().

@codecov
Copy link

codecov bot commented Jun 20, 2022

Codecov Report

Merging #2251 (d23fc63) into main (7ebf2a1) will increase coverage by 0.01%.
The diff coverage is 75.00%.

❗ Current head d23fc63 differs from pull request most recent head ad4e13b. Consider uploading reports for the commit ad4e13b to get more accurate results

@@            Coverage Diff             @@
##             main    #2251      +/-   ##
==========================================
+ Coverage   63.46%   63.47%   +0.01%     
==========================================
  Files         118      118              
  Lines       19612    19608       -4     
  Branches     9566     9560       -6     
==========================================
  Hits        12447    12447              
+ Misses       5096     5094       -2     
+ Partials     2069     2067       -2     
Impacted Files Coverage Δ
include/exiv2/basicio.hpp 91.66% <ø> (ø)
include/exiv2/bmffimage.hpp 100.00% <ø> (ø)
include/exiv2/webpimage.hpp 100.00% <ø> (ø)
src/epsimage.cpp 1.74% <33.33%> (+<0.01%) ⬆️
src/image.cpp 69.57% <50.00%> (ø)
src/pngimage.cpp 60.42% <57.89%> (+0.48%) ⬆️
src/webpimage.cpp 42.66% <60.86%> (-0.76%) ⬇️
src/jp2image.cpp 69.38% <71.42%> (+0.06%) ⬆️
src/basicio.cpp 51.43% <75.00%> (+0.11%) ⬆️
src/bmffimage.cpp 76.37% <100.00%> (+0.18%) ⬆️
... and 4 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 7ebf2a1...ad4e13b. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Jun 20, 2022

This pull request fixes 1 alert when merging 03bd3a8 into 7ebf2a1 - view on LGTM.com

fixed alerts:

  • 1 for Comparison result is always the same

@neheb
Copy link
Collaborator

neheb commented Jun 21, 2022

 D:\a\exiv2\exiv2\src\pngimage.cpp(81): error C2220: the following warning is treated as an error
D:\a\exiv2\exiv2\src\pngimage.cpp(81): warning C4267: 'argument': conversion from 'size_t' to 'uLong', possible loss of data
D:\a\exiv2\exiv2\src\pngimage.cpp(87): warning C4267: 'argument': conversion from 'size_t' to 'uLong', possible loss of data
D:\a\exiv2\exiv2\src\pngimage.cpp(110): warning C4267: 'argument': conversion from 'size_t' to 'uLong', possible loss of data
D:\a\exiv2\exiv2\src\pngimage.cpp(118): warning C4267: 'argument': conversion from 'size_t' to 'uLong', possible loss of data

@kevinbackhouse kevinbackhouse marked this pull request as draft June 21, 2022 09:55
@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request fixes 1 alert when merging 249bd77 into 7ebf2a1 - view on LGTM.com

fixed alerts:

  • 1 for Comparison result is always the same

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request fixes 1 alert when merging 6570f30 into 7ebf2a1 - view on LGTM.com

fixed alerts:

  • 1 for Comparison result is always the same

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request fixes 1 alert when merging 7e69e6a into 7ebf2a1 - view on LGTM.com

fixed alerts:

  • 1 for Comparison result is always the same

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request fixes 1 alert when merging d23fc63 into 7ebf2a1 - view on LGTM.com

fixed alerts:

  • 1 for Comparison result is always the same

@kevinbackhouse kevinbackhouse marked this pull request as ready for review June 21, 2022 16:05
@kevinbackhouse
Copy link
Collaborator Author

By the way, Windows has a function named _ftelli64 which we could use to get 64 bit support on Windows. It would involve some ugly #ifdef code in basicio.cpp, so I didn't make that change in this PR.

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request fixes 1 alert when merging ad4e13b into 7ebf2a1 - view on LGTM.com

fixed alerts:

  • 1 for Comparison result is always the same

@kevinbackhouse kevinbackhouse merged commit 08a68c3 into Exiv2:main Jul 5, 2022
@kevinbackhouse kevinbackhouse deleted the basicio-ftell branch July 5, 2022 12:13
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.

3 participants