hw/xwin: Correct winprefs.c function signatures for x64.

Correct SetupRootMenu(), SetupSysMenu(), HandleCustomWM_INITMENU() and
HandleCustomWM_COMMAND() function signatures which use unsigned long parameters,
where just a specific HWND or HMENU handle type should have been used.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
This commit is contained in:
Colin Harrison 2013-08-09 16:48:12 +01:00 committed by Jon TURNEY
parent e716baedc4
commit 390cfec10e
4 changed files with 13 additions and 25 deletions

View File

@ -420,14 +420,14 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* /*
* Add whatever the setup file wants to for this window * Add whatever the setup file wants to for this window
*/ */
SetupSysMenu((unsigned long) hwnd); SetupSysMenu(hwnd);
return 0; return 0;
case WM_SYSCOMMAND: case WM_SYSCOMMAND:
/* /*
* Any window menu items go through here * Any window menu items go through here
*/ */
if (HandleCustomWM_COMMAND((unsigned long) hwnd, LOWORD(wParam))) { if (HandleCustomWM_COMMAND(hwnd, LOWORD(wParam))) {
/* Don't pass customized menus to DefWindowProc */ /* Don't pass customized menus to DefWindowProc */
return 0; return 0;
} }
@ -443,7 +443,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_INITMENU: case WM_INITMENU:
/* Checks/Unchecks any menu items before they are displayed */ /* Checks/Unchecks any menu items before they are displayed */
HandleCustomWM_INITMENU((unsigned long) hwnd, wParam); HandleCustomWM_INITMENU(hwnd, (HMENU)wParam);
break; break;
case WM_ERASEBKGND: case WM_ERASEBKGND:

View File

@ -188,7 +188,7 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam)
} }
/* Update the system menu for this window */ /* Update the system menu for this window */
SetupSysMenu((unsigned long) hwnd); SetupSysMenu(hwnd);
/* That was easy... */ /* That was easy... */
} }
@ -275,15 +275,11 @@ ReloadPrefs(void)
* Check/uncheck the ALWAYSONTOP items in this menu * Check/uncheck the ALWAYSONTOP items in this menu
*/ */
void void
HandleCustomWM_INITMENU(unsigned long hwndIn, unsigned long hmenuIn) HandleCustomWM_INITMENU(HWND hwnd, HMENU hmenu)
{ {
HWND hwnd;
HMENU hmenu;
DWORD dwExStyle; DWORD dwExStyle;
int i, j; int i, j;
hwnd = (HWND) hwndIn;
hmenu = (HMENU) hmenuIn;
if (!hwnd || !hmenu) if (!hwnd || !hmenu)
return; return;
@ -305,15 +301,12 @@ HandleCustomWM_INITMENU(unsigned long hwndIn, unsigned long hmenuIn)
* Return TRUE if command is proccessed, FALSE otherwise. * Return TRUE if command is proccessed, FALSE otherwise.
*/ */
Bool Bool
HandleCustomWM_COMMAND(unsigned long hwndIn, int command) HandleCustomWM_COMMAND(HWND hwnd, int command)
{ {
HWND hwnd;
int i, j; int i, j;
MENUPARSED *m; MENUPARSED *m;
DWORD dwExStyle; DWORD dwExStyle;
hwnd = (HWND) hwndIn;
if (!command) if (!command)
return FALSE; return FALSE;
@ -412,15 +405,13 @@ HandleCustomWM_COMMAND(unsigned long hwndIn, int command)
* Add the default or a custom menu depending on the class match * Add the default or a custom menu depending on the class match
*/ */
void void
SetupSysMenu(unsigned long hwndIn) SetupSysMenu(HWND hwnd)
{ {
HWND hwnd;
HMENU sys; HMENU sys;
int i; int i;
WindowPtr pWin; WindowPtr pWin;
char *res_name, *res_class; char *res_name, *res_class;
hwnd = (HWND) hwndIn;
if (!hwnd) if (!hwnd)
return; return;
@ -465,11 +456,8 @@ SetupSysMenu(unsigned long hwndIn)
* Possibly add a menu to the toolbar icon * Possibly add a menu to the toolbar icon
*/ */
void void
SetupRootMenu(unsigned long hmenuRoot) SetupRootMenu(HMENU root)
{ {
HMENU root;
root = (HMENU) hmenuRoot;
if (!root) if (!root)
return; return;

View File

@ -150,16 +150,16 @@ void
LoadPreferences(void); LoadPreferences(void);
void void
SetupRootMenu(unsigned long hmenuRoot); SetupRootMenu(HMENU root);
void void
SetupSysMenu(unsigned long hwndIn); SetupSysMenu(HWND hwnd);
void void
HandleCustomWM_INITMENU(unsigned long hwndIn, unsigned long hmenuIn); HandleCustomWM_INITMENU(HWND hwnd, HMENU hmenu);
Bool Bool
HandleCustomWM_COMMAND(unsigned long hwndIn, int command); HandleCustomWM_COMMAND(HWND hwnd, int command);
int int
winIconIsOverride(HICON hicon); winIconIsOverride(HICON hicon);

View File

@ -170,7 +170,7 @@ winHandleIconMessage(HWND hwnd, UINT message,
RemoveMenu(hmenuTray, ID_APP_HIDE_ROOT, MF_BYCOMMAND); RemoveMenu(hmenuTray, ID_APP_HIDE_ROOT, MF_BYCOMMAND);
} }
SetupRootMenu((unsigned long) hmenuTray); SetupRootMenu(hmenuTray);
/* /*
* NOTE: This three-step procedure is required for * NOTE: This three-step procedure is required for