diff --git a/deps/glslang/glslang/OGLCompilersDLL/InitializeDll.cpp b/deps/glslang/glslang/OGLCompilersDLL/InitializeDll.cpp index 8cb30983db..0e90693f6f 100644 --- a/deps/glslang/glslang/OGLCompilersDLL/InitializeDll.cpp +++ b/deps/glslang/glslang/OGLCompilersDLL/InitializeDll.cpp @@ -102,7 +102,7 @@ bool InitThread() return false; } - glslang::SetThreadPoolAllocator(nullptr); + glslang::SetThreadPoolAllocator(NULL); return true; } diff --git a/deps/glslang/glslang/SPIRV/GlslangToSpv.cpp b/deps/glslang/glslang/SPIRV/GlslangToSpv.cpp index ea21f67439..3011d973f3 100755 --- a/deps/glslang/glslang/SPIRV/GlslangToSpv.cpp +++ b/deps/glslang/glslang/SPIRV/GlslangToSpv.cpp @@ -1019,7 +1019,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl spv::SpvBuildLogger* buildLogger, glslang::SpvOptions& options) : TIntermTraverser(true, false, true), options(options), - shaderEntry(nullptr), currentFunction(nullptr), + shaderEntry(NULL), currentFunction(NULL), sequenceDepth(0), logger(buildLogger), builder(spvVersion, (glslang::GetKhronosToolId() << 16) | GetSpirvGeneratorVersion(), logger), inEntryPoint(false), entryPointTerminated(false), linkageOnly(false), @@ -2122,8 +2122,8 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang // false otherwise. const auto bothSidesPolicy = [&]() -> bool { // do we have both sides? - if (node->getTrueBlock() == nullptr || - node->getFalseBlock() == nullptr) + if (node->getTrueBlock() == NULL || + node->getFalseBlock() == NULL) return false; // required? (unless we write additional code to look for side effects @@ -2223,13 +2223,13 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang spv::Builder::If ifBuilder(condition, control, builder); // emit the "then" statement - if (node->getTrueBlock() != nullptr) { + if (node->getTrueBlock() != NULL) { node->getTrueBlock()->traverse(this); if (result != spv::NoResult) builder.createStore(accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()), result); } - if (node->getFalseBlock() != nullptr) { + if (node->getFalseBlock() != NULL) { ifBuilder.makeBeginElse(); // emit the "else" statement node->getFalseBlock()->traverse(this); @@ -2288,7 +2288,7 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T // statements between the last case and the end of the switch statement if ((caseValues.size() && (int)codeSegments.size() == valueIndexToSegment[caseValues.size() - 1]) || (int)codeSegments.size() == defaultSegment) - codeSegments.push_back(nullptr); + codeSegments.push_back(NULL); // make the switch statement std::vector segmentBlocks; // returned, as the blocks allocated in the call @@ -2873,7 +2873,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, // nonuniform builder.addMemberDecoration(spvType, member, TranslateNonUniformDecoration(glslangMember.getQualifier())); - if (glslangIntermediate->getHlslFunctionality1() && memberQualifier.semanticName != nullptr) { + if (glslangIntermediate->getHlslFunctionality1() && memberQualifier.semanticName != NULL) { builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE, memberQualifier.semanticName); @@ -2920,7 +2920,7 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra { // First, see if this is sized with a node, meaning a specialization constant: glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim); - if (specNode != nullptr) { + if (specNode != NULL) { builder.clearAccessChain(); specNode->traverse(this); return accessChainLoad(specNode->getAsTyped()->getType()); @@ -6434,7 +6434,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol } #endif - if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != nullptr) { + if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != NULL) { builder.addExtension("SPV_GOOGLE_hlsl_functionality1"); builder.addDecoration(id, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE, symbol->getType().getQualifier().semanticName); @@ -6631,15 +6631,15 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node) { // don't know what this is - if (node == nullptr) + if (node == NULL) return false; // a constant is safe - if (node->getAsConstantUnion() != nullptr) + if (node->getAsConstantUnion() != NULL) return true; // not a symbol means non-trivial - if (node->getAsSymbolNode() == nullptr) + if (node->getAsSymbolNode() == NULL) return false; // a symbol, depends on what's being read @@ -6663,7 +6663,7 @@ bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node) // Return true if trivial. bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node) { - if (node == nullptr) + if (node == NULL) return false; // count non scalars as trivial, as well as anything coming from HLSL @@ -6679,7 +6679,7 @@ bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node) // not a simple operation const glslang::TIntermBinary* binaryNode = node->getAsBinaryNode(); const glslang::TIntermUnary* unaryNode = node->getAsUnaryNode(); - if (binaryNode == nullptr && unaryNode == nullptr) + if (binaryNode == NULL && unaryNode == NULL) return false; // not on leaf nodes @@ -6796,7 +6796,7 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, - SpvOptions* options = nullptr); + SpvOptions* options = NULL); void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, - spv::SpvBuildLogger* logger, SpvOptions* options = nullptr); + spv::SpvBuildLogger* logger, SpvOptions* options = NULL); } diff --git a/deps/glslang/glslang/SPIRV/InReadableOrder.cpp b/deps/glslang/glslang/SPIRV/InReadableOrder.cpp index b207dbf0ec..a4bdf10d37 100644 --- a/deps/glslang/glslang/SPIRV/InReadableOrder.cpp +++ b/deps/glslang/glslang/SPIRV/InReadableOrder.cpp @@ -71,8 +71,8 @@ public: return; callback_(block); visited_.insert(block); - Block* mergeBlock = nullptr; - Block* continueBlock = nullptr; + Block* mergeBlock = NULL; + Block* continueBlock = NULL; auto mergeInst = block->getMergeInstruction(); if (mergeInst) { Id mergeId = mergeInst->getIdOperand(0); diff --git a/deps/glslang/glslang/SPIRV/SpvBuilder.cpp b/deps/glslang/glslang/SPIRV/SpvBuilder.cpp index fcee599af1..dd276dc381 100755 --- a/deps/glslang/glslang/SPIRV/SpvBuilder.cpp +++ b/deps/glslang/glslang/SPIRV/SpvBuilder.cpp @@ -1506,7 +1506,7 @@ Id Builder::smearScalar(Decoration precision, Id scalar, Id vectorType) if (numComponents == 1) return scalar; - Instruction* smear = nullptr; + Instruction* smear = NULL; if (generatingOpCodeForSpecConst) { auto members = std::vector(numComponents, scalar); // Sometime even in spec-constant-op mode, the temporary vector created by diff --git a/deps/glslang/glslang/SPIRV/doc.cpp b/deps/glslang/glslang/SPIRV/doc.cpp index a905968735..c0b2a984e2 100644 --- a/deps/glslang/glslang/SPIRV/doc.cpp +++ b/deps/glslang/glslang/SPIRV/doc.cpp @@ -467,7 +467,7 @@ const char* ImageChannelOrderString(int format) case 17: return "sRGBA"; case 18: return "sBGRA"; - default: + default: return "Bad"; } } @@ -739,7 +739,7 @@ const char* CapabilityString(int info) case 22: return "Int16"; case 23: return "TessellationPointSize"; case 24: return "GeometryPointSize"; - case 25: return "ImageGatherExtended"; + case 25: return "ImageGatherExtended"; case 26: return "Bad"; case 27: return "StorageImageMultisample"; case 28: return "UniformBufferArrayDynamicIndexing"; @@ -1371,37 +1371,37 @@ void Parameterize() DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'"); OperandClassParams[OperandSource].set(0, SourceString, 0); - OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, nullptr); - OperandClassParams[OperandAddressing].set(0, AddressingString, nullptr); - OperandClassParams[OperandMemory].set(0, MemoryString, nullptr); + OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, NULL); + OperandClassParams[OperandAddressing].set(0, AddressingString, NULL); + OperandClassParams[OperandMemory].set(0, MemoryString, NULL); OperandClassParams[OperandExecutionMode].set(ExecutionModeCeiling, ExecutionModeString, ExecutionModeParams); OperandClassParams[OperandExecutionMode].setOperands(ExecutionModeOperands); - OperandClassParams[OperandStorage].set(0, StorageClassString, nullptr); - OperandClassParams[OperandDimensionality].set(0, DimensionString, nullptr); - OperandClassParams[OperandSamplerAddressingMode].set(0, SamplerAddressingModeString, nullptr); - OperandClassParams[OperandSamplerFilterMode].set(0, SamplerFilterModeString, nullptr); - OperandClassParams[OperandSamplerImageFormat].set(0, ImageFormatString, nullptr); - OperandClassParams[OperandImageChannelOrder].set(0, ImageChannelOrderString, nullptr); - OperandClassParams[OperandImageChannelDataType].set(0, ImageChannelDataTypeString, nullptr); + OperandClassParams[OperandStorage].set(0, StorageClassString, NULL); + OperandClassParams[OperandDimensionality].set(0, DimensionString, NULL); + OperandClassParams[OperandSamplerAddressingMode].set(0, SamplerAddressingModeString, NULL); + OperandClassParams[OperandSamplerFilterMode].set(0, SamplerFilterModeString, NULL); + OperandClassParams[OperandSamplerImageFormat].set(0, ImageFormatString, NULL); + OperandClassParams[OperandImageChannelOrder].set(0, ImageChannelOrderString, NULL); + OperandClassParams[OperandImageChannelDataType].set(0, ImageChannelDataTypeString, NULL); OperandClassParams[OperandImageOperands].set(ImageOperandsCeiling, ImageOperandsString, ImageOperandsParams, true); - OperandClassParams[OperandFPFastMath].set(0, FPFastMathString, nullptr, true); - OperandClassParams[OperandFPRoundingMode].set(0, FPRoundingModeString, nullptr); - OperandClassParams[OperandLinkageType].set(0, LinkageTypeString, nullptr); - OperandClassParams[OperandFuncParamAttr].set(0, FuncParamAttrString, nullptr); - OperandClassParams[OperandAccessQualifier].set(0, AccessQualifierString, nullptr); + OperandClassParams[OperandFPFastMath].set(0, FPFastMathString, NULL, true); + OperandClassParams[OperandFPRoundingMode].set(0, FPRoundingModeString, NULL); + OperandClassParams[OperandLinkageType].set(0, LinkageTypeString, NULL); + OperandClassParams[OperandFuncParamAttr].set(0, FuncParamAttrString, NULL); + OperandClassParams[OperandAccessQualifier].set(0, AccessQualifierString, NULL); OperandClassParams[OperandDecoration].set(DecorationCeiling, DecorationString, DecorationParams); OperandClassParams[OperandDecoration].setOperands(DecorationOperands); - OperandClassParams[OperandBuiltIn].set(0, BuiltInString, nullptr); + OperandClassParams[OperandBuiltIn].set(0, BuiltInString, NULL); OperandClassParams[OperandSelect].set(SelectControlCeiling, SelectControlString, SelectionControlParams, true); OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true); OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true); - OperandClassParams[OperandMemorySemantics].set(0, MemorySemanticsString, nullptr, true); - OperandClassParams[OperandMemoryAccess].set(0, MemoryAccessString, nullptr, true); - OperandClassParams[OperandScope].set(0, ScopeString, nullptr); - OperandClassParams[OperandGroupOperation].set(0, GroupOperationString, nullptr); - OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr); - OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true); - OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr); + OperandClassParams[OperandMemorySemantics].set(0, MemorySemanticsString, NULL, true); + OperandClassParams[OperandMemoryAccess].set(0, MemoryAccessString, NULL, true); + OperandClassParams[OperandScope].set(0, ScopeString, NULL); + OperandClassParams[OperandGroupOperation].set(0, GroupOperationString, NULL); + OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, NULL); + OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, NULL, true); + OperandClassParams[OperandCapability].set(0, CapabilityString, NULL); OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, 0); // set name of operator, an initial set of style operands, and the description @@ -1943,11 +1943,11 @@ void Parameterize() InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Offset'"); InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Count'"); - + InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Offset'"); InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Count'"); - + InstructionDesc[OpBitReverse].operands.push(OperandId, "'Base'"); InstructionDesc[OpBitCount].operands.push(OperandId, "'Base'"); diff --git a/deps/glslang/glslang/SPIRV/hex_float.h b/deps/glslang/glslang/SPIRV/hex_float.h index 5cd686f50a..32fa70f685 100644 --- a/deps/glslang/glslang/SPIRV/hex_float.h +++ b/deps/glslang/glslang/SPIRV/hex_float.h @@ -643,7 +643,7 @@ inline uint8_t get_nibble_from_character(int character) { const char* dec = "0123456789"; const char* lower = "abcdef"; const char* upper = "ABCDEF"; - const char* p = nullptr; + const char* p = NULL; if ((p = strchr(dec, character))) return static_cast(p - dec); else if ((p = strchr(lower, character))) diff --git a/deps/glslang/glslang/SPIRV/spvIR.h b/deps/glslang/glslang/SPIRV/spvIR.h index ad363da06c..9109c60591 100755 --- a/deps/glslang/glslang/SPIRV/spvIR.h +++ b/deps/glslang/glslang/SPIRV/spvIR.h @@ -84,8 +84,8 @@ const MemorySemanticsMask MemorySemanticsAllMemory = class Instruction { public: - Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(nullptr) { } - explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { } + Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(NULL) { } + explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(NULL) { } virtual ~Instruction() {} void addIdOperand(Id id) { operands.push_back(id); } void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); } @@ -182,16 +182,17 @@ public: bool isUnreachable() const { return unreachable; } // Returns the block's merge instruction, if one exists (otherwise null). const Instruction* getMergeInstruction() const { - if (instructions.size() < 2) return nullptr; + if (instructions.size() < 2) return NULL; const Instruction* nextToLast = (instructions.cend() - 2)->get(); - switch (nextToLast->getOpCode()) { + switch (nextToLast->getOpCode()) + { case OpSelectionMerge: case OpLoopMerge: return nextToLast; default: - return nullptr; + break; } - return nullptr; + return NULL; } bool isTerminated() const diff --git a/deps/glslang/glslang/glslang/Include/Common.h b/deps/glslang/glslang/glslang/Include/Common.h index 41b9253408..0d6003b683 100644 --- a/deps/glslang/glslang/glslang/Include/Common.h +++ b/deps/glslang/glslang/glslang/Include/Common.h @@ -222,12 +222,12 @@ inline const TString String(const int i, const int /*base*/ = 10) #endif struct TSourceLoc { - void init() { name = nullptr; string = 0; line = 0; column = 0; } + void init() { name = NULL; string = 0; line = 0; column = 0; } void init(int stringNum) { init(); string = stringNum; } // Returns the name if it exists. Otherwise, returns the string number. std::string getStringNameOrNum(bool quoteStringName = true) const { - if (name != nullptr) + if (name != NULL) return quoteStringName ? ("\"" + std::string(name) + "\"") : name; return std::to_string((long long)string); } diff --git a/deps/glslang/glslang/glslang/Include/ConstantUnion.h b/deps/glslang/glslang/glslang/Include/ConstantUnion.h index 1860e37565..cc6db52e18 100644 --- a/deps/glslang/glslang/glslang/Include/ConstantUnion.h +++ b/deps/glslang/glslang/glslang/Include/ConstantUnion.h @@ -846,13 +846,13 @@ class TConstUnionArray { public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TConstUnionArray() : unionArray(nullptr) { } + TConstUnionArray() : unionArray(NULL) { } virtual ~TConstUnionArray() { } explicit TConstUnionArray(int size) { if (size == 0) - unionArray = nullptr; + unionArray = NULL; else unionArray = new TConstUnionVector(size); } @@ -894,7 +894,7 @@ public: return sum; } - bool empty() const { return unionArray == nullptr; } + bool empty() const { return unionArray == NULL; } protected: typedef TVector TConstUnionVector; diff --git a/deps/glslang/glslang/glslang/Include/Types.h b/deps/glslang/glslang/glslang/Include/Types.h index 5874b3e58c..28dc3614f1 100644 --- a/deps/glslang/glslang/glslang/Include/Types.h +++ b/deps/glslang/glslang/glslang/Include/Types.h @@ -431,7 +431,7 @@ public: // drop qualifiers that don't belong in a temporary variable void makeTemporary() { - semanticName = nullptr; + semanticName = NULL; storage = EvqTemporary; builtIn = EbvNone; clearInterstage(); @@ -1119,8 +1119,8 @@ public: vectorSize = 1; matrixRows = 0; matrixCols = 0; - arraySizes = nullptr; - userDef = nullptr; + arraySizes = NULL; + userDef = NULL; loc = l; } @@ -1155,7 +1155,7 @@ public: bool isScalar() const { - return matrixCols == 0 && vectorSize == 1 && arraySizes == nullptr && userDef == nullptr; + return matrixCols == 0 && vectorSize == 1 && arraySizes == NULL && userDef == NULL; } // "Image" is a superset of "Subpass" @@ -1174,7 +1174,7 @@ public: explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0, bool isVector = false) : basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), - arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr) + arraySizes(NULL), structure(NULL), fieldName(NULL), typeName(NULL) { sampler.clear(); qualifier.clear(); @@ -1184,7 +1184,7 @@ public: TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0, bool isVector = false) : basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), - arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr) + arraySizes(NULL), structure(NULL), fieldName(NULL), typeName(NULL) { sampler.clear(); qualifier.clear(); @@ -1195,7 +1195,7 @@ public: explicit TType(const TPublicType& p) : basicType(p.basicType), vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), - arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr) + arraySizes(p.arraySizes), structure(NULL), fieldName(NULL), typeName(NULL) { if (basicType == EbtSampler) sampler = p.sampler; @@ -1208,9 +1208,9 @@ public: } } // for construction of sampler types - TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) : + TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = NULL) : basicType(EbtSampler), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), - arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr), + arraySizes(as), structure(NULL), fieldName(NULL), typeName(NULL), sampler(sampler) { qualifier.clear(); @@ -1224,7 +1224,7 @@ public: if (type.isArray()) { shallowCopy(type); if (type.getArraySizes()->getNumDims() == 1) { - arraySizes = nullptr; + arraySizes = NULL; } else { // want our own copy of the array, so we can edit it arraySizes = new TArraySizes; @@ -1258,7 +1258,7 @@ public: // for making structures, ... TType(TTypeList* userDef, const TString& n) : basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), - arraySizes(nullptr), structure(userDef), fieldName(nullptr) + arraySizes(NULL), structure(userDef), fieldName(NULL) { sampler.clear(); qualifier.clear(); @@ -1267,7 +1267,7 @@ public: // For interface blocks TType(TTypeList* userDef, const TString& n, const TQualifier& q) : basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), - qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr) + qualifier(q), arraySizes(NULL), structure(userDef), fieldName(NULL) { sampler.clear(); typeName = NewPoolTString(n.c_str()); @@ -1346,7 +1346,7 @@ public: virtual int getOuterArraySize() const { return arraySizes->getOuterSize(); } virtual TIntermTyped* getOuterArrayNode() const { return arraySizes->getOuterNode(); } virtual int getCumulativeArraySize() const { return arraySizes->getCumulativeSize(); } - virtual bool isArrayOfArrays() const { return arraySizes != nullptr && arraySizes->getNumDims() > 1; } + virtual bool isArrayOfArrays() const { return arraySizes != NULL && arraySizes->getNumDims() > 1; } virtual int getImplicitArraySize() const { return arraySizes->getImplicitSize(); } virtual const TArraySizes* getArraySizes() const { return arraySizes; } virtual TArraySizes* getArraySizes() { return arraySizes; } @@ -1355,13 +1355,13 @@ public: virtual bool isScalarOrVec1() const { return isScalar() || vector1; } virtual bool isVector() const { return vectorSize > 1 || vector1; } virtual bool isMatrix() const { return matrixCols ? true : false; } - virtual bool isArray() const { return arraySizes != nullptr; } + virtual bool isArray() const { return arraySizes != NULL; } virtual bool isSizedArray() const { return isArray() && arraySizes->isSized(); } virtual bool isUnsizedArray() const { return isArray() && !arraySizes->isSized(); } virtual bool isArrayVariablyIndexed() const { return arraySizes->isVariablyIndexed(); } virtual void setArrayVariablyIndexed() { arraySizes->setVariablyIndexed(); } virtual void updateImplicitArraySize(int size) { arraySizes->updateImplicitSize(size); } - virtual bool isStruct() const { return structure != nullptr; } + virtual bool isStruct() const { return structure != NULL; } virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16; } virtual bool isIntegerDomain() const { @@ -1498,15 +1498,15 @@ public: } void clearArraySizes() { - arraySizes = nullptr; + arraySizes = NULL; } // Add inner array sizes, to any existing sizes, via copy; the // sizes passed in can still be reused for other purposes. void copyArrayInnerSizes(const TArraySizes* s) { - if (s != nullptr) { - if (arraySizes == nullptr) + if (s != NULL) { + if (arraySizes == NULL) copyArraySizes(*s); else arraySizes->addInnerSizes(*s); @@ -1783,7 +1783,7 @@ public: else components = vectorSize; - if (arraySizes != nullptr) { + if (arraySizes != NULL) { components *= arraySizes->getCumulativeSize(); } @@ -1807,12 +1807,12 @@ public: // bool sameStructType(const TType& right) const { - // Most commonly, they are both nullptr, or the same pointer to the same actual structure + // Most commonly, they are both NULL, or the same pointer to the same actual structure if (structure == right.structure) return true; - // Both being nullptr was caught above, now they both have to be structures of the same number of elements - if (structure == nullptr || right.structure == nullptr || + // Both being NULL was caught above, now they both have to be structures of the same number of elements + if (structure == NULL || right.structure == NULL || structure->size() != right.structure->size()) return false; @@ -1841,8 +1841,8 @@ public: // See if two type's arrayness match bool sameArrayness(const TType& right) const { - return ((arraySizes == nullptr && right.arraySizes == nullptr) || - (arraySizes != nullptr && right.arraySizes != nullptr && *arraySizes == *right.arraySizes)); + return ((arraySizes == NULL && right.arraySizes == NULL) || + (arraySizes != NULL && right.arraySizes != NULL && *arraySizes == *right.arraySizes)); } // See if two type's arrayness match in everything except their outer dimension @@ -1927,8 +1927,8 @@ protected: // from a scalar. TQualifier qualifier; - TArraySizes* arraySizes; // nullptr unless an array; can be shared across types - TTypeList* structure; // nullptr unless this is a struct; can be shared across types + TArraySizes* arraySizes; // NULL unless an array; can be shared across types + TTypeList* structure; // NULL unless this is a struct; can be shared across types TString *fieldName; // for structure field names TString *typeName; // for structure type name TSampler sampler; diff --git a/deps/glslang/glslang/glslang/Include/arrays.h b/deps/glslang/glslang/glslang/Include/arrays.h index ab0e5761e6..98aa87c121 100644 --- a/deps/glslang/glslang/glslang/Include/arrays.h +++ b/deps/glslang/glslang/glslang/Include/arrays.h @@ -56,12 +56,12 @@ extern bool SameSpecializationConstants(TIntermTyped*, TIntermTyped*); // size and specialization constant nodes are the same. struct TArraySize { unsigned int size; - TIntermTyped* node; // nullptr means no specialization constant node + TIntermTyped* node; // NULL means no specialization constant node bool operator==(const TArraySize& rhs) const { if (size != rhs.size) return false; - if (node == nullptr || rhs.node == nullptr) + if (node == NULL || rhs.node == NULL) return node == rhs.node; return SameSpecializationConstants(node, rhs.node); @@ -82,14 +82,14 @@ struct TSmallArrayVector { // POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TSmallArrayVector() : sizes(nullptr) { } + TSmallArrayVector() : sizes(NULL) { } virtual ~TSmallArrayVector() { dealloc(); } // For breaking into two non-shared copies, independently modifiable. TSmallArrayVector& operator=(const TSmallArrayVector& from) { - if (from.sizes == nullptr) - sizes = nullptr; + if (from.sizes == NULL) + sizes = NULL; else { alloc(); *sizes = *from.sizes; @@ -100,7 +100,7 @@ struct TSmallArrayVector { int size() const { - if (sizes == nullptr) + if (sizes == NULL) return 0; return (int)sizes->size(); } @@ -170,9 +170,9 @@ struct TSmallArrayVector { bool operator==(const TSmallArrayVector& rhs) const { - if (sizes == nullptr && rhs.sizes == nullptr) + if (sizes == NULL && rhs.sizes == NULL) return true; - if (sizes == nullptr || rhs.sizes == nullptr) + if (sizes == NULL || rhs.sizes == NULL) return false; return *sizes == *rhs.sizes; } @@ -183,13 +183,13 @@ protected: void alloc() { - if (sizes == nullptr) + if (sizes == NULL) sizes = new TVector; } void dealloc() { delete sizes; - sizes = nullptr; + sizes = NULL; } TVector* sizes; // will either hold such a pointer, or in the future, hold the two array sizes @@ -240,7 +240,7 @@ struct TArraySizes { return size; } void addInnerSize() { addInnerSize((unsigned)UnsizedArraySize); } - void addInnerSize(int s) { addInnerSize((unsigned)s, nullptr); } + void addInnerSize(int s) { addInnerSize((unsigned)s, NULL); } void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); } void addInnerSize(TArraySize pair) { sizes.push_back(pair.size, pair.node); } void addInnerSizes(const TArraySizes& s) { sizes.push_back(s.sizes); } @@ -268,7 +268,7 @@ struct TArraySizes { bool isInnerSpecialization() const { for (int d = 1; d < sizes.size(); ++d) { - if (sizes.getDimNode(d) != nullptr) + if (sizes.getDimNode(d) != NULL) return true; } @@ -276,7 +276,7 @@ struct TArraySizes { } bool isOuterSpecialization() { - return sizes.getDimNode(0) != nullptr; + return sizes.getDimNode(0) != NULL; } bool hasUnsized() const { return getOuterSize() == UnsizedArraySize || isInnerUnsized(); } diff --git a/deps/glslang/glslang/glslang/Include/intermediate.h b/deps/glslang/glslang/glslang/Include/intermediate.h index 4f3e101129..e13ebe7fc7 100755 --- a/deps/glslang/glslang/glslang/Include/intermediate.h +++ b/deps/glslang/glslang/glslang/Include/intermediate.h @@ -1158,7 +1158,7 @@ public: // it is essential to use "symbol = sym" to assign to symbol TIntermSymbol(int i, const TString& n, const TType& t) : TIntermTyped(t), id(i), - constSubtree(nullptr) + constSubtree(NULL) { name = n; } virtual int getId() const { return id; } virtual const TString& getName() const { return name; } @@ -1471,8 +1471,8 @@ typedef TVector TQualifierList; // class TIntermAggregate : public TIntermOperator { public: - TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) { } - TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) { } + TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(NULL) { } + TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(NULL) { } ~TIntermAggregate() { delete pragmaTable; } virtual TIntermAggregate* getAsAggregate() { return this; } virtual const TIntermAggregate* getAsAggregate() const { return this; } diff --git a/deps/glslang/glslang/glslang/MachineIndependent/Constant.cpp b/deps/glslang/glslang/glslang/MachineIndependent/Constant.cpp index 20eb2caf79..4637b8b2bc 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/Constant.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/Constant.cpp @@ -701,7 +701,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) // TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) { - if (aggrNode == nullptr) + if (aggrNode == NULL) return aggrNode; if (! areAllChildConst(aggrNode)) diff --git a/deps/glslang/glslang/glslang/MachineIndependent/InfoSink.cpp b/deps/glslang/glslang/glslang/MachineIndependent/InfoSink.cpp index 1fc5a5c604..d17d4dda33 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/InfoSink.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/InfoSink.cpp @@ -41,7 +41,7 @@ namespace glslang { void TInfoSinkBase::append(const char* s) { if (outputStream & EString) { - if (s == nullptr) + if (s == NULL) sink.append("(null)"); else { checkMem(strlen(s)); diff --git a/deps/glslang/glslang/glslang/MachineIndependent/Intermediate.cpp b/deps/glslang/glslang/glslang/MachineIndependent/Intermediate.cpp index 50d3da3a0b..fc29854f36 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -103,7 +103,7 @@ TIntermSymbol* TIntermediate::addSymbol(const TType& type, const TSourceLoc& loc { TConstUnionArray unionArray; // just a null constant - return addSymbol(0, "", type, unionArray, nullptr, loc); + return addSymbol(0, "", type, unionArray, NULL, loc); } // @@ -111,26 +111,26 @@ TIntermSymbol* TIntermediate::addSymbol(const TType& type, const TSourceLoc& loc // // Returns the added node. // -// Returns nullptr if the working conversions and promotions could not be found. +// Returns NULL if the working conversions and promotions could not be found. // TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc loc) { // No operations work on blocks if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock) - return nullptr; + return NULL; // Try converting the children's base types to compatible types. auto children = addConversion(op, left, right); left = std::get<0>(children); right = std::get<1>(children); - if (left == nullptr || right == nullptr) - return nullptr; + if (left == NULL || right == NULL) + return NULL; // Convert the children's type shape to be compatible. addBiShapeConversion(op, left, right); - if (left == nullptr || right == nullptr) - return nullptr; + if (left == NULL || right == NULL) + return NULL; // // Need a new node holding things together. Make @@ -138,7 +138,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn // TIntermBinary* node = addBinaryNode(op, left, right, loc); if (! promote(node)) - return nullptr; + return NULL; node->updatePrecision(); @@ -222,24 +222,24 @@ TIntermUnary* TIntermediate::addUnaryNode(TOperator op, TIntermTyped* child, TSo // // Returns the added node. // -// Returns nullptr if the 'right' type could not be converted to match the 'left' type, +// Returns NULL if the 'right' type could not be converted to match the 'left' type, // or the resulting operation cannot be properly promoted. // TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc loc) { // No block assignment if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock) - return nullptr; + return NULL; // // Like adding binary math, except the conversion can only go // from right to left. // - // convert base types, nullptr return means not possible + // convert base types, NULL return means not possible right = addConversion(op, left->getType(), right); - if (right == nullptr) - return nullptr; + if (right == NULL) + return NULL; // convert shape right = addUniShapeConversion(op, left->getType(), right); @@ -248,7 +248,7 @@ TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TInterm TIntermBinary* node = addBinaryNode(op, left, right, loc); if (! promote(node)) - return nullptr; + return NULL; node->updatePrecision(); @@ -276,10 +276,10 @@ TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermT TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSourceLoc loc) { if (child == 0) - return nullptr; + return NULL; if (child->getType().getBasicType() == EbtBlock) - return nullptr; + return NULL; switch (op) { case EOpLogicalNot: @@ -288,7 +288,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo } if (child->getType().getBasicType() != EbtBool || child->getType().isMatrix() || child->getType().isArray() || child->getType().isVector()) { - return nullptr; + return NULL; } break; @@ -298,7 +298,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo case EOpPreDecrement: case EOpNegative: if (child->getType().getBasicType() == EbtStruct || child->getType().isArray()) - return nullptr; + return NULL; default: break; // some compilers want this } @@ -328,8 +328,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo child->getMatrixRows(), child->isVector()), child); - if (child == nullptr) - return nullptr; + if (child == NULL) + return NULL; } // @@ -359,7 +359,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo TIntermUnary* node = addUnaryNode(op, child, loc); if (! promote(node)) - return nullptr; + return NULL; node->updatePrecision(); @@ -389,8 +389,8 @@ TIntermTyped* TIntermediate::addBuiltInFunctionCall(const TSourceLoc& loc, TOper // including constness (which would differ from the prototype). // TIntermTyped* child = childNode->getAsTyped(); - if (child == nullptr) - return nullptr; + if (child == NULL) + return NULL; if (child->getAsConstantUnion()) { TIntermTyped* folded = child->getAsConstantUnion()->fold(op, returnType); @@ -424,9 +424,9 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o // // Make sure we have an aggregate. If not turn it into one. // - if (node != nullptr) { + if (node != NULL) { aggNode = node->getAsAggregate(); - if (aggNode == nullptr || aggNode->getOp() != EOpNull) { + if (aggNode == NULL || aggNode->getOp() != EOpNull) { // // Make an aggregate containing this node. // @@ -471,7 +471,7 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const // samplers can get assigned via a sampler constructor // (well, not yet, but code in the rest of this function is ready for it) if (node->getBasicType() == EbtSampler && op == EOpAssign && - node->getAsOperator() != nullptr && node->getAsOperator()->getOp() == EOpConstructTextureSampler) + node->getAsOperator() != NULL && node->getAsOperator()->getOp() == EOpConstructTextureSampler) break; // otherwise, opaque types can't even be operated on, let alone converted @@ -491,7 +491,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped // // Add a new newNode for the conversion. // - TIntermUnary* newNode = nullptr; + TIntermUnary* newNode = NULL; TOperator newOp = EOpNull; @@ -510,7 +510,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtInt64: newOp = EOpConvInt64ToDouble; break; case EbtUint64: newOp = EOpConvUint64ToDouble; break; default: - return nullptr; + return NULL; } break; case EbtFloat: @@ -527,7 +527,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtInt64: newOp = EOpConvInt64ToFloat; break; case EbtUint64: newOp = EOpConvUint64ToFloat; break; default: - return nullptr; + return NULL; } break; case EbtFloat16: @@ -544,7 +544,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtInt64: newOp = EOpConvInt64ToFloat16; break; case EbtUint64: newOp = EOpConvUint64ToFloat16; break; default: - return nullptr; + return NULL; } break; case EbtBool: @@ -561,7 +561,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtInt64: newOp = EOpConvInt64ToBool; break; case EbtUint64: newOp = EOpConvUint64ToBool; break; default: - return nullptr; + return NULL; } break; case EbtInt8: @@ -578,7 +578,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtDouble: newOp = EOpConvDoubleToInt8; break; case EbtFloat16: newOp = EOpConvFloat16ToInt8; break; default: - return nullptr; + return NULL; } break; case EbtUint8: @@ -595,7 +595,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtDouble: newOp = EOpConvDoubleToUint8; break; case EbtFloat16: newOp = EOpConvFloat16ToUint8; break; default: - return nullptr; + return NULL; } break; @@ -613,7 +613,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtDouble: newOp = EOpConvDoubleToInt16; break; case EbtFloat16: newOp = EOpConvFloat16ToInt16; break; default: - return nullptr; + return NULL; } break; case EbtUint16: @@ -630,7 +630,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtDouble: newOp = EOpConvDoubleToUint16; break; case EbtFloat16: newOp = EOpConvFloat16ToUint16; break; default: - return nullptr; + return NULL; } break; @@ -648,7 +648,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtInt64: newOp = EOpConvInt64ToInt; break; case EbtUint64: newOp = EOpConvUint64ToInt; break; default: - return nullptr; + return NULL; } break; case EbtUint: @@ -665,7 +665,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtInt64: newOp = EOpConvInt64ToUint; break; case EbtUint64: newOp = EOpConvUint64ToUint; break; default: - return nullptr; + return NULL; } break; case EbtInt64: @@ -682,7 +682,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtFloat16: newOp = EOpConvFloat16ToInt64; break; case EbtUint64: newOp = EOpConvUint64ToInt64; break; default: - return nullptr; + return NULL; } break; case EbtUint64: @@ -699,11 +699,11 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped case EbtFloat16: newOp = EOpConvFloat16ToUint64; break; case EbtInt64: newOp = EOpConvInt64ToUint64; break; default: - return nullptr; + return NULL; } break; default: - return nullptr; + return NULL; } TType newType(convertTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows()); @@ -729,21 +729,21 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped // See addShapeConversion() for shape conversions. // // Returns the converted pair of nodes. -// Returns when there is no conversion. +// Returns when there is no conversion. std::tuple TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) const { if (!isConversionAllowed(op, node0) || !isConversionAllowed(op, node1)) - return std::make_tuple(nullptr, nullptr); + return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL); if (node0->getType() != node1->getType()) { // If differing structure, then no conversions. if (node0->isStruct() || node1->isStruct()) - return std::make_tuple(nullptr, nullptr); + return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL); // If differing arrays, then no conversions. if (node0->getType().isArray() || node1->getType().isArray()) - return std::make_tuple(nullptr, nullptr); + return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL); } auto promoteTo = std::make_tuple(EbtNumTypes, EbtNumTypes); @@ -782,7 +782,7 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no promoteTo = getConversionDestinatonType(node0->getBasicType(), node1->getBasicType(), op); if (std::get<0>(promoteTo) == EbtNumTypes || std::get<1>(promoteTo) == EbtNumTypes) - return std::make_tuple(nullptr, nullptr); + return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL); break; @@ -812,7 +812,7 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no if (isTypeInt(node0->getBasicType()) && isTypeInt(node1->getBasicType())) return std::make_tuple(node0, node1); else - return std::make_tuple(nullptr, nullptr); + return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL); } break; @@ -820,7 +820,7 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no if (node0->getType() == node1->getType()) return std::make_tuple(node0, node1); - return std::make_tuple(nullptr, nullptr); + return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL); } TIntermTyped* newNode0; @@ -858,12 +858,12 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no // Generally, this is focused on basic type conversion, not shape conversion. // See addShapeConversion() for shape conversions. // -// Return nullptr if a conversion can't be done. +// Return NULL if a conversion can't be done. // TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) const { if (!isConversionAllowed(op, node)) - return nullptr; + return NULL; // Otherwise, if types are identical, no problem if (type == node->getType()) @@ -871,11 +871,11 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // If one's a structure, then no conversions. if (type.isStruct() || node->isStruct()) - return nullptr; + return NULL; // If one's an array, then no conversions. if (type.isArray() || node->getType().isArray()) - return nullptr; + return NULL; // Note: callers are responsible for other aspects of shape, // like vector and matrix sizes. @@ -970,7 +970,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt if (canImplicitlyPromote(node->getBasicType(), type.getBasicType(), op)) promoteTo = type.getBasicType(); else - return nullptr; + return NULL; break; // For GLSL, there are no conversions needed; the shift amount just needs to be an @@ -985,7 +985,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt if (isTypeInt(type.getBasicType()) && isTypeInt(node->getBasicType())) return node; else - return nullptr; + return NULL; } break; } @@ -996,7 +996,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt if (type.getBasicType() == node->getType().getBasicType()) return node; else - return nullptr; + return NULL; } if (node->getAsConstantUnion()) @@ -1191,7 +1191,7 @@ TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped* const int matSize = type.getMatrixRows() * type.getMatrixCols(); TIntermAggregate* rhsAggregate = new TIntermAggregate(); - const bool isSimple = (node->getAsSymbolNode() != nullptr) || (node->getAsConstantUnion() != nullptr); + const bool isSimple = (node->getAsSymbolNode() != NULL) || (node->getAsConstantUnion() != NULL); for (int x=0; xgetSequence().push_back(node); @@ -2052,24 +2052,24 @@ 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 nullptr was passed in for +// Returns the resulting aggregate, unless NULL was passed in for // both existing nodes. // TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* right) { - if (left == nullptr && right == nullptr) - return nullptr; + if (left == NULL && right == NULL) + return NULL; - TIntermAggregate* aggNode = nullptr; - if (left != nullptr) + TIntermAggregate* aggNode = NULL; + if (left != NULL) aggNode = left->getAsAggregate(); - if (aggNode == nullptr || aggNode->getOp() != EOpNull) { + if (aggNode == NULL || aggNode->getOp() != EOpNull) { aggNode = new TIntermAggregate; - if (left != nullptr) + if (left != NULL) aggNode->getSequence().push_back(left); } - if (right != nullptr) + if (right != NULL) aggNode->getSequence().push_back(right); return aggNode; @@ -2087,12 +2087,12 @@ TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* r // // Turn an existing node into an aggregate. // -// Returns an aggregate, unless nullptr was passed in for the existing node. +// Returns an aggregate, unless NULL was passed in for the existing node. // TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node) { - if (node == nullptr) - return nullptr; + if (node == NULL) + return NULL; TIntermAggregate* aggNode = new TIntermAggregate; aggNode->getSequence().push_back(node); @@ -2103,8 +2103,8 @@ TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node) TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node, const TSourceLoc& loc) { - if (node == nullptr) - return nullptr; + if (node == NULL) + return NULL; TIntermAggregate* aggNode = new TIntermAggregate; aggNode->getSequence().push_back(node); @@ -2180,7 +2180,7 @@ TIntermTyped* TIntermediate::addMethod(TIntermTyped* object, const TType& type, // Specialization constant operations include // - The ternary operator ( ? : ) // -// Returns the selection node created, or nullptr if one could not be. +// Returns the selection node created, or NULL if one could not be. // TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc& loc) @@ -2202,8 +2202,8 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true trueBlock = std::get<0>(children); falseBlock = std::get<1>(children); - if (trueBlock == nullptr || falseBlock == nullptr) - return nullptr; + if (trueBlock == NULL || falseBlock == NULL) + return NULL; // Handle a vector condition as a mix if (!cond->getType().isScalarOrVec1()) { @@ -2215,7 +2215,7 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true // After conversion, types have to match. if (falseBlock->getType() != trueBlock->getType()) - return nullptr; + return NULL; // make the mix operation TIntermAggregate* mix = makeAggregate(loc); @@ -2235,7 +2235,7 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true // After conversion, types have to match. if (falseBlock->getType() != trueBlock->getType()) - return nullptr; + return NULL; // Eliminate the selection when the condition is a scalar and all operands are constant. if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) { @@ -2407,7 +2407,7 @@ TIntermTyped* TIntermediate::addSwizzle(TSwizzleSelectors& selecto // expression (just "." and []). // // Return the base of the l-value (where following indexing quits working). -// Return nullptr if a chain following dereferences cannot be followed. +// Return NULL if a chain following dereferences cannot be followed. // // 'swizzleOkay' says whether or not it is okay to consider a swizzle // a valid part of the dereference chain. @@ -2416,18 +2416,18 @@ const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool { do { const TIntermBinary* binary = node->getAsBinaryNode(); - if (binary == nullptr) + if (binary == NULL) return node; TOperator op = binary->getOp(); if (op != EOpIndexDirect && op != EOpIndexIndirect && op != EOpIndexDirectStruct && op != EOpVectorSwizzle && op != EOpMatrixSwizzle) - return nullptr; + return NULL; if (! swizzleOkay) { if (op == EOpVectorSwizzle || op == EOpMatrixSwizzle) - return nullptr; + return NULL; if ((op == EOpIndexDirect || op == EOpIndexIndirect) && (binary->getLeft()->getType().isVector() || binary->getLeft()->getType().isScalar()) && ! binary->getLeft()->getType().isArray()) - return nullptr; + return NULL; } node = node->getAsBinaryNode()->getLeft(); } while (true); @@ -2456,10 +2456,10 @@ TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* init // make a sequence of the initializer and statement, but try to reuse the // aggregate already created for whatever is in the initializer, if there is one - TIntermAggregate* loopSequence = (initializer == nullptr || - initializer->getAsAggregate() == nullptr) ? makeAggregate(initializer, loc) + TIntermAggregate* loopSequence = (initializer == NULL || + initializer->getAsAggregate() == NULL) ? makeAggregate(initializer, loc) : initializer->getAsAggregate(); - if (loopSequence != nullptr && loopSequence->getOp() == EOpSequence) + if (loopSequence != NULL && loopSequence->getOp() == EOpSequence) loopSequence->setOp(EOpNull); loopSequence = growAggregate(loopSequence, node); loopSequence->setOperator(EOpSequence); @@ -2472,7 +2472,7 @@ TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* init // TIntermBranch* TIntermediate::addBranch(TOperator branchOp, const TSourceLoc& loc) { - return addBranch(branchOp, nullptr, loc); + return addBranch(branchOp, NULL, loc); } TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expression, const TSourceLoc& loc) @@ -2489,7 +2489,7 @@ TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expres // bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/) { - if (root == nullptr) + if (root == NULL) return true; // Finish off the top-level sequence @@ -2913,7 +2913,7 @@ bool TIntermOperator::isConstructor() const // bool TIntermediate::promote(TIntermOperator* node) { - if (node == nullptr) + if (node == NULL) return false; if (node->getAsUnaryNode()) @@ -2942,7 +2942,7 @@ bool TIntermediate::promoteUnary(TIntermUnary& node) if (operand->getBasicType() != EbtBool) { // Add constructor to boolean type. If that fails, we can't do it, so return false. TIntermTyped* converted = addConversion(op, TType(EbtBool), operand); - if (converted == nullptr) + if (converted == NULL) return false; // Use the result of converting the node to a bool. @@ -3062,7 +3062,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) left = createConversion(EbtInt, left); if (right->getBasicType() == EbtBool) right = createConversion(EbtInt, right); - if (left == nullptr || right == nullptr) + if (left == NULL || right == NULL) return false; node.setLeft(left); node.setRight(right); @@ -3420,7 +3420,7 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node) // TODO: array and struct behavior // Try converting all nodes to the given node's type - TIntermSequence convertedArgs(numArgs, nullptr); + TIntermSequence convertedArgs(numArgs, NULL); // Try to convert all types to the nonConvArg type. for (int nonConvArg = 0; nonConvArg < numArgs; ++nonConvArg) { @@ -3432,7 +3432,7 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node) // If we successfully converted all the args, use the result. if (std::all_of(convertedArgs.begin(), convertedArgs.end(), - [](const TIntermNode* node) { return node != nullptr; })) { + [](const TIntermNode* node) { return node != NULL; })) { std::swap(args, convertedArgs); return true; @@ -3807,7 +3807,7 @@ const char* TIntermediate::getResourceName(TResourceType res) default: break; } - return nullptr; + return NULL; } diff --git a/deps/glslang/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/deps/glslang/glslang/glslang/MachineIndependent/ParseContextBase.cpp index 2e5d9343b0..8210a0fa66 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -139,12 +139,12 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, return true; } - const char* symbol = nullptr; + const char* symbol = NULL; TIntermSymbol* symNode = node->getAsSymbolNode(); - if (symNode != nullptr) + if (symNode != NULL) symbol = symNode->getName().c_str(); - const char* message = nullptr; + const char* message = NULL; switch (node->getQualifier().storage) { case EvqConst: message = "can't modify a const"; break; case EvqConstReadOnly: message = "can't modify a const"; break; @@ -173,7 +173,7 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, } } - if (message == nullptr && binaryNode == nullptr && symNode == nullptr) { + if (message == NULL && binaryNode == NULL && symNode == NULL) { error(loc, " l-value required", op, "", ""); return true; @@ -182,7 +182,7 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, // // Everything else is okay, no error. // - if (message == nullptr) + if (message == NULL) return false; // @@ -276,15 +276,15 @@ void TParseContextBase::makeEditable(TSymbol*& symbol) // Return a writable version of the variable 'name'. // -// Return nullptr if 'name' is not found. This should mean +// Return NULL if 'name' is not found. This should mean // something is seriously wrong (e.g., compiler asking self for // built-in that doesn't exist). TVariable* TParseContextBase::getEditableVariable(const char* name) { bool builtIn; TSymbol* symbol = symbolTable.find(name, &builtIn); - if (symbol == nullptr) - return nullptr; + if (symbol == NULL) + return NULL; if (builtIn) makeEditable(symbol); @@ -398,7 +398,7 @@ const TFunction* TParseContextBase::selectFunction( // 2. none viable... if (viableCandidates.size() == 0) - return nullptr; + return NULL; // 3. only one viable... if (viableCandidates.size() == 1) @@ -558,7 +558,7 @@ void TParseContextBase::parseSwizzleSelector(const TSourceLoc& loc, const TStrin void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& memberType, const TString& memberName, TTypeList* typeList) { // Make the global block, if not yet made. - if (globalUniformBlock == nullptr) { + if (globalUniformBlock == NULL) { TQualifier blockQualifier; blockQualifier.clear(); blockQualifier.storage = EvqUniform; diff --git a/deps/glslang/glslang/glslang/MachineIndependent/ParseHelper.cpp b/deps/glslang/glslang/glslang/MachineIndependent/ParseHelper.cpp index a33a93a9c7..0de58fa713 100755 --- a/deps/glslang/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -55,9 +55,9 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages, entryPoint), inMain(false), - blockName(nullptr), + blockName(NULL), limits(resources.limits), - atomicUintOffsets(nullptr), anyIndexLimits(false) + atomicUintOffsets(NULL), anyIndexLimits(false) { // decide whether precision qualifiers should be ignored or respected if (profile == EEsProfile || spvVersion.vulkan > 0) { @@ -91,7 +91,7 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b if (language == EShLangGeometry) globalOutputDefaults.layoutStream = 0; - if (entryPoint != nullptr && entryPoint->size() > 0 && *entryPoint != "main") + if (entryPoint != NULL && entryPoint->size() > 0 && *entryPoint != "main") infoSink.info.message(EPrefixError, "Source entry point must be \"main\""); } @@ -278,7 +278,7 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& // TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symbol, const TString* string) { - TIntermTyped* node = nullptr; + TIntermTyped* node = NULL; // Error check for requiring specific extensions present. if (symbol && symbol->getNumExtensions()) @@ -300,12 +300,12 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb } const TVariable* variable; - const TAnonMember* anon = symbol ? symbol->getAsAnonMember() : nullptr; + const TAnonMember* anon = symbol ? symbol->getAsAnonMember() : NULL; if (anon) { // It was a member of an anonymous container. // The "getNumExtensions()" mechanism above doesn't yet work for block members - blockMemberExtensionCheck(loc, nullptr, *string); + blockMemberExtensionCheck(loc, NULL, *string); // Create a subtree for its dereference. variable = anon->getAnonContainer().getAsVariable(); @@ -321,12 +321,12 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb // The symbol table search was done in the lexical phase. // See if it was a variable. - variable = symbol ? symbol->getAsVariable() : nullptr; + variable = symbol ? symbol->getAsVariable() : NULL; if (variable) { if ((variable->getType().getBasicType() == EbtBlock || - variable->getType().getBasicType() == EbtStruct) && variable->getType().getStruct() == nullptr) { + variable->getType().getBasicType() == EbtStruct) && variable->getType().getStruct() == NULL) { error(loc, "cannot be used (maybe an instance name is needed)", string->c_str(), ""); - variable = nullptr; + variable = NULL; } } else { if (symbol) @@ -354,7 +354,7 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb // TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index) { - TIntermTyped* result = nullptr; + TIntermTyped* result = NULL; int indexValue = 0; if (index->getQualifier().isFrontEndConstant()) @@ -412,14 +412,14 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn const char* explanation = "variable indexing sampler array"; requireProfile(base->getLoc(), EEsProfile | ECoreProfile | ECompatibilityProfile, explanation); profileRequires(base->getLoc(), EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, explanation); - profileRequires(base->getLoc(), ECoreProfile | ECompatibilityProfile, 400, nullptr, explanation); + profileRequires(base->getLoc(), ECoreProfile | ECompatibilityProfile, 400, NULL, explanation); } result = intermediate.addIndex(EOpIndexIndirect, base, index, loc); } } - if (result == nullptr) { + if (result == NULL) { // Insert dummy error-recovery result result = intermediate.addConstantUnion(0.0, EbtFloat, loc); } else { @@ -589,7 +589,7 @@ void TParseContext::checkIoArrayConsistency(const TSourceLoc& loc, int requiredS } // Handle seeing a binary node with a math operation. -// Returns nullptr if not semantically allowed. +// Returns NULL if not semantically allowed. TIntermTyped* TParseContext::handleBinaryMath(const TSourceLoc& loc, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right) { rValueErrorCheck(loc, str, left->getAsTyped()); @@ -610,11 +610,11 @@ TIntermTyped* TParseContext::handleBinaryMath(const TSourceLoc& loc, const char* break; } - TIntermTyped* result = nullptr; + TIntermTyped* result = NULL; if (allowed) result = intermediate.addBinaryMath(op, left, right, loc); - if (result == nullptr) + if (result == NULL) binaryOpError(loc, str, left->getCompleteString(), right->getCompleteString()); return result; @@ -650,7 +650,7 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm if (field == "length") { if (base->isArray()) { profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, ".length"); - profileRequires(loc, EEsProfile, 300, nullptr, ".length"); + profileRequires(loc, EEsProfile, 300, NULL, ".length"); } else if (base->isVector() || base->isMatrix()) { const char* feature = ".length() on vectors and matrices"; requireProfile(loc, ~EEsProfile, feature); @@ -789,7 +789,7 @@ TFunction* TParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunct const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0; if (prevDec) { if (prevDec->isPrototyped() && prototype) - profileRequires(loc, EEsProfile, 300, nullptr, "multiple prototypes for same function"); + profileRequires(loc, EEsProfile, 300, NULL, "multiple prototypes for same function"); if (prevDec->getType() != function.getType()) error(loc, "overloaded functions must have the same return type", function.getName().c_str(), ""); for (int i = 0; i < prevDec->getParamCount(); ++i) { @@ -836,7 +836,7 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, { currentCaller = function.getMangledName(); TSymbol* symbol = symbolTable.find(function.getMangledName()); - TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr; + TFunction* prevDec = symbol ? symbol->getAsFunction() : NULL; if (! prevDec) error(loc, "can't find function", function.getName().c_str(), ""); @@ -891,7 +891,7 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, TIntermAggregate* paramNodes = new TIntermAggregate; for (int i = 0; i < function.getParamCount(); i++) { TParameter& param = function[i]; - if (param.name != nullptr) { + if (param.name != NULL) { TVariable *variable = new TVariable(param.name, *param.type); // Insert the parameters with name in the symbol table. @@ -899,7 +899,7 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, error(loc, "redefinition", variable->getName().c_str(), ""); else { // Transfer ownership of name pointer to symbol table. - param.name = nullptr; + param.name = NULL; // Add the parameter to the HIL paramNodes = intermediate.growAggregate(paramNodes, @@ -929,7 +929,7 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, // TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction* function, TIntermNode* arguments) { - TIntermTyped* result = nullptr; + TIntermTyped* result = NULL; if (function->getBuiltInOp() == EOpArrayLength) result = handleLengthMethod(loc, function, arguments); @@ -945,7 +945,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction // It's a constructor, of type 'type'. // result = addConstructor(loc, arguments, type); - if (result == nullptr) + if (result == NULL) error(loc, "cannot construct with these arguments", type.getCompleteString().c_str(), ""); } } else { @@ -965,7 +965,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction if (builtIn && fnCandidate->getNumExtensions()) requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(), fnCandidate->getName().c_str()); - if (arguments != nullptr) { + if (arguments != NULL) { // Make sure qualifications work for these arguments. TIntermAggregate* aggregate = arguments->getAsAggregate(); for (int i = 0; i < fnCandidate->getParamCount(); ++i) { @@ -1045,7 +1045,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction // generic error recovery // TODO: simplification: localize all the error recoveries that look like this, and taking type into account to reduce cascades - if (result == nullptr) + if (result == NULL) result = intermediate.addConstantUnion(0.0, EbtFloat, loc); return result; @@ -1061,8 +1061,8 @@ TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNo if (obeyPrecisionQualifiers()) computeBuiltinPrecisions(*result, function); - if (result == nullptr) { - if (arguments == nullptr) + if (result == NULL) { + if (arguments == NULL) error(loc, " wrong operand type", "Internal Error", "built in unary operator function. Type: %s", ""); else @@ -1113,7 +1113,7 @@ void TParseContext::computeBuiltinPrecisions(TIntermTyped& node, const TFunction TPrecisionQualifier resultPrecision = EpqNone; TIntermOperator* opNode = node.getAsOperator(); - if (opNode == nullptr) + if (opNode == NULL) return; if (TIntermUnary* unaryNode = node.getAsUnaryNode()) { @@ -1333,8 +1333,8 @@ TIntermTyped* TParseContext::addOutputArgumentConversions(const TFunction& funct // void: function(arg, ...) -> ( function(tempArg, ...), arg = tempArg, ...) // ret = function(arg, ...) -> ret = (tempRet = function(tempArg, ...), arg = tempArg, ..., tempRet) // Where the "tempArg" type needs no conversion as an argument, but will convert on assignment. - TIntermTyped* conversionTree = nullptr; - TVariable* tempRet = nullptr; + TIntermTyped* conversionTree = NULL; + TVariable* tempRet = NULL; if (intermNode.getBasicType() != EbtVoid) { // do the "tempRet = function(...), " bit from above tempRet = makeInternalVariable("tempReturn", intermNode.getType()); @@ -1384,9 +1384,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan // Set up convenience accessors to the argument(s). There is almost always // multiple arguments for the cases below, but when there might be one, // check the unaryArg first. - const TIntermSequence* argp = nullptr; // confusing to use [] syntax on a pointer, so this is to help get a reference - const TIntermTyped* unaryArg = nullptr; - const TIntermTyped* arg0 = nullptr; + const TIntermSequence* argp = NULL; // confusing to use [] syntax on a pointer, so this is to help get a reference + const TIntermTyped* unaryArg = NULL; + const TIntermTyped* arg0 = NULL; if (callNode.getAsAggregate()) { argp = &callNode.getAsAggregate()->getSequence(); if (argp->size() > 0) @@ -1397,7 +1397,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } TString featureString; - const char* feature = nullptr; + const char* feature = NULL; switch (callNode.getOp()) { case EOpTextureGather: case EOpTextureGatherOffset: @@ -1409,7 +1409,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan featureString = fnCandidate.getName(); featureString += "(...)"; feature = featureString.c_str(); - profileRequires(loc, EEsProfile, 310, nullptr, feature); + profileRequires(loc, EEsProfile, 310, NULL, feature); int compArg = -1; // track which argument, if any, is the constant component argument switch (callNode.getOp()) { case EOpTextureGather: @@ -1467,7 +1467,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan featureString = fnCandidate.getName(); featureString += "with bias argument"; feature = featureString.c_str(); - profileRequires(loc, ~EEsProfile, 450, nullptr, feature); + profileRequires(loc, ~EEsProfile, 450, NULL, feature); requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); } #endif @@ -1491,7 +1491,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan featureString = fnCandidate.getName(); featureString += "with bias argument"; feature = featureString.c_str(); - profileRequires(loc, ~EEsProfile, 450, nullptr, feature); + profileRequires(loc, ~EEsProfile, 450, NULL, feature); requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); } @@ -1649,7 +1649,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan // desktop 4.4 and later: swizzles may be used bool swizzleOkay = (profile != EEsProfile) && (version >= 440); const TIntermTyped* base = TIntermediate::findLValueBase(arg0, swizzleOkay); - if (base == nullptr || base->getType().getQualifier().storage != EvqVaryingIn) + if (base == NULL || base->getType().getQualifier().storage != EvqVaryingIn) error(loc, "first argument must be an interpolant, or interpolant-array element", fnCandidate.getName().c_str(), ""); } @@ -1683,7 +1683,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpSubgroupClusteredAnd: case EOpSubgroupClusteredOr: case EOpSubgroupClusteredXor: - if ((*argp)[1]->getAsConstantUnion() == nullptr) + if ((*argp)[1]->getAsConstantUnion() == NULL) error(loc, "argument must be compile-time constant", "cluster size", ""); else { int size = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getIConst(); @@ -1732,7 +1732,7 @@ void TParseContext::nonOpBuiltInCheck(const TSourceLoc& loc, const TFunction& fn if (fnCandidate.getName().compare(0, 13, "textureGather") == 0) { TString featureString = fnCandidate.getName() + "(...)"; const char* feature = featureString.c_str(); - profileRequires(loc, EEsProfile, 310, nullptr, feature); + profileRequires(loc, EEsProfile, 310, NULL, feature); int compArg = -1; // track which argument, if any, is the constant component argument if (fnCandidate.getName().compare("textureGatherOffset") == 0) { @@ -1859,7 +1859,7 @@ TFunction* TParseContext::handleConstructorCall(const TSourceLoc& loc, const TPu if (type.isArray()) { profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed constructor"); - profileRequires(loc, EEsProfile, 300, nullptr, "arrayed constructor"); + profileRequires(loc, EEsProfile, 300, NULL, "arrayed constructor"); } TOperator op = intermediate.mapTypeToConstructorOp(type); @@ -1955,7 +1955,7 @@ void TParseContext::variableCheck(TIntermTyped*& nodePtr) } else { switch (symbol->getQualifier().storage) { case EvqPointCoord: - profileRequires(symbol->getLoc(), ENoProfile, 120, nullptr, "gl_PointCoord"); + profileRequires(symbol->getLoc(), ENoProfile, 120, NULL, "gl_PointCoord"); break; default: break; // some compilers want this } @@ -2030,12 +2030,12 @@ bool TParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, TInt if (TParseContextBase::lValueErrorCheck(loc, op, node)) return true; - const char* symbol = nullptr; + const char* symbol = NULL; TIntermSymbol* symNode = node->getAsSymbolNode(); - if (symNode != nullptr) + if (symNode != NULL) symbol = symNode->getName().c_str(); - const char* message = nullptr; + const char* message = NULL; switch (node->getQualifier().storage) { case EvqVaryingIn: message = "can't modify shader input"; break; case EvqInstanceId: message = "can't modify gl_InstanceID"; break; @@ -2054,7 +2054,7 @@ bool TParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, TInt break; } - if (message == nullptr && binaryNode == nullptr && symNode == nullptr) { + if (message == NULL && binaryNode == NULL && symNode == NULL) { error(loc, " l-value required", op, "", ""); return true; @@ -2063,7 +2063,7 @@ bool TParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, TInt // // Everything else is okay, no error. // - if (message == nullptr) + if (message == NULL) return false; // @@ -2205,7 +2205,7 @@ bool TParseContext::lineContinuationCheck(const TSourceLoc& loc, bool endOfComme warn(loc, "not allowed in this version", message, ""); return true; } else { - profileRequires(loc, EEsProfile, 300, nullptr, message); + profileRequires(loc, EEsProfile, 300, NULL, message); profileRequires(loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, message); } @@ -2428,7 +2428,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T } if (matrixInMatrix && ! type.isArray()) { - profileRequires(loc, ENoProfile, 120, nullptr, "constructing matrix from matrix"); + profileRequires(loc, ENoProfile, 120, NULL, "constructing matrix from matrix"); // "If a matrix argument is given to a matrix constructor, // it is a compile-time error to have any other arguments." @@ -2454,7 +2454,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T } TIntermTyped* typed = node->getAsTyped(); - if (typed == nullptr) { + if (typed == NULL) { error(loc, "constructor argument does not have a type", "constructor", ""); return true; } @@ -2639,14 +2639,14 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q // move from parameter/unknown qualifiers to pipeline in/out qualifiers switch (qualifier.storage) { case EvqIn: - profileRequires(loc, ENoProfile, 130, nullptr, "in for stage inputs"); - profileRequires(loc, EEsProfile, 300, nullptr, "in for stage inputs"); + profileRequires(loc, ENoProfile, 130, NULL, "in for stage inputs"); + profileRequires(loc, EEsProfile, 300, NULL, "in for stage inputs"); qualifier.storage = EvqVaryingIn; nonuniformOkay = true; break; case EvqOut: - profileRequires(loc, ENoProfile, 130, nullptr, "out for stage outputs"); - profileRequires(loc, EEsProfile, 300, nullptr, "out for stage outputs"); + profileRequires(loc, ENoProfile, 130, NULL, "out for stage outputs"); + profileRequires(loc, EEsProfile, 300, NULL, "out for stage outputs"); qualifier.storage = EvqVaryingOut; break; case EvqInOut: @@ -2695,7 +2695,7 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali } if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) - profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output"); + profileRequires(loc, EEsProfile, 300, NULL, "shader input/output"); #ifdef AMD_EXTENSIONS if (! qualifier.flat && ! qualifier.explicitInterp) { @@ -2732,10 +2732,10 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali } if (publicType.arraySizes) { requireProfile(loc, ~EEsProfile, "vertex input arrays"); - profileRequires(loc, ENoProfile, 150, nullptr, "vertex input arrays"); + profileRequires(loc, ENoProfile, 150, NULL, "vertex input arrays"); } if (publicType.basicType == EbtDouble) - profileRequires(loc, ~EEsProfile, 410, nullptr, "vertex-shader `double` type input"); + profileRequires(loc, ~EEsProfile, 410, NULL, "vertex-shader `double` type input"); if (qualifier.isAuxiliary() || qualifier.isInterpolation() || qualifier.isMemory() || qualifier.invariant) error(loc, "vertex input cannot be further qualified", "", ""); break; @@ -2753,8 +2753,8 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali case EShLangFragment: if (publicType.userDef) { - profileRequires(loc, EEsProfile, 300, nullptr, "fragment-shader struct input"); - profileRequires(loc, ~EEsProfile, 150, nullptr, "fragment-shader struct input"); + profileRequires(loc, EEsProfile, 300, NULL, "fragment-shader struct input"); + profileRequires(loc, ~EEsProfile, 150, NULL, "fragment-shader struct input"); if (publicType.userDef->containsStructure()) requireProfile(loc, ~EEsProfile, "fragment-shader struct input containing structure"); if (publicType.userDef->containsArray()) @@ -2775,8 +2775,8 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali switch (language) { case EShLangVertex: if (publicType.userDef) { - profileRequires(loc, EEsProfile, 300, nullptr, "vertex-shader struct output"); - profileRequires(loc, ~EEsProfile, 150, nullptr, "vertex-shader struct output"); + profileRequires(loc, EEsProfile, 300, NULL, "vertex-shader struct output"); + profileRequires(loc, ~EEsProfile, 150, NULL, "vertex-shader struct output"); if (publicType.userDef->containsStructure()) requireProfile(loc, ~EEsProfile, "vertex-shader struct output containing structure"); if (publicType.userDef->containsArray()) @@ -2797,7 +2797,7 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali break; case EShLangFragment: - profileRequires(loc, EEsProfile, 300, nullptr, "fragment shader output"); + profileRequires(loc, EEsProfile, 300, NULL, "fragment shader output"); if (publicType.basicType == EbtStruct) { error(loc, "cannot be a structure", GetStorageQualifierString(qualifier.storage), ""); return; @@ -3025,7 +3025,7 @@ bool TParseContext::containsFieldWithBasicType(const TType& type, TBasicType bas void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair) { bool isConst = false; - sizePair.node = nullptr; + sizePair.node = NULL; int size = 1; @@ -3067,12 +3067,12 @@ bool TParseContext::arrayQualifierError(const TSourceLoc& loc, const TQualifier& { if (qualifier.storage == EvqConst) { profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, "const array"); - profileRequires(loc, EEsProfile, 300, nullptr, "const array"); + profileRequires(loc, EEsProfile, 300, NULL, "const array"); } if (qualifier.storage == EvqVaryingIn && language == EShLangVertex) { requireProfile(loc, ~EEsProfile, "vertex input arrays"); - profileRequires(loc, ENoProfile, 150, nullptr, "vertex input arrays"); + profileRequires(loc, ENoProfile, 150, NULL, "vertex input arrays"); } return false; @@ -3134,7 +3134,7 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua // initializer must be a sized array, in which case // allow the initializer to set any unknown array sizes - if (initializer != nullptr) { + if (initializer != NULL) { if (initializer->getType().isUnsizedArray()) error(loc, "array initializer must be sized", "[]", ""); return; @@ -3191,14 +3191,14 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua void TParseContext::arrayOfArrayVersionCheck(const TSourceLoc& loc, const TArraySizes* sizes) { - if (sizes == nullptr || sizes->getNumDims() == 1) + if (sizes == NULL || sizes->getNumDims() == 1) return; const char* feature = "arrays of arrays"; requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, feature); - profileRequires(loc, EEsProfile, 310, nullptr, feature); - profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, feature); + profileRequires(loc, EEsProfile, 310, NULL, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, NULL, feature); } // @@ -3207,16 +3207,16 @@ void TParseContext::arrayOfArrayVersionCheck(const TSourceLoc& loc, const TArray // void TParseContext::declareArray(const TSourceLoc& loc, const TString& identifier, const TType& type, TSymbol*& symbol) { - if (symbol == nullptr) { + if (symbol == NULL) { bool currentScope; - symbol = symbolTable.find(identifier, nullptr, ¤tScope); + symbol = symbolTable.find(identifier, NULL, ¤tScope); if (symbol && builtInName(identifier) && ! symbolTable.atBuiltInLevel()) { // bad shader (errors already reported) trying to redeclare a built-in name as an array - symbol = nullptr; + symbol = NULL; return; } - if (symbol == nullptr || ! currentScope) { + if (symbol == NULL || ! currentScope) { // // Successfully process a new definition. // (Redeclarations have to take place at the same scope; otherwise they are hiding declarations) @@ -3238,7 +3238,7 @@ void TParseContext::declareArray(const TSourceLoc& loc, const TString& identifie } if (symbol->getAsAnonMember()) { error(loc, "cannot redeclare a user-block member array", identifier.c_str(), ""); - symbol = nullptr; + symbol = NULL; return; } } @@ -3247,7 +3247,7 @@ void TParseContext::declareArray(const TSourceLoc& loc, const TString& identifie // Process a redeclaration. // - if (symbol == nullptr) { + if (symbol == NULL) { error(loc, "array variable name expected", identifier.c_str(), ""); return; } @@ -3306,7 +3306,7 @@ bool TParseContext::isRuntimeLength(const TIntermTyped& base) const if (base.getType().getQualifier().storage == EvqBuffer) { // in a buffer block const TIntermBinary* binary = base.getAsBinaryNode(); - if (binary != nullptr && binary->getOp() == EOpIndexDirectStruct) { + if (binary != NULL && binary->getOp() == EOpIndexDirectStruct) { // is it the last member? const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); const int memberCount = (int)binary->getLeft()->getType().getStruct()->size(); @@ -3352,7 +3352,7 @@ void TParseContext::nonInitConstCheck(const TSourceLoc& loc, TString& identifier // copy the symbol table's read-only built-in variable to the current // global level, where it can be modified based on the passed in type. // -// Returns nullptr if no redeclaration took place; meaning a normal declaration still +// Returns NULL if no redeclaration took place; meaning a normal declaration still // needs to occur for it, not necessarily an error. // // Returns a redeclared and type-modified variable if a redeclarated occurred. @@ -3361,13 +3361,13 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS const TQualifier& qualifier, const TShaderQualifiers& publicType) { if (! builtInName(identifier) || symbolTable.atBuiltInLevel() || ! symbolTable.atGlobalLevel()) - return nullptr; + return NULL; bool nonEsRedecls = (profile != EEsProfile && (version >= 130 || identifier == "gl_TexCoord")); bool esRedecls = (profile == EEsProfile && (version >= 320 || extensionsTurnedOn(Num_AEP_shader_io_blocks, AEP_shader_io_blocks))); if (! esRedecls && ! nonEsRedecls) - return nullptr; + return NULL; // Special case when using GL_ARB_separate_shader_objects bool ssoPre150 = false; // means the only reason this variable is redeclared is due to this combination @@ -3405,7 +3405,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS // If the symbol was not found, this must be a version/profile/stage // that doesn't have it. if (! symbol) - return nullptr; + return NULL; // If it wasn't at a built-in level, then it's already been redeclared; // that is, this is a redeclaration of a redeclaration; reuse that initial @@ -3494,7 +3494,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS return symbol; } - return nullptr; + return NULL; } // @@ -3656,8 +3656,8 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT if (numOriginalMembersFound < newTypeList.size()) error(loc, "block redeclaration has extra members", blockName.c_str(), ""); - if (type.isArray() != (arraySizes != nullptr) || - (type.isArray() && arraySizes != nullptr && type.getArraySizes()->getNumDims() != arraySizes->getNumDims())) + if (type.isArray() != (arraySizes != NULL) || + (type.isArray() && arraySizes != NULL && type.getArraySizes()->getNumDims() != arraySizes->getNumDims())) error(loc, "cannot change arrayness of redeclared block", blockName.c_str(), ""); else if (type.isArray()) { // At this point, we know both are arrays and both have the same number of dimensions. @@ -3763,7 +3763,7 @@ void TParseContext::arrayObjectCheck(const TSourceLoc& loc, const TType& type, c // Some versions don't allow comparing arrays or structures containing arrays if (type.containsArray()) { profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, op); - profileRequires(loc, EEsProfile, 300, nullptr, op); + profileRequires(loc, EEsProfile, 300, NULL, op); } } @@ -4038,8 +4038,8 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } if (id == TQualifier::getLayoutPackingString(ElpStd430)) { requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "std430"); - profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, "std430"); - profileRequires(loc, EEsProfile, 310, nullptr, "std430"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, NULL, "std430"); + profileRequires(loc, EEsProfile, 310, NULL, "std430"); publicType.qualifier.layoutPacking = ElpStd430; return; } @@ -4158,7 +4158,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } if (id == "early_fragment_tests") { profileRequires(loc, ENoProfile | ECoreProfile | ECompatibilityProfile, 420, E_GL_ARB_shader_image_load_store, "early_fragment_tests"); - profileRequires(loc, EEsProfile, 310, nullptr, "early_fragment_tests"); + profileRequires(loc, EEsProfile, 310, NULL, "early_fragment_tests"); publicType.shaderQualifiers.earlyFragmentTests = true; return; } @@ -4173,7 +4173,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth+1)) { if (id == TQualifier::getLayoutDepthString(depth)) { requireProfile(loc, ECoreProfile | ECompatibilityProfile, "depth layout qualifier"); - profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, nullptr, "depth layout qualifier"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, NULL, "depth layout qualifier"); publicType.shaderQualifiers.layoutDepth = depth; return; } @@ -4254,7 +4254,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, feature); const char* exts[2] = { E_GL_ARB_enhanced_layouts, E_GL_ARB_shader_atomic_counters }; profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, 2, exts, feature); - profileRequires(loc, EEsProfile, 310, nullptr, feature); + profileRequires(loc, EEsProfile, 310, NULL, feature); } publicType.qualifier.layoutOffset = value; return; @@ -4271,7 +4271,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.qualifier.layoutAlign = value; return; } else if (id == "location") { - profileRequires(loc, EEsProfile, 300, nullptr, "location"); + profileRequires(loc, EEsProfile, 300, NULL, "location"); const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location }; profileRequires(loc, ~EEsProfile, 330, 2, exts, "location"); if ((unsigned int)value >= TQualifier::layoutLocationEnd) @@ -4289,7 +4289,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi return; } else if (id == "binding") { profileRequires(loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, "binding"); - profileRequires(loc, EEsProfile, 310, nullptr, "binding"); + profileRequires(loc, EEsProfile, 310, NULL, "binding"); if ((unsigned int)value >= TQualifier::layoutBindingEnd) error(loc, "binding is too large", id.c_str(), ""); else @@ -4400,7 +4400,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi case EShLangGeometry: if (id == "invocations") { - profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, nullptr, "invocations"); + profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, NULL, "invocations"); if (value == 0) error(loc, "must be at least 1", "invocations", ""); else @@ -4570,7 +4570,7 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb switch (qualifier.storage) { case EvqUniform: case EvqBuffer: - if (symbol.getAsVariable() == nullptr) + if (symbol.getAsVariable() == NULL) error(loc, "can only be used on variable declaration", "location", ""); break; default: @@ -4634,7 +4634,7 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool memberWithLocation, TArraySizes* arraySizes) { - if (memberWithLocation && arraySizes != nullptr) { + if (memberWithLocation && arraySizes != NULL) { if (arraySizes->getNumDims() > (currentBlockQualifier.isArrayedIo(language) ? 1 : 0)) error(loc, "cannot use in a block array where new locations are needed for each block element", "location", ""); @@ -4884,10 +4884,10 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier if (language == EShLangVertex) { const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location }; profileRequires(loc, ~EEsProfile, 330, 2, exts, feature); - profileRequires(loc, EEsProfile, 300, nullptr, feature); + profileRequires(loc, EEsProfile, 300, NULL, feature); } else { profileRequires(loc, ~EEsProfile, 410, E_GL_ARB_separate_shader_objects, feature); - profileRequires(loc, EEsProfile, 310, nullptr, feature); + profileRequires(loc, EEsProfile, 310, NULL, feature); } break; } @@ -4901,10 +4901,10 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier if (language == EShLangFragment) { const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location }; profileRequires(loc, ~EEsProfile, 330, 2, exts, feature); - profileRequires(loc, EEsProfile, 300, nullptr, feature); + profileRequires(loc, EEsProfile, 300, NULL, feature); } else { profileRequires(loc, ~EEsProfile, 410, E_GL_ARB_separate_shader_objects, feature); - profileRequires(loc, EEsProfile, 310, nullptr, feature); + profileRequires(loc, EEsProfile, 310, NULL, feature); } break; } @@ -4913,8 +4913,8 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier { const char* feature = "location qualifier on uniform or buffer"; requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, feature); - profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, feature); - profileRequires(loc, EEsProfile, 310, nullptr, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, NULL, feature); + profileRequires(loc, EEsProfile, 310, NULL, feature); break; } default: @@ -5031,15 +5031,15 @@ void TParseContext::fixOffset(const TSourceLoc& loc, TSymbol& symbol) // // Look up a function name in the symbol table, and make sure it is a function. // -// Return the function symbol if found, otherwise nullptr. +// Return the function symbol if found, otherwise NULL. // const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunction& call, bool& builtIn) { - const TFunction* function = nullptr; + const TFunction* function = NULL; if (symbolTable.isFunctionNameVariable(call.getName())) { error(loc, "can't use function syntax on variable", call.getName().c_str(), ""); - return nullptr; + return NULL; } bool explicitTypesEnabled = extensionTurnedOn(E_GL_KHX_shader_explicit_arithmetic_types) || @@ -5067,10 +5067,10 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct const TFunction* TParseContext::findFunctionExact(const TSourceLoc& loc, const TFunction& call, bool& builtIn) { TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn); - if (symbol == nullptr) { + if (symbol == NULL) { error(loc, "no matching overloaded function found", call.getName().c_str(), ""); - return nullptr; + return NULL; } return symbol->getAsFunction(); @@ -5093,7 +5093,7 @@ const TFunction* TParseContext::findFunction120(const TSourceLoc& loc, const TFu // a match, it is a semantic error if there are multiple ways to apply these conversions to make the call match // more than one function." - const TFunction* candidate = nullptr; + const TFunction* candidate = NULL; TVector candidateList; symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); @@ -5138,7 +5138,7 @@ const TFunction* TParseContext::findFunction120(const TSourceLoc& loc, const TFu } } - if (candidate == nullptr) + if (candidate == NULL) error(loc, "no matching overloaded function found", call.getName().c_str(), ""); return candidate; @@ -5233,7 +5233,7 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu // send to the generic selector const TFunction* bestMatch = selectFunction(candidateList, call, convertible, better, tie); - if (bestMatch == nullptr) + if (bestMatch == NULL) error(loc, "no matching overloaded function found", call.getName().c_str(), ""); else if (tie) error(loc, "ambiguous best function under implicit type conversion", call.getName().c_str(), ""); @@ -5312,7 +5312,7 @@ const TFunction* TParseContext::findFunctionExplicitTypes(const TSourceLoc& loc, // send to the generic selector const TFunction* bestMatch = selectFunction(candidateList, call, convertible, better, tie); - if (bestMatch == nullptr) + if (bestMatch == NULL) error(loc, "no matching overloaded function found", call.getName().c_str(), ""); else if (tie) error(loc, "ambiguous best function under implicit type conversion", call.getName().c_str(), ""); @@ -5343,7 +5343,7 @@ void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType // table, and all error checking. // // Returns a subtree node that computes an initializer, if needed. -// Returns nullptr if there is no code to execute for initialization. +// Returns NULL if there is no code to execute for initialization. // // 'publicType' is the type part of the declaration (to the left) // 'arraySizes' is the arrayness tagged on the identifier (to the right) @@ -5359,7 +5359,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden arrayOfArrayVersionCheck(loc, type.getArraySizes()); if (voidErrorCheck(loc, identifier, type.getBasicType())) - return nullptr; + return NULL; if (initializer) rValueErrorCheck(loc, "initializer", initializer); @@ -5377,7 +5377,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden // Check for redeclaration of built-ins and/or attempting to declare a reserved name TSymbol* symbol = redeclareBuiltinVariable(loc, identifier, type.getQualifier(), publicType.shaderQualifiers); - if (symbol == nullptr) + if (symbol == NULL) reservedErrorCheck(loc, identifier); inheritGlobalDefaults(type.getQualifier()); @@ -5392,26 +5392,26 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden if (initializer) { profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, "initializer"); - profileRequires(loc, EEsProfile, 300, nullptr, "initializer"); + profileRequires(loc, EEsProfile, 300, NULL, "initializer"); } } else { // non-array case - if (symbol == nullptr) + if (symbol == NULL) symbol = declareNonArray(loc, identifier, type); else if (type != symbol->getType()) error(loc, "cannot change the type of", "redeclaration", symbol->getName().c_str()); } - if (symbol == nullptr) - return nullptr; + if (symbol == NULL) + return NULL; // Deal with initializer - TIntermNode* initNode = nullptr; - if (symbol != nullptr && initializer) { + TIntermNode* initNode = NULL; + if (symbol != NULL && initializer) { TVariable* variable = symbol->getAsVariable(); if (! variable) { error(loc, "initializer requires a variable, not a member", identifier.c_str(), ""); - return nullptr; + return NULL; } initNode = executeInitializer(loc, initializer, variable); } @@ -5472,13 +5472,13 @@ TVariable* TParseContext::declareNonArray(const TSourceLoc& loc, const TString& } error(loc, "redefinition", variable->getName().c_str(), ""); - return nullptr; + return NULL; } // // Handle all types of initializers from the grammar. // -// Returning nullptr just means there is no code to execute to handle the +// Returning NULL just means there is no code to execute to handle the // initializer, which will, for example, be the case for constant initializers. // TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable) @@ -5491,7 +5491,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp if (! (qualifier == EvqTemporary || qualifier == EvqGlobal || qualifier == EvqConst || (qualifier == EvqUniform && profile != EEsProfile && version >= 120))) { error(loc, " cannot initialize this type of qualifier ", variable->getType().getStorageQualifierString(), ""); - return nullptr; + return NULL; } arrayObjectCheck(loc, variable->getType(), "array initializer"); @@ -5512,7 +5512,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp // error recovery; don't leave const without constant values if (qualifier == EvqConst) variable->getWritableType().getQualifier().makeTemporary(); - return nullptr; + return NULL; } // Fix outer arrayness if variable is unsized, getting size from the initializer @@ -5536,13 +5536,13 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp if (qualifier == EvqUniform && ! initializer->getType().getQualifier().isFrontEndConstant()) { error(loc, "uniform initializers must be constant", "=", "'%s'", variable->getType().getCompleteString().c_str()); variable->getWritableType().getQualifier().makeTemporary(); - return nullptr; + return NULL; } // Global consts require a constant initializer (specialization constant is okay) if (qualifier == EvqConst && symbolTable.atGlobalLevel() && ! initializer->getType().getQualifier().isConstant()) { error(loc, "global const initializers must be constant", "=", "'%s'", variable->getType().getCompleteString().c_str()); variable->getWritableType().getQualifier().makeTemporary(); - return nullptr; + return NULL; } // Const variables require a constant initializer, depending on version @@ -5578,7 +5578,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp error(loc, "non-matching or non-convertible constant type for const initializer", variable->getType().getStorageQualifierString(), ""); variable->getWritableType().getQualifier().makeTemporary(); - return nullptr; + return NULL; } // We either have a folded constant in getAsConstantUnion, or we have to use @@ -5605,7 +5605,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp return initNode; } - return nullptr; + return NULL; } // @@ -5654,40 +5654,40 @@ TIntermTyped* TParseContext::convertInitializerList(const TSourceLoc& loc, const TType elementType(arrayType, 0); // dereferenced type for (size_t i = 0; i < initList->getSequence().size(); ++i) { initList->getSequence()[i] = convertInitializerList(loc, elementType, initList->getSequence()[i]->getAsTyped()); - if (initList->getSequence()[i] == nullptr) - return nullptr; + if (initList->getSequence()[i] == NULL) + return NULL; } return addConstructor(loc, initList, arrayType); } else if (type.isStruct()) { if (type.getStruct()->size() != initList->getSequence().size()) { error(loc, "wrong number of structure members", "initializer list", ""); - return nullptr; + return NULL; } for (size_t i = 0; i < type.getStruct()->size(); ++i) { initList->getSequence()[i] = convertInitializerList(loc, *(*type.getStruct())[i].type, initList->getSequence()[i]->getAsTyped()); - if (initList->getSequence()[i] == nullptr) - return nullptr; + if (initList->getSequence()[i] == NULL) + return NULL; } } else if (type.isMatrix()) { if (type.getMatrixCols() != (int)initList->getSequence().size()) { error(loc, "wrong number of matrix columns:", "initializer list", type.getCompleteString().c_str()); - return nullptr; + return NULL; } TType vectorType(type, 0); // dereferenced type for (int i = 0; i < type.getMatrixCols(); ++i) { initList->getSequence()[i] = convertInitializerList(loc, vectorType, initList->getSequence()[i]->getAsTyped()); - if (initList->getSequence()[i] == nullptr) - return nullptr; + if (initList->getSequence()[i] == NULL) + return NULL; } } else if (type.isVector()) { if (type.getVectorSize() != (int)initList->getSequence().size()) { error(loc, "wrong vector size (or rows in a matrix column):", "initializer list", type.getCompleteString().c_str()); - return nullptr; + return NULL; } } else { error(loc, "unexpected initializer-list type:", "initializer list", type.getCompleteString().c_str()); - return nullptr; + return NULL; } // Now that the subtree is processed, process this node as if the @@ -5707,12 +5707,12 @@ TIntermTyped* TParseContext::convertInitializerList(const TSourceLoc& loc, const // 'node' is what to construct from. // 'type' is what type to construct. // -// Returns nullptr for an error or the constructed node (aggregate or typed) for no error. +// Returns NULL for an error or the constructed node (aggregate or typed) for no error. // TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* node, const TType& type) { - if (node == nullptr || node->getAsTyped() == nullptr) - return nullptr; + if (node == NULL || node->getAsTyped() == NULL) + return NULL; rValueErrorCheck(loc, "constructor", node->getAsTyped()); TIntermAggregate* aggrNode = node->getAsAggregate(); @@ -5784,7 +5784,7 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* if (newNode) *p = newNode; else - return nullptr; + return NULL; } return intermediate.setAggregateOperator(aggrNode, op, type, loc); @@ -5795,7 +5795,7 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* // the parameter types correctly. If a constructor expects an int (like ivec2) and is passed a // float, then float is converted to int. // -// Returns nullptr for an error or the constructed node. +// Returns NULL for an error or the constructed node. // TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node, const TSourceLoc& loc, bool subset) @@ -5939,12 +5939,12 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T default: error(loc, "unsupported construction", "", ""); - return nullptr; + return NULL; } newNode = intermediate.addUnaryMath(basicOp, node, node->getLoc()); - if (newNode == nullptr) { + if (newNode == NULL) { error(loc, "can't convert", "constructor", ""); - return nullptr; + return NULL; } // @@ -5962,7 +5962,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T // This function tests for the type of the parameters to the structure or array constructor. Raises // an error message if the expected type does not match the parameter passed to the constructor. // -// Returns nullptr for an error or the input node itself if the expected and the given parameter types match. +// Returns NULL for an error or the input node itself if the expected and the given parameter types match. // TIntermTyped* TParseContext::constructAggregate(TIntermNode* node, const TType& type, int paramCount, const TSourceLoc& loc) { @@ -5971,7 +5971,7 @@ TIntermTyped* TParseContext::constructAggregate(TIntermNode* node, const TType& error(loc, "", "constructor", "cannot convert parameter %d from '%s' to '%s'", paramCount, node->getAsTyped()->getType().getCompleteString().c_str(), type.getCompleteString().c_str()); - return nullptr; + return NULL; } return converted; @@ -5984,9 +5984,9 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con TArraySizes* arraySizes) { blockStageIoCheck(loc, currentBlockQualifier); - blockQualifierCheck(loc, currentBlockQualifier, instanceName != nullptr); - if (arraySizes != nullptr) { - arraySizesCheck(loc, currentBlockQualifier, arraySizes, nullptr, false); + blockQualifierCheck(loc, currentBlockQualifier, instanceName != NULL); + if (arraySizes != NULL) { + arraySizesCheck(loc, currentBlockQualifier, arraySizes, NULL, false); arrayOfArrayVersionCheck(loc, arraySizes); if (arraySizes->getNumDims() > 1) requireProfile(loc, ~EEsProfile, "array-of-array of block"); @@ -6004,7 +6004,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con if ((currentBlockQualifier.storage == EvqUniform || currentBlockQualifier.storage == EvqBuffer) && (memberQualifier.isInterpolation() || memberQualifier.isAuxiliary())) error(memberLoc, "member of uniform or buffer block cannot have an auxiliary or interpolation qualifier", memberType.getFieldName().c_str(), ""); if (memberType.isArray()) - arraySizesCheck(memberLoc, currentBlockQualifier, memberType.getArraySizes(), nullptr, member == typeList.size() - 1); + arraySizesCheck(memberLoc, currentBlockQualifier, memberType.getArraySizes(), NULL, member == typeList.size() - 1); if (memberQualifier.hasOffset()) { if (spvVersion.spv == 0) { requireProfile(memberLoc, ~EEsProfile, "offset on block member"); @@ -6126,7 +6126,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // TType blockType(&typeList, *blockName, currentBlockQualifier); - if (arraySizes != nullptr) + if (arraySizes != NULL) blockType.transferArraySizes(arraySizes); else ioArrayCheck(loc, blockType, instanceName ? *instanceName : *blockName); @@ -6194,15 +6194,15 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q { switch (qualifier.storage) { case EvqUniform: - profileRequires(loc, EEsProfile, 300, nullptr, "uniform block"); - profileRequires(loc, ENoProfile, 140, nullptr, "uniform block"); + profileRequires(loc, EEsProfile, 300, NULL, "uniform block"); + profileRequires(loc, ENoProfile, 140, NULL, "uniform block"); if (currentBlockQualifier.layoutPacking == ElpStd430 && ! currentBlockQualifier.layoutPushConstant) error(loc, "requires the 'buffer' storage qualifier", "std430", ""); break; case EvqBuffer: requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "buffer block"); - profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, "buffer block"); - profileRequires(loc, EEsProfile, 310, nullptr, "buffer block"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, NULL, "buffer block"); + profileRequires(loc, EEsProfile, 310, NULL, "buffer block"); break; case EvqVaryingIn: profileRequires(loc, ~EEsProfile, 150, E_GL_ARB_separate_shader_objects, "input block"); @@ -6559,7 +6559,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con // Fix the existing constant gl_WorkGroupSize with this new information. TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); - if (workGroupSize != nullptr) + if (workGroupSize != NULL) workGroupSize->getWritableConstArray()[i].setUConst(intermediate.getLocalSize(i)); } } else @@ -6573,7 +6573,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "can only apply to 'in'", "local_size id", ""); // Set the workgroup built-in variable as a specialization constant TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); - if (workGroupSize != nullptr) + if (workGroupSize != NULL) workGroupSize->getWritableType().getQualifier().specConstant = true; } } @@ -6674,10 +6674,10 @@ void TParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TInter if (prevBranch) { TIntermTyped* prevExpression = prevBranch->getExpression(); TIntermTyped* newExpression = branchNode->getAsBranchNode()->getExpression(); - if (prevExpression == nullptr && newExpression == nullptr) + if (prevExpression == NULL && newExpression == NULL) error(branchNode->getLoc(), "duplicate label", "default", ""); - else if (prevExpression != nullptr && - newExpression != nullptr && + else if (prevExpression != NULL && + newExpression != NULL && prevExpression->getAsConstantUnion() && newExpression->getAsConstantUnion() && prevExpression->getAsConstantUnion()->getConstArray()[0].getIConst() == @@ -6695,12 +6695,12 @@ void TParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TInter // TIntermNode* TParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expression, TIntermAggregate* lastStatements) { - profileRequires(loc, EEsProfile, 300, nullptr, "switch statements"); - profileRequires(loc, ENoProfile, 130, nullptr, "switch statements"); + profileRequires(loc, EEsProfile, 300, NULL, "switch statements"); + profileRequires(loc, ENoProfile, 130, NULL, "switch statements"); - wrapupSwitchSubsequence(lastStatements, nullptr); + wrapupSwitchSubsequence(lastStatements, NULL); - if (expression == nullptr || + if (expression == NULL || (expression->getBasicType() != EbtInt && expression->getBasicType() != EbtUint) || expression->getType().isArray() || expression->getType().isMatrix() || expression->getType().isVector()) error(loc, "condition must be a scalar integer expression", "switch", ""); @@ -6710,7 +6710,7 @@ TIntermNode* TParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expre if (switchSequence->size() == 0) return expression; - if (lastStatements == nullptr) { + if (lastStatements == NULL) { // This was originally an ERRROR, because early versions of the specification said // "it is an error to have no statement between a label and the end of the switch statement." // The specifications were updated to remove this (being ill-defined what a "statement" was), diff --git a/deps/glslang/glslang/glslang/MachineIndependent/ParseHelper.h b/deps/glslang/glslang/glslang/MachineIndependent/ParseHelper.h index dd8e30d20e..535357cb6c 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/deps/glslang/glslang/glslang/MachineIndependent/ParseHelper.h @@ -77,20 +77,20 @@ public: TParseContextBase(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink, bool forwardCompatible, EShMessages messages, - const TString* entryPoint = nullptr) + const TString* entryPoint = NULL) : TParseVersions(interm, version, profile, spvVersion, language, infoSink, forwardCompatible, messages), scopeMangler("::"), symbolTable(symbolTable), statementNestingLevel(0), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), postEntryPointReturn(false), contextPragma(true, false), - parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr), + parsingBuiltins(parsingBuiltins), scanContext(NULL), ppContext(NULL), limits(resources.limits), - globalUniformBlock(nullptr), + globalUniformBlock(NULL), globalUniformBinding(TQualifier::layoutBindingEnd), globalUniformSet(TQualifier::layoutSetEnd) { - if (entryPoint != nullptr) + if (entryPoint != NULL) sourceEntryPointName = *entryPoint; } virtual ~TParseContextBase() { } @@ -149,14 +149,14 @@ public: } // Manage the global uniform block (default uniforms in GLSL, $Global in HLSL) - virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr); + virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = NULL); // Potentially rename shader entry point function void renameShaderFunction(TString*& name) const { // Replace the entry point name given in the shader with the real entry point name, // if there is a substitution. - if (name != nullptr && *name == sourceEntryPointName && intermediate.getEntryPointName().size() > 0) + if (name != NULL && *name == sourceEntryPointName && intermediate.getEntryPointName().size() > 0) name = NewPoolTString(intermediate.getEntryPointName().c_str()); } @@ -272,7 +272,7 @@ class TParseContext : public TParseContextBase { public: TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, const SpvVersion& spvVersion, EShLanguage, TInfoSink&, bool forwardCompatible = false, EShMessages messages = EShMsgDefault, - const TString* entryPoint = nullptr); + const TString* entryPoint = NULL); virtual ~TParseContext(); bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); }; diff --git a/deps/glslang/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/deps/glslang/glslang/glslang/MachineIndependent/PoolAlloc.cpp index a85966eed0..f7fdcbf470 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/PoolAlloc.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/PoolAlloc.cpp @@ -81,8 +81,8 @@ bool DeinitializePoolIndex() TPoolAllocator::TPoolAllocator(int growthIncrement, int allocationAlignment) : pageSize(growthIncrement), alignment(allocationAlignment), - freeList(nullptr), - inUseList(nullptr), + freeList(NULL), + inUseList(NULL), numCalls(0) { // diff --git a/deps/glslang/glslang/glslang/MachineIndependent/Scan.cpp b/deps/glslang/glslang/glslang/MachineIndependent/Scan.cpp index 25e1b83ede..560d0aff10 100755 --- a/deps/glslang/glslang/glslang/MachineIndependent/Scan.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/Scan.cpp @@ -302,8 +302,8 @@ namespace { // A single global usable by all threads, by all versions, by all languages. // After a single process-level initialization, this is read only and thread safe -std::unordered_map* KeywordMap = nullptr; -std::unordered_set* ReservedSet = nullptr; +std::unordered_map* KeywordMap = NULL; +std::unordered_set* ReservedSet = NULL; }; @@ -311,7 +311,7 @@ namespace glslang { void TScanContext::fillInKeywordMap() { - if (KeywordMap != nullptr) { + if (KeywordMap != NULL) { // this is really an error, as this should called only once per process // but, the only risk is if two threads called simultaneously return; @@ -715,9 +715,9 @@ void TScanContext::fillInKeywordMap() void TScanContext::deleteKeywordMap() { delete KeywordMap; - KeywordMap = nullptr; + KeywordMap = NULL; delete ReservedSet; - ReservedSet = nullptr; + ReservedSet = NULL; } // Called by yylex to get the next token. @@ -1519,7 +1519,7 @@ int TScanContext::identifierOrType() return IDENTIFIER; parserToken->sType.lex.symbol = _parseContext.symbolTable.find(*parserToken->sType.lex.string); - if ((afterType == false && afterStruct == false) && parserToken->sType.lex.symbol != nullptr) { + if ((afterType == false && afterStruct == false) && parserToken->sType.lex.symbol != NULL) { if (const TVariable* variable = parserToken->sType.lex.symbol->getAsVariable()) { if (variable->isUserType()) { afterType = true; diff --git a/deps/glslang/glslang/glslang/MachineIndependent/Scan.h b/deps/glslang/glslang/glslang/MachineIndependent/Scan.h index 2c26c2efd4..1c219daa7c 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/Scan.h +++ b/deps/glslang/glslang/glslang/MachineIndependent/Scan.h @@ -51,7 +51,7 @@ const int EndOfInput = -1; // class TInputScanner { public: - TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = nullptr, + TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = NULL, int b = 0, int f = 0, bool single = false) : numSources(n), // up to this point, common usage is "char*", but now we need positive 8-bit characters @@ -63,7 +63,7 @@ public: for (int i = 0; i < numSources; ++i) { loc[i].init(i - stringBias); } - if (names != nullptr) { + if (names != NULL) { for (int i = 0; i < numSources; ++i) loc[i].name = names[i]; } @@ -186,8 +186,8 @@ public: { logicalSourceLoc.string = newString; loc[getLastValidSourceIndex()].string = newString; - logicalSourceLoc.name = nullptr; - loc[getLastValidSourceIndex()].name = nullptr; + logicalSourceLoc.name = NULL; + loc[getLastValidSourceIndex()].name = NULL; } // for #include content indentation diff --git a/deps/glslang/glslang/glslang/MachineIndependent/ShaderLang.cpp b/deps/glslang/glslang/glslang/MachineIndependent/ShaderLang.cpp index 127cb4b265..82c16a01ed 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -77,7 +77,7 @@ TBuiltInParseables* CreateBuiltInParseables(TInfoSink& infoSink, EShSource sourc default: infoSink.info.message(EPrefixInternalError, "Unable to determine source language"); - return nullptr; + return NULL; } } @@ -98,7 +98,7 @@ TParseContextBase* CreateParseContext(TSymbolTable& symbolTable, TIntermediate& } default: infoSink.info.message(EPrefixInternalError, "Unable to determine source language"); - return nullptr; + return NULL; } } @@ -195,12 +195,12 @@ enum EPrecisionClass { TSymbolTable* CommonSymbolTable[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EPcCount] = {}; TSymbolTable* SharedSymbolTables[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EShLangCount] = {}; -TPoolAllocator* PerProcessGPA = nullptr; +TPoolAllocator* PerProcessGPA = NULL; // // Parse and add to the given symbol table the content of the given shader string. // -bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, +static bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable& symbolTable) { TIntermediate intermediate(language, version, profile); @@ -245,7 +245,7 @@ bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profil return true; } -int CommonIndex(EProfile profile, EShLanguage language) +static int CommonIndex(EProfile profile, EShLanguage language) { return (profile == EEsProfile && language == EShLangFragment) ? EPcFragment : EPcGeneral; } @@ -253,7 +253,7 @@ int CommonIndex(EProfile profile, EShLanguage language) // // To initialize per-stage shared tables, with the common table already complete. // -void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int version, EProfile profile, const SpvVersion& spvVersion, +static void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) { @@ -271,11 +271,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi // Initialize the full set of shareable symbol tables; // The common (cross-stage) and those shareable per-stage. // -bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source) +static bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source) { std::unique_ptr builtInParseables(CreateBuiltInParseables(infoSink, source)); - if (builtInParseables == nullptr) + if (builtInParseables == NULL) return false; builtInParseables->initialize(version, profile, spvVersion); @@ -319,12 +319,12 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS return true; } -bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, +static bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, EShSource source) { std::unique_ptr builtInParseables(CreateBuiltInParseables(infoSink, source)); - if (builtInParseables == nullptr) + if (builtInParseables == NULL) return false; builtInParseables->initialize(*resources, version, profile, spvVersion, language); @@ -346,7 +346,7 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf // This only gets done the first time any thread needs a particular symbol table // (lazy evaluation). // -void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& spvVersion, EShSource source) +static void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& spvVersion, EShSource source) { TInfoSink infoSink; @@ -414,7 +414,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp } // Return true if the shader was correctly specified for version/profile/stage. -bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNotFirst, int defaultVersion, +static bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNotFirst, int defaultVersion, EShSource source, int& version, EProfile& profile, const SpvVersion& spvVersion) { const int FirstProfileVersion = 150; @@ -588,7 +588,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo // TEnvironment takes precedence, for what it sets, so sort all this out. // Ideally, the internal code could be made to use TEnvironment, but for // now, translate it to the historically used parameters. -void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages, EShSource& source, +static void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages, EShSource& source, EShLanguage& stage, SpvVersion& spvVersion) { // Set up environmental defaults, first ignoring 'environment'. @@ -603,7 +603,7 @@ void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages // Now, override, based on any content set in 'environment'. // 'environment' must be cleared to ESh*None settings when items // are not being set. - if (environment != nullptr) { + if (environment != NULL) { // input language if (environment->input.languageFamily != EShSourceNone) { stage = environment->input.stage; @@ -653,7 +653,7 @@ void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages // Most processes are recorded when set in the intermediate representation, // These are the few that are not. -void RecordProcesses(TIntermediate& intermediate, EShMessages messages, const std::string& sourceEntryPointName) +static void RecordProcesses(TIntermediate& intermediate, EShMessages messages, const std::string& sourceEntryPointName) { if ((messages & EShMsgRelaxedErrors) != 0) intermediate.addProcess("relaxed-errors"); @@ -677,7 +677,7 @@ void RecordProcesses(TIntermediate& intermediate, EShMessages messages, const st // Which returns false if a failure was detected and true otherwise. // template -bool ProcessDeferred( +static bool ProcessDeferred( TCompiler* compiler, const char* const shaderStrings[], const int numStrings, @@ -698,7 +698,7 @@ bool ProcessDeferred( bool requireNonempty, TShader::Includer& includer, const std::string sourceEntryPointName = "", - const TEnvironment* environment = nullptr) // optional way of fully setting all versions, overriding the above + const TEnvironment* environment = NULL) // optional way of fully setting all versions, overriding the above { // This must be undone (.pop()) by the caller, after it finishes consuming the created tree. GetThreadPoolAllocator().push(); @@ -723,17 +723,17 @@ bool ProcessDeferred( std::unique_ptr names(new const char*[numTotal]); for (int s = 0; s < numStrings; ++s) { strings[s + numPre] = shaderStrings[s]; - if (inputLengths == nullptr || inputLengths[s] < 0) + if (inputLengths == NULL || inputLengths[s] < 0) lengths[s + numPre] = strlen(shaderStrings[s]); else lengths[s + numPre] = inputLengths[s]; } - if (stringNames != nullptr) { + if (stringNames != NULL) { for (int s = 0; s < numStrings; ++s) names[s + numPre] = stringNames[s]; } else { for (int s = 0; s < numStrings; ++s) - names[s + numPre] = nullptr; + names[s + numPre] = NULL; } // Get all the stages, languages, clients, and other environment @@ -742,7 +742,7 @@ bool ProcessDeferred( SpvVersion spvVersion; EShLanguage stage = compiler->getLanguage(); TranslateEnvironment(environment, messages, source, stage, spvVersion); - if (environment != nullptr && environment->target.hlslFunctionality1) + if (environment != NULL && environment->target.hlslFunctionality1) intermediate.setHlslFunctionality1(); // First, without using the preprocessor or parser, find the #version, so we know what @@ -815,9 +815,8 @@ bool ProcessDeferred( // Add built-in symbols that are potentially context dependent; // they get popped again further down. if (! AddContextSpecificSymbols(resources, compiler->infoSink, *symbolTable, version, profile, spvVersion, - stage, source)) { + stage, source)) return false; - } // // Now we can process the full shader under proper symbols and rules. @@ -850,15 +849,15 @@ bool ProcessDeferred( _parseContext->getPreamble(preamble); strings[0] = preamble.c_str(); lengths[0] = strlen(strings[0]); - names[0] = nullptr; + names[0] = NULL; strings[1] = customPreamble; lengths[1] = strlen(strings[1]); - names[1] = nullptr; + names[1] = NULL; if (requireNonempty) { const int postIndex = numStrings + numPre; strings[postIndex] = "\n int;"; lengths[postIndex] = strlen(strings[numStrings + numPre]); - names[postIndex] = nullptr; + names[postIndex] = NULL; } TInputScanner fullInput(numStrings + numPre + numPost, strings.get(), lengths.get(), names.get(), numPre, numPost); @@ -974,13 +973,12 @@ struct DoPreprocessing { outputBuffer += std::to_string(newLineNum); if (hasSource) { outputBuffer += ' '; - if (sourceName != nullptr) { + if (sourceName != NULL) { outputBuffer += '\"'; outputBuffer += sourceName; outputBuffer += '\"'; - } else { + } else outputBuffer += std::to_string(sourceNum); - } } if (_parseContext.lineDirectiveShouldSetNextLine()) { // newLineNum is the new line number for the line following the #line @@ -1007,9 +1005,8 @@ struct DoPreprocessing { int line, const glslang::TVector& ops) { lineSync.syncToLine(line); outputBuffer += "#pragma "; - for(size_t i = 0; i < ops.size(); ++i) { + for(size_t i = 0; i < ops.size(); ++i) outputBuffer += ops[i].c_str(); - } }); _parseContext.setErrorCallback([&lineSync, &outputBuffer]( @@ -1132,7 +1129,7 @@ bool PreprocessDeferred( // return: the tree and other information is filled into the intermediate argument, // and true is returned by the function for success. // -bool CompileDeferred( +static bool CompileDeferred( TCompiler* compiler, const char* const shaderStrings[], const int numStrings, @@ -1149,7 +1146,7 @@ bool CompileDeferred( TIntermediate& intermediate,// returned tree, etc. TShader::Includer& includer, const std::string sourceEntryPointName = "", - TEnvironment* environment = nullptr) + TEnvironment* environment = NULL) { DoFullParse parser; return ProcessDeferred(compiler, shaderStrings, numStrings, inputLengths, stringNames, @@ -1175,7 +1172,7 @@ int ShInitialize() ++NumberOfClients; glslang::ReleaseGlobalLock(); - if (PerProcessGPA == nullptr) + if (PerProcessGPA == NULL) PerProcessGPA = new TPoolAllocator(); glslang::TScanContext::fillInKeywordMap(); @@ -1271,9 +1268,9 @@ int __fastcall ShFinalize() } } - if (PerProcessGPA != nullptr) { + if (PerProcessGPA != NULL) { delete PerProcessGPA; - PerProcessGPA = nullptr; + PerProcessGPA = NULL; } glslang::TScanContext::deleteKeywordMap(); @@ -1319,7 +1316,7 @@ int ShCompile( TIntermediate intermediate(compiler->getLanguage()); TShader::ForbidIncluder includer; - bool success = CompileDeferred(compiler, shaderStrings, numStrings, inputLengths, nullptr, + bool success = CompileDeferred(compiler, shaderStrings, numStrings, inputLengths, NULL, "", optLevel, resources, defaultVersion, ENoProfile, false, forwardCompatible, messages, intermediate, includer); @@ -1571,7 +1568,7 @@ public: }; TShader::TShader(EShLanguage s) - : stage(s), lengths(nullptr), stringNames(nullptr), preamble("") + : stage(s), lengths(NULL), stringNames(NULL), preamble("") { pool = new TPoolAllocator; infoSink = new TInfoSink; @@ -1598,7 +1595,7 @@ void TShader::setStrings(const char* const* s, int n) { strings = s; numStrings = n; - lengths = nullptr; + lengths = NULL; } void TShader::setStringsWithLengths(const char* const* s, const int* l, int n) @@ -1723,7 +1720,7 @@ const char* TShader::getInfoDebugLog() return infoSink->debug.c_str(); } -TProgram::TProgram() : reflection(0), ioMapper(nullptr), linked(false) +TProgram::TProgram() : reflection(0), ioMapper(NULL), linked(false) { pool = new TPoolAllocator; infoSink = new TInfoSink; @@ -1783,12 +1780,12 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages) return true; int numEsShaders = 0, numNonEsShaders = 0; - for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) { - if ((*it)->intermediate->getProfile() == EEsProfile) { + for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) + { + if ((*it)->intermediate->getProfile() == EEsProfile) numEsShaders++; - } else { + else numNonEsShaders++; - } } if (numEsShaders > 0 && numNonEsShaders > 0) { @@ -1814,9 +1811,8 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages) // The new TIntermediate must use the same origin as the original TIntermediates. // Otherwise linking will fail due to different coordinate systems. - if (firstIntermediate->getOriginUpperLeft()) { + if (firstIntermediate->getOriginUpperLeft()) intermediate[stage]->setOriginUpperLeft(); - } intermediate[stage]->setSpv(firstIntermediate->getSpv()); newedIntermediate[stage] = true; @@ -1839,12 +1835,12 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages) return intermediate[stage]->getNumErrors() == 0; } -const char* TProgram::getInfoLog() +const char* TProgram::getInfoLog(void) { return infoSink->info.c_str(); } -const char* TProgram::getInfoDebugLog() +const char* TProgram::getInfoDebugLog(void) { return infoSink->debug.c_str(); } @@ -1853,7 +1849,7 @@ const char* TProgram::getInfoDebugLog() // Reflection implementation. // -bool TProgram::buildReflection() +bool TProgram::buildReflection(void) { if (! linked || reflection) return false; @@ -1891,9 +1887,7 @@ const TType* TProgram::getUniformTType(int index) const { return reflection const TType* TProgram::getUniformBlockTType(int index) const { return reflection->getUniformBlock(index).getType(); } unsigned TProgram::getLocalSize(int dim) const { return reflection->getLocalSize(dim); } -// // I/O mapping implementation. -// bool TProgram::mapIO(TIoMapResolver* resolver) { if (! linked || ioMapper) diff --git a/deps/glslang/glslang/glslang/MachineIndependent/SymbolTable.cpp b/deps/glslang/glslang/glslang/MachineIndependent/SymbolTable.cpp index 608f32fecd..21434d9e0f 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -294,7 +294,7 @@ TVariable::TVariable(const TVariable& copyOf) : TSymbol(copyOf) } // don't support specialization-constant subtrees in cloned tables - constSubtree = nullptr; + constSubtree = NULL; } TVariable* TVariable::clone() const diff --git a/deps/glslang/glslang/glslang/MachineIndependent/SymbolTable.h b/deps/glslang/glslang/glslang/MachineIndependent/SymbolTable.h index dc9cbc7e55..e643347875 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/SymbolTable.h +++ b/deps/glslang/glslang/glslang/MachineIndependent/SymbolTable.h @@ -151,7 +151,7 @@ public: TVariable(const TString *name, const TType& t, bool uT = false ) : TSymbol(name), userType(uT), - constSubtree(nullptr), + constSubtree(NULL), anonId(-1) { type.shallowCopy(t); } virtual TVariable* clone() const; virtual ~TVariable() { } @@ -240,7 +240,7 @@ public: parameters.push_back(p); p.type->appendMangledName(mangledName); - if (p.defaultValue != nullptr) + if (p.defaultValue != NULL) defaultParamCount++; } @@ -248,7 +248,7 @@ public: // 'this' is reflected in the list of parameters, but not the mangled name. virtual void addThisParameter(TType& type, const char* name) { - TParameter p = { NewPoolTString(name), new TType, nullptr }; + TParameter p = { NewPoolTString(name), new TType, NULL }; p.type->shallowCopy(type); parameters.insert(parameters.begin(), p); } @@ -695,13 +695,13 @@ public: ++thisDepth; symbol = table[level]->find(name); --level; - } while (symbol == nullptr && level >= 0); + } while (symbol == NULL && level >= 0); level++; if (builtIn) *builtIn = isBuiltInLevel(level); if (currentScope) *currentScope = isGlobalLevel(currentLevel()) || level == currentLevel(); // consider shared levels as "current scope" WRT user globals - if (thisDepthP != nullptr) { + if (thisDepthP != NULL) { if (! table[level]->isThisLevel()) thisDepth = 0; *thisDepthP = thisDepth; diff --git a/deps/glslang/glslang/glslang/MachineIndependent/Versions.cpp b/deps/glslang/glslang/glslang/MachineIndependent/Versions.cpp index 8bd1aa2786..350eedf069 100755 --- a/deps/glslang/glslang/glslang/MachineIndependent/Versions.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/Versions.cpp @@ -803,16 +803,16 @@ void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBe // Call for any operation needing full GLSL integer data-type support. void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op) { - profileRequires(loc, ENoProfile, 130, nullptr, op); - profileRequires(loc, EEsProfile, 300, nullptr, op); + profileRequires(loc, ENoProfile, 130, NULL, op); + profileRequires(loc, EEsProfile, 300, NULL, op); } // Call for any operation needing GLSL double data-type support. void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op) { requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 400, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 400, nullptr, op); + profileRequires(loc, ECoreProfile, 400, NULL, op); + profileRequires(loc, ECompatibilityProfile, 400, NULL, op); } // Call for any operation needing GLSL float16 data-type support. @@ -830,8 +830,8 @@ void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool bu #endif requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile, 450, NULL, op); + profileRequires(loc, ECompatibilityProfile, 450, NULL, op); } } @@ -843,8 +843,8 @@ void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op, E_GL_KHX_shader_explicit_arithmetic_types_float32}; requireExtensions(loc, 2, extensions, "explicit types"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile, 450, NULL, op); + profileRequires(loc, ECompatibilityProfile, 450, NULL, op); } } @@ -856,8 +856,8 @@ void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op, E_GL_KHX_shader_explicit_arithmetic_types_float64}; requireExtensions(loc, 2, extensions, "explicit types"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile, 450, NULL, op); + profileRequires(loc, ECompatibilityProfile, 450, NULL, op); } } @@ -869,8 +869,8 @@ void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bo E_GL_KHX_shader_explicit_arithmetic_types_int8}; requireExtensions(loc, 2, extensions, "explicit types"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile, 450, NULL, op); + profileRequires(loc, ECompatibilityProfile, 450, NULL, op); } } @@ -881,8 +881,8 @@ void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, b if (! builtIn) { requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float_fetch, op); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile, 450, NULL, op); + profileRequires(loc, ECompatibilityProfile, 450, NULL, op); } } #endif @@ -901,8 +901,8 @@ void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, b #endif requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile, 450, NULL, op); + profileRequires(loc, ECompatibilityProfile, 450, NULL, op); } } @@ -914,8 +914,8 @@ void TParseVersions::explicitInt32Check(const TSourceLoc& loc, const char* op, b E_GL_KHX_shader_explicit_arithmetic_types_int32}; requireExtensions(loc, 2, extensions, "explicit types"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile, 450, NULL, op); + profileRequires(loc, ECompatibilityProfile, 450, NULL, op); } } @@ -928,8 +928,8 @@ void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool buil E_GL_KHX_shader_explicit_arithmetic_types_int64}; requireExtensions(loc, 3, extensions, "shader int64"); requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile, 450, nullptr, op); - profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + profileRequires(loc, ECoreProfile, 450, NULL, op); + profileRequires(loc, ECompatibilityProfile, 450, NULL, op); } } diff --git a/deps/glslang/glslang/glslang/MachineIndependent/attribute.cpp b/deps/glslang/glslang/glslang/MachineIndependent/attribute.cpp index 13acfe4b83..d793199b05 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/attribute.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/attribute.cpp @@ -45,7 +45,7 @@ bool TAttributeArgs::getInt(int& value, int argNum) const { const TConstUnion* intConst = getConstUnion(EbtInt, argNum); - if (intConst == nullptr) + if (intConst == NULL) return false; value = intConst->getIConst(); @@ -58,7 +58,7 @@ bool TAttributeArgs::getString(TString& value, int argNum, bool convertToLower) { const TConstUnion* stringConst = getConstUnion(EbtString, argNum); - if (stringConst == nullptr) + if (stringConst == NULL) return false; value = *stringConst->getSConst(); @@ -73,21 +73,21 @@ bool TAttributeArgs::getString(TString& value, int argNum, bool convertToLower) // How many arguments were supplied? int TAttributeArgs::size() const { - return args == nullptr ? 0 : (int)args->getSequence().size(); + return args == NULL ? 0 : (int)args->getSequence().size(); } -// Helper to get attribute const union. Returns nullptr on failure. +// Helper to get attribute const union. Returns NULL on failure. const TConstUnion* TAttributeArgs::getConstUnion(TBasicType basicType, int argNum) const { - if (args == nullptr) - return nullptr; + if (args == NULL) + return NULL; if (argNum >= (int)args->getSequence().size()) - return nullptr; + return NULL; const TConstUnion* constVal = &args->getSequence()[argNum]->getAsConstantUnion()->getConstArray()[0]; - if (constVal == nullptr || constVal->getType() != basicType) - return nullptr; + if (constVal == NULL || constVal->getType() != basicType) + return NULL; return constVal; } @@ -113,9 +113,9 @@ TAttributeType TParseContext::attributeFromName(const TString& name) const // Make an initial leaf for the grammar from a no-argument attribute TAttributes* TParseContext::makeAttributes(const TString& identifier) const { - TAttributes *attributes = nullptr; + TAttributes *attributes = NULL; attributes = NewPoolObject(attributes); - TAttributeArgs args = { attributeFromName(identifier), nullptr }; + TAttributeArgs args = { attributeFromName(identifier), NULL }; attributes->push_back(args); return attributes; } @@ -123,7 +123,7 @@ TAttributes* TParseContext::makeAttributes(const TString& identifier) const // Make an initial leaf for the grammar from a one-argument attribute TAttributes* TParseContext::makeAttributes(const TString& identifier, TIntermNode* node) const { - TAttributes *attributes = nullptr; + TAttributes *attributes = NULL; attributes = NewPoolObject(attributes); // for now, node is always a simple single expression, but other code expects @@ -148,7 +148,7 @@ TAttributes* TParseContext::mergeAttributes(TAttributes* attr1, TAttributes* att void TParseContext::handleSelectionAttributes(const TAttributes& attributes, TIntermNode* node) { TIntermSelection* selection = node->getAsSelectionNode(); - if (selection == nullptr) + if (selection == NULL) return; for (auto it = attributes.begin(); it != attributes.end(); ++it) { @@ -177,7 +177,7 @@ void TParseContext::handleSelectionAttributes(const TAttributes& attributes, TIn void TParseContext::handleSwitchAttributes(const TAttributes& attributes, TIntermNode* node) { TIntermSwitch* selection = node->getAsSwitchNode(); - if (selection == nullptr) + if (selection == NULL) return; for (auto it = attributes.begin(); it != attributes.end(); ++it) { @@ -206,17 +206,17 @@ void TParseContext::handleSwitchAttributes(const TAttributes& attributes, TInter void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermNode* node) { TIntermLoop* loop = node->getAsLoopNode(); - if (loop == nullptr) { + if (loop == NULL) { // the actual loop might be part of a sequence TIntermAggregate* agg = node->getAsAggregate(); - if (agg == nullptr) + if (agg == NULL) return; for (auto it = agg->getSequence().begin(); it != agg->getSequence().end(); ++it) { loop = (*it)->getAsLoopNode(); - if (loop != nullptr) + if (loop != NULL) break; } - if (loop == nullptr) + if (loop == NULL) return; } diff --git a/deps/glslang/glslang/glslang/MachineIndependent/glslang.y b/deps/glslang/glslang/glslang/MachineIndependent/glslang.y index e65483a82e..c78ce93377 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/glslang.y +++ b/deps/glslang/glslang/glslang/MachineIndependent/glslang.y @@ -1083,7 +1083,7 @@ fully_specified_type } if ($2.arraySizes && parseContext.arrayQualifierError($2.loc, $1.qualifier)) - $2.arraySizes = nullptr; + $2.arraySizes = NULL; parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers); $2.shaderQualifiers.merge($1.shaderQualifiers); @@ -3546,7 +3546,7 @@ translation_unit parseContext.intermediate.setTreeRoot($$); } | translation_unit external_declaration { - if ($2 != nullptr) { + if ($2 != NULL) { $$ = parseContext.intermediate.growAggregate($1, $2); parseContext.intermediate.setTreeRoot($$); } @@ -3562,8 +3562,8 @@ external_declaration } | SEMICOLON { parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon"); - parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); - $$ = nullptr; + parseContext.profileRequires($1.loc, ~EEsProfile, 460, NULL, "extraneous semicolon"); + $$ = NULL; } ; diff --git a/deps/glslang/glslang/glslang/MachineIndependent/glslang_tab.cpp b/deps/glslang/glslang/glslang/MachineIndependent/glslang_tab.cpp index 25523309eb..37dc200c00 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -92,7 +92,7 @@ using namespace glslang; # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULL NULL # else # define YY_NULL 0 # endif @@ -5304,7 +5304,7 @@ yyreduce: } if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier)) - (yyvsp[0].interm.type).arraySizes = nullptr; + (yyvsp[0].interm.type).arraySizes = NULL; parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); (yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers); @@ -9710,7 +9710,7 @@ yyreduce: case 546: #line 3548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[0].interm.intermNode) != nullptr) { + if ((yyvsp[0].interm.intermNode) != NULL) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } @@ -9738,8 +9738,8 @@ yyreduce: #line 3563 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); - parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); - (yyval.interm.intermNode) = nullptr; + parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, NULL, "extraneous semicolon"); + (yyval.interm.intermNode) = NULL; } #line 9749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; diff --git a/deps/glslang/glslang/glslang/MachineIndependent/iomapper.cpp b/deps/glslang/glslang/glslang/MachineIndependent/iomapper.cpp index 9ab9deaa35..5deb62f31f 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/iomapper.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/iomapper.cpp @@ -127,7 +127,7 @@ public: virtual void visitSymbol(TIntermSymbol* base) { - TVarLiveMap* target = nullptr; + TVarLiveMap* target = NULL; if (base->getQualifier().storage == EvqVaryingIn) target = &inputList; else if (base->getQualifier().storage == EvqVaryingOut) @@ -359,7 +359,7 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver { } int getBaseBinding(TResourceType res, unsigned int set) const { - return selectBaseBinding(intermediate.getShiftBinding(res), + return selectBaseBinding(intermediate.getShiftBinding(res), intermediate.getShiftBindingForSet(res, set)); } @@ -535,7 +535,7 @@ protected: } static bool isTextureType(const glslang::TType& type) { - return (type.getBasicType() == glslang::EbtSampler && + return (type.getBasicType() == glslang::EbtSampler && (type.getSampler().isTexture() || type.getSampler().isSubpass())); } @@ -634,7 +634,7 @@ t - for shader resource views (SRV) BYTEADDRESSBUFFER BUFFER TBUFFER - + s - for samplers SAMPLER SAMPLER1D @@ -738,21 +738,21 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi intermediate.hasShiftBindingForSet(TResourceType(res)); } - if (!somethingToDo && resolver == nullptr) + if (!somethingToDo && resolver == NULL) return true; if (intermediate.getNumEntryPoints() != 1 || intermediate.isRecursive()) return false; TIntermNode* root = intermediate.getTreeRoot(); - if (root == nullptr) + if (root == NULL) return false; // if no resolver is provided, use the default resolver with the given shifts and auto map settings TDefaultIoResolver defaultResolver(intermediate); TDefaultHlslIoResolver defaultHlslResolver(intermediate); - if (resolver == nullptr) { + if (resolver == NULL) { // TODO: use a passed in IO mapper for this if (intermediate.usingHlslIoMapping()) resolver = &defaultHlslResolver; diff --git a/deps/glslang/glslang/glslang/MachineIndependent/limits.cpp b/deps/glslang/glslang/glslang/MachineIndependent/limits.cpp index 64d191b472..4d21230221 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/limits.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/limits.cpp @@ -133,7 +133,7 @@ void TParseContext::inductiveLoopBodyCheck(TIntermNode* body, int loopId, TSymbo { TInductiveTraverser it(loopId, symbolTable); - if (body == nullptr) + if (body == NULL) return; body->traverse(&it); diff --git a/deps/glslang/glslang/glslang/MachineIndependent/linkValidate.cpp b/deps/glslang/glslang/glslang/MachineIndependent/linkValidate.cpp index 2457cc8b00..b08f104457 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -388,7 +388,7 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy // void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) { - if (getTreeRoot() == nullptr) + if (getTreeRoot() == NULL) return; if (numEntryPoints < 1) { @@ -679,9 +679,9 @@ void TIntermediate::checkCallGraphBodies(TInfoSink& infoSink, bool keepUncalled) if (! keepUncalled) { for (int f = 0; f < (int)functionSequence.size(); ++f) { if (! reachable[f]) - functionSequence[f] = nullptr; + functionSequence[f] = NULL; } - functionSequence.erase(std::remove(functionSequence.begin(), functionSequence.end(), nullptr), functionSequence.end()); + functionSequence.erase(std::remove(functionSequence.begin(), functionSequence.end(), NULL), functionSequence.end()); } } diff --git a/deps/glslang/glslang/glslang/MachineIndependent/localintermediate.h b/deps/glslang/glslang/glslang/MachineIndependent/localintermediate.h index 5206c0c6c1..26bc15c061 100755 --- a/deps/glslang/glslang/glslang/MachineIndependent/localintermediate.h +++ b/deps/glslang/glslang/glslang/MachineIndependent/localintermediate.h @@ -267,7 +267,7 @@ public: shiftBinding[res] = shift; const char* name = getResourceName(res); - if (name != nullptr) + if (name != NULL) processes.addIfNonZero(name, shift); } @@ -281,7 +281,7 @@ public: shiftBindingForSet[res][set] = shift; const char* name = getResourceName(res); - if (name != nullptr) { + if (name != NULL) { processes.addProcess(name); processes.addArgument(shift); processes.addArgument(set); @@ -618,7 +618,7 @@ public: return semanticNameSet.insert(name).first->c_str(); } - void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; } + void setSourceFile(const char* file) { if (file != NULL) sourceFile = file; } const std::string& getSourceFile() const { return sourceFile; } void addSourceText(const char* text) { sourceText = sourceText + text; } const std::string& getSourceText() const { return sourceText; } diff --git a/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index e3b9dc95b3..fc68f91879 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -86,6 +86,8 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include + #include "PpContext.h" #include "PpTokens.h" @@ -159,7 +161,7 @@ int TPpContext::CPPdefine(TPpToken* ppToken) // check for duplicate definition MacroSymbol* existing = lookupMacroDef(defAtom); - if (existing != nullptr) { + if (existing != NULL) { if (! existing->undef) { // Already defined -- need to make sure they are identical: // "Two replacement lists are identical if and only if the preprocessing tokens in both have the same number, @@ -205,7 +207,7 @@ int TPpContext::CPPundef(TPpToken* ppToken) _parseContext.reservedPpErrorCheck(ppToken->loc, ppToken->name, "#undef"); MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name)); - if (macro != nullptr) + if (macro != NULL) macro->undef = 1; token = scanToken(ppToken); if (token != '\n') @@ -422,7 +424,7 @@ int TPpContext::eval(int token, int precedence, bool shortCircuit, int& res, boo } MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name)); - res = macro != nullptr ? !macro->undef : 0; + res = macro != NULL ? !macro->undef : 0; token = scanToken(ppToken); if (needclose) { if (token != ')') { @@ -584,7 +586,7 @@ int TPpContext::CPPifdef(int defined, TPpToken* ppToken) while (token != '\n' && token != EndOfInput) token = scanToken(ppToken); } - if (((macro != nullptr && !macro->undef) ? 1 : 0) != defined) + if (((macro != NULL && !macro->undef) ? 1 : 0) != defined) token = CPPelse(1, ppToken); } @@ -628,17 +630,17 @@ int TPpContext::CPPinclude(TPpToken* ppToken) // Find the inclusion, first look in "Local" ("") paths, if requested, // otherwise, only search the "System" (<>) paths. - TShader::Includer::IncludeResult* res = nullptr; + TShader::Includer::IncludeResult* res = NULL; if (startWithLocalSearch) res = includer.includeLocal(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1); - if (res == nullptr || res->headerName.empty()) { + if (res == NULL || res->headerName.empty()) { includer.releaseInclude(res); res = includer.includeSystem(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1); } // Process the results - if (res != nullptr && !res->headerName.empty()) { - if (res->headerData != nullptr && res->headerLength > 0) { + if (res != NULL && !res->headerName.empty()) { + if (res->headerData != NULL && res->headerLength > 0) { // path for processing one or more tokens from an included header, hand off 'res' const bool forNextLine = _parseContext.lineDirectiveShouldSetNextLine(); std::ostringstream prologue; @@ -656,7 +658,7 @@ int TPpContext::CPPinclude(TPpToken* ppToken) } else { // error path, clean up std::string message = - res != nullptr ? std::string(res->headerData, res->headerLength) + res != NULL ? std::string(res->headerData, res->headerLength) : std::string("Could not process include directive"); _parseContext.ppError(directiveLoc, message.c_str(), "#include", "for header name: %s", filename.c_str()); includer.releaseInclude(res); @@ -683,7 +685,7 @@ int TPpContext::CPPline(TPpToken* ppToken) int lineToken = 0; bool hasFile = false; int fileRes = 0; // Source file number after macro expansion. - const char* sourceName = nullptr; // Optional source file name. + const char* sourceName = NULL; // Optional source file name. bool lineErr = false; bool fileErr = false; token = eval(token, MIN_PRECEDENCE, false, lineRes, lineErr, ppToken); @@ -820,7 +822,7 @@ int TPpContext::CPPversion(TPpToken* ppToken) token = scanToken(ppToken); if (token == '\n') { - _parseContext.notifyVersion(line, versionNumber, nullptr); + _parseContext.notifyVersion(line, versionNumber, NULL); return token; } else { int profileAtom = atomStrings.getAtom(ppToken->name); @@ -1000,7 +1002,7 @@ int TPpContext::scanHeaderName(TPpToken* ppToken, char delimit) // Macro-expand a macro argument 'arg' to create 'expandedArg'. // Does not replace 'arg'. -// Returns nullptr if no expanded argument is created. +// Returns NULL if no expanded argument is created. TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken* ppToken, bool newLineOkay) { // expand the argument @@ -1020,7 +1022,7 @@ TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken* if (token == EndOfInput) { // MacroExpand ate the marker, so had bad input, recover delete expandedArg; - expandedArg = nullptr; + expandedArg = NULL; } else { // remove the marker popInput(); @@ -1084,7 +1086,7 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken) break; if (i >= 0) { TokenStream* arg = expandedArgs[i]; - if (arg == nullptr || pasting) + if (arg == NULL || pasting) arg = args[i]; pp->pushTokenStreamInput(*arg, prepaste); @@ -1135,7 +1137,7 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka if (_parseContext.getCurrentLoc().name) _parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based __FILE__"); ppToken->ival = _parseContext.getCurrentLoc().string; - snprintf(ppToken->name, sizeof(ppToken->name), "%s", ppToken->loc.getStringNameOrNum().c_str()); + strlcpy(ppToken->name, ppToken->loc.getStringNameOrNum().c_str(), sizeof(ppToken->name)); UngetToken(PpAtomConstInt, ppToken); return 1; } @@ -1150,19 +1152,19 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka break; } - MacroSymbol* macro = macroAtom == 0 ? nullptr : lookupMacroDef(macroAtom); + MacroSymbol* macro = macroAtom == 0 ? NULL : lookupMacroDef(macroAtom); int depth = 0; // no recursive expansions - if (macro != nullptr && macro->busy) + if (macro != NULL && macro->busy) return 0; // not expanding undefined macros - if ((macro == nullptr || macro->undef) && ! expandUndef) + if ((macro == NULL || macro->undef) && ! expandUndef) return 0; // 0 is the value of an undefined macro - if ((macro == nullptr || macro->undef) && expandUndef) { + if ((macro == NULL || macro->undef) && expandUndef) { pushInput(new tZeroInput(this)); return -1; } @@ -1187,7 +1189,7 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka in->args[i] = new TokenStream; in->expandedArgs.resize(in->mac->args.size()); for (size_t i = 0; i < in->mac->args.size(); i++) - in->expandedArgs[i] = nullptr; + in->expandedArgs[i] = NULL; size_t arg = 0; bool tokenRecorded = false; do { diff --git a/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index 1ea4c5513a..8bf82b52d0 100755 --- a/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -273,7 +273,7 @@ public: MacroSymbol* lookupMacroDef(int atom) { auto existingMacroIt = macroDefs.find(atom); - return (existingMacroIt == macroDefs.end()) ? nullptr : &(existingMacroIt->second); + return (existingMacroIt == macroDefs.end()) ? NULL : &(existingMacroIt->second); } void addMacroDef(int atom, MacroSymbol& macroDef) { macroDefs[atom] = macroDef; } @@ -527,7 +527,7 @@ protected: epilogue_(epilogue), includedFile_(includedFile), scanner(3, strings, lengths, names, 0, 0, true), - prevScanner(nullptr), + prevScanner(NULL), stringInput(pp, scanner) { strings[0] = prologue_.data(); diff --git a/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp index 1c587f980e..613a799d88 100755 --- a/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -288,9 +288,9 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) } } else if (ch == 'f' || ch == 'F') { if (ifdepth == 0) - _parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix"); + _parseContext.profileRequires(ppToken->loc, EEsProfile, 300, NULL, "floating-point suffix"); if (ifdepth == 0 && !_parseContext.relaxedErrors()) - _parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix"); + _parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, NULL, "floating-point suffix"); if (ifdepth == 0 && !hasDecimalOrExponent) _parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); saveName(ch); diff --git a/deps/glslang/glslang/glslang/MachineIndependent/propagateNoContraction.cpp b/deps/glslang/glslang/glslang/MachineIndependent/propagateNoContraction.cpp index 1ee780a0b1..b49e93b7cd 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/propagateNoContraction.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/propagateNoContraction.cpp @@ -274,7 +274,7 @@ TSymbolDefinitionCollectingTraverser::TSymbolDefinitionCollectingTraverser( : TIntermTraverser(true, false, false), symbol_definition_mapping_(*symbol_definition_mapping), precise_objects_(*precise_objects), precise_return_nodes_(*precise_return_nodes), current_object_(), accesschain_mapping_(*accesschain_mapping), - current_function_definition_node_(nullptr) {} + current_function_definition_node_(NULL) {} // Visits a symbol node, set the current_object_ to the // current node symbol ID, and record a mapping from this node to the current @@ -462,7 +462,7 @@ class TNoContractionAssigneeCheckingTraverser : public glslang::TIntermTraverser public: TNoContractionAssigneeCheckingTraverser(const AccessChainMapping& accesschain_mapping) : TIntermTraverser(true, false, false), accesschain_mapping_(accesschain_mapping), - precise_object_(nullptr) {} + precise_object_(NULL) {} // Checks the preciseness of a given assignment node with a precise object // represented as access chain. The precise object shares the same symbol @@ -654,7 +654,7 @@ protected: // Gets the struct dereference index that leads to 'precise' object. ObjectAccessChain precise_accesschain_index_str = getFrontElement(remained_accesschain_); - unsigned precise_accesschain_index = (unsigned)strtoul(precise_accesschain_index_str.c_str(), nullptr, 10); + unsigned precise_accesschain_index = (unsigned)strtoul(precise_accesschain_index_str.c_str(), NULL, 10); // Gets the node pointed by the access chain index extracted before. glslang::TIntermTyped* potential_precise_node = node->getSequence()[precise_accesschain_index]->getAsTyped(); diff --git a/deps/glslang/glslang/glslang/MachineIndependent/reflection.cpp b/deps/glslang/glslang/glslang/MachineIndependent/reflection.cpp index cd61057088..f7401d2286 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/reflection.cpp +++ b/deps/glslang/glslang/glslang/MachineIndependent/reflection.cpp @@ -372,7 +372,7 @@ public: return base; TIntermBinary* left = node->getLeft()->getAsBinaryNode(); if (! left) - return nullptr; + return NULL; return findBase(left); } @@ -781,7 +781,7 @@ void TReflection::buildCounterIndices(const TIntermediate& intermediate) // Returns false if the input is too malformed to do this. bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate) { - if (intermediate.getTreeRoot() == nullptr || + if (intermediate.getTreeRoot() == NULL || intermediate.getNumEntryPoints() != 1 || intermediate.isRecursive()) return false; diff --git a/deps/glslang/glslang/glslang/MachineIndependent/reflection.h b/deps/glslang/glslang/glslang/MachineIndependent/reflection.h index a9cc13bd5c..92d50ad416 100644 --- a/deps/glslang/glslang/glslang/MachineIndependent/reflection.h +++ b/deps/glslang/glslang/glslang/MachineIndependent/reflection.h @@ -62,7 +62,7 @@ public: const TType* const getType() const { return type; } int getBinding() const { - if (type == nullptr || !type->getQualifier().hasBinding()) + if (type == NULL || !type->getQualifier().hasBinding()) return -1; return type->getQualifier().layoutBinding; } @@ -76,7 +76,7 @@ public: int counterIndex; protected: - TObjectReflection() : offset(-1), glDefineType(-1), size(-1), index(-1), type(nullptr) { } + TObjectReflection() : offset(-1), glDefineType(-1), size(-1), index(-1), type(NULL) { } const TType* type; }; diff --git a/deps/glslang/glslang/glslang/Public/ShaderLang.h b/deps/glslang/glslang/glslang/Public/ShaderLang.h index 187efcc3e8..8988b2d03d 100644 --- a/deps/glslang/glslang/glslang/Public/ShaderLang.h +++ b/deps/glslang/glslang/glslang/Public/ShaderLang.h @@ -474,7 +474,7 @@ public: // and include depth. // On success, returns an IncludeResult containing the resolved name // and content of the include. - // On failure, returns a nullptr, or an IncludeResult + // On failure, returns a NULL, or an IncludeResult // with an empty string for the headerName and error details in the // header field. // The Includer retains ownership of the contents @@ -489,14 +489,14 @@ public: // For the "system" or <>-style includes; search the "system" paths. virtual IncludeResult* includeSystem(const char* /*headerName*/, const char* /*includerName*/, - size_t /*inclusionDepth*/) { return nullptr; } + size_t /*inclusionDepth*/) { return NULL; } // For the "local"-only aspect of a "" include. Should not search in the // "system" paths, because on returning a failure, the parser will // call includeSystem() to look in the "system" locations. virtual IncludeResult* includeLocal(const char* /*headerName*/, const char* /*includerName*/, - size_t /*inclusionDepth*/) { return nullptr; } + size_t /*inclusionDepth*/) { return NULL; } // Signals that the parser will no longer use the contents of the // specified IncludeResult.