# HG changeset patch # User ib # Date 1309043437 0 # Node ID dbca6aa18b501331abae204b0ea89fa67ca49158 # Parent 40c81f3fb390149c31d94a461e2b54b3520281e8 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. diff -r 40c81f3fb390 -r dbca6aa18b50 gui/win32/dialogs.c --- 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); } diff -r 40c81f3fb390 -r dbca6aa18b50 gui/win32/gui.c --- 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)); diff -r 40c81f3fb390 -r dbca6aa18b50 gui/win32/preferences.c --- 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); }