From de43ef45ec0e37f2cf7fb38e6da6fc5772517563 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 28 Feb 1999 19:56:59 +0000 Subject: [PATCH] Fixed a lot of warnings using WINE_UNUSED, casts, commenting out and additional {}. Rewrote GetCreationModeFromSTGM so we don't get "possible use of uninitialized variable". --- controls/menu.c | 2 +- dlls/comctl32/hotkey.c | 4 ++-- dlls/comctl32/toolbar.c | 9 ++++++--- dlls/comctl32/treeview.c | 2 +- loader/pe_image.c | 3 ++- msdos/dpmi.c | 2 +- multimedia/audio.c | 6 ------ multimedia/mmsystem.c | 3 ++- objects/dc.c | 2 +- ole/storage32.c | 23 ++++++++--------------- windows/driver.c | 2 +- windows/winproc.c | 2 +- 12 files changed, 26 insertions(+), 34 deletions(-) diff --git a/controls/menu.c b/controls/menu.c index 4754eff6636..afe322369f2 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -1717,7 +1717,7 @@ static LPCSTR MENUEX_ParseResource( LPCSTR res, HMENU hMenu) } if (resinfo & 1) { /* Pop-up? */ - DWORD helpid = GET_DWORD(res); /* FIXME: use this. */ + /* DWORD helpid = GET_DWORD(res); FIXME: use this. */ res += sizeof(DWORD); mii.hSubMenu = CreatePopupMenu(); if (!mii.hSubMenu) diff --git a/dlls/comctl32/hotkey.c b/dlls/comctl32/hotkey.c index a2e5d28722e..b798248a7dc 100644 --- a/dlls/comctl32/hotkey.c +++ b/dlls/comctl32/hotkey.c @@ -233,7 +233,7 @@ HOTKEY_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT WINE_UNUSED HOTKEY_SysKeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam) { /* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */ @@ -262,7 +262,7 @@ HOTKEY_SysKeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT WINE_UNUSED HOTKEY_SysKeyUp (WND *wndPtr, WPARAM wParam, LPARAM lParam) { /* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */ diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 4db62ad56ac..82010c0d471 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -313,14 +313,17 @@ static void TOOLBAR_CalcToolbar (WND *wndPtr) { TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr); - TBUTTON_INFO *btnPtr, *grpPtr; - INT i, j, nRows; + TBUTTON_INFO *btnPtr; + INT i, nRows; INT x, y, cx, cy; BOOL bWrap; SIZE sizeString; /* --- new --- */ +#ifdef __NEW_WRAP_CODE__ INT nGrpCount = 0; - INT grpX; + INT grpX,j; + TBUTTON_INFO *grpPtr; +#endif /* --- end new --- */ TOOLBAR_CalcStrings (wndPtr, &sizeString); diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 82d6c10fd97..6f597bb8376 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -419,7 +419,7 @@ TREEVIEW_DrawItem (WND *wndPtr, HDC hdc, TREEVIEW_ITEM *wineItem) TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(wndPtr); INT oldBkMode,center,xpos,cx,cy, cditem, drawmode; TREEVIEW_ITEM *parentItem; - COLORREF oldBkColor; + COLORREF oldBkColor = 0; HFONT hOldFont; UINT uTextJustify = DT_LEFT; HPEN hOldPen, hnewPen; diff --git a/loader/pe_image.c b/loader/pe_image.c index f56daa1924f..0affebb4364 100644 --- a/loader/pe_image.c +++ b/loader/pe_image.c @@ -821,11 +821,12 @@ HMODULE PE_LoadLibraryExA (LPCSTR name, } /* Now try the built-in even if disabled */ - if ( builtin ) + if ( builtin ) { if ( (hModule32 = BUILTIN32_LoadImage( name, &ofs, TRUE )) ) WARN( module, "Could not load external DLL '%s', using built-in module.\n", name ); else return 0; + } /* Create 16-bit dummy module */ diff --git a/msdos/dpmi.c b/msdos/dpmi.c index caab2ea82b7..41794fa8860 100644 --- a/msdos/dpmi.c +++ b/msdos/dpmi.c @@ -437,7 +437,7 @@ static void CallRMProc( CONTEXT *context, int iret ) } -static void WINAPI RMCallbackProc( RMCB *rmcb ) +static void WINAPI WINE_UNUSED RMCallbackProc( RMCB *rmcb ) { /* This routine should call DPMI_CallRMCBProc, but we don't have the register structure available - this is easily fixed by going through diff --git a/multimedia/audio.c b/multimedia/audio.c index e9716a419f4..7fefd89ee3d 100644 --- a/multimedia/audio.c +++ b/multimedia/audio.c @@ -31,12 +31,6 @@ #define SOUND_DEV "/dev/dsp" #define MIXER_DEV "/dev/mixer" -#ifdef SOUND_VERSION -#define IOCTL(a,b,c) ((-1==ioctl(a,b,&c))&&(perror("ioctl:"#b":"#c),0)) -#else -#define IOCTL(a,b,c) (c = ioctl(a,b,c) ) -#endif - #define MAX_WAVEOUTDRV (1) #define MAX_WAVEINDRV (1) diff --git a/multimedia/mmsystem.c b/multimedia/mmsystem.c index 83f910d9b82..e1ccc4ecacb 100644 --- a/multimedia/mmsystem.c +++ b/multimedia/mmsystem.c @@ -1534,6 +1534,7 @@ BOOL WINAPI mciFreeCommandResource(UINT uTable) UINT WINAPI mciLoadCommandResource(HANDLE hinst, LPCWSTR resname,UINT type) { FIXME(mmsys,"(%04x,%s,%d): stub!\n", hinst, debugstr_w(resname), type); + return 0; } const char* MCI_CommandToString(UINT16 wMsg) @@ -3381,7 +3382,7 @@ typedef struct { /************************************************************************** * MMSYSTEM_MidiStreamPlayer [internal] */ -static void MMSYSTEM_MidiStreamPlayer(WINE_MIDIStream* ms) +static void WINE_UNUSED MMSYSTEM_MidiStreamPlayer(WINE_MIDIStream* ms) { /* FIXME: should I sleep a bit when there is no pending lpMidiHdr ? * => provide a better synchronization system diff --git a/objects/dc.c b/objects/dc.c index 54b20010212..32984b03ca1 100644 --- a/objects/dc.c +++ b/objects/dc.c @@ -868,7 +868,7 @@ BOOL WINAPI GetDCOrgEx( HDC hDC, LPPOINT lpp ) int w, h, border, depth; /* FIXME: this is not correct for managed windows */ TSXGetGeometry( display, physDev->drawable, &root, - &lpp->x, &lpp->y, &w, &h, &border, &depth ); + (int*)&lpp->x, (int*)&lpp->y, &w, &h, &border, &depth ); } else lpp->x = lpp->y = 0; lpp->x += dc->w.DCOrgX; lpp->y += dc->w.DCOrgY; diff --git a/ole/storage32.c b/ole/storage32.c index 7dc0ca2e8f0..fd812f474ad 100644 --- a/ole/storage32.c +++ b/ole/storage32.c @@ -5213,21 +5213,14 @@ static DWORD GetAccessModeFromSTGM(DWORD stgm) */ static DWORD GetCreationModeFromSTGM(DWORD stgm) { - DWORD dwCreationDistribution; - BOOL bSTGM_CREATE = ((stgm & STGM_CREATE) == STGM_CREATE); - BOOL bSTGM_CONVERT = ((stgm & STGM_CONVERT) == STGM_CONVERT); - BOOL bSTGM_FAILIFTHERE = ! (bSTGM_CREATE || bSTGM_CONVERT); - - if (bSTGM_CREATE) - dwCreationDistribution = CREATE_ALWAYS; - else if (bSTGM_FAILIFTHERE) - dwCreationDistribution = CREATE_NEW; - else if (bSTGM_CONVERT) - { + if ( stgm & STGM_CREATE) + return CREATE_ALWAYS; + if (stgm & STGM_CONVERT) { FIXME(ole, "STGM_CONVERT not implemented!\n"); - dwCreationDistribution = CREATE_NEW; + return CREATE_NEW; } - - return dwCreationDistribution; + /* All other cases */ + if (stgm & ~ (STGM_CREATE|STGM_CONVERT)) + FIXME(ole,"unhandled storage mode : 0x%08lx\n",stgm & ~ (STGM_CREATE|STGM_CONVERT)); + return CREATE_NEW; } - diff --git a/windows/driver.c b/windows/driver.c index cce1911fa74..be719ad4409 100644 --- a/windows/driver.c +++ b/windows/driver.c @@ -28,7 +28,7 @@ static LPWINE_DRIVER lpDrvItemList = NULL; /************************************************************************** * LoadStartupDrivers [internal] */ -static void DRIVER_LoadStartupDrivers(void) +static void WINE_UNUSED DRIVER_LoadStartupDrivers(void) { HDRVR16 hDrv; char str[256]; diff --git a/windows/winproc.c b/windows/winproc.c index 3f04cebc0f1..b32e9f87d1b 100644 --- a/windows/winproc.c +++ b/windows/winproc.c @@ -1091,7 +1091,7 @@ INT WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16, UINT *pmsg32, message queues. */ HTASK16 htask = (HTASK16) *plparam; - DWORD idThread = ((TDB*)GlobalLock16(htask))->thdb->server_tid; + DWORD idThread = (DWORD)((TDB*)GlobalLock16(htask))->thdb->server_tid; *plparam = (LPARAM) idThread; } return 1;