Skip to content

Commit bb3ff0f

Browse files
committed
Ensure -Wmicrosoft-cast is ignored
1 parent a339c2b commit bb3ff0f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Src/GamePad.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ using namespace GameInput::v3;
9898

9999
using GameInputCreateFn = HRESULT(*)(IGameInput**);
100100

101+
#ifdef __clang__
102+
#pragma clang diagnostic ignored "-Wmicrosoft-cast"
103+
#endif
104+
101105
class GamePad::Impl
102106
{
103107
public:
@@ -122,7 +126,7 @@ class GamePad::Impl
122126
s_gameInputModule = LoadLibraryExW(L"GameInput.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
123127
if (s_gameInputModule)
124128
{
125-
s_gameInputCreate = reinterpret_cast<GameInputCreateFn>(static_cast<void*>(GetProcAddress(s_gameInputModule, "GameInputCreate")));
129+
s_gameInputCreate = reinterpret_cast<GameInputCreateFn>(reinterpret_cast<void*>(GetProcAddress(s_gameInputModule, "GameInputCreate")));
126130
}
127131

128132
if (!s_gameInputCreate)

Src/Keyboard.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ using namespace GameInput::v3;
6565

6666
using GameInputCreateFn = HRESULT(*)(IGameInput**);
6767

68+
#ifdef __clang__
69+
#pragma clang diagnostic ignored "-Wmicrosoft-cast"
70+
#endif
71+
6872
class Keyboard::Impl
6973
{
7074
public:
@@ -89,7 +93,7 @@ class Keyboard::Impl
8993
s_gameInputModule = LoadLibraryExW(L"GameInput.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
9094
if (s_gameInputModule)
9195
{
92-
s_gameInputCreate = reinterpret_cast<GameInputCreateFn>(static_cast<void*>(GetProcAddress(s_gameInputModule, "GameInputCreate")));
96+
s_gameInputCreate = reinterpret_cast<GameInputCreateFn>(reinterpret_cast<void*>(GetProcAddress(s_gameInputModule, "GameInputCreate")));
9397
}
9498

9599
if (!s_gameInputCreate)

Src/Mouse.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ using namespace GameInput::v3;
3333

3434
using GameInputCreateFn = HRESULT(*)(IGameInput**);
3535

36+
#ifdef __clang__
37+
#pragma clang diagnostic ignored "-Wmicrosoft-cast"
38+
#endif
39+
3640
//
3741
// Call this static function from your Window Message Procedure
3842
//
@@ -93,7 +97,7 @@ class Mouse::Impl
9397
s_gameInputModule = LoadLibraryExW(L"GameInput.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
9498
if (s_gameInputModule)
9599
{
96-
s_gameInputCreate = reinterpret_cast<GameInputCreateFn>(static_cast<void*>(GetProcAddress(s_gameInputModule, "GameInputCreate")));
100+
s_gameInputCreate = reinterpret_cast<GameInputCreateFn>(reinterpret_cast<void*>(GetProcAddress(s_gameInputModule, "GameInputCreate")));
97101
}
98102

99103
if (!s_gameInputCreate)

0 commit comments

Comments
 (0)