mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-09-29 14:12:54 -04:00
newer standards prefer nullptr over NULL - this is most of them but there are others too
This commit is contained in:
@@ -22,7 +22,7 @@ struct SetBufferMode
|
||||
|
||||
SetBufferMode::SetBufferMode()
|
||||
{
|
||||
setvbuf(stdin, NULL, _IONBF, 0);
|
||||
setvbuf(stdin, nullptr, _IONBF, 0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -92,7 +92,7 @@ void makeParameters(const std::vector<std::string> & parameters, std::vector<cha
|
||||
strcpy(arg, (*i).c_str()); //lint !e64 !e534
|
||||
p.push_back(arg);
|
||||
}
|
||||
p.push_back(NULL);
|
||||
p.push_back(nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -29,7 +29,7 @@ int main(int argc, char ** argv)
|
||||
SetupSharedCompression::install();
|
||||
SetupSharedFile::install(false);
|
||||
SetupSharedNetworkMessages::install();
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(NULL))); //lint !e1924 !e64 // NULL is a C-Style cast?
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(nullptr))); //lint !e1924 !e64 // nullptr is a C-Style cast?
|
||||
|
||||
Os::setProgramName("TaskManager");
|
||||
//setup the server
|
||||
|
||||
@@ -89,7 +89,7 @@ void GameConnection::receive(const Archive::ByteStream & message)
|
||||
char filename[30];
|
||||
snprintf(filename, sizeof(filename)-1, "/proc/%lu/cmdline", m_pid);
|
||||
|
||||
// format of the cmdline file is a NULL separates every
|
||||
// format of the cmdline file is a nullptr separates every
|
||||
// parameter, so we'll have to replace the NULLs with spaces
|
||||
FILE *inFile = fopen(filename,"rb");
|
||||
if (inFile)
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace LocatorNamespace
|
||||
float getConfigSetting(const char *section, const char *key, const float defaultValue)
|
||||
{
|
||||
const ConfigFile::Section * sec = ConfigFile::getSection(section);
|
||||
if (sec == NULL)
|
||||
if (sec == nullptr)
|
||||
return defaultValue;
|
||||
|
||||
const ConfigFile::Key * ky = sec->findKey(key);
|
||||
if (ky == NULL)
|
||||
if (ky == nullptr)
|
||||
return defaultValue;
|
||||
|
||||
return ky->getAsFloat(ky->getCount()-1, defaultValue);
|
||||
@@ -364,7 +364,7 @@ void Locator::opened(std::string const &label, ManagerConnection *newConnection)
|
||||
TaskManager::runSpawnRequestQueue();
|
||||
}
|
||||
else
|
||||
WARNING_STRICT_FATAL(true, ("Passed null connection to Locator::opened"));
|
||||
WARNING_STRICT_FATAL(true, ("Passed nullptr connection to Locator::opened"));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -98,7 +98,7 @@ void ManagerConnection::onReceive(const Archive::ByteStream & message)
|
||||
r = message.begin();
|
||||
if (m.isType("SystemTimeCheck"))
|
||||
{
|
||||
long const currentTime = static_cast<long>(::time(NULL));
|
||||
long const currentTime = static_cast<long>(::time(nullptr));
|
||||
GenericValueTypeMessage<std::pair<std::string, long > > msg(r);
|
||||
|
||||
if (TaskManager::getNodeLabel() == "node0")
|
||||
@@ -117,7 +117,7 @@ void ManagerConnection::onReceive(const Archive::ByteStream & message)
|
||||
else if (m.isType("TaskConnectionIdMessage"))
|
||||
{
|
||||
static long const clockDriftFatalTimePeriod = static_cast<long>(TaskManager::getStartTime()) + ConfigTaskManager::getClockDriftFatalIntervalSeconds();
|
||||
long const currentTime = static_cast<long>(::time(NULL));
|
||||
long const currentTime = static_cast<long>(::time(nullptr));
|
||||
TaskConnectionIdMessage t(r);
|
||||
WARNING_STRICT_FATAL(t.getServerType() != TaskConnectionIdMessage::TaskManager,
|
||||
("ManagerConnection received wrong type identifier"));
|
||||
|
||||
@@ -161,7 +161,7 @@ m_processEntries(),
|
||||
m_localServers(),
|
||||
m_remoteServers(),
|
||||
m_nodeLabel(),
|
||||
m_startTime(::time(NULL)),
|
||||
m_startTime(::time(nullptr)),
|
||||
m_nodeList(),
|
||||
m_nodeNumber(-1),
|
||||
m_nodeToConnectToList(),
|
||||
@@ -362,7 +362,7 @@ void TaskManager::processRcFile()
|
||||
void TaskManager::setupNodeList()
|
||||
{
|
||||
char buffer[64];
|
||||
const char* result = NULL;
|
||||
const char* result = nullptr;
|
||||
int nodeIndex = 0;
|
||||
bool found = true;
|
||||
|
||||
@@ -375,7 +375,7 @@ void TaskManager::setupNodeList()
|
||||
{
|
||||
found = false;
|
||||
sprintf(buffer, "node%d", nodeIndex);
|
||||
result = ConfigFile::getKeyString("TaskManager", buffer, NULL);
|
||||
result = ConfigFile::getKeyString("TaskManager", buffer, nullptr);
|
||||
if (result)
|
||||
{
|
||||
NodeEntry n(result, buffer, nodeIndex);
|
||||
@@ -967,8 +967,8 @@ void TaskManager::update()
|
||||
// of slave TaskManager that has disconnected but has not reconnected,
|
||||
// so that an alert can be made in SOEMon so ops can see it and restart
|
||||
// the disconnected TaskManager
|
||||
static time_t timeSystemTimeCheck = ::time(NULL) + ConfigTaskManager::getSystemTimeCheckIntervalSeconds();
|
||||
time_t const timeNow = ::time(NULL);
|
||||
static time_t timeSystemTimeCheck = ::time(nullptr) + ConfigTaskManager::getSystemTimeCheckIntervalSeconds();
|
||||
time_t const timeNow = ::time(nullptr);
|
||||
if (timeSystemTimeCheck <= timeNow)
|
||||
{
|
||||
if (getNodeLabel() != "node0")
|
||||
|
||||
Reference in New Issue
Block a user