Fix clang warnings: Intermediate.cpp: warning: '&&' within '||'
Issue=126
Signed-off-by: Nicolas Capens
Signed-off-by: Daniel Koch
Part 3 of 5: <http://webkit.org/b/56337> Enable -Werror on ANGLE
Upstream bug: <http://code.google.com/p/angleproject/issues/detail?id=126>
Fixes the following static analyzer warnings:
src/compiler/Intermediate.cpp:1008:55:{1008:17-1008:54}: warning: '&&' within '||' [-Wlogical-op-parentheses,2]
if (left->isMatrix() && right->isVector() ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
src/compiler/Intermediate.cpp:1008:55: note: place parentheses around the '&&' expression to silence this warning [2]
if (left->isMatrix() && right->isVector() ||
^
( )
fix-it:"src/compiler/Intermediate.cpp":{1008:17-1008:17}:"("
fix-it:"src/compiler/Intermediate.cpp":{1008:54-1008:54}:")"
src/compiler/Intermediate.cpp:1008:55:{1009:17-1009:54}: warning: '&&' within '||' [-Wlogical-op-parentheses,2]
if (left->isMatrix() && right->isVector() ||
^
src/compiler/Intermediate.cpp:1008:55: note: place parentheses around the '&&' expression to silence this warning [2]
if (left->isMatrix() && right->isVector() ||
^
fix-it:"src/compiler/Intermediate.cpp":{1009:17-1009:17}:"("
fix-it:"src/compiler/Intermediate.cpp":{1009:54-1009:54}:")"
src/compiler/Intermediate.cpp:1020:55:{1020:17-1020:54}: warning: '&&' within '||' [-Wlogical-op-parentheses,2]
if (left->isMatrix() && right->isVector() ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
src/compiler/Intermediate.cpp:1020:55: note: place parentheses around the '&&' expression to silence this warning [2]
if (left->isMatrix() && right->isVector() ||
^
( )
fix-it:"src/compiler/Intermediate.cpp":{1020:17-1020:17}:"("
fix-it:"src/compiler/Intermediate.cpp":{1020:54-1020:54}:")"
src/compiler/Intermediate.cpp:1020:55:{1021:17-1021:54}: warning: '&&' within '||' [-Wlogical-op-parentheses,2]
if (left->isMatrix() && right->isVector() ||
^
src/compiler/Intermediate.cpp:1020:55: note: place parentheses around the '&&' expression to silence this warning [2]
if (left->isMatrix() && right->isVector() ||
^
fix-it:"src/compiler/Intermediate.cpp":{1021:17-1021:17}:"("
fix-it:"src/compiler/Intermediate.cpp":{1021:54-1021:54}:")"
* src/compiler/Intermediate.cpp:
(TIntermBinary::promote): Added parnetheses.
Author: David Kilzer <ddkilzer@apple.com>
git-svn-id: https://angleproject.googlecode.com/svn/trunk@574 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/Intermediate.cpp b/src/compiler/Intermediate.cpp
index ea71234..e1e8da2 100644
--- a/src/compiler/Intermediate.cpp
+++ b/src/compiler/Intermediate.cpp
@@ -1005,8 +1005,8 @@
case EOpAddAssign:
case EOpSubAssign:
case EOpDivAssign:
- if (left->isMatrix() && right->isVector() ||
- left->isVector() && right->isMatrix())
+ if ((left->isMatrix() && right->isVector()) ||
+ (left->isVector() && right->isMatrix()))
return false;
setType(TType(basicType, higherPrecision, EvqTemporary, size, left->isMatrix() || right->isMatrix()));
break;
@@ -1017,8 +1017,8 @@
case EOpGreaterThan:
case EOpLessThanEqual:
case EOpGreaterThanEqual:
- if (left->isMatrix() && right->isVector() ||
- left->isVector() && right->isMatrix())
+ if ((left->isMatrix() && right->isVector()) ||
+ (left->isVector() && right->isMatrix()))
return false;
setType(TType(EbtBool, EbpUndefined));
break;