This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Restore safe reinterpret_casts in MSWindowsClientTaskBarReceiver

  • Loading branch information...
nlyan committed Sep 13, 2016
1 parent 19b9be4 commit 23cf284a66617bfe551e02355fa9382ddde734f5
@@ -287,7 +287,7 @@ MSWindowsClientTaskBarReceiver::createWindow()
MAKEINTRESOURCE(IDD_TASKBAR_STATUS),
NULL,
(DLGPROC)&MSWindowsClientTaskBarReceiver::staticDlgProc,
- static_cast<LPARAM>(
+ reinterpret_cast<LPARAM>(
static_cast<void*>(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<MSWindowsClientTaskBarReceiver*>(
- static_cast<void*>(lParam));
+ reinterpret_cast<void*>(lParam));
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) lParam);
}
else {
@@ -304,7 +304,7 @@ MSWindowsPortableTaskBarReceiver::createWindow()
MAKEINTRESOURCE(IDD_TASKBAR_STATUS),
NULL,
(DLGPROC)&MSWindowsPortableTaskBarReceiver::staticDlgProc,
- static_cast<LPARAM>(
+ reinterpret_cast<LPARAM>(
static_cast<void*>(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<MSWindowsPortableTaskBarReceiver*>(
- static_cast<void*>(lParam));
+ reinterpret_cast<void*>(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<MSWindowsPortableTaskBarReceiver*>(
- static_cast<void*>(data));
+ reinterpret_cast<void*>(data));
}
}
@@ -318,7 +318,7 @@ MSWindowsServerTaskBarReceiver::createWindow()
MAKEINTRESOURCE(IDD_TASKBAR_STATUS),
NULL,
(DLGPROC)&MSWindowsServerTaskBarReceiver::staticDlgProc,
- static_cast<LPARAM>(
+ reinterpret_cast<LPARAM>(
static_cast<void*>(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<MSWindowsServerTaskBarReceiver*>(
- static_cast<void*>(lParam));
+ reinterpret_cast<void*>(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<MSWindowsServerTaskBarReceiver*>(
- static_cast<void*>(data));
+ reinterpret_cast<void*>(data));
}
}

0 comments on commit 23cf284

Please sign in to comment.