Use nullptr where possible instead of NULL or 0

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

View file

@ -9615,7 +9615,7 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector<unsigned int>&
{
TIntermNode* root = intermediate.getTreeRoot();
if (root == 0)
if (root == nullptr)
return;
SpvOptions defaultOptions;

View file

@ -71,9 +71,9 @@ Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogg
addressModel(AddressingModelLogical),
memoryModel(MemoryModelGLSL450),
builderNumber(magicNumber),
buildPoint(0),
buildPoint(nullptr),
uniqueId(0),
entryPointFunction(0),
entryPointFunction(nullptr),
generatingOpCodeForSpecConst(false),
logger(buildLogger)
{
@ -1675,7 +1675,7 @@ Id Builder::importNonSemanticShaderDebugInfoInstructions()
Id Builder::findCompositeConstant(Op typeClass, Id typeId, const std::vector<Id>& comps)
{
Instruction* constant = 0;
Instruction* constant = nullptr;
bool found = false;
for (int i = 0; i < (int)groupedConstants[typeClass].size(); ++i) {
constant = groupedConstants[typeClass][i];
@ -1702,7 +1702,7 @@ Id Builder::findCompositeConstant(Op typeClass, Id typeId, const std::vector<Id>
Id Builder::findStructConstant(Id typeId, const std::vector<Id>& comps)
{
Instruction* constant = 0;
Instruction* constant = nullptr;
bool found = false;
for (int i = 0; i < (int)groupedStructConstants[typeId].size(); ++i) {
constant = groupedStructConstants[typeId][i];
@ -3332,7 +3332,7 @@ Builder::If::If(Id cond, unsigned int ctrl, Builder& gb) :
builder(gb),
condition(cond),
control(ctrl),
elseBlock(0)
elseBlock(nullptr)
{
function = &builder.getBuildPoint()->getParent();

View file

@ -414,7 +414,7 @@ public:
// The returned pointer is only valid for the lifetime of this builder.
Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name,
const std::vector<Id>& paramTypes, const std::vector<char const*>& paramNames,
const std::vector<std::vector<Decoration>>& precisions, Block **entry = 0);
const std::vector<std::vector<Decoration>>& precisions, Block **entry = nullptr);
// Create a return. An 'implicit' return is one not appearing in the source
// code. In the case of an implicit return, no post-return block is inserted.

View file

@ -1607,7 +1607,7 @@ void Parameterize()
DecorationOperands[DecorationInputAttachmentIndex].push(OperandLiteralNumber, "'Attachment Index'");
DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'");
OperandClassParams[OperandSource].set(0, SourceString, 0);
OperandClassParams[OperandSource].set(0, SourceString, nullptr);
OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, nullptr);
OperandClassParams[OperandAddressing].set(0, AddressingString, nullptr);
OperandClassParams[OperandMemory].set(0, MemoryString, nullptr);
@ -1639,7 +1639,7 @@ void Parameterize()
OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr);
OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true);
OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr);
OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, 0);
OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, nullptr);
// set name of operator, an initial set of <id> style operands, and the description

View file

@ -190,7 +190,7 @@ protected:
// Parameterize an enumerant
class EnumParameters {
public:
EnumParameters() : desc(0) { }
EnumParameters() : desc(nullptr) { }
const char* desc;
};
@ -198,7 +198,7 @@ public:
class EnumDefinition : public EnumParameters {
public:
EnumDefinition() :
ceiling(0), bitmask(false), getName(0), enumParams(0), operandParams(0) { }
ceiling(0), bitmask(false), getName(nullptr), enumParams(nullptr), operandParams(nullptr) { }
void set(int ceil, const char* (*name)(int), EnumParameters* ep, bool mask = false)
{
ceiling = ceil;