From 908464d44800c83e372f703fa95c850088c3a95f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 1 Nov 2000 03:11:12 +0000 Subject: [PATCH] Authors: Andreas Mohr , Dimitrie O. Paun , Patrik Stridvall Various warning fixes. --- controls/edit.c | 1 + dlls/comctl32/listview.c | 7 ++++--- dlls/comctl32/monthcal.c | 1 + dlls/comctl32/tab.c | 4 ++-- dlls/comctl32/treeview.c | 2 ++ dlls/ddraw/ddraw/dga.c | 2 +- dlls/ddraw/ddraw/x11.c | 6 +++--- dlls/ddraw/x11_private.h | 2 +- dlls/kernel/time.c | 1 + dlls/kernel/win87em.c | 11 ++++++++--- dlls/msvideo/drawdib.c | 4 ++-- dlls/oleaut32/variant.c | 11 +++++++---- dlls/setupapi/setupx_main.c | 2 +- dlls/shell32/shlmenu.c | 10 ++++++++-- dlls/shell32/shv_bg_cmenu.c | 2 +- graphics/x11drv/xfont.c | 4 +++- loader/ne/segment.c | 2 +- misc/cpu.c | 2 +- misc/error.c | 16 ++++++++-------- misc/options.c | 8 ++++---- misc/registry.c | 14 +++++++------- msdos/devices.c | 2 +- msdos/vga.c | 3 +-- msdos/vxd.c | 18 +++++++++--------- objects/dib.c | 2 ++ relay32/snoop.c | 4 ++-- scheduler/process.c | 18 +++++++++--------- scheduler/timer.c | 8 ++++---- server/atom.c | 2 +- server/mapping.c | 2 +- server/request.c | 2 +- server/thread.h | 8 ++++---- win32/console.c | 12 ++++++------ windows/dialog.c | 11 ++++++----- windows/x11drv/clipboard.c | 3 ++- 35 files changed, 116 insertions(+), 91 deletions(-) diff --git a/controls/edit.c b/controls/edit.c index cebb44c08db..7a9664b91ec 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -14,6 +14,7 @@ #include "config.h" #include +#include #include "winbase.h" #include "winnt.h" diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 0933f31b8d2..2ca516efd4d 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -43,6 +43,7 @@ #include #include +#include #include "winbase.h" #include "heap.h" @@ -1182,7 +1183,7 @@ static INT LISTVIEW_GetItemHeight(HWND hwnd) } -static void LISTVIEW_PrintSelectionRanges(hwnd) +static void LISTVIEW_PrintSelectionRanges(HWND hwnd) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0); LISTVIEW_SELECTION *selection; @@ -1935,7 +1936,7 @@ static BOOL LISTVIEW_KeySelection(HWND hwnd, INT nItem) * over the item for a certain period of time. * */ -static LRESULT LISTVIEW_MouseHover(hwnd, wParam, lParam) +static LRESULT LISTVIEW_MouseHover(HWND hwnd, WPARAM wParam, LPARAM lParam) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0); POINT pt; @@ -4113,7 +4114,7 @@ static LRESULT LISTVIEW_DeleteItem(HWND hwnd, INT nItem) * SUCCESS : HWND * FAILURE : 0 */ -static LRESULT LISTVIEW_GetEditControl(hwnd) +static LRESULT LISTVIEW_GetEditControl(HWND hwnd) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0); return infoPtr->hwndEdit; diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index c2512896645..1eaeb373a5d 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -18,6 +18,7 @@ #include #include +#include #include "winbase.h" #include "windef.h" diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index 5af72445769..8fe2c8ea6c9 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -1410,8 +1410,8 @@ TAB_DrawItemInterior HFONT hFont; HFONT hOldFont = 0; /* stop uninitialized warning */ - INT nEscapement; - INT nOrientation; + INT nEscapement = 0; /* stop uninitialized warning */ + INT nOrientation = 0; /* stop uninitialized warning */ INT iPointSize; /* used to center the icon and text in the tab */ diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 65c58ea8900..b04678fdf33 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -27,6 +27,8 @@ #include #include #include +#include + #include "winbase.h" #include "wingdi.h" #include "wine/winestring.h" diff --git a/dlls/ddraw/ddraw/dga.c b/dlls/ddraw/ddraw/dga.c index bc6b1f170d9..1695ea312c9 100644 --- a/dlls/ddraw/ddraw/dga.c +++ b/dlls/ddraw/ddraw/dga.c @@ -423,7 +423,7 @@ HRESULT WINAPI DGA_IDirectDraw2Impl_QueryInterface( } if ( IsEqualGUID( &IID_IDirectDraw7, refiid ) ) { IDirectDraw4Impl *dd = HeapAlloc(GetProcessHeap(),0,sizeof(*dd)); - ICOM_VTBL(dd) = &dga_dd7vt;dd->ref = 1;dd->d = This->d;This->d++; + ICOM_VTBL(dd) = (ICOM_VTABLE(IDirectDraw4)*)&dga_dd7vt;dd->ref = 1;dd->d = This->d;This->d++; *obj = dd; IDirectDraw7_AddRef(iface); diff --git a/dlls/ddraw/ddraw/x11.c b/dlls/ddraw/ddraw/x11.c index cd54c0b9d73..b827e81aa91 100644 --- a/dlls/ddraw/ddraw/x11.c +++ b/dlls/ddraw/ddraw/x11.c @@ -152,13 +152,13 @@ clean_up_and_exit: static XF86VidModeModeInfo *orig_mode = NULL; void -xf86vmode_setdisplaymode(width,height) { +xf86vmode_setdisplaymode(DWORD width, DWORD height) { int i, mode_count; XF86VidModeModeInfo **all_modes, *vidmode = NULL; XF86VidModeModeLine mod_tmp; /* int dotclock_tmp; */ - /* save original video mode and set fullscreen if available*/ + /* save original video mode and set fullscreen if available */ orig_mode = (XF86VidModeModeInfo *)malloc(sizeof(XF86VidModeModeInfo)); TSXF86VidModeGetModeLine(display, DefaultScreen(display), &orig_mode->dotclock, &mod_tmp); orig_mode->hdisplay = mod_tmp.hdisplay; @@ -216,7 +216,7 @@ void xf86vmode_restore() { orig_mode = NULL; } #else -void xf86vmode_setdisplaymode(width,height) {} +void xf86vmode_setdisplaymode(DWORD width, DWORD height) {} void xf86vmode_restore() {} #endif diff --git a/dlls/ddraw/x11_private.h b/dlls/ddraw/x11_private.h index c13fdee151a..bba192a43bd 100644 --- a/dlls/ddraw/x11_private.h +++ b/dlls/ddraw/x11_private.h @@ -23,7 +23,7 @@ extern XF86VidModeModeInfo *orig_mode; #endif /* defined(HAVE_LIBXXF86VM) */ -extern void xf86vmode_setdisplaymode(int,int); +extern void xf86vmode_setdisplaymode(DWORD,DWORD); extern void xf86vmode_restore(); #ifdef HAVE_XVIDEO diff --git a/dlls/kernel/time.c b/dlls/kernel/time.c index 0d3d3ee8d64..8bfdd2114e6 100644 --- a/dlls/kernel/time.c +++ b/dlls/kernel/time.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include "file.h" diff --git a/dlls/kernel/win87em.c b/dlls/kernel/win87em.c index fa32bc5ea60..7646c5c5516 100644 --- a/dlls/kernel/win87em.c +++ b/dlls/kernel/win87em.c @@ -92,8 +92,10 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context ) { case 0: /* install (increase instanceref) emulator, install NMI vector */ RefCount++; +#if 0 if (Installed) - /* InstallIntVecs02hAnd75h(); */ ; + InstallIntVecs02hAnd75h(); +#endif WIN87_Init(context); AX_reg(context) = 0; break; @@ -106,8 +108,11 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context ) * if zero. Every '0' call should have a matching '2' call. */ WIN87_Init(context); - if (!(--RefCount) && (Installed)) - /* RestoreInt02h() */ ; + RefCount--; +#if 0 + if (!RefCount && Installed) + RestoreInt02h(); +#endif break; diff --git a/dlls/msvideo/drawdib.c b/dlls/msvideo/drawdib.c index 8429f2ae69a..a9e52750cd0 100644 --- a/dlls/msvideo/drawdib.c +++ b/dlls/msvideo/drawdib.c @@ -157,7 +157,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, DrawDibEnd(hdd); if (lpbi->biCompression) { - DWORD size; + DWORD size = 0; whdd->hic = ICOpen(ICTYPE_VIDEO,lpbi->biCompression,ICMODE_DECOMPRESS); if (!whdd->hic) { @@ -280,7 +280,7 @@ BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, whdd = GlobalLock16(hdd); -#define CHANGED(x) (whdd->##x != ##x) +#define CHANGED(x) (whdd->x != x) if ((!whdd->begun) || (!(wFlags & DDF_SAME_HDC) && CHANGED(hdc)) || (!(wFlags & DDF_SAME_DRAW) && (CHANGED(lpbi) || CHANGED(dxSrc) || CHANGED(dySrc) || CHANGED(dxDst) || CHANGED(dyDst)))) { diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 0895c547d18..379764b486c 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -3070,8 +3070,10 @@ HRESULT WINAPI VarDateFromR8(double dblIn, DATE* pdateOut) */ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pdateOut) { - HRESULT ret = S_OK; - struct tm TM = { 0,0,0,0,0,0,0,0,0 }; + HRESULT ret = S_OK; + struct tm TM; + + memset( &TM, 0, sizeof(TM) ); TRACE("( %p, %lx, %lx, %p ), stub\n", strIn, lcid, dwFlags, pdateOut ); @@ -3264,8 +3266,9 @@ HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut) */ HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR* pbstrOut) { - struct tm TM = {0,0,0,0,0,0,0,0,0}; - + struct tm TM; + memset( &TM, 0, sizeof(TM) ); + TRACE("( %f, %ld, %ld, %p ), stub\n", dateIn, lcid, dwFlags, pbstrOut ); if( DateToTm( dateIn, lcid, &TM ) == FALSE ) diff --git a/dlls/setupapi/setupx_main.c b/dlls/setupapi/setupx_main.c index 4131c1b6844..33d90982b47 100644 --- a/dlls/setupapi/setupx_main.c +++ b/dlls/setupapi/setupx_main.c @@ -88,7 +88,7 @@ RETERR16 WINAPI CtlSetLddPath16(LOGDISKID16 ldid, LPSTR szPath) RETERR16 WINAPI vcpOpen16(LPWORD p1, LPWORD p2) { - FIXME("(%p, %p, stub.\n", p1, p2); + FIXME("(%p, %p), stub.\n", p1, p2); return OK; } diff --git a/dlls/shell32/shlmenu.c b/dlls/shell32/shlmenu.c index 09840a663ce..2154aa3e6b6 100644 --- a/dlls/shell32/shlmenu.c +++ b/dlls/shell32/shlmenu.c @@ -686,7 +686,10 @@ BOOL WINAPI FileMenu_DeleteItemByCmd (HMENU hMenu, UINT uID) mii.fMask = MIIM_SUBMENU; GetMenuItemInfoA(hMenu, uID, FALSE, &mii ); - if ( mii.hSubMenu ); + if ( mii.hSubMenu ) + { + /* FIXME: Do what? */ + } DeleteMenu(hMenu, MF_BYCOMMAND, uID); return TRUE; @@ -706,7 +709,10 @@ BOOL WINAPI FileMenu_DeleteItemByIndex ( HMENU hMenu, UINT uPos) mii.fMask = MIIM_SUBMENU; GetMenuItemInfoA(hMenu, uPos, TRUE, &mii ); - if ( mii.hSubMenu ); + if ( mii.hSubMenu ) + { + /* FIXME: Do what? */ + } DeleteMenu(hMenu, MF_BYPOSITION, uPos); return TRUE; diff --git a/dlls/shell32/shv_bg_cmenu.c b/dlls/shell32/shv_bg_cmenu.c index e058a0434e8..de52ddf49fe 100644 --- a/dlls/shell32/shv_bg_cmenu.c +++ b/dlls/shell32/shv_bg_cmenu.c @@ -194,7 +194,7 @@ static BOOL DoPaste( TRACE("\n"); - if(SUCCEEDED(pOleGetClipboard(&pda))); + if(SUCCEEDED(pOleGetClipboard(&pda))) { STGMEDIUM medium; FORMATETC formatetc; diff --git a/graphics/x11drv/xfont.c b/graphics/x11drv/xfont.c index 502953d4a69..ff68a193391 100644 --- a/graphics/x11drv/xfont.c +++ b/graphics/x11drv/xfont.c @@ -927,7 +927,9 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, sprintf(resy_string, "%d", resy); } else - ; /* FIXME - synth width */ + { + /* FIXME - synth width */ + } } aLFD.resolution_y = resy_string; } diff --git a/loader/ne/segment.c b/loader/ne/segment.c index d3f6aa0704d..9459ef5a85b 100644 --- a/loader/ne/segment.c +++ b/loader/ne/segment.c @@ -473,7 +473,7 @@ static void NE_FixupSegmentPrologs(NE_MODULE *pModule, WORD segnum) entry = (ET_ENTRY *)((BYTE *)bundle+6); while (num_entries--) { - /*TRACE(module, "entry: %p, entry->segnum: %d, entry->offs: %04x\n", entry, entry->segnum, entry->offs);*/ + /*TRACE_(module)("entry: %p, entry->segnum: %d, entry->offs: %04x\n", entry, entry->segnum, entry->offs);*/ if (entry->segnum == segnum) { pFunc = ((BYTE *)pSeg+entry->offs); diff --git a/misc/cpu.c b/misc/cpu.c index b1c47a9e258..7b75d6fb73e 100644 --- a/misc/cpu.c +++ b/misc/cpu.c @@ -168,7 +168,7 @@ VOID WINAPI GetSystemInfo( } if (!strncasecmp(line,"processor",strlen("processor"))) { /* processor number counts up...*/ - int x; + unsigned int x; if (sscanf(value,"%d",&x)) if (x+1>cachedsi.dwNumberOfProcessors) diff --git a/misc/error.c b/misc/error.c index 216417d8731..03c581a8919 100644 --- a/misc/error.c +++ b/misc/error.c @@ -97,11 +97,11 @@ static const struct { static const char *GetErrorString(UINT16 uErr) { static char buffer[80]; - int i; + unsigned int n; - for (i = 0; i < ErrorStringCount; i++) { - if (uErr == ErrorStrings[i].constant) - return ErrorStrings[i].name; + for (n = 0; n < ErrorStringCount; n++) { + if (uErr == ErrorStrings[n].constant) + return ErrorStrings[n].name; } sprintf(buffer, "%x", uErr); @@ -122,11 +122,11 @@ static const char *GetParamErrorString(UINT16 uErr) { buffer[0] = '\0'; { - int i; + unsigned int n; - for (i = 0; i < ParamErrorStringCount; i++) { - if (uErr == ParamErrorStrings[i].constant) { - strcat(buffer, ParamErrorStrings[i].name); + for (n = 0; n < ParamErrorStringCount; n++) { + if (uErr == ParamErrorStrings[n].constant) { + strcat(buffer, ParamErrorStrings[n].name); return buffer; } } diff --git a/misc/options.c b/misc/options.c index 68cc4a3f2e3..e1e715495b3 100644 --- a/misc/options.c +++ b/misc/options.c @@ -225,15 +225,15 @@ static void parse_options( char *argv[] ) static void inherit_options( char *buffer ) { char *argv[256]; - int i; + unsigned int n; char *p = strtok( buffer, " \t" ); - for (i = 0; i < sizeof(argv)/sizeof(argv[0])-1 && p; i++) + for (n = 0; n < sizeof(argv)/sizeof(argv[0])-1 && p; n++) { - argv[i] = p; + argv[n] = p; p = strtok( NULL, " \t" ); } - argv[i] = NULL; + argv[n] = NULL; parse_options( argv ); if (argv[0]) /* an option remains */ { diff --git a/misc/registry.c b/misc/registry.c index 64e7899265c..7d9117ef366 100644 --- a/misc/registry.c +++ b/misc/registry.c @@ -706,7 +706,7 @@ error: ERR("error reading lf block\n"); static int _nt_parse_nk(HKEY hkey, char * base, nt_nk * nk, int level) { char * name; - int i; + unsigned int n; DWORD * vl; HKEY subkey = hkey; @@ -740,9 +740,9 @@ static int _nt_parse_nk(HKEY hkey, char * base, nt_nk * nk, int level) /* loop trough the value list */ vl = (DWORD *)(base+nk->valuelist_off+4); - for (i=0; inr_values; i++) + for (n=0; nnr_values; n++) { - nt_vk * vk = (nt_vk*)(base+vl[i]+4); + nt_vk * vk = (nt_vk*)(base+vl[n]+4); if (!_nt_parse_vk(subkey, base, vk)) goto error1; } @@ -1306,7 +1306,7 @@ void _w31_loadreg(void) { struct _w31_header head; struct _w31_tabent *tab; unsigned char *txt; - int len; + unsigned int len; OFSTRUCT ofs; BY_HANDLE_FILE_INFORMATION hfinfo; time_t lastmodified; @@ -1470,7 +1470,7 @@ void SHELL_LoadRegistry( void ) /* test %windir%/system32/config/system --> winnt */ strcpy(path, windir); strncat(path, "\\system32\\config\\system", MAX_PATHNAME_LEN - strlen(path) - 1); - if(GetFileAttributesA(path) != -1) + if(GetFileAttributesA(path) != (DWORD)-1) { systemtype = REG_WINNT; } @@ -1479,7 +1479,7 @@ void SHELL_LoadRegistry( void ) /* test %windir%/system.dat --> win95 */ strcpy(path, windir); strncat(path, "\\system.dat", MAX_PATHNAME_LEN - strlen(path) - 1); - if(GetFileAttributesA(path) != -1) + if(GetFileAttributesA(path) != (DWORD)-1) { systemtype = REG_WIN95; } @@ -1616,7 +1616,7 @@ void SHELL_LoadRegistry( void ) if (PROFILE_GetWineIniBool("registry", "LoadHomeRegistryFiles", 1)) { const char *confdir = get_config_dir(); - int len = strlen(confdir) + 20; + unsigned int len = strlen(confdir) + 20; char *fn = path; if (len > sizeof(path)) fn = HeapAlloc( GetProcessHeap(), 0, len ); diff --git a/msdos/devices.c b/msdos/devices.c index 57146ede3f4..f0e1efaeaa3 100644 --- a/msdos/devices.c +++ b/msdos/devices.c @@ -439,7 +439,7 @@ void DOSDEV_InstallDOSDevices(void) { DOS_DATASEG *dataseg; UINT16 seg; - int n; + unsigned int n; /* allocate DOS data segment or something */ DOS_LOLSeg = GlobalDOSAlloc16(sizeof(DOS_DATASEG)); diff --git a/msdos/vga.c b/msdos/vga.c index 13a716be03b..a17aa5a79be 100644 --- a/msdos/vga.c +++ b/msdos/vga.c @@ -221,9 +221,8 @@ void VGA_WriteChars(unsigned X,unsigned Y,unsigned ch,int attr,int count) void CALLBACK VGA_Poll( ULONG_PTR arg ) { char *dat; - unsigned Pitch,Height,Width; + unsigned int Pitch,Height,Width,Y,X; char *surf; - int Y,X; if (!InterlockedExchangeAdd(&vga_polling, 1)) { /* FIXME: optimize by doing this only if the data has actually changed diff --git a/msdos/vxd.c b/msdos/vxd.c index 727ec583dd4..adb00de9363 100644 --- a/msdos/vxd.c +++ b/msdos/vxd.c @@ -48,7 +48,7 @@ void WINAPI VXD_VMM ( CONTEXT86 *context ) { unsigned service = AX_reg(context); - TRACE("[%04x] VMM \n", (UINT16)service); + TRACE("[%04x] VMM\n", (UINT16)service); switch(service) { @@ -121,7 +121,7 @@ void WINAPI VXD_Reboot ( CONTEXT86 *context ) { unsigned service = AX_reg(context); - TRACE("[%04x] VMM \n", (UINT16)service); + TRACE("[%04x] Reboot\n", (UINT16)service); switch(service) { @@ -142,7 +142,7 @@ void WINAPI VXD_VDD ( CONTEXT86 *context ) { unsigned service = AX_reg(context); - TRACE("[%04x] VDD \n", (UINT16)service); + TRACE("[%04x] VDD\n", (UINT16)service); switch(service) { @@ -163,7 +163,7 @@ void WINAPI VXD_VMD ( CONTEXT86 *context ) { unsigned service = AX_reg(context); - TRACE("[%04x] VMD \n", (UINT16)service); + TRACE("[%04x] VMD\n", (UINT16)service); switch(service) { @@ -380,7 +380,7 @@ void WINAPI VXD_TimerAPI ( CONTEXT86 *context ) { unsigned service = AX_reg(context); - TRACE("[%04x] TimerAPI \n", (UINT16)service); + TRACE("[%04x] TimerAPI\n", (UINT16)service); switch(service) { @@ -413,7 +413,7 @@ void WINAPI VXD_ConfigMG ( CONTEXT86 *context ) { unsigned service = AX_reg(context); - TRACE("[%04x] ConfigMG \n", (UINT16)service); + TRACE("[%04x] ConfigMG\n", (UINT16)service); switch(service) { @@ -434,7 +434,7 @@ void WINAPI VXD_Enable ( CONTEXT86 *context ) { unsigned service = AX_reg(context); - TRACE("[%04x] Enable \n", (UINT16)service); + TRACE("[%04x] Enable\n", (UINT16)service); switch(service) { @@ -455,7 +455,7 @@ void WINAPI VXD_APM ( CONTEXT86 *context ) { unsigned service = AX_reg(context); - TRACE("[%04x] APM \n", (UINT16)service); + TRACE("[%04x] APM\n", (UINT16)service); switch(service) { @@ -753,7 +753,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) IMAGE_SECTION_HEADER *pe_seg = PE_SECTIONS(module->baseAddr); HFILE image = _lopen(module->pathName, OF_READ); - BOOL error = (image == INVALID_HANDLE_VALUE); + BOOL error = (image == HFILE_ERROR); UINT i; TRACE("MapModule: Loading %s\n", module->pathName); diff --git a/objects/dib.c b/objects/dib.c index 4650d89f47d..67143ac4005 100644 --- a/objects/dib.c +++ b/objects/dib.c @@ -5,6 +5,8 @@ * */ +#include + #include "winbase.h" #include "bitmap.h" #include "callback.h" diff --git a/relay32/snoop.c b/relay32/snoop.c index f24dbcee4da..082175c1904 100644 --- a/relay32/snoop.c +++ b/relay32/snoop.c @@ -61,7 +61,7 @@ typedef struct tagSNOOP_DLL { HMODULE hmod; SNOOP_FUN *funs; LPCSTR name; - int nrofordinals; + DWORD nrofordinals; struct tagSNOOP_DLL *next; } SNOOP_DLL; typedef struct tagSNOOP_RETURNENTRY { @@ -192,7 +192,7 @@ SNOOP_GetProcAddress(HMODULE hmod,LPCSTR name,DWORD ordinal,FARPROC origfun) { return origfun; if (!SNOOP_ShowDebugmsgSnoop(dll->name,ordinal,name)) return origfun; - assert(ordinalnrofordinals); + assert(ordinal < dll->nrofordinals); fun = dll->funs+ordinal; if (!fun->name) fun->name = HEAP_strdupA(GetProcessHeap(),0,name); fun->lcall = 0xe8; diff --git a/scheduler/process.c b/scheduler/process.c index 730ce63e560..acf14d8ec8a 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -41,7 +41,7 @@ PDB current_process; static char **main_exe_argv; static char main_exe_name[MAX_PATH]; -static HFILE main_exe_file = INVALID_HANDLE_VALUE; +static HANDLE main_exe_file = INVALID_HANDLE_VALUE; unsigned int server_startticks; @@ -740,7 +740,7 @@ BOOL PROCESS_Create( HFILE hFile, LPCSTR filename, LPSTR cmd_line, LPCSTR env, const char *unixfilename = NULL; const char *unixdir = NULL; DOS_FULL_NAME full_name; - HANDLE load_done_evt = -1; + HANDLE load_done_evt = (HANDLE)-1; info->hThread = info->hProcess = INVALID_HANDLE_VALUE; @@ -824,7 +824,7 @@ BOOL PROCESS_Create( HFILE hFile, LPCSTR filename, LPSTR cmd_line, LPCSTR env, if (!ret || (pid == -1)) goto error; /* Wait until process is initialized (or initialization failed) */ - if (load_done_evt != -1) + if (load_done_evt != (HANDLE)-1) { DWORD res; HANDLE handles[2]; @@ -845,7 +845,7 @@ BOOL PROCESS_Create( HFILE hFile, LPCSTR filename, LPSTR cmd_line, LPCSTR env, return TRUE; error: - if (load_done_evt != -1) CloseHandle( load_done_evt ); + if (load_done_evt != (HANDLE)-1) CloseHandle( load_done_evt ); if (info->hThread != INVALID_HANDLE_VALUE) CloseHandle( info->hThread ); if (info->hProcess != INVALID_HANDLE_VALUE) CloseHandle( info->hProcess ); return FALSE; @@ -941,16 +941,16 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset ) case GPD_STARTF_SIZE: x = current_startupinfo.dwXSize; - if ( x == CW_USEDEFAULT ) x = CW_USEDEFAULT16; + if ( (INT)x == CW_USEDEFAULT ) x = CW_USEDEFAULT16; y = current_startupinfo.dwYSize; - if ( y == CW_USEDEFAULT ) y = CW_USEDEFAULT16; + if ( (INT)y == CW_USEDEFAULT ) y = CW_USEDEFAULT16; return MAKELONG( x, y ); case GPD_STARTF_POSITION: x = current_startupinfo.dwX; - if ( x == CW_USEDEFAULT ) x = CW_USEDEFAULT16; + if ( (INT)x == CW_USEDEFAULT ) x = CW_USEDEFAULT16; y = current_startupinfo.dwY; - if ( y == CW_USEDEFAULT ) y = CW_USEDEFAULT16; + if ( (INT)y == CW_USEDEFAULT ) y = CW_USEDEFAULT16; return MAKELONG( x, y ); case GPD_STARTF_FLAGS: @@ -1168,7 +1168,7 @@ BOOL WINAPI SetProcessWorkingSetSize(HANDLE hProcess,DWORD minset, DWORD maxset) { FIXME("(0x%08x,%ld,%ld): stub - harmless\n",hProcess,minset,maxset); - if(( minset == -1) && (maxset == -1)) { + if(( minset == (DWORD)-1) && (maxset == (DWORD)-1)) { /* Trim the working set to zero */ /* Swap the process out of physical RAM */ } diff --git a/scheduler/timer.c b/scheduler/timer.c index a5de434a27c..a0aa575fcd0 100644 --- a/scheduler/timer.c +++ b/scheduler/timer.c @@ -37,7 +37,7 @@ HANDLE WINAPI CreateWaitableTimerA( SECURITY_ATTRIBUTES *sa, BOOL manual, LPCSTR ret = req->handle; } SERVER_END_REQ; - if (ret == -1) ret = 0; /* must return 0 on failure, not -1 */ + if (ret == INVALID_HANDLE_VALUE) ret = 0; /* must return 0 on failure, not -1 */ return ret; } @@ -66,7 +66,7 @@ HANDLE WINAPI CreateWaitableTimerW( SECURITY_ATTRIBUTES *sa, BOOL manual, LPCWST ret = req->handle; } SERVER_END_REQ; - if (ret == -1) ret = 0; /* must return 0 on failure, not -1 */ + if (ret == INVALID_HANDLE_VALUE) ret = 0; /* must return 0 on failure, not -1 */ return ret; } @@ -94,7 +94,7 @@ HANDLE WINAPI OpenWaitableTimerA( DWORD access, BOOL inherit, LPCSTR name ) ret = req->handle; } SERVER_END_REQ; - if (ret == -1) ret = 0; /* must return 0 on failure, not -1 */ + if (ret == INVALID_HANDLE_VALUE) ret = 0; /* must return 0 on failure, not -1 */ return ret; } @@ -122,7 +122,7 @@ HANDLE WINAPI OpenWaitableTimerW( DWORD access, BOOL inherit, LPCWSTR name ) ret = req->handle; } SERVER_END_REQ; - if (ret == -1) ret = 0; /* must return 0 on failure, not -1 */ + if (ret == INVALID_HANDLE_VALUE) ret = 0; /* must return 0 on failure, not -1 */ return ret; } diff --git a/server/atom.c b/server/atom.c index 5e65b23ad36..0e9f47782f2 100644 --- a/server/atom.c +++ b/server/atom.c @@ -268,7 +268,7 @@ static int find_atom( struct atom_table *table, const WCHAR *str ) static size_t get_atom_name( struct atom_table *table, int atom, WCHAR *str, size_t maxsize, int *count ) { - int len = 0; + size_t len = 0; struct atom_entry *entry = get_atom_entry( table, atom ); *count = -1; if (entry) diff --git a/server/mapping.c b/server/mapping.c index 0ad6a570792..ab98a62ce38 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -55,7 +55,7 @@ static const struct object_ops mapping_ops = /* These are always the same on an i386, and it will be faster this way */ # define page_mask 0xfff # define page_shift 12 -# define init_page_size() /* nothing */ +# define init_page_size() do { /* nothing */ } while(0) #else /* __i386__ */ diff --git a/server/request.c b/server/request.c index 8865604bd01..083c6013f1b 100644 --- a/server/request.c +++ b/server/request.c @@ -72,7 +72,7 @@ static const struct object_ops master_socket_ops = struct thread *current = NULL; /* thread handling the current request */ -int global_error = 0; /* global error code for when no thread is current */ +unsigned int global_error = 0; /* global error code for when no thread is current */ static struct master_socket *master_socket; /* the master socket object */ diff --git a/server/thread.h b/server/thread.h index f0f170b4bdc..c0db4819b46 100644 --- a/server/thread.h +++ b/server/thread.h @@ -47,7 +47,7 @@ struct thread struct thread_wait *wait; /* current wait condition if sleeping */ struct thread_apc *apc_head; /* queue of async procedure calls */ struct thread_apc *apc_tail; /* queue of async procedure calls */ - int error; /* current error code */ + unsigned int error; /* current error code */ int pass_fd; /* fd to pass to the client */ enum run_state state; /* running state */ int attached; /* is thread attached with ptrace? */ @@ -108,10 +108,10 @@ extern int read_thread_int( struct thread *thread, const int *addr, int *data ); extern int write_thread_int( struct thread *thread, int *addr, int data, unsigned int mask ); extern void *get_thread_ip( struct thread *thread ); -extern int global_error; /* global error code for when no thread is current */ +extern unsigned int global_error; /* global error code for when no thread is current */ -static inline int get_error(void) { return current ? current->error : global_error; } -static inline void set_error( int err ) { global_error = err; if (current) current->error = err; } +static inline unsigned int get_error(void) { return current ? current->error : global_error; } +static inline void set_error( unsigned int err ) { global_error = err; if (current) current->error = err; } static inline void clear_error(void) { set_error(0); } static inline void *get_thread_id( struct thread *thread ) { return thread; } diff --git a/win32/console.c b/win32/console.c index eca18e5394a..fc828e189a3 100644 --- a/win32/console.c +++ b/win32/console.c @@ -93,8 +93,8 @@ static int mapvkey_1[256]={ }; /* FIXME: Should be in an internal header file. OK, so which one? - Used by CONSOLE_makecomplex. */ -int wine_openpty(int *master, int *slave, char *name, + Used by CONSOLE_make_complex. */ +extern int wine_openpty(int *master, int *slave, char *name, struct termios *term, struct winsize *winsize); /**************************************************************************** @@ -553,7 +553,7 @@ BOOL WINAPI FreeConsole(VOID) * This makes simple commandline tools pipeable, while complex commandline * tools work without getting messed up by debugoutput. * - * All other functions should work indedependend from this call. + * All other functions should work independent from this call. * * To test for complex console: pid == 0 -> simple, otherwise complex. */ @@ -1002,7 +1002,7 @@ BOOL WINAPI ReadConsoleA( HANDLE hConsoleInput, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved ) { - int charsread = 0; + DWORD charsread = 0; LPSTR xbuf = (LPSTR)lpBuffer; TRACE("(%d,%p,%ld,%p,%p)\n", @@ -1462,7 +1462,7 @@ BOOL WINAPI FillConsoleOutputCharacterA( COORD dwCoord, LPDWORD lpNumCharsWritten) { - long count; + DWORD count; DWORD xlen; SetConsoleCursorPosition(hConsoleOutput,dwCoord); @@ -1493,7 +1493,7 @@ BOOL WINAPI FillConsoleOutputCharacterW(HANDLE hConsoleOutput, COORD dwCoord, LPDWORD lpNumCharsWritten) { - long count; + DWORD count; DWORD xlen; SetConsoleCursorPosition(hConsoleOutput,dwCoord); diff --git a/windows/dialog.c b/windows/dialog.c index 0b9b3c75f5f..7af5da4d225 100644 --- a/windows/dialog.c +++ b/windows/dialog.c @@ -859,8 +859,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate, hwndPreInitFocus = GetFocus(); if (SendMessageA( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param )) { - /* check where the focus is again, some controls status might have changed in - WM_INITDIALOG */ + /* check where the focus is again, + * some controls status might have changed in WM_INITDIALOG */ dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE); SetFocus( dlgInfo->hwndFocus ); } @@ -1334,10 +1334,10 @@ static BOOL DIALOG_IsAccelerator( HWND hwnd, HWND hwndDlg, WPARAM vKey ) /*********************************************************************** * DIALOG_FindMsgDestination * - * The messages that IsDialogMessage send may not go to the dialog + * The messages that IsDialogMessage sends may not go to the dialog * calling IsDialogMessage if that dialog is a child, and it has the * DS_CONTROL style set. - * We propagate up until we hit a that does not have DS_CONTROL, or + * We propagate up until we hit one that does not have DS_CONTROL, or * whose parent is not a dialog. * * This is undocumented behaviour. @@ -1966,7 +1966,8 @@ HWND WINAPI GetNextDlgGroupItem( HWND hwndDlg, HWND hwndCtrl, if(hwndCtrl) { - /* if the hwndCtrl is the child of the control in the hwndDlg then the hwndDlg has to be the parent of the hwndCtrl */ + /* if the hwndCtrl is the child of the control in the hwndDlg, + * then the hwndDlg has to be the parent of the hwndCtrl */ if(GetParent(hwndCtrl) != hwndDlg && GetParent(GetParent(hwndCtrl)) == hwndDlg) hwndDlg = GetParent(hwndCtrl); } diff --git a/windows/x11drv/clipboard.c b/windows/x11drv/clipboard.c index d9290a72cbc..1440456e581 100644 --- a/windows/x11drv/clipboard.c +++ b/windows/x11drv/clipboard.c @@ -49,6 +49,7 @@ #include #include +#include #include #include @@ -291,7 +292,7 @@ BOOL X11DRV_CLIPBOARD_LaunchServer() TRACE("Waiting for clipboard server to acquire selection\n"); if ( WaitForSingleObject( selectionClearEvent, 60000 ) != WAIT_OBJECT_0 ) - TRACE("Server could not acquire selection, or a time out occured!\n"); + TRACE("Server could not acquire selection, or a timeout occurred!\n"); else TRACE("Server successfully acquired selection\n"); -- 2.11.4.GIT