Fixed some of the issues reported by Solaris Lint.

diff --git a/console/generic.c b/console/generic.c
index d45813a..eeedc08 100644
--- a/console/generic.c
+++ b/console/generic.c
@@ -69,8 +69,8 @@
 {
    /* Scroll Up Window: Characters go down */
 
-   char trow, tcol;
-   int old_refresh, x;
+   char trow, tcol, x;
+   int old_refresh;
 
    TRACE("Scroll Up %d lines from %d to %d.\n", lines, row1,
       row2);
@@ -101,8 +101,8 @@
 {
    /* Scroll Down Window: Characters go up */
 
-   char trow, tcol;
-   int old_refresh, x;
+   char trow, tcol, x;
+   int old_refresh;
 
    /* Abort if we have only partial functionality */
    if (!(driver.getCursorPosition && driver.moveCursor && driver.write
@@ -144,7 +144,7 @@
       functions but may be useful elsewhere. If it can be used from
       outside here, it should be made non-static */
 
-   int x;
+   char x;
 
    TRACE("Clear Line: %d from %d to %d.\n", row, col1, col2);
 
@@ -165,7 +165,7 @@
       functions but may be useful elsewhere. If it can be used from
       outside here, it should be made non-static */
 
-   int x;
+   char x;
    int bg_color, fg_color, attribute;
    char ch;
 
diff --git a/console/xterm.c b/console/xterm.c
index 8c2e7bc..35ba5eb 100644
--- a/console/xterm.c
+++ b/console/xterm.c
@@ -25,9 +25,9 @@
 
 char console_xterm_prog[80];
 
-static BOOL wine_create_console(FILE **master, FILE **slave, int *pid);
-FILE *wine_openpty(int *master, int *slave, char *name,
-                        struct termios *term, struct winsize *winsize);
+static BOOL wine_create_console(FILE **master, FILE **slave, pid_t *pid);
+int wine_openpty(int *master, int *slave, char *name,
+		 struct termios *term, struct winsize *winsize);
 
 /* The console -- I chose to keep the master and slave
  * (UNIX) file descriptors around in case they are needed for
@@ -36,7 +36,7 @@
 typedef struct _XTERM_CONSOLE {
         FILE    *master;                 /* xterm side of pty */
         FILE    *slave;                  /* wine side of pty */
-        int     pid;                     /* xterm's pid, -1 if no xterm */
+        pid_t    pid;                    /* xterm's pid, -1 if no xterm */
 } XTERM_CONSOLE;
 
 static XTERM_CONSOLE xterm_console;
@@ -109,7 +109,7 @@
 }
 
 
-static BOOL wine_create_console(FILE **master, FILE **slave, int *pid)
+static BOOL wine_create_console(FILE **master, FILE **slave, pid_t *pid)
 {
         /* There is definately a bug in this routine that causes a lot
            of garbage to be written to the screen, but I can't find it...
diff --git a/graphics/enhmetafiledrv/graphics.c b/graphics/enhmetafiledrv/graphics.c
index f11d9e4..242b01f 100644
--- a/graphics/enhmetafiledrv/graphics.c
+++ b/graphics/enhmetafiledrv/graphics.c
@@ -5,6 +5,8 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
+
 #include "gdi.h"
 #include "dc.h"
 #include "enhmetafiledrv.h"
diff --git a/graphics/enhmetafiledrv/objects.c b/graphics/enhmetafiledrv/objects.c
index b25715d..ef90372 100644
--- a/graphics/enhmetafiledrv/objects.c
+++ b/graphics/enhmetafiledrv/objects.c
@@ -6,6 +6,8 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
+
 #include "bitmap.h"
 #include "brush.h"
 #include "font.h"
diff --git a/graphics/metafiledrv/bitblt.c b/graphics/metafiledrv/bitblt.c
index af3e9d6..a8ee0f6 100644
--- a/graphics/metafiledrv/bitblt.c
+++ b/graphics/metafiledrv/bitblt.c
@@ -4,6 +4,8 @@
  * Copyright 1993, 1994  Alexandre Julliard
  */
 
+#include <string.h>
+
 #include "gdi.h"
 #include "metafiledrv.h"
 #include "heap.h"
diff --git a/graphics/metafiledrv/graphics.c b/graphics/metafiledrv/graphics.c
index 4c579d6..3c29fb8 100644
--- a/graphics/metafiledrv/graphics.c
+++ b/graphics/metafiledrv/graphics.c
@@ -5,6 +5,8 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
+
 #include "gdi.h"
 #include "dc.h"
 #include "region.h"
diff --git a/graphics/metafiledrv/objects.c b/graphics/metafiledrv/objects.c
index b898871..389996e 100644
--- a/graphics/metafiledrv/objects.c
+++ b/graphics/metafiledrv/objects.c
@@ -6,6 +6,8 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
+
 #include "bitmap.h"
 #include "brush.h"
 #include "font.h"
diff --git a/graphics/metafiledrv/text.c b/graphics/metafiledrv/text.c
index c744616..9390336 100644
--- a/graphics/metafiledrv/text.c
+++ b/graphics/metafiledrv/text.c
@@ -5,6 +5,8 @@
  *
  */
 
+#include <string.h>
+
 #include "windef.h"
 #include "metafiledrv.h"
 #include "debugtools.h"
diff --git a/include/debugdefs.h b/include/debugdefs.h
index 859302b..419842c 100644
--- a/include/debugdefs.h
+++ b/include/debugdefs.h
@@ -8,167 +8,164 @@
 
 const char * const debug_cl_name[] = { "fixme", "err", "warn", "trace" };
 
-int dbch_accel = 0;
-int dbch_advapi = 1;
-int dbch_animate = 2;
-int dbch_aspi = 3;
-int dbch_atom = 4;
-int dbch_avifile = 5;
-int dbch_bitblt = 6;
-int dbch_bitmap = 7;
-int dbch_caret = 8;
-int dbch_cdaudio = 9;
-int dbch_class = 10;
-int dbch_clipboard = 11;
-int dbch_clipping = 12;
-int dbch_combo = 13;
-int dbch_comboex = 14;
-int dbch_comm = 15;
-int dbch_commctrl = 16;
-int dbch_commdlg = 17;
-int dbch_console = 18;
-int dbch_crtdll = 19;
-int dbch_cursor = 20;
-int dbch_datetime = 21;
-int dbch_dc = 22;
-int dbch_dde = 23;
-int dbch_ddeml = 24;
-int dbch_ddraw = 25;
-int dbch_debug = 26;
-int dbch_delayhlp = 27;
-int dbch_dialog = 28;
-int dbch_dinput = 29;
-int dbch_dll = 30;
-int dbch_dosfs = 31;
-int dbch_dosmem = 32;
-int dbch_dplay = 33;
-int dbch_driver = 34;
-int dbch_dsound = 35;
-int dbch_edit = 36;
-int dbch_elfdll = 37;
-int dbch_enhmetafile = 38;
-int dbch_event = 39;
-int dbch_exec = 40;
-int dbch_file = 41;
-int dbch_fixup = 42;
-int dbch_font = 43;
-int dbch_gdi = 44;
-int dbch_global = 45;
-int dbch_graphics = 46;
-int dbch_header = 47;
-int dbch_heap = 48;
-int dbch_hook = 49;
-int dbch_hotkey = 50;
-int dbch_icon = 51;
-int dbch_imagehlp = 52;
-int dbch_imagelist = 53;
-int dbch_imm = 54;
-int dbch_int = 55;
-int dbch_int10 = 56;
-int dbch_int16 = 57;
-int dbch_int17 = 58;
-int dbch_int19 = 59;
-int dbch_int21 = 60;
-int dbch_int31 = 61;
-int dbch_io = 62;
-int dbch_ipaddress = 63;
-int dbch_key = 64;
-int dbch_keyboard = 65;
-int dbch_ldt = 66;
-int dbch_listbox = 67;
-int dbch_listview = 68;
-int dbch_local = 69;
-int dbch_mci = 70;
-int dbch_mcianim = 71;
-int dbch_mciavi = 72;
-int dbch_mcimidi = 73;
-int dbch_mciwave = 74;
-int dbch_mdi = 75;
-int dbch_menu = 76;
-int dbch_message = 77;
-int dbch_metafile = 78;
-int dbch_midi = 79;
-int dbch_mmaux = 80;
-int dbch_mmio = 81;
-int dbch_mmsys = 82;
-int dbch_mmtime = 83;
-int dbch_module = 84;
-int dbch_monthcal = 85;
-int dbch_mpr = 86;
-int dbch_msacm = 87;
-int dbch_msg = 88;
-int dbch_msvideo = 89;
-int dbch_nativefont = 90;
-int dbch_nonclient = 91;
-int dbch_ntdll = 92;
-int dbch_ole = 93;
-int dbch_pager = 94;
-int dbch_palette = 95;
-int dbch_pidl = 96;
-int dbch_print = 97;
-int dbch_process = 98;
-int dbch_profile = 99;
-int dbch_progress = 100;
-int dbch_prop = 101;
-int dbch_propsheet = 102;
-int dbch_psapi = 103;
-int dbch_psdrv = 104;
-int dbch_ras = 105;
-int dbch_rebar = 106;
-int dbch_reg = 107;
-int dbch_region = 108;
-int dbch_relay = 109;
-int dbch_resource = 110;
-int dbch_scroll = 111;
-int dbch_security = 112;
-int dbch_segment = 113;
-int dbch_seh = 114;
-int dbch_selector = 115;
-int dbch_sem = 116;
-int dbch_sendmsg = 117;
-int dbch_server = 118;
-int dbch_shell = 119;
-int dbch_shm = 120;
-int dbch_snoop = 121;
-int dbch_sound = 122;
-int dbch_static = 123;
-int dbch_statusbar = 124;
-int dbch_storage = 125;
-int dbch_stress = 126;
-int dbch_string = 127;
-int dbch_syscolor = 128;
-int dbch_system = 129;
-int dbch_tab = 130;
-int dbch_tapi = 131;
-int dbch_task = 132;
-int dbch_text = 133;
-int dbch_thread = 134;
-int dbch_thunk = 135;
-int dbch_timer = 136;
-int dbch_toolbar = 137;
-int dbch_toolhelp = 138;
-int dbch_tooltips = 139;
-int dbch_trackbar = 140;
-int dbch_treeview = 141;
-int dbch_ttydrv = 142;
-int dbch_tweak = 143;
-int dbch_typelib = 144;
-int dbch_updown = 145;
-int dbch_ver = 146;
-int dbch_virtual = 147;
-int dbch_vxd = 148;
-int dbch_wave = 149;
-int dbch_win = 150;
-int dbch_win16drv = 151;
-int dbch_win32 = 152;
-int dbch_wing = 153;
-int dbch_winsock = 154;
-int dbch_winspool = 155;
-int dbch_wnet = 156;
-int dbch_x11 = 157;
-int dbch_x11drv = 158;
+const int dbch_accel = 0;
+const int dbch_advapi = 1;
+const int dbch_animate = 2;
+const int dbch_aspi = 3;
+const int dbch_atom = 4;
+const int dbch_avifile = 5;
+const int dbch_bitblt = 6;
+const int dbch_bitmap = 7;
+const int dbch_caret = 8;
+const int dbch_cdaudio = 9;
+const int dbch_class = 10;
+const int dbch_clipboard = 11;
+const int dbch_clipping = 12;
+const int dbch_combo = 13;
+const int dbch_comboex = 14;
+const int dbch_comm = 15;
+const int dbch_commctrl = 16;
+const int dbch_commdlg = 17;
+const int dbch_console = 18;
+const int dbch_crtdll = 19;
+const int dbch_cursor = 20;
+const int dbch_datetime = 21;
+const int dbch_dc = 22;
+const int dbch_ddeml = 23;
+const int dbch_ddraw = 24;
+const int dbch_debug = 25;
+const int dbch_delayhlp = 26;
+const int dbch_dialog = 27;
+const int dbch_dinput = 28;
+const int dbch_dll = 29;
+const int dbch_dosfs = 30;
+const int dbch_dosmem = 31;
+const int dbch_dplay = 32;
+const int dbch_driver = 33;
+const int dbch_dsound = 34;
+const int dbch_edit = 35;
+const int dbch_elfdll = 36;
+const int dbch_enhmetafile = 37;
+const int dbch_event = 38;
+const int dbch_exec = 39;
+const int dbch_file = 40;
+const int dbch_fixup = 41;
+const int dbch_font = 42;
+const int dbch_gdi = 43;
+const int dbch_global = 44;
+const int dbch_graphics = 45;
+const int dbch_header = 46;
+const int dbch_heap = 47;
+const int dbch_hook = 48;
+const int dbch_hotkey = 49;
+const int dbch_icon = 50;
+const int dbch_imagehlp = 51;
+const int dbch_imagelist = 52;
+const int dbch_imm = 53;
+const int dbch_int = 54;
+const int dbch_int10 = 55;
+const int dbch_int16 = 56;
+const int dbch_int17 = 57;
+const int dbch_int19 = 58;
+const int dbch_int21 = 59;
+const int dbch_int31 = 60;
+const int dbch_io = 61;
+const int dbch_ipaddress = 62;
+const int dbch_key = 63;
+const int dbch_keyboard = 64;
+const int dbch_ldt = 65;
+const int dbch_listbox = 66;
+const int dbch_listview = 67;
+const int dbch_local = 68;
+const int dbch_mci = 69;
+const int dbch_mcianim = 70;
+const int dbch_mciavi = 71;
+const int dbch_mcimidi = 72;
+const int dbch_mciwave = 73;
+const int dbch_mdi = 74;
+const int dbch_menu = 75;
+const int dbch_message = 76;
+const int dbch_metafile = 77;
+const int dbch_midi = 78;
+const int dbch_mmaux = 79;
+const int dbch_mmio = 80;
+const int dbch_mmsys = 81;
+const int dbch_mmtime = 82;
+const int dbch_module = 83;
+const int dbch_monthcal = 84;
+const int dbch_mpr = 85;
+const int dbch_msacm = 86;
+const int dbch_msg = 87;
+const int dbch_msvideo = 88;
+const int dbch_nativefont = 89;
+const int dbch_nonclient = 90;
+const int dbch_ntdll = 91;
+const int dbch_ole = 92;
+const int dbch_pager = 93;
+const int dbch_palette = 94;
+const int dbch_pidl = 95;
+const int dbch_print = 96;
+const int dbch_process = 97;
+const int dbch_profile = 98;
+const int dbch_progress = 99;
+const int dbch_prop = 100;
+const int dbch_propsheet = 101;
+const int dbch_psapi = 102;
+const int dbch_psdrv = 103;
+const int dbch_ras = 104;
+const int dbch_rebar = 105;
+const int dbch_reg = 106;
+const int dbch_region = 107;
+const int dbch_relay = 108;
+const int dbch_resource = 109;
+const int dbch_scroll = 110;
+const int dbch_security = 111;
+const int dbch_segment = 112;
+const int dbch_seh = 113;
+const int dbch_selector = 114;
+const int dbch_sendmsg = 115;
+const int dbch_server = 116;
+const int dbch_shell = 117;
+const int dbch_snoop = 118;
+const int dbch_sound = 119;
+const int dbch_static = 120;
+const int dbch_statusbar = 121;
+const int dbch_storage = 122;
+const int dbch_stress = 123;
+const int dbch_string = 124;
+const int dbch_syscolor = 125;
+const int dbch_system = 126;
+const int dbch_tab = 127;
+const int dbch_tapi = 128;
+const int dbch_task = 129;
+const int dbch_text = 130;
+const int dbch_thread = 131;
+const int dbch_thunk = 132;
+const int dbch_timer = 133;
+const int dbch_toolbar = 134;
+const int dbch_toolhelp = 135;
+const int dbch_tooltips = 136;
+const int dbch_trackbar = 137;
+const int dbch_treeview = 138;
+const int dbch_ttydrv = 139;
+const int dbch_tweak = 140;
+const int dbch_typelib = 141;
+const int dbch_updown = 142;
+const int dbch_ver = 143;
+const int dbch_virtual = 144;
+const int dbch_vxd = 145;
+const int dbch_wave = 146;
+const int dbch_win = 147;
+const int dbch_win16drv = 148;
+const int dbch_win32 = 149;
+const int dbch_wing = 150;
+const int dbch_winsock = 151;
+const int dbch_winspool = 152;
+const int dbch_wnet = 153;
+const int dbch_x11 = 154;
+const int dbch_x11drv = 155;
 
-#define DEBUG_CHANNEL_COUNT 159
+#define DEBUG_CHANNEL_COUNT 156
 
 char __debug_msg_enabled[DEBUG_CHANNEL_COUNT][DEBUG_CLASS_COUNT] = {
 {1, 1, 0, 0},
@@ -326,9 +323,6 @@
 {1, 1, 0, 0},
 {1, 1, 0, 0},
 {1, 1, 0, 0},
-{1, 1, 0, 0},
-{1, 1, 0, 0},
-{1, 1, 0, 0},
 {1, 1, 0, 0}
 };
 
@@ -356,7 +350,6 @@
 "cursor",
 "datetime",
 "dc",
-"dde",
 "ddeml",
 "ddraw",
 "debug",
@@ -449,11 +442,9 @@
 "segment",
 "seh",
 "selector",
-"sem",
 "sendmsg",
 "server",
 "shell",
-"shm",
 "snoop",
 "sound",
 "static",
diff --git a/include/xmalloc.h b/include/xmalloc.h
index e909cb8..0e1c565 100644
--- a/include/xmalloc.h
+++ b/include/xmalloc.h
@@ -5,9 +5,9 @@
 extern "C" {
 #endif
 
-void *xmalloc( int size );
-void *xcalloc( int size );
-void *xrealloc( void *ptr, int size );
+void *xmalloc( size_t size );
+void *xcalloc( size_t size );
+void *xrealloc( void *ptr, size_t size );
 char *xstrdup( const char *str );
 
 #ifdef __cplusplus
diff --git a/misc/xmalloc.c b/misc/xmalloc.c
index e76ce51..10e69c9 100644
--- a/misc/xmalloc.c
+++ b/misc/xmalloc.c
@@ -18,7 +18,7 @@
 #include "xmalloc.h"
 #include "debugtools.h"
 
-void *xmalloc( int size )
+void *xmalloc( size_t size )
 {
     void *res;
 
@@ -32,7 +32,7 @@
     return res;
 }
 
-void *xcalloc( int size )
+void *xcalloc( size_t size )
 {
     void *res;
 
@@ -42,7 +42,7 @@
 }
 
 
-void *xrealloc( void *ptr, int size )
+void *xrealloc( void *ptr, size_t size )
 {
     void *res = realloc (ptr, size);
     if ((res == NULL) && size)
diff --git a/scheduler/debugger.c b/scheduler/debugger.c
index c777c59..c5b4c54 100644
--- a/scheduler/debugger.c
+++ b/scheduler/debugger.c
@@ -4,6 +4,8 @@
  * Copyright (C) 1999 Alexandre Julliard
  */
 
+#include <string.h>
+
 #include "process.h"
 #include "thread.h"
 #include "server.h"
diff --git a/server/debugger.c b/server/debugger.c
index 404206e..ef8e99d 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -5,6 +5,8 @@
  */
 
 #include <assert.h>
+#include <string.h>
+
 #include "winbase.h"
 #include "winerror.h"
 
diff --git a/tools/make_debug b/tools/make_debug
index 15db5b4..a7d8bb9 100755
--- a/tools/make_debug
+++ b/tools/make_debug
@@ -30,7 +30,7 @@
 chno=0
 for ch in $DEBUG_CHANNELS
 do
-    echo "int dbch_$ch = $chno;"
+    echo "const int dbch_$ch = $chno;"
     chno=`expr $chno + 1`
 done
 echo
diff --git a/win32/console.c b/win32/console.c
index 0a2e9ef..e2f7ea0 100644
--- a/win32/console.c
+++ b/win32/console.c
@@ -53,8 +53,8 @@
 
 /* FIXME:  Should be in an internal header file.  OK, so which one?
    Used by CONSOLE_makecomplex. */
-FILE *wine_openpty(int *master, int *slave, char *name,
-                   struct termios *term, struct winsize *winsize);
+int wine_openpty(int *master, int *slave, char *name,
+                 struct termios *term, struct winsize *winsize);
 
 /****************************************************************************
  *		CONSOLE_GetPid