Skip to content

Commit 19469f7

Browse files
committed
Address review comments
Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent e8d0b4c commit 19469f7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/openexr.imageio/exroutput.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,17 +1700,17 @@ OpenEXROutput::write_deep_scanlines(int ybegin, int yend, int /*z*/,
17001700
return false;
17011701
}
17021702

1703-
int nchans = m_spec.nchannels;
1703+
size_t nchans(m_spec.nchannels);
17041704
const DeepData* dd = &deepdata;
17051705
std::unique_ptr<DeepData> dd_local; // In case we need a copy
17061706
bool same_chantypes = true;
1707-
for (int c = 0; c < nchans; ++c)
1707+
for (size_t c = 0; c < nchans; ++c)
17081708
same_chantypes &= (m_spec.channelformat(c) == deepdata.channeltype(c));
17091709
if (!same_chantypes) {
17101710
// If the channel types don't match, we need to make a copy of the
17111711
// DeepData and convert the channels to the spec's channel types.
17121712
std::vector<TypeDesc> chantypes;
1713-
if (m_spec.channelformats.size() == size_t(nchans))
1713+
if (m_spec.channelformats.size() == nchans)
17141714
chantypes = m_spec.channelformats;
17151715
else
17161716
chantypes.resize(nchans, m_spec.format);
@@ -1729,11 +1729,11 @@ OpenEXROutput::write_deep_scanlines(int ybegin, int yend, int /*z*/,
17291729
frameBuffer.insertSampleCountSlice(countslice);
17301730
std::vector<void*> pointerbuf;
17311731
dd->get_pointers(pointerbuf);
1732-
size_t slchans = size_t(m_spec.width) * size_t(nchans);
1733-
size_t xstride = sizeof(void*) * size_t(nchans);
1732+
size_t slchans = size_t(m_spec.width) * nchans;
1733+
size_t xstride = sizeof(void*) * nchans;
17341734
size_t ystride = sizeof(void*) * slchans;
17351735
size_t samplestride = dd->samplesize();
1736-
for (int c = 0; c < nchans; ++c) {
1736+
for (size_t c = 0; c < nchans; ++c) {
17371737
Imf::DeepSlice slice(m_pixeltype[c],
17381738
(char*)(&pointerbuf[c] - m_spec.x * nchans
17391739
- ybegin * slchans),

0 commit comments

Comments
 (0)