diff --git a/controls/edit.c b/controls/edit.c
index cebb44c08db5cd79b60f1ae2a9d671291a693db1..7a9664b91ecc9c93c2d0d06b60a68da27bc0fb8a 100644
--- a/controls/edit.c
+++ b/controls/edit.c
@@ -14,6 +14,7 @@
 #include "config.h"
 
 #include <string.h>
+#include <stdlib.h>
 
 #include "winbase.h"
 #include "winnt.h"
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 0933f31b8d2b5006fad3a984bce0fdcace1a7cb1..2ca516efd4dc5fc948865ef298f5506fd5f5d9e2 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -43,6 +43,7 @@
 
 #include <ctype.h>
 #include <string.h>
+#include <stdlib.h>
 
 #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 c25128966458ac3ebcc0aec4b9b2cd49af85d369..1eaeb373a5deeb246916baa4a3ac68d3af4b9351 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #include "winbase.h"
 #include "windef.h"
diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c
index 5af724457692255fca2171db17495ad0f5517a41..8fe2c8ea6c9ae86717c7c36884466d3ca849df77 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 65c58ea89007dfd701373308e5a623b43fcd25e3..b04678fdf339149f170d1dced070d9e4ab7faf57 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -27,6 +27,8 @@
 #include <assert.h>
 #include <string.h>
 #include <limits.h>
+#include <stdlib.h>
+
 #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 bc6b1f170d9f84c325268c22a7f86a9df8839f82..1695ea312c9c83db3db4383e2cb4ab2ebca614c6 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 cd54c0b9d73f5b7a6da96c3fb25783b23f119fa5..b827e81aa918308bfdab757a9069c30b0dc415b2 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 c13fdee151a53893e4e3ac2b986051b1a969ca3a..bba192a43bdfda8ac2a2ef4c9b02be52663e1dc9 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 0d3d3ee8d6457d89721da7ff5d8ccf363eb98c1e..8bfdd2114e66c19c6c7429d5e170ac8ace046c42 100644
--- a/dlls/kernel/time.c
+++ b/dlls/kernel/time.c
@@ -6,6 +6,7 @@
 
 #include <string.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <sys/time.h>
 #include <sys/times.h>
 #include "file.h"
diff --git a/dlls/kernel/win87em.c b/dlls/kernel/win87em.c
index fa32bc5ea602994e4f1b5e6330486139175eb3be..7646c5c551611852a4972fd55cb9d554a3121023 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 8429f2ae69aae77d13edef8b5263a0338929a3d5..a9e52750cd089762bb9a3644abef508a9eabec32 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 0895c547d1868f422906ffdfe268f017f5e26161..379764b486cd130e6f95d84dfe8bce9fa53ec77d 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 4131c1b68444a14ab8f89d213a985cdc3ad993c7..33d90982b47734e725e00a3f8d278b8695859930 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 09840a663ce96e1db47ce13d4488e2bd4aff3b52..2154aa3e6b6707219af632d09af1a5f881e364b6 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 e058a0434e8cc9e7367019a99ea595ec06aad672..de52ddf49fe374e06355633df75203e2330b1ed8 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 502953d4a695ea4c527c8b8e85b6f7cfbe9225a3..ff68a1933919d6f8fd7ee0f1e8547402b4069cd4 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 d3f6aa0704dc8fa4270012ad2a08b8b0cf8eecd6..9459ef5a85b4e6ac192c3c9ba74a9a38bf31eb5a 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 b1c47a9e258db6661dce6d18756a2318d64b82d3..7b75d6fb73eae370316f5c5d9c58776d045ac404 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 216417d87318775e802116bdb2361e16d6aa9a9e..03c581a891992759a99073ace92cb78a113ccf28 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 68cc4a3f2e3b3960b9d0355e516bb844f7e036fd..e1e715495b3b270d19c66d630603c10e2d4171e5 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 64e7899265c753f71c84aa1dda3e88774bb555d5..7d9117ef36649a4a1c3dafeffd9004ac380380d2 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; i<nk->nr_values; i++)
+	for (n=0; n<nk->nr_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 57146ede3f452582b349389dda631fccddd8f06b..f0e1efaeaa3ad989c963742675b67ed1aaef2eef 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 13a716be03bf1beccfa39a893a8cdb00914dfeaa..a17aa5a79be2f5b1da7c8b21b6f22b3d52739ce3 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 727ec583dd4059ef73599350aab1083413a12f3f..adb00de9363dafe77acf886e1ee181504922a86c 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 4650d89f47d78257a18b9c2c4ea05cb7e7242fc3..67143ac4005bea6f45134cef6d0c56b45f314064 100644
--- a/objects/dib.c
+++ b/objects/dib.c
@@ -5,6 +5,8 @@
  *
  */
 
+#include <stdlib.h>
+
 #include "winbase.h"
 #include "bitmap.h"
 #include "callback.h"
diff --git a/relay32/snoop.c b/relay32/snoop.c
index f24dbcee4da79d514b0f1cf00f6866d20dcb66f1..082175c190468f5c2697bcaafe010092354aa27f 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(ordinal<dll->nrofordinals);
+	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 730ce63e560c3048d0f6d544289856cb6eceaefe..acf14d8ec8acd9a07961ac4cd0229cd58372794c 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 a5de434a27ce8ff36157f3d53d81e2cb2e6b3997..a0aa575fcd08ad70a99601b2dfb588a4be79e8cf 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 5e65b23ad369a84d86dacd7709b35d2a744349b9..0e9f47782f2713910d57c726af7bfca5068bad81 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 0ad6a5707927a2dbf80034ba8b99896196204aab..ab98a62ce38c99d63c367c186cc406a615faf610 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 8865604bd019986b06a81567e4f7ef9f9cc02072..083c6013f1bf5c83590f2cf884f24c078f8f5c7d 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 f0f170b4bdc251992b1c7e93dc3a5ae718f48b9d..c0db4819b46f47e23d598ab88e154e684ec9d4a8 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 eca18e5394af3e575b9ab703586e9ed41a0b03f7..fc828e189a300095f605a4b61e83a354cc508f3d 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 0b9b3c75f5f5200a370429e1b4c352f464d2911b..7af5da4d225be9cbb96c54ee5fe8484468ca5f7b 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 d9290a72cbccfb5245dde537270b896a0b0e45cb..1440456e581ef4f5d30cc86554bdc80a10b7bbcc 100644
--- a/windows/x11drv/clipboard.c
+++ b/windows/x11drv/clipboard.c
@@ -49,6 +49,7 @@
 
 #include <string.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 
@@ -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");