From c81bbcfc2c341e6cfd40a658cbeda14b1554b1e2 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 29 Mar 2017 18:04:19 +0500 Subject: [PATCH 1/6] ~NVI_ImageBordered() hides ~NVI_Image() --- src/utils/xrDXT/NVI_Image.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/xrDXT/NVI_Image.h b/src/utils/xrDXT/NVI_Image.h index 1459e63ffba..d914d89b95f 100644 --- a/src/utils/xrDXT/NVI_Image.h +++ b/src/utils/xrDXT/NVI_Image.h @@ -49,7 +49,7 @@ class NVI_Image public: NVI_Image(); - ~NVI_Image(); + virtual ~NVI_Image(); virtual HRESULT Initialize(int width, int height, NVI_PIXEL_FORMAT format); virtual HRESULT Initialize(int width, int height, NVI_PIXEL_FORMAT format, u8* data); virtual HRESULT Free(); @@ -135,7 +135,7 @@ class NVI_ImageBordered : public NVI_Image public: NVI_ImageBordered(); - ~NVI_ImageBordered(); + ~NVI_ImageBordered() override; HRESULT Initialize(NVI_Image** hSrcImage, const RECT* border, bool wrap); HRESULT Free(); // i,j relative to src image, so i,j = 0 fetches from From e45334c078692e3b4b011c4f791b24efcae09757 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 29 Mar 2017 18:06:29 +0500 Subject: [PATCH 2/6] Expression is always true --- src/utils/xrDXT/dds/tPixel.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/utils/xrDXT/dds/tPixel.h b/src/utils/xrDXT/dds/tPixel.h index b426a175570..9fdf3baeb6c 100644 --- a/src/utils/xrDXT/dds/tPixel.h +++ b/src/utils/xrDXT/dds/tPixel.h @@ -50,8 +50,6 @@ inline size_t calcMaxMipmap(size_t w, size_t h) { size_t n = 0; size_t count = 0; - assert(w >= 0); - assert(h >= 0); count = w > h ? w : h; while (count) { @@ -65,9 +63,6 @@ inline size_t calcMaxMipmap(size_t w, size_t h, size_t d) { size_t n = 0; size_t count = 0; - assert(w >= 0); - assert(h >= 0); - assert(d >= 0); count = w > h ? w : h; if (d > count) count = d; From 269ddee02c16564a984f9a307ecff3af0801dc04 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 29 Mar 2017 18:10:59 +0500 Subject: [PATCH 3/6] It was never used. For what purpose this int did even existed? --- src/xrCore/LocatorAPI.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/xrCore/LocatorAPI.cpp b/src/xrCore/LocatorAPI.cpp index 1a22e42eec3..d70f1dd6e67 100644 --- a/src/xrCore/LocatorAPI.cpp +++ b/src/xrCore/LocatorAPI.cpp @@ -794,9 +794,6 @@ void CLocatorAPI::_initialize(u32 flags, LPCSTR target_folder, LPCSTR fs_name) pAppdataPath->_set_root(c_newAppPathRoot); rescan_path(pAppdataPath->m_Path, pAppdataPath->m_Flags.is(FS_Path::flRecurse)); } - - int x = 0; - x = x; } rec_files.clear(); From 83a88812144ecb64d10ac882d54b72d5196ff861 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 29 Mar 2017 18:22:32 +0500 Subject: [PATCH 4/6] Fix incorrect use of #pragma warning --- src/xrCore/_math.h | 3 ++- src/xrCore/xrsharedmem.h | 3 ++- src/xrCore/xrstring.h | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/xrCore/_math.h b/src/xrCore/_math.h index 652907ddb70..f0d2f870413 100644 --- a/src/xrCore/_math.h +++ b/src/xrCore/_math.h @@ -31,13 +31,14 @@ XRCORE_API extern u64 QPC(); #ifdef M_VISUAL #ifndef _M_AMD64 +#pragma warning(push) #pragma warning(disable : 4035) IC u64 GetCLK(void) { _asm _emit 0x0F; _asm _emit 0x31; } -#pragma warning(default : 4035) +#pragma warning(pop) #else IC u64 GetCLK(void) { return __rdtsc(); } #endif diff --git a/src/xrCore/xrsharedmem.h b/src/xrCore/xrsharedmem.h index cddab12e590..45d4664486a 100644 --- a/src/xrCore/xrsharedmem.h +++ b/src/xrCore/xrsharedmem.h @@ -4,6 +4,7 @@ #pragma pack(push, 4) ////////////////////////////////////////////////////////////////////////// +#pragma warning(push) #pragma warning(disable : 4200) struct XRCORE_API smem_value { @@ -46,7 +47,7 @@ IC bool smem_equal(const smem_value* A, u32 dwCRC, u32 dwLength, u8* ptr) return false; return 0 == memcmp(A->value, ptr, dwLength); }; -#pragma warning(default : 4200) +#pragma warning(pop) ////////////////////////////////////////////////////////////////////////// class XRCORE_API smem_container diff --git a/src/xrCore/xrstring.h b/src/xrCore/xrstring.h index 2e3d9038068..9eee6e881bb 100644 --- a/src/xrCore/xrstring.h +++ b/src/xrCore/xrstring.h @@ -9,6 +9,7 @@ typedef const char* str_c; ////////////////////////////////////////////////////////////////////////// +#pragma warning(push) #pragma warning(disable : 4200) struct XRCORE_API str_value { @@ -30,7 +31,7 @@ struct XRCORE_API str_hash_function IC u32 operator()(str_value const* const value) const { return value->dwCRC; }; }; -#pragma warning(default : 4200) +#pragma warning(pop) struct str_container_impl; class IWriter; From 2f715691380f2259b70fed5ffc0445bd3037c7a9 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 29 Mar 2017 18:27:27 +0500 Subject: [PATCH 5/6] Fix non-void function not returning a value --- src/xrCore/buffer_vector_inline.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xrCore/buffer_vector_inline.h b/src/xrCore/buffer_vector_inline.h index a2bb7e17096..bbf070ccbb8 100644 --- a/src/xrCore/buffer_vector_inline.h +++ b/src/xrCore/buffer_vector_inline.h @@ -48,6 +48,7 @@ TEMPLATE_SPECIALIZATION inline typename buffer_vector_specialized::self_type& buffer_vector_specialized::operator=(self_type const& other) { assign(other.begin(), other.end()); + return *this; } TEMPLATE_SPECIALIZATION From 480d75e5f1ea6ee082a7ce1fbd6b661c6e871e7c Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sat, 1 Apr 2017 09:05:46 +0500 Subject: [PATCH 6/6] Just small text appearance change Not related to PVS or any bug --- src/xrCore/LocatorAPI.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/xrCore/LocatorAPI.cpp b/src/xrCore/LocatorAPI.cpp index d70f1dd6e67..d8b5d857a92 100644 --- a/src/xrCore/LocatorAPI.cpp +++ b/src/xrCore/LocatorAPI.cpp @@ -765,9 +765,8 @@ void CLocatorAPI::_initialize(u32 flags, LPCSTR target_folder, LPCSTR fs_name) #endif // DEBUG CHECK_OR_EXIT(I.second, - "The file 'fsgame.ltx' is corrupted (it contains duplicated lines).\nPlease reinstall the game or fix " - "the " - "problem manually."); + "The file 'fsgame.ltx' is corrupted (it contains duplicated lines).\n" + "Please reinstall the game or fix the problem manually."); } r_close(pFSltx); R_ASSERT(path_exist("$app_data_root$"));