Fix signed/unsigned comparison warnings.
Bug 15387371
Change-Id: Id4c9b54c5c0b4115479b6710c4d8c91d34e5c002
Reviewed-on: https://swiftshader-review.googlesource.com/4494
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/compiler/ParseHelper.cpp b/src/OpenGL/compiler/ParseHelper.cpp
index 2fa4512..522b13e 100644
--- a/src/OpenGL/compiler/ParseHelper.cpp
+++ b/src/OpenGL/compiler/ParseHelper.cpp
@@ -509,7 +509,7 @@
if(type->isArray()) {
if(type->getArraySize() == 0) {
type->setArraySize(function.getParamCount());
- } else if(type->getArraySize() != function.getParamCount()) {
+ } else if(type->getArraySize() != (int)function.getParamCount()) {
error(line, "array constructor needs one argument per array element", "constructor");
return true;
}
@@ -532,7 +532,7 @@
return true;
}
- if (op == EOpConstructStruct && !type->isArray() && int(type->getStruct()->fields().size()) != function.getParamCount()) {
+ if (op == EOpConstructStruct && !type->isArray() && type->getStruct()->fields().size() != function.getParamCount()) {
error(line, "Number of constructor parameters does not match the number of structure fields", "constructor");
return true;
}
@@ -1763,47 +1763,47 @@
{
switch(publicType.type)
{
- case EbtFloat:
- if(publicType.isMatrix())
- {
- switch(publicType.getCols())
- {
- case 2:
- switch(publicType.getRows())
- {
- case 2: op = EOpConstructMat2; break;
- case 3: op = EOpConstructMat2x3; break;
- case 4: op = EOpConstructMat2x4; break;
- }
- break;
- case 3:
- switch(publicType.getRows())
- {
- case 2: op = EOpConstructMat3x2; break;
- case 3: op = EOpConstructMat3; break;
- case 4: op = EOpConstructMat3x4; break;
- }
- break;
- case 4:
- switch(publicType.getRows())
- {
- case 2: op = EOpConstructMat4x2; break;
- case 3: op = EOpConstructMat4x3; break;
- case 4: op = EOpConstructMat4; break;
- }
- break;
- }
- }
- else
- {
- switch(publicType.getNominalSize())
- {
- case 1: op = EOpConstructFloat; break;
- case 2: op = EOpConstructVec2; break;
- case 3: op = EOpConstructVec3; break;
- case 4: op = EOpConstructVec4; break;
- }
- }
+ case EbtFloat:
+ if(publicType.isMatrix())
+ {
+ switch(publicType.getCols())
+ {
+ case 2:
+ switch(publicType.getRows())
+ {
+ case 2: op = EOpConstructMat2; break;
+ case 3: op = EOpConstructMat2x3; break;
+ case 4: op = EOpConstructMat2x4; break;
+ }
+ break;
+ case 3:
+ switch(publicType.getRows())
+ {
+ case 2: op = EOpConstructMat3x2; break;
+ case 3: op = EOpConstructMat3; break;
+ case 4: op = EOpConstructMat3x4; break;
+ }
+ break;
+ case 4:
+ switch(publicType.getRows())
+ {
+ case 2: op = EOpConstructMat4x2; break;
+ case 3: op = EOpConstructMat4x3; break;
+ case 4: op = EOpConstructMat4; break;
+ }
+ break;
+ }
+ }
+ else
+ {
+ switch(publicType.getNominalSize())
+ {
+ case 1: op = EOpConstructFloat; break;
+ case 2: op = EOpConstructVec2; break;
+ case 3: op = EOpConstructVec3; break;
+ case 4: op = EOpConstructVec4; break;
+ }
+ }
break;
case EbtInt: