refactor(Core): apply clang-tidy modernize-use-nullptr (#3819)

This commit is contained in:
Francesco Borzì
2020-12-06 20:55:11 +01:00
committed by GitHub
parent 161302252e
commit cba126fa84
40 changed files with 127 additions and 127 deletions

View File

@@ -12,7 +12,7 @@
#include <algorithm>
#include <cstdio>
Model::Model(std::string& filename) : filename(filename), vertices(0), indices(0)
Model::Model(std::string& filename) : filename(filename), vertices(nullptr), indices(nullptr)
{
memset(&header, 0, sizeof(header));
}

View File

@@ -50,7 +50,7 @@ void MPQArchive::close()
MPQFile::MPQFile(const char* filename):
eof(false),
buffer(0),
buffer(nullptr),
pointer(0),
size(0)
{
@@ -68,7 +68,7 @@ MPQFile::MPQFile(const char* filename):
{
// printf("info: file %s has size %d; considered dummy file.\n", filename, size);
eof = true;
buffer = 0;
buffer = nullptr;
return;
}
buffer = new char[size];
@@ -80,7 +80,7 @@ MPQFile::MPQFile(const char* filename):
}
eof = true;
buffer = 0;
buffer = nullptr;
}
size_t MPQFile::read(void* dest, size_t bytes)
@@ -116,6 +116,6 @@ void MPQFile::seekRelative(int offset)
void MPQFile::close()
{
delete[] buffer;
buffer = 0;
buffer = nullptr;
eof = true;
}

View File

@@ -53,7 +53,7 @@ typedef struct
} map_id;
map_id* map_ids;
uint16* LiqType = 0;
uint16* LiqType = nullptr;
uint32 map_count;
char output_path[128] = ".";
char input_path[1024] = ".";

View File

@@ -125,8 +125,8 @@ bool WMORoot::ConvertToVMAPRootWmo(FILE* pOutfile)
}
WMOGroup::WMOGroup(const std::string& filename) :
filename(filename), MOPY(0), MOVI(0), MoviEx(0), MOVT(0), MOBA(0), MobaEx(0),
hlq(0), LiquEx(0), LiquBytes(0), groupName(0), descGroupName(0), mogpFlags(0),
filename(filename), MOPY(nullptr), MOVI(nullptr), MoviEx(nullptr), MOVT(nullptr), MOBA(nullptr), MobaEx(nullptr),
hlq(nullptr), LiquEx(nullptr), LiquBytes(nullptr), groupName(0), descGroupName(0), mogpFlags(0),
moprIdx(0), moprNItems(0), nBatchA(0), nBatchB(0), nBatchC(0), fogIdx(0),
liquidType(0), groupWMOID(0), mopy_size(0), moba_size(0), LiquEx_size(0),
nVertices(0), nTriangles(0), liquflags(0)