Fixed wrong static_casting in ANGLE from r153064.
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Aug 2013 20:21:01 +0000 (20:21 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Aug 2013 20:21:01 +0000 (20:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=119296

Reviewed by Dean Jackson.

* src/compiler/Intermediate.cpp:
(TIntermediate::promoteConstantUnion):
Undid erroneous static_cast change.
* src/compiler/intermediate.h:
(TIntermConstantUnion::getIConst):
(TIntermConstantUnion::getFConst):
(TIntermConstantUnion::getBConst):
Made getters use size_t instead of int.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153600 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/src/compiler/Intermediate.cpp
Source/ThirdParty/ANGLE/src/compiler/intermediate.h

index 7f56f8eb49e386e4cee3cb227d6bee96bcce59b3..0076794e9c0765fec19e202ac29f6a30ed3cf7f2 100644 (file)
@@ -1,3 +1,19 @@
+2013-08-01  Alex Christensen  <achristensen@apple.com>
+
+        Fixed wrong static_casting in ANGLE from r153064.
+        https://bugs.webkit.org/show_bug.cgi?id=119296
+
+        Reviewed by Dean Jackson.
+
+        * src/compiler/Intermediate.cpp:
+        (TIntermediate::promoteConstantUnion):
+        Undid erroneous static_cast change.
+        * src/compiler/intermediate.h:
+        (TIntermConstantUnion::getIConst):
+        (TIntermConstantUnion::getFConst):
+        (TIntermConstantUnion::getBConst):
+        Made getters use size_t instead of int.
+
 2013-07-29  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Fix make distcheck.
index 334f0d756f9db20cd301a06f40dae5c484546835..3b6622185d20263df825dac6a4c3a37da998fb45 100644 (file)
@@ -1371,13 +1371,13 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
             case EbtFloat:
                 switch (node->getType().getBasicType()) {
                     case EbtInt:
-                        leftUnionArray[i].setFConst(static_cast<float>(node->getIConst(static_cast<int>(i))));
+                        leftUnionArray[i].setFConst(static_cast<float>(node->getIConst(i)));
                         break;
                     case EbtBool:
-                        leftUnionArray[i].setFConst(static_cast<float>(node->getBConst(static_cast<bool>(i))));
+                        leftUnionArray[i].setFConst(static_cast<float>(node->getBConst(i)));
                         break;
                     case EbtFloat:
-                        leftUnionArray[i].setFConst(static_cast<float>(node->getFConst(static_cast<float>(i))));
+                        leftUnionArray[i].setFConst(static_cast<float>(node->getFConst(i)));
                         break;
                     default:
                         infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");
@@ -1387,13 +1387,13 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
             case EbtInt:
                 switch (node->getType().getBasicType()) {
                     case EbtInt:
-                        leftUnionArray[i].setIConst(static_cast<int>(node->getIConst(static_cast<int>(i))));
+                        leftUnionArray[i].setIConst(static_cast<int>(node->getIConst(i)));
                         break;
                     case EbtBool:
-                        leftUnionArray[i].setIConst(static_cast<int>(node->getBConst(static_cast<bool>(i))));
+                        leftUnionArray[i].setIConst(static_cast<int>(node->getBConst(i)));
                         break;
                     case EbtFloat:
-                        leftUnionArray[i].setIConst(static_cast<int>(node->getFConst(static_cast<float>(i))));
+                        leftUnionArray[i].setIConst(static_cast<int>(node->getFConst(i)));
                         break;
                     default:
                         infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");
@@ -1403,13 +1403,13 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
             case EbtBool:
                 switch (node->getType().getBasicType()) {
                     case EbtInt:
-                        leftUnionArray[i].setBConst(node->getIConst(static_cast<int>(i)) != 0);
+                        leftUnionArray[i].setBConst(node->getIConst(i) != 0);
                         break;
                     case EbtBool:
-                        leftUnionArray[i].setBConst(node->getBConst(static_cast<bool>(i)));
+                        leftUnionArray[i].setBConst(node->getBConst(i));
                         break;
                     case EbtFloat:
-                        leftUnionArray[i].setBConst(node->getFConst(static_cast<float>(i)) != 0.0f);
+                        leftUnionArray[i].setBConst(node->getFConst(i) != 0.0f);
                         break;
                     default:
                         infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");
index b1d20f704cf5791cd7a543071a67a1e50d1b19a5..c96479639bb0bed6c3fbd8c1c6c5943370263d03 100644 (file)
@@ -369,9 +369,9 @@ public:
 
     ConstantUnion* getUnionArrayPointer() const { return unionArrayPointer; }
     
-    int getIConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getIConst() : 0; }
-    float getFConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getFConst() : 0.0f; }
-    bool getBConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getBConst() : false; }
+    int getIConst(size_t index) const { return unionArrayPointer ? unionArrayPointer[index].getIConst() : 0; }
+    float getFConst(size_t index) const { return unionArrayPointer ? unionArrayPointer[index].getFConst() : 0.0f; }
+    bool getBConst(size_t index) const { return unionArrayPointer ? unionArrayPointer[index].getBConst() : false; }
 
     virtual TIntermConstantUnion* getAsConstantUnion()  { return this; }
     virtual void traverse(TIntermTraverser*);