diff options
author | Pierre Ossman <ossman@cendio.se> | 2015-03-03 16:44:30 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2015-03-03 16:44:30 +0100 |
commit | 8a044ee41e175b8d6cb69dc6f38c6bc94dcb1c8d (patch) | |
tree | 686b2236c3d97135430ec21b77a92a5617006b71 /win | |
parent | f10d2a7cb0bd28743971dc5edc3e3fff298fa264 (diff) | |
download | tigervnc-8a044ee41e175b8d6cb69dc6f38c6bc94dcb1c8d.tar.gz tigervnc-8a044ee41e175b8d6cb69dc6f38c6bc94dcb1c8d.zip |
Pointer truncation/expansion needs to be very explicit
Diffstat (limited to 'win')
-rw-r--r-- | win/rfb_win32/CleanDesktop.cxx | 12 | ||||
-rw-r--r-- | win/rfb_win32/MsgWindow.cxx | 7 | ||||
-rw-r--r-- | win/wm_hooks/wm_hooks.cxx | 4 |
3 files changed, 12 insertions, 11 deletions
diff --git a/win/rfb_win32/CleanDesktop.cxx b/win/rfb_win32/CleanDesktop.cxx index 90b3451b..8009fc8b 100644 --- a/win/rfb_win32/CleanDesktop.cxx +++ b/win/rfb_win32/CleanDesktop.cxx @@ -303,12 +303,12 @@ void CleanDesktop::enableEffects() { desktopCfg.openKey(HKEY_CURRENT_USER, _T("Control Panel\\Desktop")); SysParamsInfo(SPI_SETFONTSMOOTHING, desktopCfg.getInt(_T("FontSmoothing"), 0) != 0, 0, SPIF_SENDCHANGE); #ifdef RFB_HAVE_SPI_UIEFFECTS - if (SysParamsInfo(SPI_SETUIEFFECTS, 0, (void*)uiEffects, SPIF_SENDCHANGE) == ERROR_CALL_NOT_IMPLEMENTED) { - SysParamsInfo(SPI_SETCOMBOBOXANIMATION, 0, (void*)comboBoxAnim, SPIF_SENDCHANGE); - SysParamsInfo(SPI_SETGRADIENTCAPTIONS, 0, (void*)gradientCaptions, SPIF_SENDCHANGE); - SysParamsInfo(SPI_SETHOTTRACKING, 0, (void*)hotTracking, SPIF_SENDCHANGE); - SysParamsInfo(SPI_SETLISTBOXSMOOTHSCROLLING, 0, (void*)listBoxSmoothScroll, SPIF_SENDCHANGE); - SysParamsInfo(SPI_SETMENUANIMATION, 0, (void*)menuAnim, SPIF_SENDCHANGE); + if (SysParamsInfo(SPI_SETUIEFFECTS, 0, (void*)(intptr_t)uiEffects, SPIF_SENDCHANGE) == ERROR_CALL_NOT_IMPLEMENTED) { + SysParamsInfo(SPI_SETCOMBOBOXANIMATION, 0, (void*)(intptr_t)comboBoxAnim, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETGRADIENTCAPTIONS, 0, (void*)(intptr_t)gradientCaptions, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETHOTTRACKING, 0, (void*)(intptr_t)hotTracking, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETLISTBOXSMOOTHSCROLLING, 0, (void*)(intptr_t)listBoxSmoothScroll, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETMENUANIMATION, 0, (void*)(intptr_t)menuAnim, SPIF_SENDCHANGE); } restoreEffects = false; #else diff --git a/win/rfb_win32/MsgWindow.cxx b/win/rfb_win32/MsgWindow.cxx index 1d585618..8086bea0 100644 --- a/win/rfb_win32/MsgWindow.cxx +++ b/win/rfb_win32/MsgWindow.cxx @@ -85,7 +85,7 @@ MsgWindowClass::MsgWindowClass() : classAtom(0) { MsgWindowClass::~MsgWindowClass() { if (classAtom) { - UnregisterClass((const TCHAR*)classAtom, instance); + UnregisterClass((const TCHAR*)(intptr_t)classAtom, instance); } } @@ -97,8 +97,9 @@ static MsgWindowClass baseClass; MsgWindow::MsgWindow(const TCHAR* name_) : name(tstrDup(name_)), handle(0) { vlog.debug("creating window \"%s\"", (const char*)CStr(name.buf)); - handle = CreateWindow((const TCHAR*)baseClass.classAtom, name.buf, WS_OVERLAPPED, - 0, 0, 10, 10, 0, 0, baseClass.instance, this); + handle = CreateWindow((const TCHAR*)(intptr_t)baseClass.classAtom, + name.buf, WS_OVERLAPPED, 0, 0, 10, 10, 0, 0, + baseClass.instance, this); if (!handle) { throw rdr::SystemException("unable to create WMNotifier window instance", GetLastError()); } diff --git a/win/wm_hooks/wm_hooks.cxx b/win/wm_hooks/wm_hooks.cxx index 50a981e8..c0350cd2 100644 --- a/win/wm_hooks/wm_hooks.cxx +++ b/win/wm_hooks/wm_hooks.cxx @@ -204,11 +204,11 @@ void ProcessWindowMessage(UINT msg, HWND wnd, WPARAM wParam, LPARAM lParam) { // Handle pop-up menus having items selected case 485: { - HANDLE prop = GetProp(wnd, (LPCTSTR) MAKELONG(ATOM_Popup_Selection, 0)); + HANDLE prop = GetProp(wnd, (LPCTSTR) (intptr_t) ATOM_Popup_Selection); if (prop != (HANDLE) wParam) { NotifyWindow(wnd, 485); SetProp(wnd, - (LPCTSTR) MAKELONG(ATOM_Popup_Selection, 0), + (LPCTSTR) (intptr_t) ATOM_Popup_Selection, (HANDLE) wParam); } } |