Skip to content

Commit

Permalink
Merge pull request #181 from Xottab-DUTY/pvs-fixes2
Browse files Browse the repository at this point in the history
Various PVS warning fixes
  • Loading branch information
CrossVR committed Apr 10, 2017
2 parents 54f4f68 + 480d75e commit a18cbdf
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/utils/xrDXT/NVI_Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions src/utils/xrDXT/dds/tPixel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
Expand Down
8 changes: 2 additions & 6 deletions src/xrCore/LocatorAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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$"));
Expand All @@ -794,9 +793,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();
Expand Down
3 changes: 2 additions & 1 deletion src/xrCore/_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/xrCore/buffer_vector_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/xrCore/xrsharedmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#pragma pack(push, 4)
//////////////////////////////////////////////////////////////////////////
#pragma warning(push)
#pragma warning(disable : 4200)
struct XRCORE_API smem_value
{
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/xrCore/xrstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
typedef const char* str_c;

//////////////////////////////////////////////////////////////////////////
#pragma warning(push)
#pragma warning(disable : 4200)
struct XRCORE_API str_value
{
Expand All @@ -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;
Expand Down

0 comments on commit a18cbdf

Please sign in to comment.