changeset 33638:dbca6aa18b50

Cast new user data value in SetWindowLongPtr() to LONG_PTR. This makes the call compatible with both 32-bit and 64-bit versions of Windows. Patch by Stephen Sheldon, sfsheldo gmail com.
author ib
date Sat, 25 Jun 2011 23:10:37 +0000
parents 40c81f3fb390
children 6776826e72a9
files gui/win32/dialogs.c gui/win32/gui.c gui/win32/preferences.c
diffstat 3 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gui/win32/dialogs.c	Sat Jun 25 17:30:19 2011 +0000
+++ b/gui/win32/dialogs.c	Sat Jun 25 23:10:37 2011 +0000
@@ -399,7 +399,7 @@
                         NULL,
                         hInstance,
                         NULL);
-   SetWindowLongPtr(hWnd, GWLP_USERDATA, (DWORD) gui);
+   SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) gui);
    ShowWindow(hWnd, SW_SHOW);
    UpdateWindow(hWnd);
 }
@@ -651,7 +651,7 @@
                         NULL,
                         hInstance,
                         NULL);
-   SetWindowLongPtr(hWnd, GWLP_USERDATA, (DWORD)gui);
+   SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)gui);
    updatetracklist(hWnd);
    DragAcceptFiles(hWnd,TRUE);
    ShowWindow(hWnd, SW_SHOW);
@@ -768,7 +768,7 @@
                         NULL,
                         hInstance,
                         NULL);
-   SetWindowLongPtr(hWnd, GWLP_USERDATA, (DWORD) gui);
+   SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) gui);
    ShowWindow(hWnd, SW_SHOW);
    UpdateWindow(hWnd);
 }
@@ -897,7 +897,7 @@
                         NULL,
                         hInstance,
                         NULL);
-   SetWindowLongPtr(hWnd, GWLP_USERDATA, (DWORD) gui);
+   SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) gui);
    ShowWindow(hWnd, SW_SHOW);
    UpdateWindow(hWnd);
 }
@@ -1111,7 +1111,7 @@
                         NULL,
                         hInstance,
                         NULL);
-   SetWindowLongPtr(hWnd, GWLP_USERDATA, (DWORD) gui);
+   SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) gui);
    ShowWindow(hWnd, SW_SHOW);
    UpdateWindow(hWnd);
 }
--- a/gui/win32/gui.c	Sat Jun 25 17:30:19 2011 +0000
+++ b/gui/win32/gui.c	Sat Jun 25 23:10:37 2011 +0000
@@ -1273,7 +1273,7 @@
 static int window_render(gui_t *gui, HWND hWnd, HDC hdc, window_priv_t *priv, window *desc, BITMAPINFO binfo)
 {
     int i;
-    SetWindowLongPtr(hWnd, GWLP_USERDATA, (DWORD) gui);
+    SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) gui);
     (gui->window_priv_count)++;
     gui->window_priv = realloc(gui->window_priv, sizeof(window_priv_t *) * gui->window_priv_count);
     priv = gui->window_priv[gui->window_priv_count - 1] = calloc(1, sizeof(window_priv_t));
--- a/gui/win32/preferences.c	Sat Jun 25 17:30:19 2011 +0000
+++ b/gui/win32/preferences.c	Sat Jun 25 23:10:37 2011 +0000
@@ -707,7 +707,7 @@
                         NULL,
                         hInstance,
                         NULL);
-   SetWindowLongPtr(hWnd, GWLP_USERDATA, (DWORD) gui);
+   SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) gui);
    ShowWindow(hWnd, SW_SHOW);
    UpdateWindow(hWnd);
 }