Skip to content
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 warning sign compare #80

Merged
merged 6 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/src/SDK/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/Utils/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CL_DEVICE_NAME>() + ".bin";
Expand Down
6 changes: 3 additions & 3 deletions samples/core/blur/blur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion samples/core/copybuffer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down
2 changes: 1 addition & 1 deletion samples/core/copybufferkernel/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down
Loading