From e1432f670cc775856714b6a2df06f7b45cf4dc2a Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 24 Jun 2016 15:38:17 +0100 Subject: [PATCH] #4978 Fixed bad casting on 64bit Windows --- src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp | 5 ++--- src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp | 8 +++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp b/src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp index c09234a2..a7987d4c 100644 --- a/src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp +++ b/src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp @@ -360,10 +360,9 @@ MSWindowsPortableTaskBarReceiver::staticDlgProc(HWND hwnd, } else { // get the extra window data and forward the call - LONG data = (LONG)GetWindowLongPtr(hwnd, GWLP_USERDATA); + LONG_PTR data = GetWindowLongPtr(hwnd, GWLP_USERDATA); if (data != 0) { - self = reinterpret_cast( - reinterpret_cast(data)); + self = reinterpret_cast(data); } } diff --git a/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp b/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp index d7ced073..4ffe8244 100644 --- a/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp +++ b/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp @@ -368,16 +368,14 @@ MSWindowsServerTaskBarReceiver::staticDlgProc(HWND hwnd, // and put it in the extra window data then forward the call. MSWindowsServerTaskBarReceiver* self = NULL; if (msg == WM_INITDIALOG) { - self = reinterpret_cast( - reinterpret_cast(lParam)); + self = reinterpret_cast(lParam); SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam); } else { // get the extra window data and forward the call - LONG data = (LONG)GetWindowLongPtr(hwnd, GWLP_USERDATA); + LONG_PTR data = GetWindowLongPtr(hwnd, GWLP_USERDATA); if (data != 0) { - self = reinterpret_cast( - reinterpret_cast(data)); + self = reinterpret_cast(data); } }