From 23cf284a66617bfe551e02355fa9382ddde734f5 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Tue, 13 Sep 2016 10:53:27 +0100 Subject: [PATCH] Restore safe reinterpret_casts in MSWindowsClientTaskBarReceiver --- src/cmd/synergyc/MSWindowsClientTaskBarReceiver.cpp | 4 ++-- src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp | 8 ++++---- src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.cpp b/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.cpp index 529a54dc..fc3ed94e 100644 --- a/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.cpp +++ b/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.cpp @@ -287,7 +287,7 @@ MSWindowsClientTaskBarReceiver::createWindow() MAKEINTRESOURCE(IDD_TASKBAR_STATUS), NULL, (DLGPROC)&MSWindowsClientTaskBarReceiver::staticDlgProc, - static_cast( + reinterpret_cast( static_cast(this))); // window should appear on top of everything, including (especially) @@ -338,7 +338,7 @@ MSWindowsClientTaskBarReceiver::staticDlgProc(HWND hwnd, MSWindowsClientTaskBarReceiver* self = NULL; if (msg == WM_INITDIALOG) { self = static_cast( - static_cast(lParam)); + reinterpret_cast(lParam)); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) lParam); } else { diff --git a/src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp b/src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp index b42f28b3..ae7b0ee4 100644 --- a/src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp +++ b/src/cmd/synergyp/MSWindowsPortableTaskBarReceiver.cpp @@ -304,7 +304,7 @@ MSWindowsPortableTaskBarReceiver::createWindow() MAKEINTRESOURCE(IDD_TASKBAR_STATUS), NULL, (DLGPROC)&MSWindowsPortableTaskBarReceiver::staticDlgProc, - static_cast( + reinterpret_cast( static_cast(this))); // window should appear on top of everything, including (especially) @@ -355,15 +355,15 @@ MSWindowsPortableTaskBarReceiver::staticDlgProc(HWND hwnd, MSWindowsPortableTaskBarReceiver* self = NULL; if (msg == WM_INITDIALOG) { self = static_cast( - static_cast(lParam)); + 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 = static_cast( - static_cast(data)); + reinterpret_cast(data)); } } diff --git a/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp b/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp index 83fc539c..b2d304a1 100644 --- a/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp +++ b/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp @@ -318,7 +318,7 @@ MSWindowsServerTaskBarReceiver::createWindow() MAKEINTRESOURCE(IDD_TASKBAR_STATUS), NULL, (DLGPROC)&MSWindowsServerTaskBarReceiver::staticDlgProc, - static_cast( + reinterpret_cast( static_cast(this))); // window should appear on top of everything, including (especially) @@ -369,15 +369,15 @@ MSWindowsServerTaskBarReceiver::staticDlgProc(HWND hwnd, MSWindowsServerTaskBarReceiver* self = NULL; if (msg == WM_INITDIALOG) { self = static_cast( - static_cast(lParam)); + 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 = static_cast( - static_cast(data)); + reinterpret_cast(data)); } }