From efd907105cf7906c78253631f75bf4fd83f769db Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 29 Jun 2023 04:22:33 +0100 Subject: Code cleanup (#478) * turn implicit type casts into standard compliant explicit type casts * correct includes and library names * correct implicit use of std-namespaced functions * turn incomplete virtual implementations into pure virtuals (this also follows what the Source SDK tier0 header does) * define SqRecurseArgs ahead of implementation to fix templating problems * switch out removed getentity with getthisentity * fix calls to curl_easy_escape with wrong types * replace winapi-specific function with std starts_with function * format squirrel header --- NorthstarDLL/core/convar/concommand.cpp | 2 +- NorthstarDLL/core/convar/convar.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'NorthstarDLL/core/convar') diff --git a/NorthstarDLL/core/convar/concommand.cpp b/NorthstarDLL/core/convar/concommand.cpp index 82594f04..ce198159 100644 --- a/NorthstarDLL/core/convar/concommand.cpp +++ b/NorthstarDLL/core/convar/concommand.cpp @@ -151,5 +151,5 @@ ON_DLL_LOAD("engine.dll", ConCommand, (CModule module)) ConCommandConstructor = module.Offset(0x415F60).As(); AddMiscConCommands(); - g_pPluginCommunicationhandler->m_sEngineData.ConCommandConstructor = ConCommandConstructor; + g_pPluginCommunicationhandler->m_sEngineData.ConCommandConstructor = (void*)ConCommandConstructor; } diff --git a/NorthstarDLL/core/convar/convar.cpp b/NorthstarDLL/core/convar/convar.cpp index d4efc1a0..5069192e 100644 --- a/NorthstarDLL/core/convar/convar.cpp +++ b/NorthstarDLL/core/convar/convar.cpp @@ -40,10 +40,10 @@ ON_DLL_LOAD("engine.dll", ConVar, (CModule module)) R2::g_pCVarInterface = new SourceInterface("vstdlib.dll", "VEngineCvar007"); R2::g_pCVar = *R2::g_pCVarInterface; - g_pPluginCommunicationhandler->m_sEngineData.conVarMalloc = conVarMalloc; - g_pPluginCommunicationhandler->m_sEngineData.conVarRegister = conVarRegister; - g_pPluginCommunicationhandler->m_sEngineData.ConVar_Vtable = g_pConVar_Vtable; - g_pPluginCommunicationhandler->m_sEngineData.IConVar_Vtable = g_pIConVar_Vtable; + g_pPluginCommunicationhandler->m_sEngineData.conVarMalloc = (void*)conVarMalloc; + g_pPluginCommunicationhandler->m_sEngineData.conVarRegister = (void*)conVarRegister; + g_pPluginCommunicationhandler->m_sEngineData.ConVar_Vtable = (void*)g_pConVar_Vtable; + g_pPluginCommunicationhandler->m_sEngineData.IConVar_Vtable = (void*)g_pIConVar_Vtable; } //----------------------------------------------------------------------------- @@ -80,7 +80,7 @@ ConVar::ConVar( this->m_ConCommandBase.s_pConCommandBases = (ConCommandBase*)g_pIConVar_Vtable; conVarMalloc(&this->m_pMalloc, 0, 0); // Allocate new memory for ConVar. - conVarRegister(this, pszName, pszDefaultValue, nFlags, pszHelpString, bMin, fMin, bMax, fMax, pCallback); + conVarRegister(this, pszName, pszDefaultValue, nFlags, pszHelpString, bMin, fMin, bMax, fMax, (void*)pCallback); } //----------------------------------------------------------------------------- @@ -321,7 +321,7 @@ void ConVar::SetValue(const char* pszValue) { // Not a color, do the standard thing float flNewValue = (float)atof(pszValue); - if (!isfinite(flNewValue)) + if (!std::isfinite(flNewValue)) { spdlog::warn("Warning: ConVar '{}' = '{}' is infinite, clamping value.\n", GetBaseName(), pszValue); flNewValue = FLT_MAX; -- cgit v1.2.3