From 83d120b90482d356be730f63aead0f8e44a4e846 Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Thu, 1 Oct 2009 14:47:22 +0100 Subject: Xming: Fix various 'ISO C90 forbids mixed declarations and code' warnings Signed-off-by: Jon TURNEY --- hw/xwin/winmouse.c | 7 +++--- hw/xwin/winmultiwindowicons.c | 53 +++++++++++++++++++++-------------------- hw/xwin/winmultiwindowwndproc.c | 18 +++++++------- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c index b537d3213..99eb6b8d2 100644 --- a/hw/xwin/winmouse.c +++ b/hw/xwin/winmouse.c @@ -371,16 +371,15 @@ winMouseButtonsHandle (ScreenPtr pScreen, */ void winEnqueueMotion(int x, int y) { - miPointerSetPosition(g_pwinPointer, &x, &y); - int i, nevents; int valuators[2]; - EventListPtr events; - GetEventList(&events); + miPointerSetPosition(g_pwinPointer, &x, &y); valuators[0] = x; valuators[1] = y; + + GetEventList(&events); nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0, POINTER_ABSOLUTE, 0, 2, valuators); diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c index e16b2a3c8..9f46a64d9 100644 --- a/hw/xwin/winmultiwindowicons.c +++ b/hw/xwin/winmultiwindowicons.c @@ -543,33 +543,34 @@ winUpdateIcon (Window id) HICON hIcon, hIconSmall=NULL, hIconOld; pWin = (WindowPtr) LookupIDByType (id, RT_WINDOW); - if (!pWin) return; - winWindowPriv(pWin); - if (pWinPriv->hWnd) { - hIcon = winOverrideIcon ((unsigned long)pWin); - if (!hIcon) { - hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXICON)); - if (!hIcon) { - hIcon = g_hIconX; - hIconSmall = g_hSmallIconX; - } else { - /* Leave undefined if not found */ - hIconSmall = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON)); + if (pWin) + { + winWindowPriv(pWin); + if (pWinPriv->hWnd) { + hIcon = winOverrideIcon ((unsigned long)pWin); + if (!hIcon) { + hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXICON)); + if (!hIcon) { + hIcon = g_hIconX; + hIconSmall = g_hSmallIconX; + } else { + /* Leave undefined if not found */ + hIconSmall = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON)); + } + } + + /* Set the large icon */ + hIconOld = (HICON) SendMessage (pWinPriv->hWnd, + WM_SETICON, ICON_BIG, (LPARAM) hIcon); + + /* Delete the icon if its not the default */ + winDestroyIcon(hIconOld); + + /* Same for the small icon */ + hIconOld = (HICON) SendMessage (pWinPriv->hWnd, + WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); + winDestroyIcon(hIconOld); } - } - - /* Set the large icon */ - hIconOld = (HICON) SendMessage (pWinPriv->hWnd, - WM_SETICON, ICON_BIG, (LPARAM) hIcon); - - /* Delete the icon if its not the default */ - winDestroyIcon(hIconOld); - - /* Same for the small icon */ - hIconOld = (HICON) SendMessage (pWinPriv->hWnd, - WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); - winDestroyIcon(hIconOld); - } } diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 543a1652f..d14ceee9c 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -282,11 +282,11 @@ static void winRaiseWindow(WindowPtr pWin) if (!winInDestroyWindowsWindow && !winInRaiseWindow) { BOOL oldstate = winInRaiseWindow; + XID vlist[1] = { 0 }; winInRaiseWindow = TRUE; /* Call configure window directly to make sure it gets processed * in time */ - XID vlist[1] = { 0 }; ConfigureWindow(pWin, CWStackMode, vlist, serverClient); winInRaiseWindow = oldstate; } @@ -416,12 +416,14 @@ winTopLevelWindowProc (HWND hwnd, UINT message, winReorderWindowsMultiWindow (); /* Fix a 'round title bar corner background should be transparent not black' problem when first painted */ - RECT rWindow; - HRGN hRgnWindow; - GetWindowRect(hwnd, &rWindow); - hRgnWindow = CreateRectRgnIndirect(&rWindow); - SetWindowRgn (hwnd, hRgnWindow, TRUE); - DeleteObject(hRgnWindow); + { + RECT rWindow; + HRGN hRgnWindow; + GetWindowRect(hwnd, &rWindow); + hRgnWindow = CreateRectRgnIndirect(&rWindow); + SetWindowRgn (hwnd, hRgnWindow, TRUE); + DeleteObject(hRgnWindow); + } SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)XMING_SIGNATURE); @@ -897,10 +899,10 @@ winTopLevelWindowProc (HWND hwnd, UINT message, } else /* It is an overridden window so make it top of Z stack */ { + HWND forHwnd = GetForegroundWindow(); #if CYGWINDOWING_DEBUG ErrorF ("overridden window is shown\n"); #endif - HWND forHwnd = GetForegroundWindow(); if (forHwnd != NULL) { if (GetWindowLongPtr(forHwnd, GWLP_USERDATA) & (LONG_PTR)XMING_SIGNATURE) -- cgit v1.2.3