Commit 5f2feee4 by Arun Patole Committed by Olli Etuaho

Use nullptr consistently in TIntermConstantUnion::fold

Newly added code in TIntermConstantUnion::fold uses nullptr where as remaining part of the function uses NULL. This change removes NULL and consistently uses nullptr in complete function. Change-Id: Ieaada3cf46bf3e16d3ef91b300c86537f778c33f Reviewed-on: https://chromium-review.googlesource.com/264632Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
parent 0273c68c
...@@ -656,7 +656,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -656,7 +656,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();
...@@ -668,7 +668,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -668,7 +668,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)
...@@ -725,7 +725,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -725,7 +725,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();
...@@ -839,7 +839,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -839,7 +839,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;
} }
} }
} }
...@@ -852,7 +852,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -852,7 +852,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();
...@@ -888,7 +888,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -888,7 +888,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();
...@@ -1097,7 +1097,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1097,7 +1097,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());
...@@ -1132,7 +1132,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1132,7 +1132,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;
...@@ -1153,7 +1153,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1153,7 +1153,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;
...@@ -1169,7 +1169,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1169,7 +1169,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;
...@@ -1186,7 +1186,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1186,7 +1186,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;
...@@ -1431,7 +1431,7 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1431,7 +1431,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