summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Joystick.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-10-03 16:51:12 +0200
committerAki <please@ignore.pl>2021-10-03 16:51:12 +0200
commit104248aabf40b692231fccd1adf1a2a494f1589a (patch)
tree5eee42a18a9688b03b483aff5c2bedffb4fe8a6c /Stars45/Joystick.cpp
parentddd76aa4e1571c8d5965709db5c3cd47a89c9a38 (diff)
parentd2f333bf998691760b8970c2784756d0fa81e820 (diff)
downloadstarshatter-104248aabf40b692231fccd1adf1a2a494f1589a.zip
starshatter-104248aabf40b692231fccd1adf1a2a494f1589a.tar.gz
starshatter-104248aabf40b692231fccd1adf1a2a494f1589a.tar.bz2
Stars45 can now be built under MSYS2/Mingw32
Diffstat (limited to 'Stars45/Joystick.cpp')
-rw-r--r--Stars45/Joystick.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Stars45/Joystick.cpp b/Stars45/Joystick.cpp
index 3d641dd..5a30f8d 100644
--- a/Stars45/Joystick.cpp
+++ b/Stars45/Joystick.cpp
@@ -65,7 +65,7 @@ static int strikes = 3;
static Joystick* joystick = 0;
void DirectInputError(const char* msg, HRESULT err);
-char* DIErrStr(HRESULT hr);
+const char* DIErrStr(HRESULT hr);
void ReleaseDirectInput();
// +--------------------------------------------------------------------+
@@ -857,11 +857,12 @@ DirectInputError(const char* msg, HRESULT err)
static char errstrbuf[128];
-char* DIErrStr(HRESULT hr)
+const char* DIErrStr(HRESULT hr)
{
- switch (hr) {
+ auto casted = static_cast<long unsigned int>(hr);
+ switch (casted) {
default:
- sprintf_s(errstrbuf, "Unrecognized error value = %08x.", hr);
+ sprintf_s(errstrbuf, "Unrecognized error value = %08x.", casted);
return errstrbuf;
case DI_OK: