Use nullptr where possible instead of NULL or 0

This commit is contained in:
Johannes Kauffmann 2022-11-22 19:09:31 +01:00 committed by Jeremy Hayes
parent 728c689574
commit a7603c132d
38 changed files with 248 additions and 248 deletions

View file

@ -226,7 +226,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const());
break;
default:
return 0;
return nullptr;
#endif
}
}
@ -354,7 +354,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
break;
default:
return 0;
return nullptr;
}
TIntermConstantUnion *newNode = new TIntermConstantUnion(newConstArray, returnType);
@ -1345,7 +1345,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons
{
TType dereferencedType(node->getType(), index);
dereferencedType.getQualifier().storage = EvqConst;
TIntermTyped* result = 0;
TIntermTyped* result = nullptr;
int size = dereferencedType.computeNumComponents();
// arrays, vectors, matrices, all use simple multiplicative math
@ -1365,7 +1365,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons
result = addConstantUnion(TConstUnionArray(node->getAsConstantUnion()->getConstArray(), start, size), node->getType(), loc);
if (result == 0)
if (result == nullptr)
result = node;
else
result->setType(dereferencedType);
@ -1387,7 +1387,7 @@ TIntermTyped* TIntermediate::foldSwizzle(TIntermTyped* node, TSwizzleSelectors<T
TIntermTyped* result = addConstantUnion(constArray, node->getType(), loc);
if (result == 0)
if (result == nullptr)
result = node;
else
result->setType(TType(node->getBasicType(), EvqConst, selectors.size()));