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:
DarthArgus
2016-02-11 21:19:18 -06:00
parent 8e2160f33e
commit dd9db6d350
937 changed files with 14983 additions and 14983 deletions
@@ -19,7 +19,7 @@
// File static variables
Filename File::m_basePath;
File::FunctionPtr File::m_callBack = NULL;
File::FunctionPtr File::m_callBack = nullptr;
//========================================================================
// File functions
@@ -49,7 +49,7 @@ bool File::open(const char *filename, const char *mode)
// @todo: find an equivalent function for Linux
m_fp = fopen(m_filename, mode);
#endif
if (m_fp != NULL)
if (m_fp != nullptr)
{
m_currentLine = 0;
return true;
@@ -57,7 +57,7 @@ bool File::open(const char *filename, const char *mode)
else
{
const char * errstr = strerror(errno);
if (errstr != NULL)
if (errstr != nullptr)
{
m_filename.clear();
printError(errstr);
@@ -75,7 +75,7 @@ bool File::open(const char *filename, const char *mode)
*/
bool File::exists(const char *filename)
{
if (filename == NULL)
if (filename == nullptr)
return false;
#if defined(WIN32)
@@ -110,7 +110,7 @@ int File::readRawLine(char *buffer, int bufferSize)
NOT_NULL(buffer);
++m_currentLine;
if (fgets(buffer, bufferSize, m_fp) == NULL)
if (fgets(buffer, bufferSize, m_fp) == nullptr)
{
if (feof(m_fp))
return -1;
@@ -149,7 +149,7 @@ int File::readLine(char *buffer, int bufferSize)
for (;;)
{
++m_currentLine;
if (fgets(buffer, bufferSize, m_fp) == NULL)
if (fgets(buffer, bufferSize, m_fp) == nullptr)
{
if (feof(m_fp))
return -1;
@@ -54,13 +54,13 @@ private:
inline File::File(void) :
m_fp(NULL),
m_fp(nullptr),
m_currentLine(0)
{
} // File::File(void)
inline File::File(const char *filename, const char *mode) :
m_fp(NULL),
m_fp(nullptr),
m_currentLine(0)
{
open(filename, mode);
@@ -83,15 +83,15 @@ inline const Filename & File::getFilename(void) const
inline bool File::isOpened(void) const
{
return (m_fp != NULL);
return (m_fp != nullptr);
} // File::isOpened
inline void File::close(void)
{
if (m_fp != NULL)
if (m_fp != nullptr)
{
fclose(m_fp);
m_fp = NULL;
m_fp = nullptr;
}
} // File::close
@@ -110,7 +110,7 @@ inline void File::printWarning(const char *buffer) const
fprintf(stderr, "%s", error);
if (m_callBack != NULL)
if (m_callBack != nullptr)
{
m_callBack(error);
}
@@ -125,7 +125,7 @@ inline void File::printError(const char *buffer) const
fprintf(stderr, "%s", error);
if (m_callBack != NULL)
if (m_callBack != nullptr)
{
m_callBack(error);
}
@@ -39,7 +39,7 @@ const char PATH_SEPARATOR = LINUX_PATH_SEPARATOR;
*/
void Filename::setPath(const char *path)
{
if (path == NULL || *path == '\0')
if (path == nullptr || *path == '\0')
m_path.clear();
else
{
@@ -69,7 +69,7 @@ void Filename::setPath(const char *path)
*/
void Filename::setName(const char *name)
{
if (name == NULL || *name == '\0')
if (name == nullptr || *name == '\0')
m_name.clear();
else
{
@@ -85,7 +85,7 @@ void Filename::setName(const char *name)
const char *dot = strrchr(localname.c_str(), '.');
const char *firstSeparator = strchr(localname.c_str(), PATH_SEPARATOR);
const char *lastSeparator = strrchr(localname.c_str(), PATH_SEPARATOR);
if (firstSeparator != NULL)
if (firstSeparator != nullptr)
{
// name has a path
if (firstSeparator == localname)
@@ -100,11 +100,11 @@ void Filename::setName(const char *name)
localname.c_str() + 1);
}
}
if (dot != NULL && (lastSeparator == NULL || dot > lastSeparator))
if (dot != nullptr && (lastSeparator == nullptr || dot > lastSeparator))
{
// name has an extension
setExtension(dot);
if (lastSeparator == NULL)
if (lastSeparator == nullptr)
m_name = std::string(localname.c_str(), dot - localname.c_str());
else
m_name = std::string(lastSeparator + 1, dot - (lastSeparator + 1));
@@ -112,7 +112,7 @@ void Filename::setName(const char *name)
else
{
// name doesn't have an extension
if (lastSeparator == NULL)
if (lastSeparator == nullptr)
m_name = localname;
else
m_name = std::string(lastSeparator + 1);
@@ -129,7 +129,7 @@ void Filename::setName(const char *name)
*/
void Filename::setExtension(const char *extension)
{
if (extension == NULL || *extension == '\0')
if (extension == nullptr || *extension == '\0')
m_extension.clear();
else
{
@@ -253,7 +253,7 @@ static const std::string PATH_SEPARATOR_STRING(PATH_SEPARATOR_BUFF);
*/
void Filename::setDrive(const char *drive)
{
if (drive != NULL && isalpha(*drive))
if (drive != nullptr && isalpha(*drive))
m_drive = std::string(drive, 1) + ":";
else
m_drive.clear();
@@ -273,7 +273,7 @@ std::string path;
#if defined(WIN32)
char *pathBuf;
DWORD bufsize = GetFullPathName(getFullFilename().c_str(), 0, NULL, NULL);
DWORD bufsize = GetFullPathName(getFullFilename().c_str(), 0, nullptr, nullptr);
if (bufsize != 0)
{
pathBuf = new char[bufsize + 1];
@@ -285,7 +285,7 @@ std::string path;
}
#elif defined(linux)
char pathBuf[PATH_MAX];
if (getcwd(pathBuf, PATH_MAX) != NULL)
if (getcwd(pathBuf, PATH_MAX) != nullptr)
{
strcat(pathBuf, "/");
strcat(pathBuf, getFullFilename().c_str());
@@ -306,19 +306,19 @@ void Filename::verifyAndCreatePath(void) const
#if defined(WIN32)
if (WindowsUnicode)
{
char *buffer = NULL;
char *buffer = nullptr;
DWORD buflen;
// get our current path
buflen = GetFullPathName(".", 0, buffer, NULL);
buflen = GetFullPathName(".", 0, buffer, nullptr);
buffer = new char[buflen + 1];
buflen = GetFullPathName(".", buflen + 1, buffer, NULL);
buflen = GetFullPathName(".", buflen + 1, buffer, nullptr);
Unicode::String srcPath = Unicode::narrowToWide(buffer);
delete[] buffer;
// get the destination path
std::string correctPath(getDrive() + getPath());
buflen = GetFullPathName(correctPath.c_str(), 0, buffer, NULL);
buflen = GetFullPathName(correctPath.c_str(), 0, buffer, nullptr);
buffer = new char[buflen + 1];
buflen = GetFullPathName(correctPath.c_str(), buflen + 1, buffer, NULL);
buflen = GetFullPathName(correctPath.c_str(), buflen + 1, buffer, nullptr);
Unicode::String destPath = Unicode::narrowToWide(buffer);
delete[] buffer;
@@ -335,7 +335,7 @@ void Filename::verifyAndCreatePath(void) const
destPath += splitDestPath[i];
if (SetCurrentDirectoryW((LPCWSTR)destPath.c_str()) == 0)
{
if (CreateDirectoryW((LPCWSTR)destPath.c_str(), NULL) == 0)
if (CreateDirectoryW((LPCWSTR)destPath.c_str(), nullptr) == 0)
return;
if (SetCurrentDirectoryW((LPCWSTR)destPath.c_str()) == 0)
return;
@@ -347,19 +347,19 @@ void Filename::verifyAndCreatePath(void) const
}
else
{
char *buffer = NULL;
char *buffer = nullptr;
DWORD buflen;
// get our current path
buflen = GetFullPathName(".", 0, buffer, NULL);
buflen = GetFullPathName(".", 0, buffer, nullptr);
buffer = new char[buflen + 1];
buflen = GetFullPathName(".", buflen + 1, buffer, NULL);
buflen = GetFullPathName(".", buflen + 1, buffer, nullptr);
std::string srcPath = buffer;
delete[] buffer;
// get the destination path
std::string correctPath(getDrive() + getPath());
buflen = GetFullPathName(correctPath.c_str(), 0, buffer, NULL);
buflen = GetFullPathName(correctPath.c_str(), 0, buffer, nullptr);
buffer = new char[buflen + 1];
buflen = GetFullPathName(correctPath.c_str(), buflen + 1, buffer, NULL);
buflen = GetFullPathName(correctPath.c_str(), buflen + 1, buffer, nullptr);
std::string destPath = buffer;
delete[] buffer;
@@ -378,7 +378,7 @@ void Filename::verifyAndCreatePath(void) const
destPath += splitDestPath[i];
if (SetCurrentDirectory(destPath.c_str()) == 0)
{
if (CreateDirectory(destPath.c_str(), NULL) == 0)
if (CreateDirectory(destPath.c_str(), nullptr) == 0)
return;
if (SetCurrentDirectory(destPath.c_str()) == 0)
return;
@@ -57,13 +57,13 @@ inline Filename::Filename(void)
inline Filename::Filename(const char *drive, const char *path, const char *name, const char *extension)
{
if (drive != NULL)
if (drive != nullptr)
setDrive(drive);
if (path != NULL)
if (path != nullptr)
setPath(path);
if (name != NULL)
if (name != nullptr)
setName(name);
if (extension != NULL)
if (extension != nullptr)
setExtension(extension);
} // Filename::Filename
@@ -115,7 +115,7 @@ inline void Filename::makeFullPath(void)
//========================================================================
const Filename NEXT_HIGHER_PATH(NULL, "..", NULL, NULL);
const Filename NEXT_HIGHER_PATH(nullptr, "..", nullptr, nullptr);
#endif // _INCLUDED_Filename_H
@@ -16,8 +16,8 @@
//-----------------------------------------------------------------
template <> ObjectTemplateList::CreateDataResourceMap *ObjectTemplateList::ms_bindings = NULL;
template <> ObjectTemplateList::LoadedDataResourceMap *ObjectTemplateList::ms_loaded = NULL;
template <> ObjectTemplateList::CreateDataResourceMap *ObjectTemplateList::ms_bindings = nullptr;
template <> ObjectTemplateList::LoadedDataResourceMap *ObjectTemplateList::ms_loaded = nullptr;
// ======================================================================
@@ -40,10 +40,10 @@ ObjectTemplate::ObjectTemplate(const std::string & filename) :
ObjectTemplate::~ObjectTemplate(void)
{
if (m_baseData != NULL)
if (m_baseData != nullptr)
{
m_baseData->releaseReference();
m_baseData = NULL;
m_baseData = nullptr;
}
}
@@ -63,7 +63,7 @@ void ObjectTemplate::load(Iff &iff)
*/
void ObjectTemplate::addReference(void) const
{
if (m_baseData != NULL)
if (m_baseData != nullptr)
m_baseData->addReference();
DataResource::addReference();
@@ -76,7 +76,7 @@ void ObjectTemplate::addReference(void) const
*/
void ObjectTemplate::releaseReference(void) const
{
if (m_baseData != NULL)
if (m_baseData != nullptr)
m_baseData->releaseReference();
DataResource::releaseReference();
File diff suppressed because it is too large Load Diff
@@ -238,11 +238,11 @@ inline bool TemplateData::isWritingForCompiler(void) const
inline const TemplateDefinitionFile * TemplateData::getFileParent(void) const
{
if (m_fileParent != NULL)
if (m_fileParent != nullptr)
return m_fileParent;
if (m_templateParent != NULL)
if (m_templateParent != nullptr)
return m_templateParent->getFileParent();
return NULL;
return nullptr;
} // TemplateData::getFileParent
@@ -25,7 +25,7 @@
//-----------------------------------------------------------------------------
TemplateDataIterator::TemplateDataIterator()
: m_templateDataToIterate(NULL),
: m_templateDataToIterate(nullptr),
m_numItems(0),
m_noMoreData(true)
{
@@ -34,7 +34,7 @@ TemplateDataIterator::TemplateDataIterator()
//-----------------------------------------------------------------------------
TemplateDataIterator::TemplateDataIterator(const TemplateData& templateData)
: m_templateDataToIterate(NULL),
: m_templateDataToIterate(nullptr),
m_numItems(0),
m_noMoreData(true)
{
@@ -45,7 +45,7 @@ TemplateDataIterator::TemplateDataIterator(const TemplateData& templateData)
TemplateDataIterator::~TemplateDataIterator()
{
m_templateDataToIterate = NULL;
m_templateDataToIterate = nullptr;
}
//-----------------------------------------------------------------------------
@@ -62,7 +62,7 @@ TemplateDataIterator::setTo(const TemplateData &templateData)
// .. end at the child TDF's.
const ParameterList* parameterListToAdd;
while(m_templateDataToIterate != NULL)
while(m_templateDataToIterate != nullptr)
{
parameterListToAdd = &(m_templateDataToIterate->m_parameters);
m_numItems += parameterListToAdd->size();
@@ -75,23 +75,23 @@ TemplateDataIterator::setTo(const TemplateData &templateData)
}
// Get the template data from the parent TDF
if(m_templateDataToIterate->m_fileParent != NULL)
if(m_templateDataToIterate->m_fileParent != nullptr)
{
const TemplateDefinitionFile* parentFile =
m_templateDataToIterate->m_fileParent->getBaseDefinitionFile();
if(parentFile != NULL)
if(parentFile != nullptr)
{
m_templateDataToIterate = parentFile->getTemplateData(parentFile->getHighestVersion());
}
else
{
m_templateDataToIterate = NULL;
m_templateDataToIterate = nullptr;
}
}
else
{
m_templateDataToIterate = NULL;
m_templateDataToIterate = nullptr;
}
}
@@ -164,7 +164,7 @@ TemplateDataIterator::operator *() const
{
if(this->end())
{
return NULL;
return nullptr;
}
else
{
@@ -20,9 +20,9 @@
* Class constructor.
*/
TemplateDefinitionFile::TemplateDefinitionFile(void) :
m_baseDefinitionFile(NULL),
m_baseDefinitionFile(nullptr),
m_writeForCompilerFlag(false),
m_filterCompiledRegex(NULL)
m_filterCompiledRegex(nullptr)
{
cleanup();
} // TemplateDefinitionFile::TemplateDefinitionFile
@@ -51,24 +51,24 @@ void TemplateDefinitionFile::cleanup(void)
m_compilerPath.clear();
m_fileComments.clear();
if (m_baseDefinitionFile != NULL)
if (m_baseDefinitionFile != nullptr)
{
delete m_baseDefinitionFile;
m_baseDefinitionFile = NULL;
m_baseDefinitionFile = nullptr;
}
std::map<int, TemplateData *>::iterator iter;
for (iter = m_templateMap.begin(); iter != m_templateMap.end(); ++iter)
{
delete (*iter).second;
(*iter).second = NULL;
(*iter).second = nullptr;
}
m_templateMap.clear();
if (m_filterCompiledRegex != NULL)
if (m_filterCompiledRegex != nullptr)
{
RegexServices::freeMemory(m_filterCompiledRegex);
m_filterCompiledRegex = NULL;
m_filterCompiledRegex = nullptr;
}
} // TemplateDefinitionFile::cleanup
@@ -104,7 +104,7 @@ static const std::string wildcard = "*";
if (!m_templateNameFilter.empty())
return m_templateNameFilter;
if (m_baseDefinitionFile != NULL)
if (m_baseDefinitionFile != nullptr)
return m_baseDefinitionFile->getTemplateNameFilter();
return wildcard;
@@ -121,7 +121,7 @@ bool TemplateDefinitionFile::isValidTemplateName(const Filename & name) const
{
if (m_templateNameFilter.empty())
{
if (m_baseDefinitionFile != NULL)
if (m_baseDefinitionFile != nullptr)
return m_baseDefinitionFile->isValidTemplateName(name);
else
return true;
@@ -131,7 +131,7 @@ bool TemplateDefinitionFile::isValidTemplateName(const Filename & name) const
int const matchDataElementCount = maxCaptureCount * 3;
int matchData[matchDataElementCount];
int const matchCode = pcre_exec(m_filterCompiledRegex, NULL, name.getName().c_str(), name.getName().length(), 0, 0, matchData, matchDataElementCount);
int const matchCode = pcre_exec(m_filterCompiledRegex, nullptr, name.getName().c_str(), name.getName().length(), 0, 0, matchData, matchDataElementCount);
bool const result = (matchCode >= 0);
if (matchCode < -1)
@@ -425,10 +425,10 @@ void TemplateDefinitionFile::writeClassSourceBegin(File &fp, const TemplateData
fp.print(" */\n");
fp.print("Tag %s::getHighestTemplateVersion(void) const\n", name);
fp.print("{\n");
fp.print("\tif (m_baseData == NULL)\n");
fp.print("\tif (m_baseData == nullptr)\n");
fp.print("\t\treturn m_templateVersion;\n");
fp.print("\tconst %s * base = dynamic_cast<const %s *>(m_baseData);\n", name, name);
fp.print("\tif (base == NULL)\n");
fp.print("\tif (base == nullptr)\n");
fp.print("\t\treturn m_templateVersion;\n");
fp.print("\treturn std::max(m_templateVersion, base->getHighestTemplateVersion());\n");
fp.print("} // %s::getHighestTemplateVersion\n", name);
@@ -449,7 +449,7 @@ static const int BUFFER_SIZE = 1024;
int lineLen;
char buffer[BUFFER_SIZE];
char token[BUFFER_SIZE];
TemplateData *currentTemplate = NULL;
TemplateData *currentTemplate = nullptr;
cleanup();
@@ -510,7 +510,7 @@ TemplateData *currentTemplate = NULL;
currentTemplate = new TemplateData(version, *this);
m_templateMap[version] = currentTemplate;
}
else if (currentTemplate != NULL)
else if (currentTemplate != nullptr)
{
line = currentTemplate->parseLine(fp, buffer, token);
if (line == CHAR_ERROR)
@@ -540,7 +540,7 @@ TemplateData *currentTemplate = NULL;
fp.printError("unable to open base template definition");
return -1;
}
if (m_baseDefinitionFile == NULL)
if (m_baseDefinitionFile == nullptr)
m_baseDefinitionFile = new TemplateDefinitionFile;
else
m_baseDefinitionFile->cleanup();
@@ -570,19 +570,19 @@ TemplateData *currentTemplate = NULL;
m_templateNameFilter = token;
//-- Attempt to compile the regex.
if (m_filterCompiledRegex != NULL)
if (m_filterCompiledRegex != nullptr)
{
// First free the existing compiled regex.
RegexServices::freeMemory(m_filterCompiledRegex);
m_filterCompiledRegex = NULL;
m_filterCompiledRegex = nullptr;
}
//-- Compile the new regex.
char const *errorString = NULL;
char const *errorString = nullptr;
int errorOffset = 0;
m_filterCompiledRegex = pcre_compile(m_templateNameFilter.c_str(), 0, &errorString, &errorOffset, NULL);
WARNING(m_filterCompiledRegex == NULL, ("TemplateDefinitionFile::parse(): pcre_compile() failed, error=[%s], errorOffset=[%d], regex text=[%s].", errorString, errorOffset, m_templateNameFilter.c_str()));
m_filterCompiledRegex = pcre_compile(m_templateNameFilter.c_str(), 0, &errorString, &errorOffset, nullptr);
WARNING(m_filterCompiledRegex == nullptr, ("TemplateDefinitionFile::parse(): pcre_compile() failed, error=[%s], errorOffset=[%d], regex text=[%s].", errorString, errorOffset, m_templateNameFilter.c_str()));
}
else if (strcmp(token, "clientpath") == 0 ||
strcmp(token, "serverpath") == 0 ||
@@ -111,7 +111,7 @@ inline TemplateData *TemplateDefinitionFile::getTemplateData(int version) const
{
std::map<int, TemplateData *>::const_iterator iter = m_templateMap.find(version);
if (iter == m_templateMap.end())
return NULL;
return nullptr;
return (*iter).second;
}
@@ -57,15 +57,15 @@ int strip(char *buffer)
* the size of buffer
*
* @return the next non-whitespace character in the string after the token, or
* NULL if the end of line has been reached
* nullptr if the end of line has been reached
*/
const char *getNextWhitespaceToken(const char *buffer, char *token)
{
NOT_NULL(token);
*token = '\0';
if (buffer == NULL)
return NULL;
if (buffer == nullptr)
return nullptr;
const char *from = buffer;
char *to = token;
@@ -74,7 +74,7 @@ const char *getNextWhitespaceToken(const char *buffer, char *token)
while (isspace(*from) && *from != '\0')
++from;
if (*from == '\0')
return NULL;
return nullptr;
// copy the token
while (!isspace(*from) && *from != '\0')
@@ -85,7 +85,7 @@ const char *getNextWhitespaceToken(const char *buffer, char *token)
while (isspace(*from) && *from != '\0')
++from;
if (*from == '\0')
return NULL;
return nullptr;
return from;
} // getNextWhitespaceToken
@@ -97,20 +97,20 @@ const char *getNextWhitespaceToken(const char *buffer, char *token)
* the size of buffer
*
* @return the next token, defined by the 1st non-whitespace character in buffer:
* if it is '/' and the next character is '/', NULL
* if it is '/' and the next character is '/', nullptr
* if it is a double-quote, the text until the next double quote (not including \")
* if it is a symbol, the symbol
* if it is a number, the next characters that make a valid integer or float
* if it is a character, the text until the next whitespace or symbol, not including _
* if it is NULL, NULL
* if it is nullptr, nullptr
*/
const char *getNextToken(const char *buffer, char *token)
{
NOT_NULL(token);
*token = '\0';
if (buffer == NULL)
return NULL;
if (buffer == nullptr)
return nullptr;
const char *from = buffer;
char *to = token;
@@ -119,12 +119,12 @@ const char *getNextToken(const char *buffer, char *token)
while (isspace(*from) && *from != '\0')
++from;
if (*from == '\0')
return NULL;
return nullptr;
if (*from == '/' && *(from+1) == '/')
{
// comment
return NULL;
return nullptr;
}
else if (isdigit(*from) ||
((*from == '+' || *from == '-') && isdigit(*(from + 1)))
@@ -173,7 +173,7 @@ const char *getNextToken(const char *buffer, char *token)
while (isspace(*from) && *from != '\0')
++from;
if (*from == '\0')
return NULL;
return nullptr;
return from;
} // getNextToken
@@ -247,9 +247,9 @@ std::string filenameUpperToLower(const std::string & filename)
std::string concatPaths(const char *path1, const char *path2)
{
// test for missing path
if (path1 == NULL || *path1 == '\0')
if (path1 == nullptr || *path1 == '\0')
return path2;
if (path2 == NULL || *path2 == '\0')
if (path2 == nullptr || *path2 == '\0')
return path1;
#ifdef WIN32
@@ -286,7 +286,7 @@ std::string getNextHighestPath(const char *path)
// find the two highest path separators
const char *separator1 = strrchr(path, PATH_SEPARATOR);
if (separator1 == NULL)
if (separator1 == nullptr)
{
#ifdef WIN32
if (isalpha(*path) && *(path + 1) == ':')
@@ -304,7 +304,7 @@ std::string getNextHighestPath(const char *path)
return std::string(path, 3);
#endif
const char *separator2 = strrchr(separator1 - 1, PATH_SEPARATOR);
if (separator2 == NULL)
if (separator2 == nullptr)
return std::string(path, separator1 - path);
return std::string(path, separator2 - path);
@@ -27,12 +27,12 @@
* Class constructor.
*/
TpfFile::TpfFile(void) :
m_template(NULL),
m_template(nullptr),
m_baseTemplateName(),
m_currTemplateDef(NULL),
m_templateData(NULL),
m_highestTemplateData(NULL),
m_parameter(NULL),
m_currTemplateDef(nullptr),
m_templateData(nullptr),
m_highestTemplateData(nullptr),
m_parameter(nullptr),
m_path(),
m_iffPath(),
m_templateLocation(LOC_NONE)
@@ -53,14 +53,14 @@ TpfFile::~TpfFile()
*/
void TpfFile::cleanup(void)
{
m_parameter = NULL;
m_parameter = nullptr;
m_fp.close();
if (m_template != NULL)
if (m_template != nullptr)
{
delete m_template;
m_template = NULL;
m_template = nullptr;
}
m_currTemplateDef = NULL;
m_currTemplateDef = nullptr;
IGNORE_RETURN(m_baseTemplateName.erase());
} // TpfFile::cleanup
@@ -174,7 +174,7 @@ int TpfFile::loadTemplate(const Filename & filename)
if (lineLen == -1)
{
// if we are a base template, check for missing parameters
if (m_highestTemplateData != NULL && m_template != NULL &&
if (m_highestTemplateData != nullptr && m_template != nullptr &&
!m_highestTemplateData->verifyTemplate(m_template, m_fp))
{
result = -1;
@@ -190,7 +190,7 @@ int TpfFile::loadTemplate(const Filename & filename)
// parse the 1st token: comment, @flag, or variable name
const char *line = m_buffer;
line = getNextToken(line, m_token);
if (*m_token == '\0' && line == NULL)
if (*m_token == '\0' && line == nullptr)
{
// empty line or comment
continue;
@@ -201,7 +201,7 @@ int TpfFile::loadTemplate(const Filename & filename)
}
else if (isalpha(*m_token))
{
if (m_template == NULL)
if (m_template == nullptr)
{
m_fp.printError("unable to parse parameters, no template class defined");
return -1;
@@ -209,7 +209,7 @@ int TpfFile::loadTemplate(const Filename & filename)
line = parseAssignment(line);
if (line == CHAR_ERROR)
result = -1;
else if (line != NULL)
else if (line != nullptr)
{
char buffer[1024];
if (getNextToken(line, buffer))
@@ -261,7 +261,7 @@ int TpfFile::makeIffFiles(const Filename & filename)
if (result != 0)
return result;
Filename iffname(NULL, m_iffPath.c_str(), filename.getName().c_str(),
Filename iffname(nullptr, m_iffPath.c_str(), filename.getName().c_str(),
IFF_EXTENSION);
Iff iffFile(1024, true, true);
m_template->save(iffFile);
@@ -291,20 +291,20 @@ int TpfFile::WriteIffFile(Iff & iffData, const Filename & fileName)
{
// there are problems with long path names in Windows that changing to
// the directory seems to fix
char *buffer = NULL;
char *buffer = nullptr;
DWORD buflen;
// get our current path
buflen = GetFullPathName(".", 0, buffer, NULL);
buflen = GetFullPathName(".", 0, buffer, nullptr);
buffer = new char[buflen + 1];
buflen = GetFullPathName(".", buflen + 1, buffer, NULL);
buflen = GetFullPathName(".", buflen + 1, buffer, nullptr);
Unicode::String srcPath = Unicode::narrowToWide(buffer);
delete[] buffer;
srcPath = L"\\\\?\\" + srcPath;
// get the destination path
std::string correctPath(fileName.getDrive() + fileName.getPath());
buflen = GetFullPathName(correctPath.c_str(), 0, buffer, NULL);
buflen = GetFullPathName(correctPath.c_str(), 0, buffer, nullptr);
buffer = new char[buflen + 1];
buflen = GetFullPathName(correctPath.c_str(), buflen + 1, buffer, NULL);
buflen = GetFullPathName(correctPath.c_str(), buflen + 1, buffer, nullptr);
Unicode::String destPath = Unicode::narrowToWide(buffer);
delete[] buffer;
destPath = L"\\\\?\\" + destPath;
@@ -323,18 +323,18 @@ int TpfFile::WriteIffFile(Iff & iffData, const Filename & fileName)
}
else
{
char *buffer = NULL;
char *buffer = nullptr;
DWORD buflen;
// get our current path
buflen = GetFullPathName(".", 0, buffer, NULL);
buflen = GetFullPathName(".", 0, buffer, nullptr);
buffer = new char[buflen + 1];
buflen = GetFullPathName(".", buflen + 1, buffer, NULL);
buflen = GetFullPathName(".", buflen + 1, buffer, nullptr);
delete[] buffer;
// get the destination path
std::string correctPath(fileName.getDrive() + fileName.getPath());
buflen = GetFullPathName(correctPath.c_str(), 0, buffer, NULL);
buflen = GetFullPathName(correctPath.c_str(), 0, buffer, nullptr);
buffer = new char[buflen + 1];
buflen = GetFullPathName(correctPath.c_str(), buflen + 1, buffer, NULL);
buflen = GetFullPathName(correctPath.c_str(), buflen + 1, buffer, nullptr);
std::string destPath = buffer;
delete[] buffer;
// change to the destination path
@@ -389,7 +389,7 @@ int result = 0;
cleanup();
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 replacement\n");
return -1;
@@ -419,7 +419,7 @@ int result = 0;
// parse the 1st token: comment, @flag, or variable name
const char *line = m_buffer;
line = getNextToken(line, m_token);
if (*m_token == '\0' && line == NULL)
if (*m_token == '\0' && line == nullptr)
{
// empty line or comment
if (temp_fp.puts(m_buffer) < 0)
@@ -432,7 +432,7 @@ int result = 0;
{
// @base or @class
const char *templine = getNextToken(line, m_token);
if (templine == NULL)
if (templine == nullptr)
{
m_fp.printEolError();
return -1;
@@ -452,7 +452,7 @@ int result = 0;
else
{
// if we are a base template, check for missing parameters
if (m_highestTemplateData != NULL && m_template != NULL)
if (m_highestTemplateData != nullptr && m_template != nullptr)
{
m_highestTemplateData->updateTemplate(m_template, temp_fp);
}
@@ -462,7 +462,7 @@ int result = 0;
else if (isalpha(*m_token))
{
m_parameter = m_templateData->getParameter(m_token);
if (m_parameter == NULL)
if (m_parameter == nullptr)
{
}
else
@@ -494,14 +494,14 @@ int result = 0;
int TpfFile::parseTemplateCommand(const char *line)
{
line = getNextToken(line, m_token);
if (line == NULL)
if (line == nullptr)
{
m_fp.printEolError();
return -1;
}
if (strcmp(m_token, "base") == 0)
{
if (m_template != NULL && !m_template->getBaseTemplateName().empty())
if (m_template != nullptr && !m_template->getBaseTemplateName().empty())
{
m_fp.printError("base template already defined");
return -1;
@@ -509,7 +509,7 @@ int TpfFile::parseTemplateCommand(const char *line)
line = getNextWhitespaceToken(line, m_token);
if (isalpha(*m_token))
{
if (m_template != NULL)
if (m_template != nullptr)
{
if (m_template->setBaseTemplateName(m_token) != 0)
{
@@ -536,7 +536,7 @@ int TpfFile::parseTemplateCommand(const char *line)
{
// if we are a base template, check for missing parameters
// @todo: fix so we can verify non-base templates
if (m_highestTemplateData != NULL && m_template != NULL &&
if (m_highestTemplateData != nullptr && m_template != nullptr &&
!m_highestTemplateData->verifyTemplate(m_template, m_fp))
{
return -1;
@@ -564,7 +564,7 @@ int TpfFile::parseTemplateCommand(const char *line)
}
int result = 0;
if(m_currTemplateDef == NULL)
if(m_currTemplateDef == nullptr)
{
result = m_templateDef.parse(fp);
m_currTemplateDef = &m_templateDef;
@@ -579,7 +579,7 @@ int TpfFile::parseTemplateCommand(const char *line)
while(lookingForMatchingData)
{
if(templateDataChild == NULL) // DHERMAN Check here for template definition names not matching
if(templateDataChild == nullptr) // DHERMAN Check here for template definition names not matching
{
char errbuf[256];
@@ -618,7 +618,7 @@ int TpfFile::parseTemplateCommand(const char *line)
int version = static_cast<int>(atol(m_token));
m_templateData = m_currTemplateDef->getTemplateData(version);
if (m_templateData == NULL)
if (m_templateData == nullptr)
{
char errbuf[256];
sprintf(errbuf, "can't find version %d in template definition %s",
@@ -634,14 +634,14 @@ int TpfFile::parseTemplateCommand(const char *line)
return -1;
}
if (m_template == NULL)
if (m_template == nullptr)
{
// this is the highest class level, make a blank template
// with it
const TagInfo & templateId = m_currTemplateDef->getTemplateId();
m_template = dynamic_cast<TpfTemplate*>(TpfTemplate::createTemplate(
templateId.tag));
if (m_template == NULL)
if (m_template == nullptr)
{
m_fp.printError("Unable to create template class. May not be installed.");
return -1;
@@ -708,12 +708,12 @@ enum
PARSE_ENUM_ASSIGNMENT,
PARSE_ENUM_VALUE
} parseState = PARSE_ENUM_TOKEN;
TemplateData::EnumList * enumList = NULL; // current list being defined
TemplateData::EnumData * enumData = NULL; // current item being defined
TemplateData::EnumList * enumList = nullptr; // current list being defined
TemplateData::EnumData * enumData = nullptr; // current item being defined
int currentEnumValue = 0;
File fp;
Filename headerFilename(NULL, NULL, headerName, NULL);
Filename headerFilename(nullptr, nullptr, headerName, nullptr);
int i = 0;
while (!fp.exists(headerFilename) && i < MAX_DIRECTORY_DEPTH)
{
@@ -744,7 +744,7 @@ int currentEnumValue = 0;
}
const char * line = m_buffer;
while (line != NULL)
while (line != nullptr)
{
const char * templine = getNextToken(line, m_token);
switch (parseState)
@@ -788,7 +788,7 @@ int currentEnumValue = 0;
case PARSE_END_BRACKET :
if (*m_token == '}')
{
enumList = NULL;
enumList = nullptr;
parseState = PARSE_ENUM_TOKEN;
}
else
@@ -798,7 +798,7 @@ int currentEnumValue = 0;
}
break;
case PARSE_ENUM_DEF:
if (isalpha(*m_token) && enumList != NULL)
if (isalpha(*m_token) && enumList != nullptr)
{
enumList->push_back(TemplateData::EnumData());
enumData = &enumList->back();
@@ -815,7 +815,7 @@ int currentEnumValue = 0;
{
enumData->value = currentEnumValue++;
templine = line;
enumData = NULL;
enumData = nullptr;
parseState = PARSE_END_BRACKET;
}
break;
@@ -838,7 +838,7 @@ int currentEnumValue = 0;
}
currentEnumValue = (*iter).value;
enumData->value = currentEnumValue++;
enumData = NULL;
enumData = nullptr;
parseState = PARSE_END_BRACKET;
}
else
@@ -895,7 +895,7 @@ const char * TpfFile::parseAssignment(const char *line)
// get the parameter type info
m_parameter = m_templateData->getParameter(m_token);
if (m_parameter == NULL)
if (m_parameter == nullptr)
{
std::string errmsg = "cannot find parameter ";
errmsg += m_token;
@@ -915,7 +915,7 @@ const char * TpfFile::parseAssignment(const char *line)
m_fp.printError("non-array parameter being assigned as array");
return CHAR_ERROR;
}
if (line == NULL)
if (line == nullptr)
{
// we need to read the next line to continue parsing
line = goToNextLine();
@@ -943,7 +943,7 @@ const char * TpfFile::parseAssignment(const char *line)
}
// check for the ending ]
line = getNextToken(line, m_token);
if (line == NULL)
if (line == nullptr)
{
m_fp.printEolError();
return CHAR_ERROR;
@@ -954,13 +954,13 @@ const char * TpfFile::parseAssignment(const char *line)
return CHAR_ERROR;
}
line = getNextToken(line, m_token);
if (line == NULL)
if (line == nullptr)
{
m_fp.printEolError();
return CHAR_ERROR;
}
}
else if (line == NULL)
else if (line == nullptr)
{
m_fp.printEolError();
return CHAR_ERROR;
@@ -1038,7 +1038,7 @@ const char * TpfFile::parseAssignment(const char *line)
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseIntegerParameter(CompilerIntegerParam & param, const char *line)
@@ -1064,7 +1064,7 @@ const char * TpfFile::parseIntegerParameter(CompilerIntegerParam & param, const
if (line == CHAR_ERROR)
return CHAR_ERROR;
if (line != NULL && *line == 'd')
if (line != nullptr && *line == 'd')
{
// rolling die
int base = 0;
@@ -1115,7 +1115,7 @@ const char * TpfFile::parseIntegerParameter(CompilerIntegerParam & param, const
}
param.setValue(num_dice, num_sides, base);
}
else if (line != NULL && *line == '.' && *(line+1) == '.')
else if (line != nullptr && *line == '.' && *(line+1) == '.')
{
// range
int min_value = value;
@@ -1168,7 +1168,7 @@ const char * TpfFile::parseIntegerParameter(CompilerIntegerParam & param, const
tempLine = m_token;
char tempBuffer[64];
std::vector<std::string> enumList;
while (tempLine != NULL)
while (tempLine != nullptr)
{
tempLine = getNextToken(tempLine, tempBuffer);
if (isalpha(*tempBuffer))
@@ -1178,7 +1178,7 @@ const char * TpfFile::parseIntegerParameter(CompilerIntegerParam & param, const
}
}
}
else if (*m_token == '.' && tempLine != NULL && *tempLine == '.')
else if (*m_token == '.' && tempLine != nullptr && *tempLine == '.')
{
// range with lower bound of INT_MIN
line = tempLine + 1;
@@ -1232,7 +1232,7 @@ const char * TpfFile::parseIntegerParameter(CompilerIntegerParam & param, const
return CHAR_ERROR;
}
line = parseIntegerParameter(param, line);
if (line != NULL && *line == '%')
if (line != nullptr && *line == '%')
{
// % offset from base value
line = getNextToken(line, m_token);
@@ -1257,7 +1257,7 @@ const char * TpfFile::parseIntegerParameter(CompilerIntegerParam & param, const
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseFloatParameter(FloatParam & param, const char *line)
@@ -1278,7 +1278,7 @@ const char * TpfFile::parseFloatParameter(FloatParam & param, const char *line)
}
else if (isfloat(m_token))
{
if (line != NULL && *line == '.' && *(line+1) == '.')
if (line != nullptr && *line == '.' && *(line+1) == '.')
{
// range
float min_value = static_cast<float>(atof(m_token));
@@ -1325,7 +1325,7 @@ const char * TpfFile::parseFloatParameter(FloatParam & param, const char *line)
param.setValue(value);
}
}
else if (*m_token == '.' && line != NULL && *line == '.')
else if (*m_token == '.' && line != nullptr && *line == '.')
{
// range with lower bound of -FLT_MAX
++line;
@@ -1378,7 +1378,7 @@ const char * TpfFile::parseFloatParameter(FloatParam & param, const char *line)
return CHAR_ERROR;
}
line = parseFloatParameter(param, line);
if (line != NULL && *line == '%')
if (line != nullptr && *line == '%')
{
// % offset from base value
line = getNextToken(line, m_token);
@@ -1414,7 +1414,7 @@ const char * TpfFile::parseFloatParameter(FloatParam & param, const char *line)
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseBoolParameter(BoolParam & param, const char *line)
@@ -1455,7 +1455,7 @@ const char * TpfFile::parseBoolParameter(BoolParam & param, const char *line)
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseStringParameter(StringParam & param, const char *line)
@@ -1494,7 +1494,7 @@ const char * TpfFile::parseStringParameter(StringParam & param, const char *line
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseStringIdParameter(StringIdParam & param, const char *line)
@@ -1530,7 +1530,7 @@ const char * TpfFile::parseStringIdParameter(StringIdParam & param, const char *
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseFilenameParameter(StringParam & param, const char *line)
@@ -1586,7 +1586,7 @@ const char * TpfFile::parseFilenameParameter(StringParam & param, const char *li
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseVectorParameter(VectorParam & param, const char *line)
@@ -1648,7 +1648,7 @@ const char * TpfFile::parseVectorParameter(VectorParam & param, const char *line
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseTemplateParameter(StringParam & param, const char *line)
@@ -1662,7 +1662,7 @@ const char * TpfFile::parseTemplateParameter(StringParam & param, const char *li
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseEnumParameter(CompilerIntegerParam & param, const char *line)
@@ -1707,7 +1707,7 @@ const char * TpfFile::parseEnumParameter(CompilerIntegerParam & param, const cha
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseDynamicVariableParameter(DynamicVariableParam & param,
@@ -1731,7 +1731,7 @@ const char * TpfFile::parseDynamicVariableParameter(DynamicVariableParam & param
if (*m_token == '+')
{
// extending an objevar list
if (m_template != NULL && m_template->getBaseTemplateName().empty())
if (m_template != nullptr && m_template->getBaseTemplateName().empty())
{
m_fp.printError("trying to extend an objvar list from a base template");
return CHAR_ERROR;
@@ -1746,7 +1746,7 @@ const char * TpfFile::parseDynamicVariableParameter(DynamicVariableParam & param
}
else
{
if (line == NULL)
if (line == nullptr)
{
// we need to read the next line to continue parsing
line = goToNextLine();
@@ -1786,7 +1786,7 @@ const char * TpfFile::parseDynamicVariableParameter(DynamicVariableParam & param
* @param param a DynamicVariableParamData containing an empty list
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseDynamicVariableParameterList(
@@ -1797,7 +1797,7 @@ std::string name;
NOT_NULL(line);
if (data.m_type != DynamicVariableParamData::LIST ||
data.m_data.lparam == NULL)
data.m_data.lparam == nullptr)
{
m_fp.printError("parse objvar list not given a list");
return CHAR_ERROR;
@@ -1938,7 +1938,7 @@ std::string name;
}
else
{
if (line == NULL)
if (line == nullptr)
{
// we need to read the next line to continue parsing
line = goToNextLine();
@@ -1984,7 +1984,7 @@ std::string name;
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseStructParameter(StructParamOT & param, const char *line)
@@ -2077,7 +2077,7 @@ const char * TpfFile::parseStructParameter(StructParamOT & param, const char *li
* @param param template parameter
* @param line buffer containing the assignment statement
*
* @return character in line where parsing stopped, or NULL if at eol, or -1 if
* @return character in line where parsing stopped, or nullptr if at eol, or -1 if
* error
*/
const char * TpfFile::parseTriggerVolumeParameter(TriggerVolumeParam & param,
@@ -2313,7 +2313,7 @@ Q * param;
file.m_fp.printError("expected [ at start of list");
return CHAR_ERROR;
}
if (line == NULL)
if (line == nullptr)
{
// we need to read the next line to continue parsing
line = file.goToNextLine();
@@ -2339,7 +2339,7 @@ Q * param;
// get the next parameters in the list
param = (*getParamFunc)(*file.m_template,
file.m_parameter->name, index);
if (param == NULL)
if (param == nullptr)
{
std::string errmsg = "cannot find parameter " + file.m_parameter->name;
file.m_fp.printError(errmsg.c_str());
@@ -2385,7 +2385,7 @@ Q * param;
arrayIndex = 0;
param = (*getParamFunc)(*file.m_template,
file.m_parameter->name, arrayIndex);
if (param == NULL)
if (param == nullptr)
{
// if the tpf version is less than the current version, print a
// warning and ignore
@@ -2396,7 +2396,7 @@ Q * param;
" due to being removed from later version (need to update the "
"template to the latest version)";
file.m_fp.printWarning(errmsg.c_str());
return NULL;
return nullptr;
}
else
{
@@ -2434,7 +2434,7 @@ const char *parseWeightedList(
for (;;)
{
VALUE value;
Q *valueParam = NULL;
Q *valueParam = nullptr;
value.value = valueParam = new Q;
list->push_back(value);
VALUE *newValue = &list->back();
@@ -2505,7 +2505,7 @@ std::string TpfFile::getFileName() const
const std::string & TpfFile::getBaseTemplateName() const
{
if (m_template != NULL)
if (m_template != nullptr)
return m_template->getBaseTemplateName();
return m_baseTemplateName;
}
@@ -21,9 +21,9 @@
*/
TpfTemplate::TpfTemplate(const std::string & filename) :
ObjectTemplate(filename),
m_parentFile(NULL),
m_parentFile(nullptr),
m_baseTemplateName(),
m_baseTemplateFile(NULL)
m_baseTemplateFile(nullptr)
{
} // TpfTemplate::TpfTemplate
@@ -32,12 +32,12 @@ TpfTemplate::TpfTemplate(const std::string & filename) :
*/
TpfTemplate::~TpfTemplate()
{
m_parentFile = NULL;
m_parentFile = nullptr;
m_baseTemplateName.clear();
if (m_baseTemplateFile != NULL)
if (m_baseTemplateFile != nullptr)
{
delete m_baseTemplateFile;
m_baseTemplateFile = NULL;
m_baseTemplateFile = nullptr;
}
} // TpfTemplate::~TpfTemplate
@@ -52,18 +52,18 @@ int TpfTemplate::setBaseTemplateName(const std::string & name)
{
m_baseTemplateName = name;
if (m_parentFile == NULL)
if (m_parentFile == nullptr)
return -1;
// load the base template
if (m_baseTemplateFile != NULL)
if (m_baseTemplateFile != nullptr)
{
delete m_baseTemplateFile;
m_baseTemplateFile = NULL;
m_baseTemplateFile = nullptr;
}
Filename baseTemplateFileName(NULL, NULL, name.c_str(), TEMPLATE_EXTENSION);
Filename sourceTpfPath(NULL, m_parentFile->getTpfPath().c_str(), NULL, NULL);
Filename baseTemplateFileName(nullptr, nullptr, name.c_str(), TEMPLATE_EXTENSION);
Filename sourceTpfPath(nullptr, m_parentFile->getTpfPath().c_str(), nullptr, nullptr);
Filename tempPath(baseTemplateFileName);
tempPath.setPath(sourceTpfPath.getPath().c_str());
@@ -93,9 +93,9 @@ int TpfTemplate::setBaseTemplateName(const std::string & name)
*/
TpfTemplate * TpfTemplate::getBaseTemplate(void) const
{
if (m_baseTemplateFile != NULL)
if (m_baseTemplateFile != nullptr)
return m_baseTemplateFile->getTemplate();
return NULL;
return nullptr;
} // TpfTemplate::getBaseTemplate
/**
@@ -115,14 +115,14 @@ void TpfTemplate::save(Iff &file)
* @param deepcheck flag to check base template if the parameter isn't loaded
* @param index array index of the parameter
*
* @return the parameter, or NULL if not found
* @return the parameter, or nullptr if not found
*/
CompilerIntegerParam *TpfTemplate::getCompilerIntegerParam(const char *name, bool deepCheck, int index)
{
UNREF(name);
UNREF(deepCheck);
UNREF(index);
return NULL;
return nullptr;
} // TpfTemplate::getCompilerIntegerParam
/**
@@ -132,14 +132,14 @@ CompilerIntegerParam *TpfTemplate::getCompilerIntegerParam(const char *name, boo
* @param deepcheck flag to check base template if the parameter isn't loaded
* @param index array index of the parameter
*
* @return the parameter, or NULL if not found
* @return the parameter, or nullptr if not found
*/
FloatParam *TpfTemplate::getFloatParam(const char *name, bool deepCheck, int index)
{
UNREF(name);
UNREF(deepCheck);
UNREF(index);
return NULL;
return nullptr;
} // TpfTemplate::getFloatParam
/**
@@ -149,14 +149,14 @@ FloatParam *TpfTemplate::getFloatParam(const char *name, bool deepCheck, int ind
* @param deepcheck flag to check base template if the parameter isn't loaded
* @param index array index of the parameter
*
* @return the parameter, or NULL if not found
* @return the parameter, or nullptr if not found
*/
BoolParam *TpfTemplate::getBoolParam(const char *name, bool deepCheck, int index)
{
UNREF(name);
UNREF(deepCheck);
UNREF(index);
return NULL;
return nullptr;
} // TpfTemplate::getBoolParam
/**
@@ -166,14 +166,14 @@ BoolParam *TpfTemplate::getBoolParam(const char *name, bool deepCheck, int index
* @param deepcheck flag to check base template if the parameter isn't loaded
* @param index array index of the parameter
*
* @return the parameter, or NULL if not found
* @return the parameter, or nullptr if not found
*/
StringParam *TpfTemplate::getStringParam(const char *name, bool deepCheck, int index)
{
UNREF(name);
UNREF(deepCheck);
UNREF(index);
return NULL;
return nullptr;
} // TpfTemplate::getStringParam
/**
@@ -183,14 +183,14 @@ StringParam *TpfTemplate::getStringParam(const char *name, bool deepCheck, int i
* @param deepcheck flag to check base template if the parameter isn't loaded
* @param index array index of the parameter
*
* @return the parameter, or NULL if not found
* @return the parameter, or nullptr if not found
*/
StringIdParam *TpfTemplate::getStringIdParam(const char *name, bool deepCheck, int index)
{
UNREF(name);
UNREF(deepCheck);
UNREF(index);
return NULL;
return nullptr;
} // TpfTemplate::getStringIdParam
/**
@@ -200,14 +200,14 @@ StringIdParam *TpfTemplate::getStringIdParam(const char *name, bool deepCheck, i
* @param deepcheck flag to check base template if the parameter isn't loaded
* @param index array index of the parameter
*
* @return the parameter, or NULL if not found
* @return the parameter, or nullptr if not found
*/
VectorParam *TpfTemplate::getVectorParam(const char *name, bool deepCheck, int index)
{
UNREF(name);
UNREF(deepCheck);
UNREF(index);
return NULL;
return nullptr;
} // TpfTemplate::getVectorParam
/**
@@ -217,14 +217,14 @@ VectorParam *TpfTemplate::getVectorParam(const char *name, bool deepCheck, int i
* @param deepcheck flag to check base template if the parameter isn't loaded
* @param index array index of the parameter
*
* @return the parameter, or NULL if not found
* @return the parameter, or nullptr if not found
*/
DynamicVariableParam *TpfTemplate::getDynamicVariableParam(const char *name, bool deepCheck, int index)
{
UNREF(name);
UNREF(deepCheck);
UNREF(index);
return NULL;
return nullptr;
} // TpfTemplate::getDynamicVariableParam
/**
@@ -234,14 +234,14 @@ DynamicVariableParam *TpfTemplate::getDynamicVariableParam(const char *name, boo
* @param deepcheck flag to check base template if the parameter isn't loaded
* @param index array index of the parameter
*
* @return the parameter, or NULL if not found
* @return the parameter, or nullptr if not found
*/
StructParamOT *TpfTemplate::getStructParamOT(const char *name, bool deepCheck, int index)
{
UNREF(name);
UNREF(deepCheck);
UNREF(index);
return NULL;
return nullptr;
} // TpfTemplate::getStructParamOT
/**
@@ -251,14 +251,14 @@ StructParamOT *TpfTemplate::getStructParamOT(const char *name, bool deepCheck, i
* @param deepcheck flag to check base template if the parameter isn't loaded
* @param index array index of the parameter
*
* @return the parameter, or NULL if not found
* @return the parameter, or nullptr if not found
*/
TriggerVolumeParam *TpfTemplate::getTriggerVolumeParam(const char *name, bool deepCheck, int index)
{
UNREF(name);
UNREF(deepCheck);
UNREF(index);
return NULL;
return nullptr;
} // TpfTemplate::getTriggerVolumeParam
/**
@@ -408,7 +408,7 @@ bool TpfTemplate::isParamLoadedLocal(const std::string &name, bool deepCheck) co
{
result = true;
}
else if (deepCheck && getBaseTemplate() != NULL)
else if (deepCheck && getBaseTemplate() != nullptr)
{
result = getBaseTemplate()->isParamLoadedLocal(name);
}
@@ -433,7 +433,7 @@ bool TpfTemplate::isParamPureVirtualLocal(const std::string &name, bool deepChec
{
result = true;
}
else if (deepCheck && (getBaseTemplate() != NULL))
else if (deepCheck && (getBaseTemplate() != nullptr))
{
result = getBaseTemplate()->isParamPureVirtualLocal(name);
}