Commit fddc211a by Arun Patole Committed by Olli Etuaho

Revert "Revert "Use nullptr consistently in TIntermConstantUnion::fold""

Revert of revert as the new changes that use nullptr in fold function are already in. This reverts commit b775778a. Change-Id: Ifbdb35264132c66e5d1f2379932839b99291c54a Reviewed-on: https://chromium-review.googlesource.com/266803Reviewed-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
parent aed081ce
...@@ -657,7 +657,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -657,7 +657,7 @@ TIntermTyped *TIntermConstantUnion::fold(
ConstantUnion *unionArray = getUnionArrayPointer(); ConstantUnion *unionArray = getUnionArrayPointer();
if (!unionArray) if (!unionArray)
return NULL; return nullptr;
size_t objectSize = getType().getObjectSize(); size_t objectSize = getType().getObjectSize();
...@@ -669,7 +669,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -669,7 +669,7 @@ TIntermTyped *TIntermConstantUnion::fold(
TType returnType = getType(); TType returnType = getType();
if (!rightUnionArray) if (!rightUnionArray)
return NULL; return nullptr;
// for a case like float f = 1.2 + vec4(2,3,4,5); // for a case like float f = 1.2 + vec4(2,3,4,5);
if (constantNode->getType().getObjectSize() == 1 && objectSize > 1) if (constantNode->getType().getObjectSize() == 1 && objectSize > 1)
...@@ -726,7 +726,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -726,7 +726,7 @@ TIntermTyped *TIntermConstantUnion::fold(
infoSink.info.message( infoSink.info.message(
EPrefixInternalError, getLine(), EPrefixInternalError, getLine(),
"Constant Folding cannot be done for matrix multiply"); "Constant Folding cannot be done for matrix multiply");
return NULL; return nullptr;
} }
const int leftCols = getCols(); const int leftCols = getCols();
...@@ -840,7 +840,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -840,7 +840,7 @@ TIntermTyped *TIntermConstantUnion::fold(
infoSink.info.message( infoSink.info.message(
EPrefixInternalError, getLine(), EPrefixInternalError, getLine(),
"Constant folding cannot be done for \"/\""); "Constant folding cannot be done for \"/\"");
return NULL; return nullptr;
} }
} }
} }
...@@ -853,7 +853,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -853,7 +853,7 @@ TIntermTyped *TIntermConstantUnion::fold(
infoSink.info.message( infoSink.info.message(
EPrefixInternalError, getLine(), EPrefixInternalError, getLine(),
"Constant Folding cannot be done for matrix times vector"); "Constant Folding cannot be done for matrix times vector");
return NULL; return nullptr;
} }
const int matrixCols = getCols(); const int matrixCols = getCols();
...@@ -889,7 +889,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -889,7 +889,7 @@ TIntermTyped *TIntermConstantUnion::fold(
infoSink.info.message( infoSink.info.message(
EPrefixInternalError, getLine(), EPrefixInternalError, getLine(),
"Constant Folding cannot be done for vector times matrix"); "Constant Folding cannot be done for vector times matrix");
return NULL; return nullptr;
} }
const int matrixCols = constantNode->getType().getCols(); const int matrixCols = constantNode->getType().getCols();
...@@ -1098,7 +1098,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1098,7 +1098,7 @@ TIntermTyped *TIntermConstantUnion::fold(
infoSink.info.message( infoSink.info.message(
EPrefixInternalError, getLine(), EPrefixInternalError, getLine(),
"Invalid operator for constant folding"); "Invalid operator for constant folding");
return NULL; return nullptr;
} }
tempNode = new TIntermConstantUnion(tempConstArray, returnType); tempNode = new TIntermConstantUnion(tempConstArray, returnType);
tempNode->setLine(getLine()); tempNode->setLine(getLine());
...@@ -1133,7 +1133,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1133,7 +1133,7 @@ TIntermTyped *TIntermConstantUnion::fold(
infoSink.info.message( infoSink.info.message(
EPrefixInternalError, getLine(), EPrefixInternalError, getLine(),
"Unary operation not folded into constant"); "Unary operation not folded into constant");
return NULL; return nullptr;
} }
break; break;
...@@ -1154,7 +1154,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1154,7 +1154,7 @@ TIntermTyped *TIntermConstantUnion::fold(
infoSink.info.message( infoSink.info.message(
EPrefixInternalError, getLine(), EPrefixInternalError, getLine(),
"Unary operation not folded into constant"); "Unary operation not folded into constant");
return NULL; return nullptr;
} }
break; break;
...@@ -1170,7 +1170,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1170,7 +1170,7 @@ TIntermTyped *TIntermConstantUnion::fold(
infoSink.info.message( infoSink.info.message(
EPrefixInternalError, getLine(), EPrefixInternalError, getLine(),
"Unary operation not folded into constant"); "Unary operation not folded into constant");
return NULL; return nullptr;
} }
break; break;
...@@ -1187,7 +1187,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1187,7 +1187,7 @@ TIntermTyped *TIntermConstantUnion::fold(
infoSink.info.message( infoSink.info.message(
EPrefixInternalError, getLine(), EPrefixInternalError, getLine(),
"Unary operation not folded into constant"); "Unary operation not folded into constant");
return NULL; return nullptr;
} }
break; break;
...@@ -1386,7 +1386,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1386,7 +1386,7 @@ TIntermTyped *TIntermConstantUnion::fold(
return nullptr; return nullptr;
default: default:
return NULL; return nullptr;
} }
} }
newNode = new TIntermConstantUnion(tempConstArray, getType()); newNode = new TIntermConstantUnion(tempConstArray, getType());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment