Skip to content

Commit a18cbdf

Browse files
authored
Merge pull request #181 from Xottab-DUTY/pvs-fixes2
Various PVS warning fixes
2 parents 54f4f68 + 480d75e commit a18cbdf

File tree

7 files changed

+11
-16
lines changed

7 files changed

+11
-16
lines changed

src/utils/xrDXT/NVI_Image.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class NVI_Image
4949

5050
public:
5151
NVI_Image();
52-
~NVI_Image();
52+
virtual ~NVI_Image();
5353
virtual HRESULT Initialize(int width, int height, NVI_PIXEL_FORMAT format);
5454
virtual HRESULT Initialize(int width, int height, NVI_PIXEL_FORMAT format, u8* data);
5555
virtual HRESULT Free();
@@ -135,7 +135,7 @@ class NVI_ImageBordered : public NVI_Image
135135

136136
public:
137137
NVI_ImageBordered();
138-
~NVI_ImageBordered();
138+
~NVI_ImageBordered() override;
139139
HRESULT Initialize(NVI_Image** hSrcImage, const RECT* border, bool wrap);
140140
HRESULT Free();
141141
// i,j relative to src image, so i,j = 0 fetches from

src/utils/xrDXT/dds/tPixel.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ inline size_t calcMaxMipmap(size_t w, size_t h)
5050
{
5151
size_t n = 0;
5252
size_t count = 0;
53-
assert(w >= 0);
54-
assert(h >= 0);
5553
count = w > h ? w : h;
5654
while (count)
5755
{
@@ -65,9 +63,6 @@ inline size_t calcMaxMipmap(size_t w, size_t h, size_t d)
6563
{
6664
size_t n = 0;
6765
size_t count = 0;
68-
assert(w >= 0);
69-
assert(h >= 0);
70-
assert(d >= 0);
7166
count = w > h ? w : h;
7267
if (d > count)
7368
count = d;

src/xrCore/LocatorAPI.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -765,9 +765,8 @@ void CLocatorAPI::_initialize(u32 flags, LPCSTR target_folder, LPCSTR fs_name)
765765
#endif // DEBUG
766766

767767
CHECK_OR_EXIT(I.second,
768-
"The file 'fsgame.ltx' is corrupted (it contains duplicated lines).\nPlease reinstall the game or fix "
769-
"the "
770-
"problem manually.");
768+
"The file 'fsgame.ltx' is corrupted (it contains duplicated lines).\n"
769+
"Please reinstall the game or fix the problem manually.");
771770
}
772771
r_close(pFSltx);
773772
R_ASSERT(path_exist("$app_data_root$"));
@@ -794,9 +793,6 @@ void CLocatorAPI::_initialize(u32 flags, LPCSTR target_folder, LPCSTR fs_name)
794793
pAppdataPath->_set_root(c_newAppPathRoot);
795794
rescan_path(pAppdataPath->m_Path, pAppdataPath->m_Flags.is(FS_Path::flRecurse));
796795
}
797-
798-
int x = 0;
799-
x = x;
800796
}
801797

802798
rec_files.clear();

src/xrCore/_math.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ XRCORE_API extern u64 QPC();
3131

3232
#ifdef M_VISUAL
3333
#ifndef _M_AMD64
34+
#pragma warning(push)
3435
#pragma warning(disable : 4035)
3536
IC u64 GetCLK(void)
3637
{
3738
_asm _emit 0x0F;
3839
_asm _emit 0x31;
3940
}
40-
#pragma warning(default : 4035)
41+
#pragma warning(pop)
4142
#else
4243
IC u64 GetCLK(void) { return __rdtsc(); }
4344
#endif

src/xrCore/buffer_vector_inline.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ TEMPLATE_SPECIALIZATION
4848
inline typename buffer_vector_specialized::self_type& buffer_vector_specialized::operator=(self_type const& other)
4949
{
5050
assign(other.begin(), other.end());
51+
return *this;
5152
}
5253

5354
TEMPLATE_SPECIALIZATION

src/xrCore/xrsharedmem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#pragma pack(push, 4)
66
//////////////////////////////////////////////////////////////////////////
7+
#pragma warning(push)
78
#pragma warning(disable : 4200)
89
struct XRCORE_API smem_value
910
{
@@ -46,7 +47,7 @@ IC bool smem_equal(const smem_value* A, u32 dwCRC, u32 dwLength, u8* ptr)
4647
return false;
4748
return 0 == memcmp(A->value, ptr, dwLength);
4849
};
49-
#pragma warning(default : 4200)
50+
#pragma warning(pop)
5051

5152
//////////////////////////////////////////////////////////////////////////
5253
class XRCORE_API smem_container

src/xrCore/xrstring.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
typedef const char* str_c;
1010

1111
//////////////////////////////////////////////////////////////////////////
12+
#pragma warning(push)
1213
#pragma warning(disable : 4200)
1314
struct XRCORE_API str_value
1415
{
@@ -30,7 +31,7 @@ struct XRCORE_API str_hash_function
3031
IC u32 operator()(str_value const* const value) const { return value->dwCRC; };
3132
};
3233

33-
#pragma warning(default : 4200)
34+
#pragma warning(pop)
3435

3536
struct str_container_impl;
3637
class IWriter;

0 commit comments

Comments
 (0)