diff --git a/lib/src/SDK/Image.cpp b/lib/src/SDK/Image.cpp index c17a3d14..2be3b576 100644 --- a/lib/src/SDK/Image.cpp +++ b/lib/src/SDK/Image.cpp @@ -44,11 +44,12 @@ namespace sdk { err_msg.c_str()); } - im.pixels.insert(im.pixels.end(), data, - data + im.width * im.height * im.pixel_size); + std::size_t data_size = im.width * im.height * im.pixel_size; + + im.pixels.insert(im.pixels.end(), data, data + data_size); if (im.width && im.height && im.pixel_size - && im.pixels.size() == im.width * im.height * im.pixel_size) + && im.pixels.size() == data_size) err = CL_SUCCESS; else cl::util::detail::errHandler(CL_INVALID_ARG_VALUE, &err, diff --git a/lib/src/Utils/File.cpp b/lib/src/Utils/File.cpp index a62efb62..4ff44f23 100644 --- a/lib/src/Utils/File.cpp +++ b/lib/src/Utils/File.cpp @@ -97,7 +97,7 @@ cl_int cl::util::write_binaries(const cl::Program::Binaries& binaries, { try { - for (auto i = 0; i < binaries.size(); ++i) + for (auto i = 0U; i < binaries.size(); ++i) { string binary_name = string(program_file_name) + "-" + devices.at(i).getInfo() + ".bin"; diff --git a/samples/core/blur/blur.cpp b/samples/core/blur/blur.cpp index c19eca91..06f6dd52 100644 --- a/samples/core/blur/blur.cpp +++ b/samples/core/blur/blur.cpp @@ -732,9 +732,9 @@ void BlurCppExample::finalize_blur() // restore image type if needed if (input_image.pixel_size != output_image.pixel_size) { - const auto pixels = input_image.width * input_image.height, - pixel_size = output_image.pixel_size; - for (size_t i = 1; i < pixels; ++i) + const std::size_t pixels = input_image.width * input_image.height, + pixel_size = output_image.pixel_size; + for (std::size_t i = 1; i < pixels; ++i) memcpy(output_image.pixels.data() + pixel_size * i, output_image.pixels.data() + 4 * i, pixel_size); } diff --git a/samples/core/copybuffer/main.cpp b/samples/core/copybuffer/main.cpp index e9b53f45..5429afa6 100644 --- a/samples/core/copybuffer/main.cpp +++ b/samples/core/copybuffer/main.cpp @@ -95,7 +95,7 @@ int main(int argc, char** argv) } else { - for (size_t i = 1; i < argc; i++) + for (int i = 1; i < argc; i++) { if (!strcmp(argv[i], "-d")) { diff --git a/samples/core/copybufferkernel/main.cpp b/samples/core/copybufferkernel/main.cpp index 26d046d6..1b14cfc2 100644 --- a/samples/core/copybufferkernel/main.cpp +++ b/samples/core/copybufferkernel/main.cpp @@ -106,7 +106,7 @@ int main(int argc, char** argv) } else { - for (size_t i = 1; i < argc; i++) + for (int i = 1; i < argc; i++) { if (!strcmp(argv[i], "-d")) {