Skip to content

Commit 42ca564

Browse files
authored
fix a few warnings in 32-bit builds (#66)
1 parent fb23b75 commit 42ca564

11 files changed

Lines changed: 20 additions & 20 deletions

File tree

samples/03_mandelbrot/bmp.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ static bool save_image(
8787
info_header.bi_size_image_ = static_cast<uint32_t>(rowLength * height);
8888
os.write(reinterpret_cast<const char*>(&info_header), sizeof(info_header));
8989

90-
for (int y = 0; y < height; y++) {
91-
for (int x = 0; x < width; x++) {
90+
for (uint32_t y = 0; y < height; y++) {
91+
for (uint32_t x = 0; x < width; x++) {
9292
const uint32_t* ppix = ptr + (height - 1 - y) * width + x;
9393
os.write(reinterpret_cast<const char*>(ppix), 4);
9494
}
@@ -128,8 +128,8 @@ static bool save_image(
128128
info_header.bi_size_image_ = static_cast<uint32_t>(rowLength * height);
129129
os.write(reinterpret_cast<const char*>(&info_header), sizeof(info_header));
130130

131-
for (int y = 0; y < height; y++) {
132-
for (int x = 0; x < width; x++) {
131+
for (uint32_t y = 0; y < height; y++) {
132+
for (uint32_t x = 0; x < width; x++) {
133133
const uint8_t* ppix = ptr + (height - 1 - y) * width + x;
134134
os.write(reinterpret_cast<const char*>(ppix), 1);
135135
os.write(reinterpret_cast<const char*>(ppix), 1);

samples/04_julia/bmp.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ static bool save_image(
8787
info_header.bi_size_image_ = static_cast<uint32_t>(rowLength * height);
8888
os.write(reinterpret_cast<const char*>(&info_header), sizeof(info_header));
8989

90-
for (int y = 0; y < height; y++) {
91-
for (int x = 0; x < width; x++) {
90+
for (uint32_t y = 0; y < height; y++) {
91+
for (uint32_t x = 0; x < width; x++) {
9292
const uint32_t* ppix = ptr + (height - 1 - y) * width + x;
9393
os.write(reinterpret_cast<const char*>(ppix), 4);
9494
}
@@ -128,8 +128,8 @@ static bool save_image(
128128
info_header.bi_size_image_ = static_cast<uint32_t>(rowLength * height);
129129
os.write(reinterpret_cast<const char*>(&info_header), sizeof(info_header));
130130

131-
for (int y = 0; y < height; y++) {
132-
for (int x = 0; x < width; x++) {
131+
for (uint32_t y = 0; y < height; y++) {
132+
for (uint32_t x = 0; x < width; x++) {
133133
const uint8_t* ppix = ptr + (height - 1 - y) * width + x;
134134
os.write(reinterpret_cast<const char*>(ppix), 1);
135135
os.write(reinterpret_cast<const char*>(ppix), 1);

samples/04_julia/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int main(
164164
commandQueue.finish();
165165

166166
auto start = std::chrono::system_clock::now();
167-
for( int i = 0; i < iterations; i++ )
167+
for( size_t i = 0; i < iterations; i++ )
168168
{
169169
commandQueue.enqueueNDRangeKernel(
170170
kernel,

tutorials/interceptlayer/bmp.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ static bool save_image(
8787
info_header.bi_size_image_ = static_cast<uint32_t>(rowLength * height);
8888
os.write(reinterpret_cast<const char*>(&info_header), sizeof(info_header));
8989

90-
for (int y = 0; y < height; y++) {
91-
for (int x = 0; x < width; x++) {
90+
for (uint32_t y = 0; y < height; y++) {
91+
for (uint32_t x = 0; x < width; x++) {
9292
const uint32_t* ppix = ptr + (height - 1 - y) * width + x;
9393
os.write(reinterpret_cast<const char*>(ppix), 4);
9494
}
@@ -128,8 +128,8 @@ static bool save_image(
128128
info_header.bi_size_image_ = static_cast<uint32_t>(rowLength * height);
129129
os.write(reinterpret_cast<const char*>(&info_header), sizeof(info_header));
130130

131-
for (int y = 0; y < height; y++) {
132-
for (int x = 0; x < width; x++) {
131+
for (uint32_t y = 0; y < height; y++) {
132+
for (uint32_t x = 0; x < width; x++) {
133133
const uint8_t* ppix = ptr + (height - 1 - y) * width + x;
134134
os.write(reinterpret_cast<const char*>(ppix), 1);
135135
os.write(reinterpret_cast<const char*>(ppix), 1);

tutorials/interceptlayer/main-part1solution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static void go()
130130
commandQueue.finish();
131131

132132
auto start = std::chrono::system_clock::now();
133-
for( int i = 0; i < iterations; i++ )
133+
for( size_t i = 0; i < iterations; i++ )
134134
{
135135
commandQueue.enqueueNDRangeKernel(
136136
kernel,

tutorials/interceptlayer/main-part2solution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static void go()
130130
commandQueue.finish();
131131

132132
auto start = std::chrono::system_clock::now();
133-
for( int i = 0; i < iterations; i++ )
133+
for( size_t i = 0; i < iterations; i++ )
134134
{
135135
commandQueue.enqueueNDRangeKernel(
136136
kernel,

tutorials/interceptlayer/main-part3solution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static void go()
130130
commandQueue.finish();
131131

132132
auto start = std::chrono::system_clock::now();
133-
for( int i = 0; i < iterations; i++ )
133+
for( size_t i = 0; i < iterations; i++ )
134134
{
135135
commandQueue.enqueueNDRangeKernel(
136136
kernel,

tutorials/interceptlayer/main-part4solution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void go()
126126
commandQueue.finish();
127127

128128
auto start = std::chrono::system_clock::now();
129-
for( int i = 0; i < iterations; i++ )
129+
for( size_t i = 0; i < iterations; i++ )
130130
{
131131
commandQueue.enqueueNDRangeKernel(
132132
kernel,

tutorials/interceptlayer/main-part5solution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void go()
126126
commandQueue.finish();
127127

128128
auto start = std::chrono::system_clock::now();
129-
for( int i = 0; i < iterations; i++ )
129+
for( size_t i = 0; i < iterations; i++ )
130130
{
131131
commandQueue.enqueueNDRangeKernel(
132132
kernel,

tutorials/interceptlayer/main-start.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static void go()
130130
commandQueue.finish();
131131

132132
auto start = std::chrono::system_clock::now();
133-
for( int i = 0; i < iterations; i++ )
133+
for( size_t i = 0; i < iterations; i++ )
134134
{
135135
commandQueue.enqueueNDRangeKernel(
136136
kernel,

0 commit comments

Comments
 (0)