From fdd3f39a566462f004f5ef62a181848baac3160a Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Sun, 11 Mar 2018 17:02:08 +0100 Subject: Fix lots of warnings output by visual studio... --- BuddhaTest/src/Helpers.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'BuddhaTest/src/Helpers.cpp') diff --git a/BuddhaTest/src/Helpers.cpp b/BuddhaTest/src/Helpers.cpp index 8bd9e4b..9736786 100644 --- a/BuddhaTest/src/Helpers.cpp +++ b/BuddhaTest/src/Helpers.cpp @@ -8,6 +8,7 @@ #include #include #include +#include namespace Helpers { @@ -170,7 +171,7 @@ namespace Helpers { std::vector pngData(3*width*2*bufferHeight); std::vector rows{2*bufferHeight}; - for(int i = 0; i < 2*bufferHeight ; ++i) + for(unsigned int i = 0; i < 2*bufferHeight ; ++i) { rows[i] = pngData.data()+3*width*i; } @@ -191,9 +192,9 @@ namespace Helpers pngData[data.size() + i] = (255*data[i] + (maxValue/2))/maxValue; } } - for(int i = 0; i < bufferHeight;++i) + for(unsigned int i = 0; i < bufferHeight;++i) { - for(int j = 0; j < width*3;++j) + for(unsigned int j = 0; j < width*3;++j) { rows[i][j] =rows[2*bufferHeight-i-1][j]; } @@ -265,7 +266,7 @@ namespace Helpers const unsigned int pixelCount{(imageWidth * imageHeight/2)*3}; //*3 -> RGB int maxSSBOSize; glGetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE,&maxSSBOSize); - if(pixelCount * 4 > maxSSBOSize) + if(pixelCount * 4 > static_cast(maxSSBOSize)) { std::cerr << "Requested buffer size larger than maximum allowed by graphics driver. Max pixel number: " << maxSSBOSize/6 << std::endl; return false; @@ -274,9 +275,9 @@ namespace Helpers glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT,0,&WorkGroupSizeLimitX); glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT,1,&WorkGroupSizeLimitY); glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT,2,&WorkGroupSizeLimitZ); - if(globalWorkGroupSizeX > WorkGroupSizeLimitX || - globalWorkGroupSizeY > WorkGroupSizeLimitY || - globalWorkGroupSizeZ > WorkGroupSizeLimitZ) + if(globalWorkGroupSizeX > static_cast(WorkGroupSizeLimitX) || + globalWorkGroupSizeY > static_cast(WorkGroupSizeLimitY) || + globalWorkGroupSizeZ > static_cast(WorkGroupSizeLimitZ)) { std::cerr << "Requested global work group size exceeds maximum dimension. Limits: " << WorkGroupSizeLimitX << ", " << WorkGroupSizeLimitY << ", " << WorkGroupSizeLimitZ << std::endl; return false; @@ -284,16 +285,16 @@ namespace Helpers glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE,0,&WorkGroupSizeLimitX); glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE,1,&WorkGroupSizeLimitY); glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE,2,&WorkGroupSizeLimitZ); - if(localWorkgroupSizeX > WorkGroupSizeLimitX || - localWorkgroupSizeY > WorkGroupSizeLimitY || - localWorkgroupSizeZ > WorkGroupSizeLimitZ) + if(localWorkgroupSizeX > static_cast(WorkGroupSizeLimitX) || + localWorkgroupSizeY > static_cast(WorkGroupSizeLimitY) || + localWorkgroupSizeZ > static_cast(WorkGroupSizeLimitZ)) { std::cerr << "Requested local work group size exceeds maximum dimension. Limits: " << WorkGroupSizeLimitX << ", " << WorkGroupSizeLimitY << ", " << WorkGroupSizeLimitZ << std::endl; return false; } int maxInvocations; glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS,&maxInvocations); - if(localWorkgroupSizeX*localWorkgroupSizeY*localWorkgroupSizeZ > maxInvocations) + if(localWorkgroupSizeX*localWorkgroupSizeY*localWorkgroupSizeZ > static_cast(maxInvocations)) { std::cerr << "Requested local work group size exceeds maximum total count (Product of x*y*z dimensions). Limit: " << maxInvocations << std::endl; return false; -- cgit v1.2.3