mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-01 01:16:03 -04:00
newer standards prefer nullptr over NULL - this is most of them but there are others too
This commit is contained in:
@@ -160,7 +160,7 @@ void DebugMonitor::install(void)
|
||||
// handle input from the output terminal, particularly to
|
||||
// handle profiler modifications when the output window
|
||||
// is active.
|
||||
s_outputScreen = newterm(NULL, s_ttyOutputFile, stdin);
|
||||
s_outputScreen = newterm(nullptr, s_ttyOutputFile, stdin);
|
||||
if (!s_outputScreen)
|
||||
{
|
||||
DEBUG_WARNING(true, ("DebugMonitor: newterm() failed [%s].", strerror(errno)));
|
||||
|
||||
@@ -39,7 +39,7 @@ PerformanceTimer::~PerformanceTimer()
|
||||
|
||||
void PerformanceTimer::start()
|
||||
{
|
||||
int const result = gettimeofday(&startTime, NULL);
|
||||
int const result = gettimeofday(&startTime, nullptr);
|
||||
FATAL(result != 0,("PerformanceTimer::start failed"));
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ void PerformanceTimer::resume()
|
||||
usec += 1000000;
|
||||
}
|
||||
|
||||
int const result = gettimeofday(&startTime, NULL);
|
||||
int const result = gettimeofday(&startTime, nullptr);
|
||||
FATAL(result != 0,("PerformanceTimer::resume failed"));
|
||||
|
||||
startTime.tv_sec -= sec;
|
||||
@@ -71,7 +71,7 @@ void PerformanceTimer::resume()
|
||||
|
||||
void PerformanceTimer::stop()
|
||||
{
|
||||
int result = gettimeofday(&stopTime, NULL);
|
||||
int result = gettimeofday(&stopTime, nullptr);
|
||||
FATAL(result != 0,("PerformanceTimer::start failed"));
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ float PerformanceTimer::getSplitTime() const
|
||||
{
|
||||
timeval currentTime;
|
||||
|
||||
int const result = gettimeofday(¤tTime, NULL);
|
||||
int const result = gettimeofday(¤tTime, nullptr);
|
||||
FATAL(result != 0,("PerformanceTimer::getSplitTime failed"));
|
||||
|
||||
long sec = currentTime.tv_sec - startTime.tv_sec;
|
||||
@@ -117,7 +117,7 @@ void PerformanceTimer::logElapsedTime(const char* string) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
static char buffer [1000];
|
||||
sprintf(buffer, "%s : %1.5f seconds\n", string ? string : "null", getElapsedTime());
|
||||
sprintf(buffer, "%s : %1.5f seconds\n", string ? string : "nullptr", getElapsedTime());
|
||||
DEBUG_REPORT_LOG_PRINT(true, ("%s", buffer));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ namespace DataLintNamespace
|
||||
bool ms_installed = false;
|
||||
DataLint::AssetType m_currentAssetType = DataLint::AT_invalid;
|
||||
bool m_enabled = false;
|
||||
WarningList * m_warningList = NULL;
|
||||
StringList * m_assetStack = NULL;
|
||||
DataLint::StringPairList * m_assetList = NULL;
|
||||
WarningList * m_warningList = nullptr;
|
||||
StringList * m_assetStack = nullptr;
|
||||
DataLint::StringPairList * m_assetList = nullptr;
|
||||
std::string m_dataLintCategorizedAssetsFile("DataLint_CategorizedAssets.txt");
|
||||
std::string m_dataLintUnSupportedAssetsFile("DataLint_UnSupportedAssets.txt");
|
||||
Mode m_mode = M_client;
|
||||
@@ -123,17 +123,17 @@ void DataLint::report()
|
||||
|
||||
// Client only
|
||||
|
||||
FILE *assetErrorFileAppearance = NULL;
|
||||
FILE *assetErrorFileArrangementDescriptor = NULL;
|
||||
FILE *assetErrorFileLocalizedStringTable = NULL;
|
||||
FILE *assetErrorFilePortalProperty = NULL;
|
||||
FILE *assetErrorFileShaderTemplate = NULL;
|
||||
FILE *assetErrorFileSkyBox = NULL;
|
||||
FILE *assetErrorFileSlotDescriptor = NULL;
|
||||
FILE *assetErrorFileSoundTemplate = NULL;
|
||||
FILE *assetErrorFileTerrain = NULL;
|
||||
FILE *assetErrorFileTexture = NULL;
|
||||
FILE *assetErrorFileTextureRenderer = NULL;
|
||||
FILE *assetErrorFileAppearance = nullptr;
|
||||
FILE *assetErrorFileArrangementDescriptor = nullptr;
|
||||
FILE *assetErrorFileLocalizedStringTable = nullptr;
|
||||
FILE *assetErrorFilePortalProperty = nullptr;
|
||||
FILE *assetErrorFileShaderTemplate = nullptr;
|
||||
FILE *assetErrorFileSkyBox = nullptr;
|
||||
FILE *assetErrorFileSlotDescriptor = nullptr;
|
||||
FILE *assetErrorFileSoundTemplate = nullptr;
|
||||
FILE *assetErrorFileTerrain = nullptr;
|
||||
FILE *assetErrorFileTexture = nullptr;
|
||||
FILE *assetErrorFileTextureRenderer = nullptr;
|
||||
|
||||
if (m_mode == M_client)
|
||||
{
|
||||
@@ -450,7 +450,7 @@ std::string DataLintNamespace::formatErrorMessage(WarningPair &warningPair, int
|
||||
|
||||
char *assetError = strstr(text, " : ");
|
||||
|
||||
if (assetError != NULL)
|
||||
if (assetError != nullptr)
|
||||
{
|
||||
++assetError;
|
||||
++assetError;
|
||||
@@ -567,12 +567,12 @@ void DataLint::clearAssetStack()
|
||||
//-----------------------------------------------------------------------------
|
||||
void DataLint::addFilePath(char const *filePath)
|
||||
{
|
||||
if (filePath == NULL || (strlen(filePath) <= 0))
|
||||
if (filePath == nullptr || (strlen(filePath) <= 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_assetList != NULL)
|
||||
if (m_assetList != nullptr)
|
||||
{
|
||||
char text[4096];
|
||||
sprintf(text, "%s", filePath);
|
||||
@@ -592,7 +592,7 @@ void DataLint::addFilePath(char const *filePath)
|
||||
//-----------------------------------------------------------------------------
|
||||
void DataLint::removeFilePath(char const *filePath)
|
||||
{
|
||||
if (m_assetList != NULL)
|
||||
if (m_assetList != nullptr)
|
||||
{
|
||||
StringPairList::iterator stringPairListIter = m_assetList->begin();
|
||||
|
||||
@@ -611,8 +611,8 @@ void DataLint::removeFilePath(char const *filePath)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isAnAppearanceAsset(char const *text)
|
||||
{
|
||||
bool const appearanceAsset = (strstr(text, "appearance/") != NULL);
|
||||
bool const portalPropertyAsset = (strstr(text, ".pob") != NULL);
|
||||
bool const appearanceAsset = (strstr(text, "appearance/") != nullptr);
|
||||
bool const portalPropertyAsset = (strstr(text, ".pob") != nullptr);
|
||||
|
||||
return (appearanceAsset && !portalPropertyAsset);
|
||||
}
|
||||
@@ -620,7 +620,7 @@ bool DataLintNamespace::isAnAppearanceAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isAnArrangementDescriptorAsset(char const *text)
|
||||
{
|
||||
bool const arrangementDescriptorAsset = (strstr(text, "slot/arrangement/") != NULL);
|
||||
bool const arrangementDescriptorAsset = (strstr(text, "slot/arrangement/") != nullptr);
|
||||
|
||||
return arrangementDescriptorAsset;
|
||||
}
|
||||
@@ -628,7 +628,7 @@ bool DataLintNamespace::isAnArrangementDescriptorAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isALocalizedStringAsset(char const *text)
|
||||
{
|
||||
bool const localizedStringAsset = (strstr(text, ".stf") != NULL);
|
||||
bool const localizedStringAsset = (strstr(text, ".stf") != nullptr);
|
||||
|
||||
return localizedStringAsset;
|
||||
}
|
||||
@@ -638,8 +638,8 @@ bool DataLintNamespace::isAnObjectTemplateAsset(char const *text)
|
||||
{
|
||||
bool result = false;
|
||||
UNREF(text);
|
||||
bool const isInTheObjectDirectory = (strstr(text, "object/") != NULL);
|
||||
bool const isInTheAbstractDirectory = (strstr(text, "abstract/") != NULL);
|
||||
bool const isInTheObjectDirectory = (strstr(text, "object/") != nullptr);
|
||||
bool const isInTheAbstractDirectory = (strstr(text, "abstract/") != nullptr);
|
||||
|
||||
if (isInTheObjectDirectory || isInTheAbstractDirectory)
|
||||
{
|
||||
@@ -655,7 +655,7 @@ bool DataLintNamespace::isAnObjectTemplateAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isAPortalProprtyAsset(char const *text)
|
||||
{
|
||||
bool const portalPropertyAsset = (strstr(text, ".pob") != NULL);
|
||||
bool const portalPropertyAsset = (strstr(text, ".pob") != nullptr);
|
||||
|
||||
return portalPropertyAsset;
|
||||
}
|
||||
@@ -663,7 +663,7 @@ bool DataLintNamespace::isAPortalProprtyAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isAShaderTemplateAsset(char const *text)
|
||||
{
|
||||
bool const shaderTemplateAsset = (strstr(text, "shader/") != NULL);
|
||||
bool const shaderTemplateAsset = (strstr(text, "shader/") != nullptr);
|
||||
|
||||
return shaderTemplateAsset;
|
||||
}
|
||||
@@ -671,7 +671,7 @@ bool DataLintNamespace::isAShaderTemplateAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isASkyBoxAsset(char const *text)
|
||||
{
|
||||
bool const skyBoxAsset = (strstr(text, "skybox/") != NULL);
|
||||
bool const skyBoxAsset = (strstr(text, "skybox/") != nullptr);
|
||||
|
||||
return skyBoxAsset;
|
||||
}
|
||||
@@ -679,7 +679,7 @@ bool DataLintNamespace::isASkyBoxAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isASlotDescriptorAsset(char const *text)
|
||||
{
|
||||
bool const slotDescriptorAsset = (strstr(text, "slot/descriptor/") != NULL);
|
||||
bool const slotDescriptorAsset = (strstr(text, "slot/descriptor/") != nullptr);
|
||||
|
||||
return slotDescriptorAsset;
|
||||
}
|
||||
@@ -687,7 +687,7 @@ bool DataLintNamespace::isASlotDescriptorAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isASoundAsset(char const *text)
|
||||
{
|
||||
bool const soundAsset = (strstr(text, "sound/") != NULL);
|
||||
bool const soundAsset = (strstr(text, "sound/") != nullptr);
|
||||
|
||||
return soundAsset;
|
||||
}
|
||||
@@ -701,7 +701,7 @@ bool DataLintNamespace::isATerrainAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isATextureAsset(char const *text)
|
||||
{
|
||||
bool const textureAsset = (strstr(text, ".dds") != NULL);
|
||||
bool const textureAsset = (strstr(text, ".dds") != nullptr);
|
||||
|
||||
return textureAsset;
|
||||
}
|
||||
@@ -709,7 +709,7 @@ bool DataLintNamespace::isATextureAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isATextureRendererTemplateAsset(char const *text)
|
||||
{
|
||||
bool const textureRendererAsset = (strstr(text, ".trt") != NULL);
|
||||
bool const textureRendererAsset = (strstr(text, ".trt") != nullptr);
|
||||
|
||||
return textureRendererAsset;
|
||||
}
|
||||
@@ -749,7 +749,7 @@ bool DataLintNamespace::isAnUnSupportedAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
DataLint::StringPairList DataLintNamespace::getList(int const reserveCount, AssetFunction assetTypeFunction)
|
||||
{
|
||||
DEBUG_FATAL(!m_assetList, ("DataLint::getList() - m_assetList is NULL"));
|
||||
DEBUG_FATAL(!m_assetList, ("DataLint::getList() - m_assetList is nullptr"));
|
||||
|
||||
// Create the list of terrains
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ std::vector<DebugFlags::Flag> DebugFlags::ms_flagsSortedByReportPriority;
|
||||
|
||||
void DebugFlags::config(bool &variable, const char *configSection, const char *configName)
|
||||
{
|
||||
DEBUG_FATAL(strchr(configSection, ' ') != NULL, ("no spaces are allowed in debug flag section names: %s", configSection));
|
||||
DEBUG_FATAL(strchr(configName, ' ') != NULL, ("no spaces are allowed in debug flag names: %s", configName));
|
||||
DEBUG_FATAL(strchr(configSection, ' ') != nullptr, ("no spaces are allowed in debug flag section names: %s", configSection));
|
||||
DEBUG_FATAL(strchr(configName, ' ') != nullptr, ("no spaces are allowed in debug flag names: %s", configName));
|
||||
|
||||
if (configSection && configName && ConfigFile::isInstalled())
|
||||
{
|
||||
@@ -102,9 +102,9 @@ void DebugFlags::registerFlag(bool &variable, const char *section, const char *n
|
||||
f.section = section;
|
||||
f.name = name;
|
||||
f.reportPriority = 0;
|
||||
f.reportRoutine1 = NULL;
|
||||
f.reportRoutine2 = NULL;
|
||||
f.context = NULL;
|
||||
f.reportRoutine1 = nullptr;
|
||||
f.reportRoutine2 = nullptr;
|
||||
f.context = nullptr;
|
||||
#ifdef _DEBUG
|
||||
f.m_callStack.sample();
|
||||
#endif
|
||||
@@ -127,8 +127,8 @@ void DebugFlags::registerFlag(bool &variable, const char *section, const char *n
|
||||
f.name = name;
|
||||
f.reportPriority = reportPriority;
|
||||
f.reportRoutine1 = reportRoutine;
|
||||
f.reportRoutine2 = NULL;
|
||||
f.context = NULL;
|
||||
f.reportRoutine2 = nullptr;
|
||||
f.context = nullptr;
|
||||
#ifdef _DEBUG
|
||||
f.m_callStack.sample();
|
||||
#endif
|
||||
@@ -150,7 +150,7 @@ void DebugFlags::registerFlag(bool &variable, const char *section, const char *n
|
||||
f.section = section;
|
||||
f.name = name;
|
||||
f.reportPriority = reportPriority;
|
||||
f.reportRoutine1 = NULL;
|
||||
f.reportRoutine1 = nullptr;
|
||||
f.reportRoutine2 = reportRoutine;
|
||||
f.context = context;
|
||||
#ifdef _DEBUG
|
||||
@@ -230,7 +230,7 @@ DebugFlags::Flag const * DebugFlags::getFlag(char const * const section, char co
|
||||
return &f;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -108,7 +108,7 @@ bool DebugKey::isDown(int i)
|
||||
bool DebugKey::isActive()
|
||||
{
|
||||
#if PRODUCTION == 0
|
||||
return ms_currentFlag != NULL;
|
||||
return ms_currentFlag != nullptr;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -64,7 +64,7 @@ void InstallTimer::manualExit()
|
||||
unsigned long const endingNumberOfBytesAllocated = MemoryManager::getCurrentNumberOfBytesAllocated();
|
||||
--ms_indent;
|
||||
REPORT_LOG_PRINT(ms_enabled, ("InstallTimer:%*c%6.4f %d %s\n", ms_indent * 2, ' ', m_performanceTimer.getElapsedTime(), static_cast<int>(endingNumberOfBytesAllocated - m_startingNumberOfBytesAllocated), m_description));
|
||||
m_description = NULL;
|
||||
m_description = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,13 +83,13 @@ void PixCounterNamespace::remove()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
FreeLibrary(ms_pixDll);
|
||||
ms_pixDll = NULL;
|
||||
ms_pixDll = nullptr;
|
||||
#endif
|
||||
|
||||
ms_setCounterFloat = NULL;
|
||||
ms_setCounterInt = NULL;
|
||||
ms_setCounterInt64 = NULL;
|
||||
ms_setCounterString = NULL;
|
||||
ms_setCounterFloat = nullptr;
|
||||
ms_setCounterInt = nullptr;
|
||||
ms_setCounterInt64 = nullptr;
|
||||
ms_setCounterString = nullptr;
|
||||
|
||||
// Make sure the counter memory gets freed at this point
|
||||
Counters().swap(ms_counters);
|
||||
@@ -379,7 +379,7 @@ PixCounter::String::String()
|
||||
: Counter(),
|
||||
m_enabled(false),
|
||||
m_lastFrameValue(),
|
||||
m_lastFrameValuePointer(NULL),
|
||||
m_lastFrameValuePointer(nullptr),
|
||||
m_currentValue()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ void Profiler::install()
|
||||
|
||||
ms_profilerEntriesCurrent = &ms_profilerEntries1;
|
||||
ms_profilerEntriesLast = &ms_profilerEntries2;
|
||||
ms_rootVisibleExpandableEntry = new VisibleExpandableEntry(NULL);
|
||||
ms_rootVisibleExpandableEntry = new VisibleExpandableEntry(nullptr);
|
||||
ms_rootVisibleExpandableEntry->setExpanded(true);
|
||||
ms_selectedVisibleExpandableEntry = ms_rootVisibleExpandableEntry;
|
||||
}
|
||||
@@ -248,13 +248,13 @@ void Profiler::install()
|
||||
void Profiler::remove()
|
||||
{
|
||||
delete ms_rootVisibleExpandableEntry;
|
||||
ms_rootVisibleExpandableEntry = NULL;
|
||||
ms_beforeSelectedVisibleExpandableEntry = NULL;
|
||||
ms_selectedVisibleExpandableEntry = NULL;
|
||||
ms_afterSelectedVisibleExpandableEntry = NULL;
|
||||
ms_previousVisibleExpandableEntry = NULL;
|
||||
ms_profilerEntriesCurrent = NULL;
|
||||
ms_profilerEntriesLast = NULL;
|
||||
ms_rootVisibleExpandableEntry = nullptr;
|
||||
ms_beforeSelectedVisibleExpandableEntry = nullptr;
|
||||
ms_selectedVisibleExpandableEntry = nullptr;
|
||||
ms_afterSelectedVisibleExpandableEntry = nullptr;
|
||||
ms_previousVisibleExpandableEntry = nullptr;
|
||||
ms_profilerEntriesCurrent = nullptr;
|
||||
ms_profilerEntriesLast = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -374,11 +374,11 @@ bool ProfilerNamespace::formatEntry(int indent, ProfilerTimer::Type totalTime, i
|
||||
void ProfilerNamespace::processEntry(char const *rootName, int indent, ProfilerEntry const & entry, VisibleExpandableEntry * visibleExpandableEntry)
|
||||
{
|
||||
if (rootName == entry.name)
|
||||
rootName = NULL;
|
||||
rootName = nullptr;
|
||||
|
||||
if (!rootName)
|
||||
{
|
||||
if (!formatEntry(indent, entry.totalTime, entry.totalCalls, visibleExpandableEntry != NULL, visibleExpandableEntry && visibleExpandableEntry->isExpanded(), visibleExpandableEntry == ms_selectedVisibleExpandableEntry, entry.name))
|
||||
if (!formatEntry(indent, entry.totalTime, entry.totalCalls, visibleExpandableEntry != nullptr, visibleExpandableEntry && visibleExpandableEntry->isExpanded(), visibleExpandableEntry == ms_selectedVisibleExpandableEntry, entry.name))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ void ProfilerNamespace::processEntry(char const *rootName, int indent, ProfilerE
|
||||
|
||||
if (child.children.empty())
|
||||
{
|
||||
processEntry(rootName, indent, child, NULL);
|
||||
processEntry(rootName, indent, child, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -483,9 +483,9 @@ void ProfilerNamespace::generateReport()
|
||||
ms_rootVisibleExpandableEntry->markAllChildrenInvisible();
|
||||
ms_rootVisibleExpandableEntry->findOrAddExpandableChild(rootEntry.name);
|
||||
|
||||
ms_previousVisibleExpandableEntry = NULL;
|
||||
ms_beforeSelectedVisibleExpandableEntry = NULL;
|
||||
ms_afterSelectedVisibleExpandableEntry = NULL;
|
||||
ms_previousVisibleExpandableEntry = nullptr;
|
||||
ms_beforeSelectedVisibleExpandableEntry = nullptr;
|
||||
ms_afterSelectedVisibleExpandableEntry = nullptr;
|
||||
processEntry(ms_rootProfilerName, 0, rootEntry, ms_rootVisibleExpandableEntry);
|
||||
|
||||
if (ms_rootVisibleExpandableEntry->pruneInvisibleChildren())
|
||||
@@ -494,7 +494,7 @@ void ProfilerNamespace::generateReport()
|
||||
if (ms_setRoot)
|
||||
{
|
||||
if (ms_rootProfilerName)
|
||||
ms_rootProfilerName = NULL;
|
||||
ms_rootProfilerName = nullptr;
|
||||
else
|
||||
ms_rootProfilerName = ms_selectedVisibleExpandableEntry->getName();
|
||||
ms_setRoot = false;
|
||||
@@ -720,7 +720,7 @@ void ProfilerNamespace::enterWithTime(char const *name, ProfilerTimer::Type time
|
||||
|
||||
// search for another call to this block from the parent
|
||||
int entryIndex = -1;
|
||||
ProfilerEntry *entry = NULL;
|
||||
ProfilerEntry *entry = nullptr;
|
||||
if (!ms_profilerEntryStack.empty())
|
||||
{
|
||||
ProfilerEntry &parent = (*ms_profilerEntriesCurrent)[ms_profilerEntryStack.back()];
|
||||
|
||||
@@ -92,10 +92,10 @@ void RemoteDebug::remove(void)
|
||||
return;
|
||||
}
|
||||
|
||||
ms_removeFunction = NULL;
|
||||
ms_openFunction = NULL;
|
||||
ms_closeFunction = NULL;
|
||||
ms_sendFunction = NULL;
|
||||
ms_removeFunction = nullptr;
|
||||
ms_openFunction = nullptr;
|
||||
ms_closeFunction = nullptr;
|
||||
ms_sendFunction = nullptr;
|
||||
|
||||
//empty out session-level data
|
||||
for (StreamMap::iterator it = ms_streams->begin(); it != ms_streams->end(); ++it)
|
||||
@@ -147,7 +147,7 @@ uint32 RemoteDebug::registerStream(const std::string& streamName)
|
||||
DEBUG_FATAL(!ms_installed, ("remoteDebug not installed"));
|
||||
|
||||
uint32 streamNum = 0;
|
||||
Channel *parent = NULL;
|
||||
Channel *parent = nullptr;
|
||||
std::string base;
|
||||
std::string rest = streamName;
|
||||
//look for subchannels with a double backslash
|
||||
@@ -203,7 +203,7 @@ uint32 RemoteDebug::registerStaticView(const std::string& channelName)
|
||||
{
|
||||
DEBUG_FATAL(!ms_installed, ("remoteDebug not installed"));
|
||||
uint32 staticViewNum = 0;
|
||||
Channel *parent = NULL;
|
||||
Channel *parent = nullptr;
|
||||
std::string base;
|
||||
std::string rest = channelName;
|
||||
//look for subchannels with a double backslash
|
||||
@@ -356,7 +356,7 @@ uint32 RemoteDebug::registerVariable(const char* variableName, void *memLoc, VAR
|
||||
std::string variable = variableName;
|
||||
|
||||
uint32 variableNum = 0;
|
||||
Channel *parent = NULL;
|
||||
Channel *parent = nullptr;
|
||||
std::string base;
|
||||
std::string rest = variable;
|
||||
//look for subchannels with a double backslash
|
||||
@@ -375,7 +375,7 @@ uint32 RemoteDebug::registerVariable(const char* variableName, void *memLoc, VAR
|
||||
//only add the variable if we don't have it yet
|
||||
if (variableNumber == -1)
|
||||
{
|
||||
registerVariable(newBase.c_str(), NULL, BOOL, sendToClients);
|
||||
registerVariable(newBase.c_str(), nullptr, BOOL, sendToClients);
|
||||
}
|
||||
//look for any other subChannel
|
||||
uint32 oldRestIndex = restIndex;
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
{
|
||||
INT, //32 bit signed int
|
||||
FLOAT, //32 bit signed float
|
||||
CSTRING, //null terminated char[]
|
||||
CSTRING, //nullptr terminated char[]
|
||||
BOOL //0 or 1 (could use an int, but useful for tools)
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
static void install(RemoveFunction, OpenFunction, CloseFunction, SendFunction, IsReadyFunction);
|
||||
|
||||
///open a session
|
||||
static void open(const char *server = NULL, uint16 port = 0);
|
||||
static void open(const char *server = nullptr, uint16 port = 0);
|
||||
|
||||
///packs the data into a packet, and sends it using the client-defined SendFunction
|
||||
static void send(MESSAGE_TYPE type, const char* name = "");
|
||||
|
||||
@@ -30,7 +30,7 @@ uint32 RemoteDebugServer::ms_inputTarget;
|
||||
// ======================================================================
|
||||
|
||||
RemoteDebug::Channel::Channel(const std::string& name, Channel *parent)
|
||||
: m_name(NULL),
|
||||
: m_name(nullptr),
|
||||
m_parent(parent)
|
||||
{
|
||||
m_name = new std::string(name);
|
||||
@@ -41,16 +41,16 @@ RemoteDebug::Channel::Channel(const std::string& name, Channel *parent)
|
||||
|
||||
RemoteDebug::Channel::~Channel()
|
||||
{
|
||||
m_parent = NULL;
|
||||
m_parent = nullptr;
|
||||
if(m_name)
|
||||
{
|
||||
delete m_name;
|
||||
m_name = NULL;
|
||||
m_name = nullptr;
|
||||
}
|
||||
if (m_children)
|
||||
{
|
||||
delete m_children;
|
||||
m_children = NULL;
|
||||
m_children = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ const std::string& RemoteDebug::Channel::name()
|
||||
|
||||
RemoteDebug::Variable::Variable(const std::string& name, void *memLoc, VARIABLE_TYPES type)
|
||||
: m_memLoc(memLoc),
|
||||
m_name(NULL),
|
||||
m_name(nullptr),
|
||||
m_type(type)
|
||||
{
|
||||
m_name = new std::string(name);
|
||||
@@ -111,7 +111,7 @@ RemoteDebug::Variable::~Variable()
|
||||
if(m_name)
|
||||
{
|
||||
delete m_name;
|
||||
m_name = NULL;
|
||||
m_name = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ void RemoteDebugClient::receive(const unsigned char * const message, const uint3
|
||||
if (channelNumber < ms_nextVariable)
|
||||
return;
|
||||
//do not send value back to server (hence the "false")
|
||||
registerVariable(ms_buffer, NULL, BOOL, false);
|
||||
registerVariable(ms_buffer, nullptr, BOOL, false);
|
||||
if (ms_newVariableFunction)
|
||||
ms_newVariableFunction(channelNumber, const_cast<const char*>(ms_buffer));
|
||||
break;
|
||||
@@ -477,7 +477,7 @@ void RemoteDebugServer::receive(const unsigned char * const message, const uint3
|
||||
memcpy(ms_buffer, charMessage + sizeOfMessageType + sizeOfChannelNumber + sizeOfSizeofPayload, sizeOfPayload);
|
||||
}
|
||||
|
||||
Variable* v = NULL;
|
||||
Variable* v = nullptr;
|
||||
switch(type)
|
||||
{
|
||||
case STREAM:
|
||||
@@ -524,27 +524,27 @@ void RemoteDebugServer::receive(const unsigned char * const message, const uint3
|
||||
break;
|
||||
|
||||
case STATIC_UP:
|
||||
if ((*ms_upFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_upFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_upFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
case STATIC_DOWN:
|
||||
if ((*ms_downFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_downFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_downFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
case STATIC_LEFT:
|
||||
if ((*ms_leftFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_leftFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_leftFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
case STATIC_RIGHT:
|
||||
if ((*ms_rightFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_rightFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_rightFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
case STATIC_ENTER:
|
||||
if ((*ms_enterFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_enterFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_enterFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
|
||||
@@ -29,13 +29,13 @@ class RemoteDebug::Channel
|
||||
NodeList* m_children;
|
||||
///the fully qualified name of the channel
|
||||
std::string* m_name;
|
||||
///its parent (which is NULL for top-level nodes
|
||||
///its parent (which is nullptr for top-level nodes
|
||||
Channel *m_parent;
|
||||
};
|
||||
|
||||
/** This class stores data about a variable channel, both on the server (where the variable actually
|
||||
* resides), and the client (which just displays it). The client simply creates Variable's with
|
||||
* NULL'd out memLoc's, since it doesn't have direct access to the memory.
|
||||
* nullptr'd out memLoc's, since it doesn't have direct access to the memory.
|
||||
*/
|
||||
class RemoteDebug::Variable
|
||||
{
|
||||
|
||||
@@ -175,7 +175,7 @@ void Report::puts(const char *buffer)
|
||||
// if (flags & RF_fatal)
|
||||
// title = "Fatal Report";
|
||||
|
||||
// MessageBox(NULL, buffer, title, MB_OK | MB_ICONEXCLAMATION);
|
||||
// MessageBox(nullptr, buffer, title, MB_OK | MB_ICONEXCLAMATION);
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ void Report::vprintf(const char *format, va_list va)
|
||||
{
|
||||
char buffer[8 * 1024];
|
||||
|
||||
// make sure the buffer is always NULL terminated
|
||||
// make sure the buffer is always nullptr terminated
|
||||
buffer[sizeof(buffer)-1] = '\0';
|
||||
|
||||
// format the string
|
||||
|
||||
Reference in New Issue
Block a user