]> source.dussan.org Git - tigervnc.git/commitdiff
Pointer truncation/expansion needs to be very explicit
authorPierre Ossman <ossman@cendio.se>
Tue, 3 Mar 2015 15:44:30 +0000 (16:44 +0100)
committerPierre Ossman <ossman@cendio.se>
Tue, 3 Mar 2015 15:44:30 +0000 (16:44 +0100)
unix/vncconfig/vncExt.c
win/rfb_win32/CleanDesktop.cxx
win/rfb_win32/MsgWindow.cxx
win/wm_hooks/wm_hooks.cxx

index f4ade8c1e54adbcdcb8c37bef2ac471f0063330e..eef7c4b55a4d5cd2d2eb0bf1f160537efc56f45d 100644 (file)
@@ -16,6 +16,7 @@
  * USA.
  */
 #include <stdio.h>
+#include <stdint.h>
 
 #define NEED_REPLIES
 #include <X11/Xlib.h>
@@ -336,7 +337,7 @@ Bool XVncExtGetQueryConnect(Display* dpy, char** addr, char** user,
   _XReadPad(dpy, *user, rep.userLen);
   (*user)[rep.userLen] = 0;
   *timeout = rep.timeout;
-  *opaqueId = (void*)rep.opaqueId;
+  *opaqueId = (void*)(intptr_t)rep.opaqueId;
   return True;
 }
 
@@ -351,7 +352,7 @@ Bool XVncExtApproveConnect(Display* dpy, void* opaqueId, int approve)
   req->reqType = codes->major_opcode;
   req->vncExtReqType = X_VncExtApproveConnect;
   req->approve = approve;
-  req->opaqueId = (CARD32)opaqueId;
+  req->opaqueId = (CARD32)(intptr_t)opaqueId;
   UnlockDisplay(dpy);
   SyncHandle();
   return True;
index 90b3451b16d29227484dce3a17cb6b2961ce2d30..8009fc8b911a7d67cfe93a006feedcbc8a49e3e8 100644 (file)
@@ -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
index 1d58561885102194a5af4f5ba3914b99b90f71eb..8086bea0a2cb5ec55d61793c1a4b9efd84d2473e 100644 (file)
@@ -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());
   }
index 50a981e8c87ea60eff153509a357b4969c243deb..c0350cd2aeaf52d8fdbc84187ea110238f3269c0 100644 (file)
@@ -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);
                        }
                }