mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Use the "nullptr" literal.
"nullptr" should be used to denote the null pointer
This commit is contained in:
@@ -134,7 +134,7 @@ LONG WINAPI onUnhandledException(EXCEPTION_POINTERS* exception)
|
||||
HMODULE hModule = nullptr;
|
||||
GetModuleFileNameA(hModule, buffer, MAX_PATH);
|
||||
mname = strrchr(buffer, '\\');
|
||||
if (mname != 0)
|
||||
if (mname != nullptr)
|
||||
mname++;
|
||||
else
|
||||
mname = buffer;
|
||||
|
||||
@@ -140,7 +140,7 @@ struct DLL_LINKAGE StartInfo
|
||||
}
|
||||
|
||||
StartInfo() : mode(INVALID), difficulty(1), seedToBeUsed(0), seedPostInit(0),
|
||||
mapfileChecksum(0), startTimeIso8601(vstd::getDateTimeISO8601Basic(std::time(0))), fileURI("")
|
||||
mapfileChecksum(0), startTimeIso8601(vstd::getDateTimeISO8601Basic(std::time(nullptr))), fileURI("")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -573,7 +573,7 @@ void CGameState::initNewGame(const IMapService * mapService, bool allowSavingRan
|
||||
|
||||
const std::string templateName = options->getMapTemplate()->getName();
|
||||
const ui32 seed = scenarioOps->seedToBeUsed;
|
||||
const std::string dt = vstd::getDateTimeISO8601Basic(std::time(0));
|
||||
const std::string dt = vstd::getDateTimeISO8601Basic(std::time(nullptr));
|
||||
|
||||
const std::string fileName = boost::str(boost::format("%s_%s_%d.vmap") % dt % templateName % seed );
|
||||
const auto fullPath = path / fileName;
|
||||
|
||||
@@ -54,7 +54,7 @@ struct VectorizedObjectInfo
|
||||
class DLL_LINKAGE CSerializer
|
||||
{
|
||||
template<typename T>
|
||||
static si32 idToNumber(const T &t, typename std::enable_if<std::is_convertible<T,si32>::value>::type * dummy = 0)
|
||||
static si32 idToNumber(const T &t, typename std::enable_if<std::is_convertible<T,si32>::value>::type * dummy = nullptr)
|
||||
{
|
||||
return t;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user