Skip to content

Commit

Permalink
fixed warnings caused by comparing signed and unsigned int
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogumil-Sapinski-Mobica committed Jun 23, 2023
1 parent 28f1bda commit 681a02c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/include/CL/SDK/Image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace cl {
namespace sdk {
struct Image
{
int width = 0, height = 0, pixel_size = 1;
size_t width = 0, height = 0, pixel_size = 1;
cl::vector<unsigned char> pixels;
};

Expand Down
2 changes: 1 addition & 1 deletion lib/src/SDK/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace sdk {

Image im;
unsigned char* data =
stbi_load(file_name, &im.width, &im.height, &im.pixel_size, 0);
stbi_load(file_name, reinterpret_cast<int*>(&im.width), reinterpret_cast<int*>(&im.height), reinterpret_cast<int*>(&im.pixel_size), 0);

if (data == nullptr)
{
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
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

0 comments on commit 681a02c

Please sign in to comment.