Get rid of some warnings about unused variables, signed/unsigned

comparisons and incomplete initializations.
oldstable
Joerg Mayer 2000-11-11 00:38:37 +00:00 committed by Alexandre Julliard
parent c4b8b266a9
commit abe635cfd7
18 changed files with 51 additions and 39 deletions

View File

@ -146,7 +146,7 @@ static void GENERIC_ClearLine(char row, char col1, char col2, int bgcolor,
char x; char x;
TRACE("Clear Line: %d from %d to %d.\n", row, col1, col2); TRACE("Clear Line: %d from %d to %d (unused: bgcolor %d, attrib %d).\n", row, col1, col2, bgcolor, attribute);
for (x = col1; x <= col2; x++) for (x = col1; x <= col2; x++)
{ {

View File

@ -541,7 +541,11 @@ static UINT BUTTON_CalcLabelRect(WND *wndPtr, HDC hdc, RECT *rc)
*/ */
static BOOL CALLBACK BUTTON_DrawTextCallback(HDC hdc, LPARAM lp, WPARAM wp, int cx, int cy) static BOOL CALLBACK BUTTON_DrawTextCallback(HDC hdc, LPARAM lp, WPARAM wp, int cx, int cy)
{ {
RECT rc = {0, 0, cx, cy}; RECT rc;
rc.left = 0;
rc.top = 0;
rc.right = cx;
rc.bottom = cy;
DrawTextW(hdc, (LPCWSTR)lp, -1, &rc, (UINT)wp); DrawTextW(hdc, (LPCWSTR)lp, -1, &rc, (UINT)wp);
return TRUE; return TRUE;

View File

@ -78,7 +78,7 @@ static struct master_socket *master_socket; /* the master socket object */
/* socket communication static structures */ /* socket communication static structures */
static struct iovec myiovec; static struct iovec myiovec;
static struct msghdr msghdr = { NULL, 0, &myiovec, 1, /* remaining fields depend on system */ }; static struct msghdr msghdr;
#ifndef HAVE_MSGHDR_ACCRIGHTS #ifndef HAVE_MSGHDR_ACCRIGHTS
struct cmsg_fd struct cmsg_fd
{ {
@ -388,6 +388,12 @@ void open_master_socket(void)
fatal_error( "out of memory\n" ); fatal_error( "out of memory\n" );
set_select_events( &master_socket->obj, POLLIN ); set_select_events( &master_socket->obj, POLLIN );
/* setup msghdr structure constant fields */
msghdr.msg_name = NULL;
msghdr.msg_namelen = 0;
msghdr.msg_iov = &myiovec;
msghdr.msg_iovlen = 1;
/* go in the background */ /* go in the background */
switch(fork()) switch(fork())
{ {

View File

@ -102,7 +102,7 @@ void parse_options(int argc, char **argv)
int insert_hex (char * infile, FILE * outfile) int insert_hex (char * infile, FILE * outfile)
{ {
int i; unsigned int i;
int fd; int fd;
struct stat st; struct stat st;

View File

@ -87,7 +87,7 @@ static char *xstrdup( const char *str )
static int is_generated( const char *name ) static int is_generated( const char *name )
{ {
static const char * const extensions[] = { ".tab.h", ".mc.rc" }; static const char * const extensions[] = { ".tab.h", ".mc.rc" };
int i, len = strlen(name); size_t i, len = strlen(name);
for (i = 0; i < sizeof(extensions)/sizeof(extensions[0]); i++) for (i = 0; i < sizeof(extensions)/sizeof(extensions[0]); i++)
{ {
if (len <= strlen(extensions[i])) continue; if (len <= strlen(extensions[i])) continue;

View File

@ -183,7 +183,7 @@ static void ParseVariable( ORDDEF *odp )
static void ParseExportFunction( ORDDEF *odp ) static void ParseExportFunction( ORDDEF *odp )
{ {
char *token; char *token;
int i; unsigned int i;
switch(SpecType) switch(SpecType)
{ {

View File

@ -244,7 +244,8 @@ int output_res16_data( FILE *outfile )
/* output the resource definitions */ /* output the resource definitions */
int output_res16_directory( unsigned char *buffer ) int output_res16_directory( unsigned char *buffer )
{ {
int i, j, offset, res_offset = 0; int i, offset, res_offset = 0;
unsigned int j;
const struct res_type *type; const struct res_type *type;
const struct resource *res; const struct resource *res;
unsigned char *start = buffer; unsigned char *start = buffer;

View File

@ -265,6 +265,7 @@ static void output_string( FILE *outfile, const WCHAR *name )
int output_resources( FILE *outfile ) int output_resources( FILE *outfile )
{ {
int i, j, k; int i, j, k;
unsigned int n;
const struct res_type *type; const struct res_type *type;
const struct res_name *name; const struct res_name *name;
const struct resource *res; const struct resource *res;
@ -316,11 +317,11 @@ int output_resources( FILE *outfile )
{ {
fprintf( outfile, " struct res_dir name_%d_dir;\n", i ); fprintf( outfile, " struct res_dir name_%d_dir;\n", i );
fprintf( outfile, " struct res_dir_entry name_%d_entries[%d];\n", i, type->nb_names ); fprintf( outfile, " struct res_dir_entry name_%d_entries[%d];\n", i, type->nb_names );
for (j = 0, name = type->names; j < type->nb_names; j++, name++) for (n = 0, name = type->names; n < type->nb_names; n++, name++)
{ {
fprintf( outfile, " struct res_dir lang_%d_%d_dir;\n", i, j ); fprintf( outfile, " struct res_dir lang_%d_%d_dir;\n", i, n );
fprintf( outfile, " struct res_dir_entry lang_%d_%d_entries[%d];\n", fprintf( outfile, " struct res_dir_entry lang_%d_%d_entries[%d];\n",
i, j, name->nb_languages ); i, n, name->nb_languages );
} }
} }
@ -331,11 +332,11 @@ int output_resources( FILE *outfile )
if (type->type->str) if (type->type->str)
fprintf( outfile, " unsigned short type_%d_name[%d];\n", fprintf( outfile, " unsigned short type_%d_name[%d];\n",
i, strlenW(type->type->str)+1 ); i, strlenW(type->type->str)+1 );
for (j = 0, name = type->names; j < type->nb_names; j++, name++) for (n = 0, name = type->names; n < type->nb_names; n++, name++)
{ {
if (name->name->str) if (name->name->str)
fprintf( outfile, " unsigned short name_%d_%d_name[%d];\n", fprintf( outfile, " unsigned short name_%d_%d_name[%d];\n",
i, j, strlenW(name->name->str)+1 ); i, n, strlenW(name->name->str)+1 );
} }
} }
@ -362,21 +363,21 @@ int output_resources( FILE *outfile )
{ {
fprintf( outfile, " { 0, 0, 0, 0, %d, %d }, /* name_%d_dir */\n {\n", fprintf( outfile, " { 0, 0, 0, 0, %d, %d }, /* name_%d_dir */\n {\n",
type->nb_names - type->nb_id_names, type->nb_id_names, i ); type->nb_names - type->nb_id_names, type->nb_id_names, i );
for (j = 0, name = type->names; j < type->nb_names; j++, name++) for (n = 0, name = type->names; n < type->nb_names; n++, name++)
{ {
if (!name->name->str) if (!name->name->str)
fprintf( outfile, " { 0x%04x, OFFSETOF(lang_%d_%d_dir) | 0x80000000 },\n", fprintf( outfile, " { 0x%04x, OFFSETOF(lang_%d_%d_dir) | 0x80000000 },\n",
name->name->id, i, j ); name->name->id, i, n );
else else
fprintf( outfile, " { OFFSETOF(name_%d_%d_name) | 0x80000000, OFFSETOF(lang_%d_%d_dir) | 0x80000000 },\n", fprintf( outfile, " { OFFSETOF(name_%d_%d_name) | 0x80000000, OFFSETOF(lang_%d_%d_dir) | 0x80000000 },\n",
i, j, i, j ); i, n, i, n );
} }
fprintf( outfile, " },\n" ); fprintf( outfile, " },\n" );
for (j = 0, name = type->names; j < type->nb_names; j++, name++) for (n = 0, name = type->names; n < type->nb_names; n++, name++)
{ {
fprintf( outfile, " { 0, 0, 0, 0, 0, %d }, /* lang_%d_%d_dir */\n {\n", fprintf( outfile, " { 0, 0, 0, 0, 0, %d }, /* lang_%d_%d_dir */\n {\n",
name->nb_languages, i, j ); name->nb_languages, i, n );
for (k = 0, res = name->res; k < name->nb_languages; k++, res++) for (k = 0, res = name->res; k < name->nb_languages; k++, res++)
{ {
fprintf( outfile, " { 0x%04x, OFFSETOF(data_entries[%d]) },\n", fprintf( outfile, " { 0x%04x, OFFSETOF(data_entries[%d]) },\n",
@ -401,7 +402,7 @@ int output_resources( FILE *outfile )
fprintf( outfile, " },\n { " ); fprintf( outfile, " },\n { " );
output_string( outfile, type->type->str ); output_string( outfile, type->type->str );
} }
for (j = 0, name = type->names; j < type->nb_names; j++, name++) for (n = 0, name = type->names; n < type->nb_names; n++, name++)
{ {
if (name->name->str) if (name->name->str)
{ {

View File

@ -108,7 +108,7 @@ static int output_debug( FILE *outfile )
* *
* Output the export table for a Win32 module. * Output the export table for a Win32 module.
*/ */
static void output_exports( FILE *outfile, int nr_exports, int nr_names, int fwd_size ) static void output_exports( FILE *outfile, int nr_exports, int fwd_size )
{ {
int i, fwd_pos = 0; int i, fwd_pos = 0;
@ -454,7 +454,7 @@ void BuildSpec32File( FILE *outfile, int output_main )
/* Output the exports and relay entry points */ /* Output the exports and relay entry points */
output_exports( outfile, nr_exports, nb_names, fwd_size ); output_exports( outfile, nr_exports, fwd_size );
/* Output the DLL imports */ /* Output the DLL imports */

View File

@ -111,7 +111,7 @@ static const language_t languages[] = {
void show_languages(void) void show_languages(void)
{ {
int i; unsigned int i;
printf(" Code | DOS-cp | WIN-cp | Language | Country\n"); printf(" Code | DOS-cp | WIN-cp | Language | Country\n");
printf("-------+--------+--------+--------------+---------\n"); printf("-------+--------+--------+--------------+---------\n");
for(i = 0; i < NLAN; i++) for(i = 0; i < NLAN; i++)

View File

@ -216,7 +216,7 @@ static void dump_lvc(lvc_t *l)
*/ */
static void dump_raw_data(raw_data_t *d) static void dump_raw_data(raw_data_t *d)
{ {
int n; unsigned int n;
int i; int i;
int j; int j;

View File

@ -987,7 +987,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
} }
#undef MSGTAB_BAD_PTR #undef MSGTAB_BAD_PTR
void copy_raw_data(raw_data_t *dst, raw_data_t *src, int offs, int len) void copy_raw_data(raw_data_t *dst, raw_data_t *src, unsigned int offs, int len)
{ {
assert(offs <= src->size); assert(offs <= src->size);
assert(offs + len <= src->size); assert(offs + len <= src->size);

View File

@ -63,7 +63,7 @@ ver_words_t *new_ver_words(int i);
ver_words_t *add_ver_words(ver_words_t *w, int i); ver_words_t *add_ver_words(ver_words_t *w, int i);
messagetable_t *new_messagetable(raw_data_t *rd, int *memopt); messagetable_t *new_messagetable(raw_data_t *rd, int *memopt);
dlginit_t *new_dlginit(raw_data_t *rd, int *memopt); dlginit_t *new_dlginit(raw_data_t *rd, int *memopt);
void copy_raw_data(raw_data_t *dst, raw_data_t *src, int offs, int len); void copy_raw_data(raw_data_t *dst, raw_data_t *src, unsigned int offs, int len);
int *new_int(int i); int *new_int(int i);
stringtable_t *new_stringtable(lvc_t *lvc); stringtable_t *new_stringtable(lvc_t *lvc);
toolbar_t *new_toolbar(int button_width, int button_Height, toolbar_item_t *items, int nitems); toolbar_t *new_toolbar(int button_width, int button_Height, toolbar_item_t *items, int nitems);

View File

@ -2717,7 +2717,7 @@ static resource_t *build_fontdir(resource_t **fnt, int nfnt)
static int once = 0; static int once = 0;
if(!once) if(!once)
{ {
warning("Need to parse fonts, not yet implemented"); warning("Need to parse fonts, not yet implemented (fnt: %p, nfnt: %d)", fnt, nfnt);
once++; once++;
} }
return NULL; return NULL;

View File

@ -65,7 +65,7 @@ struct resheader32 {
*/ */
int read_data(FILE *fp, size_t size, void *buf) int read_data(FILE *fp, size_t size, void *buf)
{ {
int r; unsigned int r;
int pos = ftell(fp); int pos = ftell(fp);
r = fread(buf, 1, size, fp); r = fread(buf, 1, size, fp);
if(r == size) if(r == size)

View File

@ -377,7 +377,7 @@ static const struct lang2cp lang2cps[] =
void set_language( unsigned short lang, unsigned short sublang ) void set_language( unsigned short lang, unsigned short sublang )
{ {
int i; unsigned int i;
unsigned int cp = 0, defcp = 0; unsigned int cp = 0, defcp = 0;
for (i = 0; i < sizeof(lang2cps)/sizeof(lang2cps[0]); i++) for (i = 0; i < sizeof(lang2cps)/sizeof(lang2cps[0]); i++)

View File

@ -175,9 +175,9 @@ enum res_e {
/* Raw bytes in a row... */ /* Raw bytes in a row... */
typedef struct raw_data { typedef struct raw_data {
int size; unsigned int size;
char *data; char *data;
lvc_t lvc; /* Localized data */ lvc_t lvc; /* Localized data */
} raw_data_t; } raw_data_t;
/* Dialog structures */ /* Dialog structures */

View File

@ -511,14 +511,14 @@ static void count_resources(resource_t *top)
/* /*
***************************************************************************** *****************************************************************************
* Function : write_pe_segment * Function : write_pe_segment
* Syntax : void write_pe_segment(FILE *fp, resource_t *top) * Syntax : void write_pe_segment(FILE *fp)
* Input : * Input :
* Output : * Output :
* Description : * Description :
* Remarks : * Remarks :
***************************************************************************** *****************************************************************************
*/ */
static void write_pe_segment(FILE *fp, resource_t *top) static void write_pe_segment(FILE *fp)
{ {
int i; int i;
@ -711,14 +711,14 @@ static void write_pe_segment(FILE *fp, resource_t *top)
/* /*
***************************************************************************** *****************************************************************************
* Function : write_ne_segment * Function : write_ne_segment
* Syntax : void write_ne_segment(FILE *fp, resource_t *top) * Syntax : void write_ne_segment(FILE *fp)
* Input : * Input :
* Output : * Output :
* Description : * Description :
* Remarks : * Remarks :
***************************************************************************** *****************************************************************************
*/ */
static void write_ne_segment(FILE *fp, resource_t *top) static void write_ne_segment(FILE *fp)
{ {
int i, j; int i, j;
@ -790,14 +790,14 @@ static void write_ne_segment(FILE *fp, resource_t *top)
/* /*
***************************************************************************** *****************************************************************************
* Function : write_rsc_names * Function : write_rsc_names
* Syntax : void write_rsc_names(FILE *fp, resource_t *top) * Syntax : void write_rsc_names(FILE *fp)
* Input : * Input :
* Output : * Output :
* Description : * Description :
* Remarks : * Remarks :
***************************************************************************** *****************************************************************************
*/ */
static void write_rsc_names(FILE *fp, resource_t *top) static void write_rsc_names(FILE *fp)
{ {
int i, j; int i, j;
@ -909,13 +909,13 @@ void write_s_file(char *outname, resource_t *top)
if(create_dir) if(create_dir)
{ {
if(win32) if(win32)
write_pe_segment(fo, top); write_pe_segment(fo);
else else
write_ne_segment(fo, top); write_ne_segment(fo);
} }
/* Dump the names */ /* Dump the names */
write_rsc_names(fo, top); write_rsc_names(fo);
if(create_dir) if(create_dir)
fprintf(fo, ".LResTabEnd:\n"); fprintf(fo, ".LResTabEnd:\n");