diff --git a/src/Common/PlatformLinux.inl b/src/Common/PlatformLinux.inl index 989cc1d9052..3181f489894 100644 --- a/src/Common/PlatformLinux.inl +++ b/src/Common/PlatformLinux.inl @@ -115,7 +115,7 @@ inline void _splitpath ( } #include -inline void OutputDebugString(char *str) // for linux debugger +inline void OutputDebugString(const char *str) // for linux debugger { std::cerr << str; } @@ -202,7 +202,7 @@ typedef struct _EXCEPTION_POINTERS { #ifdef XR_X64 typedef int64_t INT_PTR; -typedef uint16_t UINT_PTR; +typedef uint64_t UINT_PTR; typedef int64_t LONG_PTR; #else typedef int INT_PTR; diff --git a/src/xrCore/XML/XMLDocument.hpp b/src/xrCore/XML/XMLDocument.hpp index b96531edf47..6a9c220193e 100644 --- a/src/xrCore/XML/XMLDocument.hpp +++ b/src/xrCore/XML/XMLDocument.hpp @@ -31,7 +31,7 @@ class XML_NODE return node; } - bool operator==(nullptr_t) = delete; + bool operator==(std::nullptr_t) = delete; XML_NODE firstChild() const { diff --git a/src/xrCore/log.h b/src/xrCore/log.h index 669dd756564..28e8ed7c764 100644 --- a/src/xrCore/log.h +++ b/src/xrCore/log.h @@ -30,7 +30,7 @@ struct LogCallback void* Context; LogCallback() : Log(nullptr), Context(nullptr) {} - LogCallback(nullptr_t) : Log(nullptr), Context(nullptr) {} + LogCallback(std::nullptr_t) : Log(nullptr), Context(nullptr) {} LogCallback(Func log, void* ctx) : Log(log), Context(ctx) {} void operator()(const char* s) { Log(Context, s); } operator bool() const { return !!Log; } diff --git a/src/xrCore/xrMemory.h b/src/xrCore/xrMemory.h index a5ee69e8860..38e05033ae6 100644 --- a/src/xrCore/xrMemory.h +++ b/src/xrCore/xrMemory.h @@ -3,8 +3,8 @@ #include "Common/Common.hpp" #include "_types.h" -#include "tbb/tbb_allocator.h" -#include "tbb/scalable_allocator.h" +#include +#include /* Можно заключить - прокси перехватывает не всегда и/или не всё используемые функции. diff --git a/src/xrCore/xr_trims.cpp b/src/xrCore/xr_trims.cpp index eecbe19b15f..dc652a67ca3 100644 --- a/src/xrCore/xr_trims.cpp +++ b/src/xrCore/xr_trims.cpp @@ -51,7 +51,7 @@ LPCSTR _CopyVal(LPCSTR src, LPSTR dst, char separator) LPCSTR p; size_t n; p = strchr(src, separator); - n = (p > 0) ? (p - src) : xr_strlen(src); + n = (p != nullptr) ? (p - src) : xr_strlen(src); strncpy(dst, src, n); dst[n] = 0; return dst; @@ -279,7 +279,7 @@ LPCSTR _CopyVal(LPCSTR src, AnsiString& dst, char separator) LPCSTR p; u32 n; p = strchr(src, separator); - n = (p > 0) ? (p - src) : xr_strlen(src); + n = (p != nullptr) ? (p - src) : xr_strlen(src); dst = src; dst = dst.Delete(n + 1, dst.Length()); return dst.c_str(); @@ -490,7 +490,7 @@ LPCSTR _CopyVal(LPCSTR src, xr_string& dst, char separator) LPCSTR p; std::ptrdiff_t n; p = strchr(src, separator); - n = (p > 0) ? (p - src) : xr_strlen(src); + n = (p != nullptr) ? (p - src) : xr_strlen(src); dst = src; dst = dst.erase(n, dst.length()); return dst.c_str(); diff --git a/src/xrEngine/xrSheduler.cpp b/src/xrEngine/xrSheduler.cpp index 35d187bea5a..98ff05e7365 100644 --- a/src/xrEngine/xrSheduler.cpp +++ b/src/xrEngine/xrSheduler.cpp @@ -702,7 +702,7 @@ void Scheduler::Unregister(ISheduled* object) Msg("SCHEDULERMT: unregister [%s][%x]", object->shedule_Name().c_str(), object); #endif - ItemReg item = { false, object->GetSchedulerData().b_RT, object }; + ItemReg item = { false, object->GetSchedulerData().b_RT != 0, object }; RegistrationQueue.emplace_back(std::move(item)); } diff --git a/src/xrGame/alife_registry_wrapper.h b/src/xrGame/alife_registry_wrapper.h index 0f08df989a6..cbc20530d93 100644 --- a/src/xrGame/alife_registry_wrapper.h +++ b/src/xrGame/alife_registry_wrapper.h @@ -40,9 +40,9 @@ const typename _registry_type::_data* CALifeRegistryWrapper<_registry_type>::obj if (I == local_registry.end()) { typename _registry_type::_data new_registry; - std::pair<_registry_type::iterator, bool> p = local_registry.insert(std::make_pair(id, new_registry)); - VERIFY(p.second); - return &(*local_registry.find(id)).second; + auto [iter, inserted] = local_registry.insert(std::make_pair(id, new_registry)); + VERIFY(inserted); + return &(iter->second); } return (&(*I).second); } @@ -63,9 +63,9 @@ typename _registry_type::_data& CALifeRegistryWrapper<_registry_type>::objects(u if (I == local_registry.end()) { typename _registry_type::_data new_registry; - std::pair<_registry_type::iterator, bool> p = local_registry.insert(std::make_pair(id, new_registry)); - VERIFY(p.second); - return (*local_registry.find(id)).second; + auto [iter, inserted] = local_registry.insert(std::make_pair(id, new_registry)); + VERIFY(inserted); + return (iter->second); } else return ((*I).second); diff --git a/src/xrGame/ik/IKLimb.h b/src/xrGame/ik/IKLimb.h index c102ecf70b6..19df2efe305 100644 --- a/src/xrGame/ik/IKLimb.h +++ b/src/xrGame/ik/IKLimb.h @@ -9,12 +9,15 @@ #include "ik_limb_state_predict.h" class IKinematics; -class CDB::TRI; struct SCalculateData; struct SIKCollideData; class CGameObject; class motion_marks; class ik_goal_matrix; +namespace CDB +{ +class TRI; +} namespace extrapolation { class points; diff --git a/src/xrScriptEngine/script_engine.cpp b/src/xrScriptEngine/script_engine.cpp index 62fc2b8682f..a7eee078517 100644 --- a/src/xrScriptEngine/script_engine.cpp +++ b/src/xrScriptEngine/script_engine.cpp @@ -1160,7 +1160,7 @@ CScriptProcess* CScriptEngine::script_process(const ScriptProcessor& process_id) void CScriptEngine::parse_script_namespace(const char* name, char* ns, u32 nsSize, char* func, u32 funcSize) { - auto p = strrchr(name, '.'); + const char* p = strrchr(name, '.'); if (!p) { xr_strcpy(ns, nsSize, GlobalNamespace); diff --git a/src/xrSound/xr_streamsnd.cpp b/src/xrSound/xr_streamsnd.cpp index dfe30a37c4a..55d8269d0bf 100644 --- a/src/xrSound/xr_streamsnd.cpp +++ b/src/xrSound/xr_streamsnd.cpp @@ -347,7 +347,7 @@ void CSoundStream::LoadADPCM() DataPos = NULL; hf = FS.r_open("$game_sounds$", fn); - R_ASSERT(hf >= 0); + VERIFY(hf); ZeroMemory(&riff, sizeof(riff)); XRead(riff); CopyMemory(buf, riff.id, 4); diff --git a/src/xr_3da/entry_point.cpp b/src/xr_3da/entry_point.cpp index fec03f96a9a..da74c45ea6d 100644 --- a/src/xr_3da/entry_point.cpp +++ b/src/xr_3da/entry_point.cpp @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) for(i = 1; i < argc; ++i) sum += strlen(argv[i]) + 1; - commandLine = malloc(sum); + commandLine = (char*)malloc(sum); memset(commandLine, 0, sum); for(i = 1; i < argc; ++i)