From 9f50ca8c2cd65b0e9090a7031c5505d14f134176 Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Sun, 21 Aug 2016 13:44:33 +0200 Subject: overlay/lib.cpp: cast to long when creating RECT. --- overlay/lib.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'overlay') diff --git a/overlay/lib.cpp b/overlay/lib.cpp index 43613bc98..f1d859846 100644 --- a/overlay/lib.cpp +++ b/overlay/lib.cpp @@ -276,7 +276,12 @@ void Pipe::checkMessage(unsigned int width, unsigned int height) { } break; case OVERLAY_MSGTYPE_BLIT: { - RECT r = {omMsg.omb.x, omMsg.omb.y, omMsg.omb.x + omMsg.omb.w, omMsg.omb.y + omMsg.omb.h}; + RECT r = { + static_cast(omMsg.omb.x), + static_cast(omMsg.omb.y), + static_cast(omMsg.omb.x + omMsg.omb.w), + static_cast(omMsg.omb.y + omMsg.omb.h) + }; std::vector::iterator i = blits.begin(); while (i != blits.end()) { -- cgit v1.2.3 From b711ea987c66ff1de7c08dc0be1e239f260f6b8d Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Sun, 21 Aug 2016 13:45:04 +0200 Subject: overlay/lib.h: fix _WIN32_WINNT redefinition. --- overlay/lib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'overlay') diff --git a/overlay/lib.h b/overlay/lib.h index 5cf28fa53..c572f4a5c 100644 --- a/overlay/lib.h +++ b/overlay/lib.h @@ -7,6 +7,9 @@ #define MUMBLE_LIB_H_ #define _UNICODE +#ifdef _WIN32_WINNT +# undef _WIN32_WINNT +#endif #define _WIN32_WINNT 0x0501 #include #include -- cgit v1.2.3 From 4cc34410ddc1fafbbba91977e64e1d653037ce7e Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Sun, 21 Aug 2016 15:06:20 +0200 Subject: overlay/overlay_exe: use unsigned long long for our passed-in handle to silence MSVC2015 warning. Before: warning C4312: 'reinterpret_cast': conversion from 'unsigned long' to 'HANDLE' of greater size Also, please note the comment in src/mumble/Overlay_win.cpp regarding the 32-bit masking: https://msdn.microsoft.com/en-us/library/aa384203.aspx says: > When sharing a handle between 32-bit and 64-bit applications, only > the lower 32 bits are significant [...] --- overlay/overlay_exe/overlay_exe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'overlay') diff --git a/overlay/overlay_exe/overlay_exe.cpp b/overlay/overlay_exe/overlay_exe.cpp index e3e1131a3..4d57801ed 100644 --- a/overlay/overlay_exe/overlay_exe.cpp +++ b/overlay/overlay_exe/overlay_exe.cpp @@ -150,8 +150,8 @@ int main(int argc, char **argv) { } try { - unsigned long passedInHandle = std::stoul(handleStr); - parent = reinterpret_cast(passedInHandle & 0xFFFFFFFFUL); + unsigned long long passedInHandle = std::stoull(handleStr); + parent = reinterpret_cast(passedInHandle & 0xFFFFFFFFULL); } catch(std::exception &) { return OVERLAY_HELPER_ERROR_EXE_INVALID_HANDLE_ARGUMENT; } -- cgit v1.2.3