Skip to content

Commit 92f1342

Browse files
committed
fix: clean up Windows compilation warnings (AcademySoftwareFoundation#4706)
Signed-off-by: Larry Gritz <[email protected]>
1 parent 91a52db commit 92f1342

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

src/libutil/simd_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ test_gatherscatter()
618618
g.scatter (scatter_out.data(), indices);
619619
OIIO_CHECK_ASSERT (scatter_out == gather_source);
620620

621-
std::fill (scatter_out.begin(), scatter_out.end(), -1);
621+
std::fill (scatter_out.begin(), scatter_out.end(), ELEM(-1));
622622
VEC::Iota().scatter_mask (mask, scatter_out.data(), indices);
623623
for (int i = 0; i < (int)scatter_out.size(); ++i)
624624
OIIO_CHECK_EQUAL (scatter_out[i], ((i%3) == 1 && (i&1) ? i/3 : -1));

src/oiiotool/expressions.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,12 @@ Oiiotool::express_parse_atom(const string_view expr, string_view& s,
276276
out << (i ? "," : "") << pixstat.avg[i];
277277
result = out.str();
278278
} else if (metadata == "NONFINITE_COUNT") {
279-
auto pixstat = ImageBufAlgo::computePixelStats((*img)(0, 0));
280-
imagesize_t sum = std::accumulate(pixstat.nancount.begin(),
281-
pixstat.nancount.end(), 0)
282-
+ std::accumulate(pixstat.infcount.begin(),
283-
pixstat.infcount.end(), 0);
279+
auto pixstat = ImageBufAlgo::computePixelStats((*img)(0, 0));
280+
imagesize_t sum
281+
= std::accumulate(pixstat.nancount.begin(),
282+
pixstat.nancount.end(), imagesize_t(0))
283+
+ std::accumulate(pixstat.infcount.begin(),
284+
pixstat.infcount.end(), imagesize_t(0));
284285
result = Strutil::to_string(sum);
285286
} else if (metadata == "META" || metadata == "METANATIVE") {
286287
std::stringstream out;

src/oiiotool/oiiotool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3276,10 +3276,10 @@ OIIOTOOL_OP(colormap, 1, [&](OiiotoolOp& op, span<ImageBuf*> img) {
32763276
// that we don't break compatibility repeatedly.
32773277

32783278
namespace ImageBufAlgox {
3279-
ImageBuf OIIO_API
3279+
ImageBuf
32803280
cryptomatte_colors(const ImageBuf& src, span<const int> channelset,
32813281
ROI roi = {}, int nthreads = 0);
3282-
bool OIIO_API
3282+
bool
32833283
cryptomatte_colors(ImageBuf& dst, const ImageBuf& src,
32843284
span<const int> channelset, ROI roi = {}, int nthreads = 0);
32853285
} // namespace ImageBufAlgox

src/python/py_oiio.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,22 +309,22 @@ py_buffer_to_stdvector(std::vector<T>& vals, const py::buffer& obj)
309309
for (size_t i = 0; i < binfo.size; ++i) {
310310
if (std::is_same<T, float>::value
311311
&& binfo.format.basetype == TypeDesc::FLOAT) {
312-
vals.emplace_back(binfo.dataval<float>(i));
312+
vals.push_back(binfo.dataval<float>(i));
313313
} else if ((std::is_same<T, float>::value || std::is_same<T, int>::value)
314314
&& binfo.format.basetype == TypeDesc::INT) {
315-
vals.emplace_back(T(binfo.dataval<int>(i)));
315+
vals.push_back(T(binfo.dataval<int>(i)));
316316
} else if (std::is_same<T, unsigned int>::value
317317
&& binfo.format.basetype == TypeDesc::UINT) {
318-
vals.emplace_back(T(binfo.dataval<unsigned int>(i)));
318+
vals.push_back(T(binfo.dataval<unsigned int>(i)));
319319
} else if (std::is_same<T, unsigned char>::value
320320
&& binfo.format.basetype == TypeDesc::UINT8) {
321-
vals.emplace_back(T(binfo.dataval<unsigned char>(i)));
321+
vals.push_back(T(binfo.dataval<unsigned char>(i)));
322322
} else if (std::is_same<T, unsigned short>::value
323323
&& binfo.format.basetype == TypeDesc::UINT16) {
324-
vals.emplace_back(T(binfo.dataval<unsigned short>(i)));
324+
vals.push_back(T(binfo.dataval<unsigned short>(i)));
325325
} else {
326326
// FIXME? Other cases?
327-
vals.emplace_back(T(42));
327+
vals.push_back(T(42));
328328
ok = false;
329329
}
330330
}

0 commit comments

Comments
 (0)