-
Notifications
You must be signed in to change notification settings - Fork 597
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
fix implicit 64 to 32 bit conversion warnings #3955
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ namespace fits_pvt { | |
// struct in which we store information about one subimage. This information | ||
// allow us to set up pointer at the beginning of given subimage | ||
struct Subimage { | ||
int number; | ||
size_t number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the change here? Subimages in OIIO are ints and other formats store their equivalent as an int. Actually is this even used? I see one line that sets this value but nothing ever reads from it; maybe remove it entirely. |
||
size_t offset; | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ class HdrInput final : public ImageInput { | |
bool read_native_scanline(int subimage, int miplevel, int y, int z, | ||
void* data) override; | ||
bool close() override; | ||
int current_subimage(void) const override { return m_subimage; } | ||
int current_subimage(void) const override { return (int)m_subimage; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unintentional change? |
||
bool seek_subimage(int subimage, int miplevel) override; | ||
|
||
private: | ||
|
@@ -488,7 +488,7 @@ HdrInput::read_native_scanline(int subimage, int miplevel, int y, int /*z*/, | |
if (m_next_scanline != y) { | ||
// For random access, use cached file offsets of scanlines. This avoids | ||
// re-reading the same pixels many times over. | ||
m_next_scanline = std::min((size_t)y, m_scanline_offsets.size() - 1); | ||
m_next_scanline = std::min(y, (int)m_scanline_offsets.size() - 1); | ||
ioseek(m_scanline_offsets[m_next_scanline]); | ||
} | ||
|
||
|
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.
I don't understand what's going on here. The parameter was unsigned int, and the loop variable below is also unsigned int. Why change to size_t? And if the param is size_t, doesn't it just make a new potential problem or warning in the loop below that still is unsigned int?
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.
SwapBuffer gets called from EndianSwapImageBuffer, passing the length parameter. EndianSwapImageBuffer in turn is called from multiple places with size_t as the length parameter. Changing the param type seemed more logical to me. I have indeed overlooked the int in the loop.