mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-31 00:15:55 -04:00
Revert "Revert "newer standards prefer nullptr over NULL - this is most of them but there are others too""
This reverts commit 8e2160f33e.
This commit is contained in:
@@ -245,7 +245,7 @@ void DataTableTool::createOutputDirectoryForFile(const std::string & fileName)
|
||||
|
||||
std::string directoryName(fileName, 0, slashPos);
|
||||
#if defined(PLATFORM_WIN32)
|
||||
int result = CreateDirectory(directoryName.c_str(), NULL);
|
||||
int result = CreateDirectory(directoryName.c_str(), nullptr);
|
||||
#elif defined(PLATFORM_LINUX)
|
||||
// make sure slashes are forward
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ static const int SUBMIT_NO_FILE_ERR = 17; // need to add file before submitting
|
||||
// virtual ~MyPerforceUser() {}
|
||||
// virtual void HandleError( Error *err )
|
||||
// {
|
||||
// if (err != NULL && err->Test())
|
||||
// if (err != nullptr && err->Test())
|
||||
// {
|
||||
// m_errorOccurred = true;
|
||||
// m_lastError = err->GetGeneric();
|
||||
@@ -154,7 +154,7 @@ int generateTemplate(File &definitionFp, File &templateFp)
|
||||
|
||||
// we now need to move down the template definition heiarchy and write the
|
||||
// parameters of the base class
|
||||
Filename basename(NULL, definitionFp.getFilename().getPath().c_str(),
|
||||
Filename basename(nullptr, definitionFp.getFilename().getPath().c_str(),
|
||||
TemplateDefinitionFile.getBaseFilename().c_str(), TEMPLATE_DEFINITION_EXTENSION);
|
||||
if (basename.getName().size() == 0)
|
||||
return 0;
|
||||
@@ -185,8 +185,8 @@ int generateTemplate(File &definitionFp, File &templateFp)
|
||||
int generateTemplate(const char *definitionFile, const char *templateFile)
|
||||
{
|
||||
// check filename extensions
|
||||
Filename defFile(NULL, NULL, definitionFile, TEMPLATE_DEFINITION_EXTENSION);
|
||||
Filename temFile(NULL, NULL, templateFile, TEMPLATE_EXTENSION);
|
||||
Filename defFile(nullptr, nullptr, definitionFile, TEMPLATE_DEFINITION_EXTENSION);
|
||||
Filename temFile(nullptr, nullptr, templateFile, TEMPLATE_EXTENSION);
|
||||
|
||||
File definitionFp;
|
||||
int i = 0;
|
||||
@@ -231,8 +231,8 @@ int generateTemplate(const char *definitionFile, const char *templateFile)
|
||||
int deriveTemplate(const char *baseFile, const char *templateFile)
|
||||
{
|
||||
// check filename extensions
|
||||
Filename basFile(NULL, NULL, baseFile, TEMPLATE_EXTENSION);
|
||||
Filename temFile(NULL, NULL, templateFile, TEMPLATE_EXTENSION);
|
||||
Filename basFile(nullptr, nullptr, baseFile, TEMPLATE_EXTENSION);
|
||||
Filename temFile(nullptr, nullptr, templateFile, TEMPLATE_EXTENSION);
|
||||
|
||||
File basFp;
|
||||
if (!basFp.open(basFile, "rt"))
|
||||
@@ -263,7 +263,7 @@ int compileTemplate(const char *filename)
|
||||
{
|
||||
TpfFile templateFile;
|
||||
|
||||
Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
return templateFile.makeIffFiles(templateFileName);
|
||||
} // compileTemplate
|
||||
|
||||
@@ -279,7 +279,7 @@ int verifyTemplate(const char *filename)
|
||||
TpfFile templateFile;
|
||||
|
||||
printf("Verifying %s: ", filename);
|
||||
Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
int result = templateFile.loadTemplate(templateFileName);
|
||||
if (result == 0)
|
||||
printf("file ok");
|
||||
@@ -299,7 +299,7 @@ int updateTemplate(const char *filename)
|
||||
{
|
||||
TpfFile templateFile;
|
||||
|
||||
Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
return templateFile.updateTemplate(templateFileName);
|
||||
} // updateTemplate
|
||||
*/
|
||||
@@ -317,7 +317,7 @@ TpfFile templateFile;
|
||||
//Error e;
|
||||
//
|
||||
// // check filename extensions
|
||||
// Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
// Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
// Filename iffFileName = templateFileName;
|
||||
// iffFileName.setExtension(IFF_EXTENSION);
|
||||
//
|
||||
@@ -345,7 +345,7 @@ TpfFile templateFile;
|
||||
// IGNORE_RETURN(templateFile.loadTemplate(templateFileName));
|
||||
//
|
||||
// // check out the client template iff file
|
||||
// Filename iffName(NULL, templateFile.getIffPath().c_str(), iffFileName, IFF_EXTENSION);
|
||||
// Filename iffName(nullptr, templateFile.getIffPath().c_str(), iffFileName, IFF_EXTENSION);
|
||||
// commands[1] = iffName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
// client.Run( commands[0], &ui );
|
||||
@@ -370,7 +370,7 @@ TpfFile templateFile;
|
||||
//Error e;
|
||||
//
|
||||
// // check filename extensions
|
||||
// Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
// Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
// Filename iffFileName = templateFileName;
|
||||
// iffFileName.setExtension(IFF_EXTENSION);
|
||||
//
|
||||
@@ -424,7 +424,7 @@ TpfFile templateFile;
|
||||
// return -1;
|
||||
//
|
||||
// // add the client iff file
|
||||
// Filename iffName(NULL, templateFile.getIffPath().c_str(), iffFileName, NULL);
|
||||
// Filename iffName(nullptr, templateFile.getIffPath().c_str(), iffFileName, nullptr);
|
||||
// commands[1] = iffName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
// client.Run( commands[0], &ui );
|
||||
@@ -591,7 +591,7 @@ int main(int argc, char *argv[ ])
|
||||
SetupSharedFoundation::Data data(SetupSharedFoundation::Data::D_console);
|
||||
#ifdef WIN32
|
||||
char buffer[1024];
|
||||
GetModuleFileName(GetModuleHandle(NULL), buffer, 1024);
|
||||
GetModuleFileName(GetModuleHandle(nullptr), buffer, 1024);
|
||||
Filename configName;
|
||||
configName.setName(buffer);
|
||||
configName.setName("templateCompiler.cfg");
|
||||
@@ -607,7 +607,7 @@ int main(int argc, char *argv[ ])
|
||||
|
||||
// setup the random number generator
|
||||
// @todo need a better seed
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(NULL)));
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(nullptr)));
|
||||
|
||||
// install templates
|
||||
SetupSharedTemplate::install();
|
||||
|
||||
+13
-13
@@ -30,7 +30,7 @@
|
||||
//==============================================================================
|
||||
// file variables
|
||||
|
||||
const TemplateData *currentTemplateData = NULL;
|
||||
const TemplateData *currentTemplateData = nullptr;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
@@ -118,7 +118,7 @@ File fp;
|
||||
return;
|
||||
|
||||
File temp_fp;
|
||||
if (!temp_fp.open(tmpnam(NULL), "wt"))
|
||||
if (!temp_fp.open(tmpnam(nullptr), "wt"))
|
||||
{
|
||||
fprintf(stderr, "error opening temp file for template header "
|
||||
"replacement [%s]\n", temp_fp.getFilename().getFullFilename().c_str());
|
||||
@@ -244,7 +244,7 @@ int result;
|
||||
}
|
||||
|
||||
File temp_fp;
|
||||
if (!temp_fp.open(tmpnam(NULL), "wt"))
|
||||
if (!temp_fp.open(tmpnam(nullptr), "wt"))
|
||||
{
|
||||
fprintf(stderr, "error opening temp file for template source "
|
||||
"replacement [%s]\n", temp_fp.getFilename().getFullFilename().c_str());
|
||||
@@ -337,8 +337,8 @@ int result;
|
||||
// std::string oldTemplateName = tdfFile.getTemplateName();
|
||||
// std::string oldBaseName = tdfFile.getBaseName();
|
||||
|
||||
Filename fullName(NULL, path.getPath().c_str(), tdfFile.getTemplateName().c_str(),
|
||||
NULL);
|
||||
Filename fullName(nullptr, path.getPath().c_str(), tdfFile.getTemplateName().c_str(),
|
||||
nullptr);
|
||||
|
||||
writeTemplateHeader(tdfFile, fullName);
|
||||
result = writeTemplateSource(tdfFile, fullName);
|
||||
@@ -397,7 +397,7 @@ TemplateDefinitionFile tdfFile;
|
||||
//Error e;
|
||||
//
|
||||
// // check filename extensions
|
||||
// Filename templateFileName(NULL, NULL, filename, TEMPLATE_DEFINITION_EXTENSION);
|
||||
// Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_DEFINITION_EXTENSION);
|
||||
//
|
||||
// // Connect to Perforce server
|
||||
// client.Init( &e );
|
||||
@@ -433,7 +433,7 @@ TemplateDefinitionFile tdfFile;
|
||||
// if (tdfFile.getPath().getFullFilename().size() != 0)
|
||||
// {
|
||||
// // check out the source files
|
||||
// Filename sourceName(NULL, tdfFile.getPath().getPath().c_str(),
|
||||
// Filename sourceName(nullptr, tdfFile.getPath().getPath().c_str(),
|
||||
// tdfFile.getTemplateName().c_str(), "cpp");
|
||||
// commands[1] = sourceName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
@@ -453,7 +453,7 @@ TemplateDefinitionFile tdfFile;
|
||||
// std::string compilerFilename;
|
||||
// compilerFilename = EnumLocationTypes[tdfFile.getTemplateLocation()] +
|
||||
// filenameLowerToUpper(templateFileName.getName());
|
||||
// Filename compilerName(NULL, tdfFile.getCompilerPath().getPath().c_str(),
|
||||
// Filename compilerName(nullptr, tdfFile.getCompilerPath().getPath().c_str(),
|
||||
// tdfFile.getTemplateName().c_str(), "cpp");
|
||||
// commands[1] = compilerName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
@@ -485,7 +485,7 @@ TemplateDefinitionFile tdfFile;
|
||||
//Error e;
|
||||
//
|
||||
// // check filename extensions
|
||||
// Filename templateFileName(NULL, NULL, filename, TEMPLATE_DEFINITION_EXTENSION);
|
||||
// Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_DEFINITION_EXTENSION);
|
||||
//
|
||||
// // find the client and server paths
|
||||
// File fp(templateFileName, "rt");
|
||||
@@ -546,7 +546,7 @@ TemplateDefinitionFile tdfFile;
|
||||
// if (tdfFile.getPath().getFullFilename().size() != 0)
|
||||
// {
|
||||
// // check in the source files
|
||||
// Filename sourceName(NULL, tdfFile.getPath().getPath().c_str(),
|
||||
// Filename sourceName(nullptr, tdfFile.getPath().getPath().c_str(),
|
||||
// tdfFile.getTemplateName().c_str(), "cpp");
|
||||
// commands[1] = sourceName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
@@ -563,7 +563,7 @@ TemplateDefinitionFile tdfFile;
|
||||
// if (tdfFile.getCompilerPath().getFullFilename().size() != 0)
|
||||
// {
|
||||
// // check in the compiler source files
|
||||
// Filename compilerName(NULL, tdfFile.getCompilerPath().getPath().c_str(),
|
||||
// Filename compilerName(nullptr, tdfFile.getCompilerPath().getPath().c_str(),
|
||||
// tdfFile.getTemplateName().c_str(), "cpp");
|
||||
// commands[1] = compilerName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
@@ -669,7 +669,7 @@ int main(int argc, char *argv[ ])
|
||||
SetupSharedFoundation::Data data(SetupSharedFoundation::Data::D_console);
|
||||
#ifdef WIN32
|
||||
char buffer[1024];
|
||||
GetModuleFileName(GetModuleHandle(NULL), buffer, 1024);
|
||||
GetModuleFileName(GetModuleHandle(nullptr), buffer, 1024);
|
||||
Filename configName;
|
||||
configName.setName(buffer);
|
||||
configName.setName("templateCompiler.cfg");
|
||||
@@ -685,7 +685,7 @@ int main(int argc, char *argv[ ])
|
||||
|
||||
// setup the random number generator
|
||||
// @todo need a better seed
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(NULL)));
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(nullptr)));
|
||||
|
||||
int result = processArgs(argc, argv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user