mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Change NULL to nullptr
This commit is contained in:
@ -26,7 +26,7 @@ lua_State* LuaManager::c_State = 0;
|
||||
|
||||
void LuaManager::Initialize()
|
||||
{
|
||||
if (c_State == NULL)
|
||||
if (c_State == nullptr)
|
||||
{
|
||||
// Initialize Lua
|
||||
c_State = luaL_newstate();
|
||||
@ -50,10 +50,10 @@ void LuaManager::Finalize()
|
||||
--c_RefCount;
|
||||
}
|
||||
|
||||
if (c_RefCount == 0 && c_State != NULL)
|
||||
if (c_RefCount == 0 && c_State != nullptr)
|
||||
{
|
||||
lua_close(c_State);
|
||||
c_State = NULL;
|
||||
c_State = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ bool LuaScript::Initialize(const std::wstring& scriptFile)
|
||||
fread(fileData, fileSize, 1, file);
|
||||
|
||||
fclose(file);
|
||||
file = NULL;
|
||||
file = nullptr;
|
||||
|
||||
int load = luaL_loadbuffer(L, fileData, fileSize, "");
|
||||
delete [] fileData;
|
||||
@ -209,7 +209,7 @@ int LuaScript::RunFunctionWithReturn(const char* funcName, double& numValue, std
|
||||
size_t strLen = 0;
|
||||
const char* str = lua_tolstring(L, -1, &strLen);
|
||||
strValue = StringUtil::Widen(str, (int)strLen);
|
||||
numValue = strtod(str, NULL);
|
||||
numValue = strtod(str, nullptr);
|
||||
}
|
||||
|
||||
lua_pop(L, 2);
|
||||
|
@ -37,7 +37,7 @@ static int Print(lua_State* L)
|
||||
|
||||
// Get result
|
||||
const char* s = lua_tostring(L, -1);
|
||||
if (s == NULL)
|
||||
if (s == nullptr)
|
||||
{
|
||||
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("print"));
|
||||
}
|
||||
@ -73,7 +73,7 @@ void LuaManager::RegisterGlobal(lua_State* L)
|
||||
const luaL_Reg toluaFuncs[] =
|
||||
{
|
||||
{ "cast", tolua_cast },
|
||||
{ NULL, NULL }
|
||||
{ nullptr, nullptr }
|
||||
};
|
||||
|
||||
luaL_register(L, "tolua", toluaFuncs);
|
||||
|
@ -147,7 +147,7 @@ void LuaManager::RegisterMeasure(lua_State* L)
|
||||
{ "GetMinValue", GetMinValue },
|
||||
{ "GetMaxValue", GetMaxValue },
|
||||
{ "GetStringValue", GetStringValue },
|
||||
{ NULL, NULL }
|
||||
{ nullptr, nullptr }
|
||||
};
|
||||
|
||||
luaL_register(L, "Measure", functions);
|
||||
|
@ -164,7 +164,7 @@ void LuaManager::RegisterMeter(lua_State* L)
|
||||
{ "Hide", Hide },
|
||||
{ "Show", Show },
|
||||
{ "SetText", SetText },
|
||||
{ NULL, NULL }
|
||||
{ nullptr, nullptr }
|
||||
};
|
||||
|
||||
luaL_register(L, "Meter", functions);
|
||||
|
@ -228,7 +228,7 @@ void LuaManager::RegisterMeterWindow(lua_State* L)
|
||||
{ "GetX", GetX },
|
||||
{ "GetY", GetY },
|
||||
{ "MakePathAbsolute", MakePathAbsolute },
|
||||
{ NULL, NULL }
|
||||
{ nullptr, nullptr }
|
||||
};
|
||||
|
||||
luaL_register(L, "MeterWindow", functions);
|
||||
|
Reference in New Issue
Block a user