Skip to content

Commit

Permalink
Cleaned up some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Dec 5, 2017
1 parent 1e1fdb8 commit 09e19e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions DirectXTex/DirectXTexConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2886,7 +2886,7 @@ namespace
};

#pragma prefast( suppress : 25004, "Signature must match bsearch_s" );
int __cdecl _ConvertCompare(void *context, const void* ptr1, const void *ptr2)
int __cdecl ConvertCompare(void *context, const void* ptr1, const void *ptr2) DIRECTX_NOEXCEPT
{
UNREFERENCED_PARAMETER(context);
const ConvertData *p1 = reinterpret_cast<const ConvertData*>(ptr1);
Expand All @@ -2912,7 +2912,7 @@ DWORD DirectX::_GetConvertFlags(DXGI_FORMAT format)

ConvertData key = { format, 0 };
const ConvertData* in = (const ConvertData*)bsearch_s(&key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData),
_ConvertCompare, nullptr);
ConvertCompare, nullptr);
return (in) ? in->flags : 0;
}

Expand Down Expand Up @@ -2945,10 +2945,10 @@ void DirectX::_ConvertScanline(
// Determine conversion details about source and dest formats
ConvertData key = { inFormat, 0 };
const ConvertData* in = (const ConvertData*)bsearch_s(&key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData),
_ConvertCompare, nullptr);
ConvertCompare, nullptr);
key.format = outFormat;
const ConvertData* out = (const ConvertData*)bsearch_s(&key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData),
_ConvertCompare, nullptr);
ConvertCompare, nullptr);
if (!in || !out)
{
assert(false);
Expand Down
5 changes: 5 additions & 0 deletions DirectXTex/DirectXTexP.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@

#define XBOX_DXGI_FORMAT_R4G4_UNORM DXGI_FORMAT(190)

#if !defined(DIRECTX_NOEXCEPT) && defined(_MSC_VER) && (_MSC_VER < 1900)

This comment has been minimized.

Copy link
@walbourn

walbourn Dec 5, 2017

Author Member

I have preferred to just use noexcept in the code, but VS 2013 doesn't support it.

#define DIRECTX_NOEXCEPT
#else
#define DIRECTX_NOEXCEPT noexcept
#endif

namespace DirectX
{
Expand Down
2 changes: 1 addition & 1 deletion DirectXTex/DirectXTexUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ IWICImagingFactory* DirectX::GetWICFactory(bool& iswic2)
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;

InitOnceExecuteOnce(&s_initOnce,
[](PINIT_ONCE, PVOID, LPVOID *factory) -> BOOL
[](PINIT_ONCE, PVOID, LPVOID *factory) DIRECTX_NOEXCEPT -> BOOL
{
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
HRESULT hr = CoCreateInstance(
Expand Down

0 comments on commit 09e19e1

Please sign in to comment.