From 2c684081c14303eb854cf04dde3367c104efed6e Mon Sep 17 00:00:00 2001 From: Patrik Stridvall Date: Sat, 31 Jul 1999 17:36:48 +0000 Subject: [PATCH] Fixed some of the issues reported by Solaris Lint. --- console/generic.c | 12 +- console/xterm.c | 10 +- graphics/enhmetafiledrv/graphics.c | 2 + graphics/enhmetafiledrv/objects.c | 2 + graphics/metafiledrv/bitblt.c | 2 + graphics/metafiledrv/graphics.c | 2 + graphics/metafiledrv/objects.c | 2 + graphics/metafiledrv/text.c | 2 + include/debugdefs.h | 323 ++++++++++++++--------------- include/xmalloc.h | 6 +- misc/xmalloc.c | 6 +- scheduler/debugger.c | 2 + server/debugger.c | 2 + tools/make_debug | 2 +- win32/console.c | 4 +- 15 files changed, 193 insertions(+), 186 deletions(-) diff --git a/console/generic.c b/console/generic.c index d45813af2b2..eeedc08b31f 100644 --- a/console/generic.c +++ b/console/generic.c @@ -69,8 +69,8 @@ void GENERIC_ScrollUpWindow(char row1, char col1, char row2, char col2, { /* 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 @@ void GENERIC_ScrollDownWindow(char row1, char col1, char row2, char col2, { /* 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 @@ static void GENERIC_ClearLine(char row, char col1, char col2, int bgcolor, 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 @@ static void GENERIC_MoveLine(char row1, char row2, char col1, char col2) 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 8c2e7bc8fbf..35ba5eb54a0 100644 --- a/console/xterm.c +++ b/console/xterm.c @@ -25,9 +25,9 @@ DEFAULT_DEBUG_CHANNEL(console) 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 @@ FILE *wine_openpty(int *master, int *slave, char *name, 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 @@ void XTERM_ResizeScreen(int x, int y) } -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 f11d9e4584c..242b01fccee 100644 --- a/graphics/enhmetafiledrv/graphics.c +++ b/graphics/enhmetafiledrv/graphics.c @@ -5,6 +5,8 @@ */ #include +#include + #include "gdi.h" #include "dc.h" #include "enhmetafiledrv.h" diff --git a/graphics/enhmetafiledrv/objects.c b/graphics/enhmetafiledrv/objects.c index b25715ddde0..ef90372e5d0 100644 --- a/graphics/enhmetafiledrv/objects.c +++ b/graphics/enhmetafiledrv/objects.c @@ -6,6 +6,8 @@ #include #include +#include + #include "bitmap.h" #include "brush.h" #include "font.h" diff --git a/graphics/metafiledrv/bitblt.c b/graphics/metafiledrv/bitblt.c index af3e9d6a63d..a8ee0f6c5b8 100644 --- a/graphics/metafiledrv/bitblt.c +++ b/graphics/metafiledrv/bitblt.c @@ -4,6 +4,8 @@ * Copyright 1993, 1994 Alexandre Julliard */ +#include + #include "gdi.h" #include "metafiledrv.h" #include "heap.h" diff --git a/graphics/metafiledrv/graphics.c b/graphics/metafiledrv/graphics.c index 4c579d6f019..3c29fb81848 100644 --- a/graphics/metafiledrv/graphics.c +++ b/graphics/metafiledrv/graphics.c @@ -5,6 +5,8 @@ */ #include +#include + #include "gdi.h" #include "dc.h" #include "region.h" diff --git a/graphics/metafiledrv/objects.c b/graphics/metafiledrv/objects.c index b8988718098..389996e5f9f 100644 --- a/graphics/metafiledrv/objects.c +++ b/graphics/metafiledrv/objects.c @@ -6,6 +6,8 @@ #include #include +#include + #include "bitmap.h" #include "brush.h" #include "font.h" diff --git a/graphics/metafiledrv/text.c b/graphics/metafiledrv/text.c index c7446164c7e..9390336981b 100644 --- a/graphics/metafiledrv/text.c +++ b/graphics/metafiledrv/text.c @@ -5,6 +5,8 @@ * */ +#include + #include "windef.h" #include "metafiledrv.h" #include "debugtools.h" diff --git a/include/debugdefs.h b/include/debugdefs.h index 859302be3d2..419842c5181 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 @@ char __debug_msg_enabled[DEBUG_CHANNEL_COUNT][DEBUG_CLASS_COUNT] = { {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 @@ const char * const debug_ch_name[DEBUG_CHANNEL_COUNT] = { "cursor", "datetime", "dc", -"dde", "ddeml", "ddraw", "debug", @@ -449,11 +442,9 @@ const char * const debug_ch_name[DEBUG_CHANNEL_COUNT] = { "segment", "seh", "selector", -"sem", "sendmsg", "server", "shell", -"shm", "snoop", "sound", "static", diff --git a/include/xmalloc.h b/include/xmalloc.h index e909cb80b90..0e1c5658bf6 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 e76ce516528..10e69c9fcfa 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 @@ void *xmalloc( int size ) return res; } -void *xcalloc( int size ) +void *xcalloc( size_t size ) { void *res; @@ -42,7 +42,7 @@ void *xcalloc( int size ) } -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 c777c5978c0..c5b4c5421d5 100644 --- a/scheduler/debugger.c +++ b/scheduler/debugger.c @@ -4,6 +4,8 @@ * Copyright (C) 1999 Alexandre Julliard */ +#include + #include "process.h" #include "thread.h" #include "server.h" diff --git a/server/debugger.c b/server/debugger.c index 404206e8a23..ef8e99d98f9 100644 --- a/server/debugger.c +++ b/server/debugger.c @@ -5,6 +5,8 @@ */ #include +#include + #include "winbase.h" #include "winerror.h" diff --git a/tools/make_debug b/tools/make_debug index 15db5b46a6d..a7d8bb95ac9 100755 --- a/tools/make_debug +++ b/tools/make_debug @@ -30,7 +30,7 @@ EOF 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 0a2e9ef47fd..e2f7ea08290 100644 --- a/win32/console.c +++ b/win32/console.c @@ -53,8 +53,8 @@ DEFAULT_DEBUG_CHANNEL(console) /* 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