Making proper use of size_t
In a lot of cases, int was being used instead of size_to represent
sizes. That led to some warnings about inconsistencies between int
and size_t usage. While this cl doesn't solve all warnings, it tries
to use size_t and int where it should be appropriate to use them.
Change-Id: Id760df1360f65b2bba60f4075cdf4954fc6bbaf3
Reviewed-on: https://swiftshader-review.googlesource.com/5177
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/OpenGL/compiler/ParseHelper.cpp b/src/OpenGL/compiler/ParseHelper.cpp
index 40fc794..87f1e2d 100644
--- a/src/OpenGL/compiler/ParseHelper.cpp
+++ b/src/OpenGL/compiler/ParseHelper.cpp
@@ -481,7 +481,7 @@
// again, there is an extra argument, so 'overfull' will become true.
//
- int size = 0;
+ size_t size = 0;
bool full = false;
bool overFull = false;
bool matrixInMatrix = false;
@@ -2221,7 +2221,7 @@
index = 0;
}
- int arrayElementSize = arrayElementType.getObjectSize();
+ size_t arrayElementSize = arrayElementType.getObjectSize();
if (tempConstantNode) {
ConstantUnion* unionArray = tempConstantNode->getUnionArrayPointer();
@@ -2246,11 +2246,10 @@
{
const TFieldList &fields = node->getType().getStruct()->fields();
TIntermTyped *typedNode;
- int instanceSize = 0;
- unsigned int index = 0;
+ size_t instanceSize = 0;
TIntermConstantUnion *tempConstantNode = node->getAsConstantUnion();
- for ( index = 0; index < fields.size(); ++index) {
+ for(size_t index = 0; index < fields.size(); ++index) {
if (fields[index]->name() == identifier) {
break;
} else {