diff options
author | John Kessenich <cepheus@frii.com> | 2016-11-27 17:30:14 -0700 |
---|---|---|
committer | John Kessenich <cepheus@frii.com> | 2016-11-27 17:30:14 -0700 |
commit | 5307eb2d1b0227f54237154a58c0fc61cad8e80c (patch) | |
tree | f363458be30b4a52fd4589759b622f84dede8b58 | |
parent | 509c4216e6af3d5fdf020c4a373473831923a42b (diff) | |
download | glslang-5307eb2d1b0227f54237154a58c0fc61cad8e80c.tar.gz |
Non-functional: Change a bunch of 0 to nullptr.
-rw-r--r-- | glslang/Include/revision.h | 2 | ||||
-rw-r--r-- | glslang/MachineIndependent/Intermediate.cpp | 86 |
2 files changed, 44 insertions, 44 deletions
diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 2cfdada1..21df38d8 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "Overload400-PrecQual.1662" +#define GLSLANG_REVISION "Overload400-PrecQual.1663" #define GLSLANG_DATE "27-Nov-2016" diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 9c2590fd..303c0ad2 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -114,7 +114,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn { // No operations work on blocks if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock) - return 0; + return nullptr; // Try converting the children's base types to compatible types. TIntermTyped* child = addConversion(op, left->getType(), right); @@ -125,7 +125,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn if (child) left = child; else - return 0; + return nullptr; } // Convert the children's type shape to be compatible. @@ -275,10 +275,10 @@ TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermT TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSourceLoc loc) { if (child == 0) - return 0; + return nullptr; if (child->getType().getBasicType() == EbtBlock) - return 0; + return nullptr; switch (op) { case EOpLogicalNot: @@ -287,7 +287,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo } if (child->getType().getBasicType() != EbtBool || child->getType().isMatrix() || child->getType().isArray() || child->getType().isVector()) { - return 0; + return nullptr; } break; @@ -297,7 +297,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo case EOpPreDecrement: case EOpNegative: if (child->getType().getBasicType() == EbtStruct || child->getType().isArray()) - return 0; + return nullptr; default: break; // some compilers want this } @@ -325,8 +325,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo child->getMatrixRows(), child->isVector()), child); - if (child == 0) - return 0; + if (child == nullptr) + return nullptr; } // @@ -379,8 +379,8 @@ TIntermTyped* TIntermediate::addBuiltInFunctionCall(const TSourceLoc& loc, TOper // including constness (which would differ from the prototype). // TIntermTyped* child = childNode->getAsTyped(); - if (child == 0) - return 0; + if (child == nullptr) + return nullptr; if (child->getAsConstantUnion()) { TIntermTyped* folded = child->getAsConstantUnion()->fold(op, returnType); @@ -416,7 +416,7 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o // if (node) { aggNode = node->getAsAggregate(); - if (aggNode == 0 || aggNode->getOp() != EOpNull) { + if (aggNode == nullptr || aggNode->getOp() != EOpNull) { // // Make an aggregate containing this node. // @@ -451,7 +451,7 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o // Generally, this is focused on basic type conversion, not shape conversion. // See addShapeConversion(). // -// Return 0 if a conversion can't be done. +// Return nullptr if a conversion can't be done. // TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) const { @@ -460,7 +460,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // switch (node->getBasicType()) { case EbtVoid: - return 0; + return nullptr; case EbtAtomicUint: case EbtSampler: // opaque types can be passed to functions @@ -478,7 +478,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt break; // otherwise, opaque types can't even be operated on, let alone converted - return 0; + return nullptr; default: break; } @@ -489,11 +489,11 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // If one's a structure, then no conversions. if (type.isStruct() || node->isStruct()) - return 0; + return nullptr; // If one's an array, then no conversions. if (type.isArray() || node->getType().isArray()) - return 0; + return nullptr; // Note: callers are responsible for other aspects of shape, // like vector and matrix sizes. @@ -584,7 +584,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt if (canImplicitlyPromote(node->getType().getBasicType(), type.getBasicType(), op)) promoteTo = type.getBasicType(); else - return 0; + return nullptr; break; @@ -606,7 +606,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt return node; else - return 0; + return nullptr; default: // default is to require a match; all exceptions should have case statements above @@ -614,7 +614,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt if (type.getBasicType() == node->getType().getBasicType()) return node; else - return 0; + return nullptr; } if (node->getAsConstantUnion()) @@ -623,7 +623,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // // Add a new newNode for the conversion. // - TIntermUnary* newNode = 0; + TIntermUnary* newNode = nullptr; TOperator newOp = EOpNull; @@ -642,7 +642,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtInt64: newOp = EOpConvInt64ToDouble; break; case EbtUint64: newOp = EOpConvUint64ToDouble; break; default: - return 0; + return nullptr; } break; case EbtFloat: @@ -657,7 +657,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtInt64: newOp = EOpConvInt64ToFloat; break; case EbtUint64: newOp = EOpConvUint64ToFloat; break; default: - return 0; + return nullptr; } break; #ifdef AMD_EXTENSIONS @@ -671,7 +671,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtInt64: newOp = EOpConvInt64ToFloat16; break; case EbtUint64: newOp = EOpConvUint64ToFloat16; break; default: - return 0; + return nullptr; } break; #endif @@ -687,7 +687,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtInt64: newOp = EOpConvInt64ToBool; break; case EbtUint64: newOp = EOpConvUint64ToBool; break; default: - return 0; + return nullptr; } break; case EbtInt: @@ -702,7 +702,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtInt64: newOp = EOpConvInt64ToInt; break; case EbtUint64: newOp = EOpConvUint64ToInt; break; default: - return 0; + return nullptr; } break; case EbtUint: @@ -717,7 +717,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtInt64: newOp = EOpConvInt64ToUint; break; case EbtUint64: newOp = EOpConvUint64ToUint; break; default: - return 0; + return nullptr; } break; case EbtInt64: @@ -732,7 +732,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt #endif case EbtUint64: newOp = EOpConvUint64ToInt64; break; default: - return 0; + return nullptr; } break; case EbtUint64: @@ -747,11 +747,11 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt #endif case EbtInt64: newOp = EOpConvInt64ToUint64; break; default: - return 0; + return nullptr; } break; default: - return 0; + return nullptr; } TType newType(promoteTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows()); @@ -1123,15 +1123,15 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const // Safe way to combine two nodes into an aggregate. Works with null pointers, // a node that's not a aggregate yet, etc. // -// Returns the resulting aggregate, unless 0 was passed in for +// Returns the resulting aggregate, unless nullptr was passed in for // both existing nodes. // TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* right) { - if (left == 0 && right == 0) - return 0; + if (left == nullptr && right == nullptr) + return nullptr; - TIntermAggregate* aggNode = 0; + TIntermAggregate* aggNode = nullptr; if (left) aggNode = left->getAsAggregate(); if (! aggNode || aggNode->getOp() != EOpNull) { @@ -1158,12 +1158,12 @@ TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* r // // Turn an existing node into an aggregate. // -// Returns an aggregate, unless 0 was passed in for the existing node. +// Returns an aggregate, unless nullptr was passed in for the existing node. // TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node) { - if (node == 0) - return 0; + if (node == nullptr) + return nullptr; TIntermAggregate* aggNode = new TIntermAggregate; aggNode->getSequence().push_back(node); @@ -1174,8 +1174,8 @@ TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node) TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node, const TSourceLoc& loc) { - if (node == 0) - return 0; + if (node == nullptr) + return nullptr; TIntermAggregate* aggNode = new TIntermAggregate; aggNode->getSequence().push_back(node); @@ -1237,7 +1237,7 @@ TIntermTyped* TIntermediate::addMethod(TIntermTyped* object, const TType& type, // a true path, and a false path. The two paths are specified // as separate parameters. // -// Returns the selection node created, or 0 if one could not be. +// Returns the selection node created, or nullptr if one could not be. // TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc& loc) { @@ -1252,12 +1252,12 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true if (child) trueBlock = child; else - return 0; + return nullptr; } // After conversion, types have to match. if (falseBlock->getType() != trueBlock->getType()) - return 0; + return nullptr; // // See if all the operands are constant, then fold it otherwise not. @@ -1431,7 +1431,7 @@ TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* init // TIntermBranch* TIntermediate::addBranch(TOperator branchOp, const TSourceLoc& loc) { - return addBranch(branchOp, 0, loc); + return addBranch(branchOp, nullptr, loc); } TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expression, const TSourceLoc& loc) @@ -1448,7 +1448,7 @@ TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expres // bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/) { - if (root == 0) + if (root == nullptr) return true; // Finish off the top-level sequence |