-
Notifications
You must be signed in to change notification settings - Fork 281
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
Replace Value::toLong with Value::toInt64. #2062
Conversation
9df656b
to
f2a4c5d
Compare
Codecov Report
@@ Coverage Diff @@
## main #2062 +/- ##
==========================================
- Coverage 62.08% 61.85% -0.24%
==========================================
Files 96 96
Lines 19153 19110 -43
Branches 9798 9781 -17
==========================================
- Hits 11891 11820 -71
- Misses 4967 5012 +45
+ Partials 2295 2278 -17
Continue to review full report at Codecov.
|
@@ -1274,6 +1298,61 @@ namespace Exiv2 { | |||
ValueList value_; | |||
|
|||
private: | |||
//! Utility for toInt64, toUint32, etc. | |||
template<typename I> | |||
inline I float_to_integer_helper(long n) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to codecov, many of these new lines are not covered by tests. Did you check if this new code is covered? I know that codecov sometimes report false issues.
In general I like the idea. I also want to do the same thing in the BasicIO classes, where we are using |
83afedd
to
f9d0faa
Compare
I found the reason why Lines 230 to 236 in a8a995f
and this Line 382 in a8a995f
|
3cbbe5c
to
ccc4fd6
Compare
Ey @kevinbackhouse , is this ready for review or is it still a Draft? |
@piponazo: yes, it's ready for review now. I rebased in the hope that it would fix the PVS check, but it didn't help unfortunately. We should probably do a "squash and merge" on this so that it's just one commit, but I have left it as separate commits so that you can see what I did to fix the msys2 problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me 👍
Regarding the squashing, as you want. Feel free to merge it with the squash option. I normally choose to squash or not depending on the relevance of the individual commits.
This is somewhat asymmetric now, as TypeId only has Lines 70 to 74 in 445757a
This also changes the API. |
@StefanBruens Don't think that's a problem as those are TIFF types, not Exiv2 API types - TIFF 32-bit LONG/SLONG is easily contained by However, thanks for pointing out we might have a potential problem w/ LONG8/IFD8 and might need |
The type
long
is problematic because it's 32 bits on Windows and 64 bits on Linux. I would like to start replacing it. In some cases, it will make sense to replace it withsize_t
, in others something likeint64_t
will be the best choice. In this PR, I have replacedValue::toLong()
withValue::toInt64()
.Value
is used for values that were read from the image file, so I think a platform-independent type is the most appropriate replacement here. I also addedValue::toUint32()
for convenience.