mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Explicitly disable certain warnings in code
This code is good as-is, they cannot be adjusted to suppress the warnings while still guaranteeing its functionality.
This commit is contained in:
parent
d620a7efe8
commit
fe0cce731b
@ -75,11 +75,16 @@ void CHostState::FrameUpdate(CHostState* pHostState, double flCurrentTime, float
|
||||
#endif // !DEDICATED
|
||||
|
||||
HostStates_t oldState{};
|
||||
|
||||
// Disable "warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable"
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4611)
|
||||
if (setjmp(*host_abortserver))
|
||||
{
|
||||
g_pHostState->Init();
|
||||
return;
|
||||
}
|
||||
#pragma warning(pop)
|
||||
else
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
|
@ -144,7 +144,10 @@ bool CSigCache::LoadCache(const string& svCacheFile)
|
||||
return false;
|
||||
}
|
||||
|
||||
#pragma warning(push) // Disabled type conversion warning, as it is possible
|
||||
#pragma warning(disable : 4244) // for Protobuf to migrate this code to feature size_t.
|
||||
if (!m_Cache.ParseFromArray(pDstBuf.get(), header.m_nBlobSizeMem))
|
||||
#pragma warning(pop)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -34,7 +34,10 @@ SQRESULT SQVM_PrintFunc(HSQUIRRELVM v, SQChar* fmt, ...)
|
||||
eDLL_T remoteContext;
|
||||
// We use the sqvm pointer as index for SDK usage as the function prototype has to match assembly.
|
||||
// The compiler 'pointer truncation' warning couldn't be avoided, but it's safe to ignore it.
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4302 4311)
|
||||
switch (static_cast<SQCONTEXT>(reinterpret_cast<int>(v)))
|
||||
#pragma warning(pop)
|
||||
{
|
||||
case SQCONTEXT::SERVER:
|
||||
remoteContext = eDLL_T::SCRIPT_SERVER;
|
||||
|
@ -629,8 +629,11 @@ V_MakeAbsolutePath(char* pOut, size_t outLen, const char* pPath, const char* pSt
|
||||
}
|
||||
#else
|
||||
{
|
||||
#pragma warning(push) // Disabled type conversion warning, as some implementations of '_getcwd' take a size_t.
|
||||
#pragma warning(disable : 4267)
|
||||
if (!_getcwd(pOut, outLen))
|
||||
Error(eDLL_T::COMMON, EXIT_FAILURE, "V_MakeAbsolutePath: _getcwd failed.");
|
||||
#pragma warning(pop)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user