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".
This commit is contained in:
Marcus Meissner 1999-02-28 19:56:59 +00:00 committed by Alexandre Julliard
parent 0a74193782
commit de43ef45ec
12 changed files with 26 additions and 34 deletions

View File

@ -1717,7 +1717,7 @@ static LPCSTR MENUEX_ParseResource( LPCSTR res, HMENU hMenu)
} }
if (resinfo & 1) { /* Pop-up? */ if (resinfo & 1) { /* Pop-up? */
DWORD helpid = GET_DWORD(res); /* FIXME: use this. */ /* DWORD helpid = GET_DWORD(res); FIXME: use this. */
res += sizeof(DWORD); res += sizeof(DWORD);
mii.hSubMenu = CreatePopupMenu(); mii.hSubMenu = CreatePopupMenu();
if (!mii.hSubMenu) if (!mii.hSubMenu)

View File

@ -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_SysKeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
{ {
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */ /* 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_SysKeyUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
{ {
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */ /* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */

View File

@ -313,14 +313,17 @@ static void
TOOLBAR_CalcToolbar (WND *wndPtr) TOOLBAR_CalcToolbar (WND *wndPtr)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr); TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TBUTTON_INFO *btnPtr, *grpPtr; TBUTTON_INFO *btnPtr;
INT i, j, nRows; INT i, nRows;
INT x, y, cx, cy; INT x, y, cx, cy;
BOOL bWrap; BOOL bWrap;
SIZE sizeString; SIZE sizeString;
/* --- new --- */ /* --- new --- */
#ifdef __NEW_WRAP_CODE__
INT nGrpCount = 0; INT nGrpCount = 0;
INT grpX; INT grpX,j;
TBUTTON_INFO *grpPtr;
#endif
/* --- end new --- */ /* --- end new --- */
TOOLBAR_CalcStrings (wndPtr, &sizeString); TOOLBAR_CalcStrings (wndPtr, &sizeString);

View File

@ -419,7 +419,7 @@ TREEVIEW_DrawItem (WND *wndPtr, HDC hdc, TREEVIEW_ITEM *wineItem)
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(wndPtr); TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(wndPtr);
INT oldBkMode,center,xpos,cx,cy, cditem, drawmode; INT oldBkMode,center,xpos,cx,cy, cditem, drawmode;
TREEVIEW_ITEM *parentItem; TREEVIEW_ITEM *parentItem;
COLORREF oldBkColor; COLORREF oldBkColor = 0;
HFONT hOldFont; HFONT hOldFont;
UINT uTextJustify = DT_LEFT; UINT uTextJustify = DT_LEFT;
HPEN hOldPen, hnewPen; HPEN hOldPen, hnewPen;

View File

@ -821,11 +821,12 @@ HMODULE PE_LoadLibraryExA (LPCSTR name,
} }
/* Now try the built-in even if disabled */ /* Now try the built-in even if disabled */
if ( builtin ) if ( builtin ) {
if ( (hModule32 = BUILTIN32_LoadImage( name, &ofs, TRUE )) ) if ( (hModule32 = BUILTIN32_LoadImage( name, &ofs, TRUE )) )
WARN( module, "Could not load external DLL '%s', using built-in module.\n", name ); WARN( module, "Could not load external DLL '%s', using built-in module.\n", name );
else else
return 0; return 0;
}
/* Create 16-bit dummy module */ /* Create 16-bit dummy module */

View File

@ -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 /* This routine should call DPMI_CallRMCBProc, but we don't have the
register structure available - this is easily fixed by going through register structure available - this is easily fixed by going through

View File

@ -31,12 +31,6 @@
#define SOUND_DEV "/dev/dsp" #define SOUND_DEV "/dev/dsp"
#define MIXER_DEV "/dev/mixer" #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_WAVEOUTDRV (1)
#define MAX_WAVEINDRV (1) #define MAX_WAVEINDRV (1)

View File

@ -1534,6 +1534,7 @@ BOOL WINAPI mciFreeCommandResource(UINT uTable)
UINT WINAPI mciLoadCommandResource(HANDLE hinst, LPCWSTR resname,UINT type) UINT WINAPI mciLoadCommandResource(HANDLE hinst, LPCWSTR resname,UINT type)
{ {
FIXME(mmsys,"(%04x,%s,%d): stub!\n", hinst, debugstr_w(resname), type); FIXME(mmsys,"(%04x,%s,%d): stub!\n", hinst, debugstr_w(resname), type);
return 0;
} }
const char* MCI_CommandToString(UINT16 wMsg) const char* MCI_CommandToString(UINT16 wMsg)
@ -3381,7 +3382,7 @@ typedef struct {
/************************************************************************** /**************************************************************************
* MMSYSTEM_MidiStreamPlayer [internal] * 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 ? /* FIXME: should I sleep a bit when there is no pending lpMidiHdr ?
* => provide a better synchronization system * => provide a better synchronization system

View File

@ -868,7 +868,7 @@ BOOL WINAPI GetDCOrgEx( HDC hDC, LPPOINT lpp )
int w, h, border, depth; int w, h, border, depth;
/* FIXME: this is not correct for managed windows */ /* FIXME: this is not correct for managed windows */
TSXGetGeometry( display, physDev->drawable, &root, 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; else lpp->x = lpp->y = 0;
lpp->x += dc->w.DCOrgX; lpp->y += dc->w.DCOrgY; lpp->x += dc->w.DCOrgX; lpp->y += dc->w.DCOrgY;

View File

@ -5213,21 +5213,14 @@ static DWORD GetAccessModeFromSTGM(DWORD stgm)
*/ */
static DWORD GetCreationModeFromSTGM(DWORD stgm) static DWORD GetCreationModeFromSTGM(DWORD stgm)
{ {
DWORD dwCreationDistribution; if ( stgm & STGM_CREATE)
BOOL bSTGM_CREATE = ((stgm & STGM_CREATE) == STGM_CREATE); return CREATE_ALWAYS;
BOOL bSTGM_CONVERT = ((stgm & STGM_CONVERT) == STGM_CONVERT); if (stgm & 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)
{
FIXME(ole, "STGM_CONVERT not implemented!\n"); FIXME(ole, "STGM_CONVERT not implemented!\n");
dwCreationDistribution = CREATE_NEW; return CREATE_NEW;
} }
/* All other cases */
return dwCreationDistribution; if (stgm & ~ (STGM_CREATE|STGM_CONVERT))
FIXME(ole,"unhandled storage mode : 0x%08lx\n",stgm & ~ (STGM_CREATE|STGM_CONVERT));
return CREATE_NEW;
} }

View File

@ -28,7 +28,7 @@ static LPWINE_DRIVER lpDrvItemList = NULL;
/************************************************************************** /**************************************************************************
* LoadStartupDrivers [internal] * LoadStartupDrivers [internal]
*/ */
static void DRIVER_LoadStartupDrivers(void) static void WINE_UNUSED DRIVER_LoadStartupDrivers(void)
{ {
HDRVR16 hDrv; HDRVR16 hDrv;
char str[256]; char str[256];

View File

@ -1091,7 +1091,7 @@ INT WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16, UINT *pmsg32,
message queues. message queues.
*/ */
HTASK16 htask = (HTASK16) *plparam; HTASK16 htask = (HTASK16) *plparam;
DWORD idThread = ((TDB*)GlobalLock16(htask))->thdb->server_tid; DWORD idThread = (DWORD)((TDB*)GlobalLock16(htask))->thdb->server_tid;
*plparam = (LPARAM) idThread; *plparam = (LPARAM) idThread;
} }
return 1; return 1;