Commit abe635cf authored by Joerg Mayer's avatar Joerg Mayer Committed by Alexandre Julliard

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

comparisons and incomplete initializations.
parent c4b8b266
......@@ -146,7 +146,7 @@ static void GENERIC_ClearLine(char row, char col1, char col2, int bgcolor,
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++)
{
......
......@@ -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)
{
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);
return TRUE;
......
......@@ -78,7 +78,7 @@ static struct master_socket *master_socket; /* the master socket object */
/* socket communication static structures */
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
struct cmsg_fd
{
......@@ -388,6 +388,12 @@ void open_master_socket(void)
fatal_error( "out of memory\n" );
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 */
switch(fork())
{
......
......@@ -102,7 +102,7 @@ void parse_options(int argc, char **argv)
int insert_hex (char * infile, FILE * outfile)
{
int i;
unsigned int i;
int fd;
struct stat st;
......
......@@ -87,7 +87,7 @@ static char *xstrdup( const char *str )
static int is_generated( const char *name )
{
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++)
{
if (len <= strlen(extensions[i])) continue;
......
......@@ -183,7 +183,7 @@ static void ParseVariable( ORDDEF *odp )
static void ParseExportFunction( ORDDEF *odp )
{
char *token;
int i;
unsigned int i;
switch(SpecType)
{
......
......@@ -244,7 +244,8 @@ int output_res16_data( FILE *outfile )
/* output the resource definitions */
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 resource *res;
unsigned char *start = buffer;
......
......@@ -265,6 +265,7 @@ static void output_string( FILE *outfile, const WCHAR *name )
int output_resources( FILE *outfile )
{
int i, j, k;
unsigned int n;
const struct res_type *type;
const struct res_name *name;
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_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",
i, j, name->nb_languages );
i, n, name->nb_languages );
}
}
......@@ -331,11 +332,11 @@ int output_resources( FILE *outfile )
if (type->type->str)
fprintf( outfile, " unsigned short type_%d_name[%d];\n",
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)
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",
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)
fprintf( outfile, " { 0x%04x, OFFSETOF(lang_%d_%d_dir) | 0x80000000 },\n",
name->name->id, i, j );
name->name->id, i, n );
else
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" );
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",
name->nb_languages, i, j );
name->nb_languages, i, n );
for (k = 0, res = name->res; k < name->nb_languages; k++, res++)
{
fprintf( outfile, " { 0x%04x, OFFSETOF(data_entries[%d]) },\n",
......@@ -401,7 +402,7 @@ int output_resources( FILE *outfile )
fprintf( outfile, " },\n { " );
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)
{
......
......@@ -108,7 +108,7 @@ static int output_debug( FILE *outfile )
*
* 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;
......@@ -454,7 +454,7 @@ void BuildSpec32File( FILE *outfile, int output_main )
/* 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 */
......
......@@ -111,7 +111,7 @@ static const language_t languages[] = {
void show_languages(void)
{
int i;
unsigned int i;
printf(" Code | DOS-cp | WIN-cp | Language | Country\n");
printf("-------+--------+--------+--------------+---------\n");
for(i = 0; i < NLAN; i++)
......
......@@ -216,7 +216,7 @@ static void dump_lvc(lvc_t *l)
*/
static void dump_raw_data(raw_data_t *d)
{
int n;
unsigned int n;
int i;
int j;
......
......@@ -987,7 +987,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
}
#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 + len <= src->size);
......
......@@ -63,7 +63,7 @@ ver_words_t *new_ver_words(int i);
ver_words_t *add_ver_words(ver_words_t *w, int i);
messagetable_t *new_messagetable(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);
stringtable_t *new_stringtable(lvc_t *lvc);
toolbar_t *new_toolbar(int button_width, int button_Height, toolbar_item_t *items, int nitems);
......
......@@ -2717,7 +2717,7 @@ static resource_t *build_fontdir(resource_t **fnt, int nfnt)
static int once = 0;
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++;
}
return NULL;
......
......@@ -65,7 +65,7 @@ struct resheader32 {
*/
int read_data(FILE *fp, size_t size, void *buf)
{
int r;
unsigned int r;
int pos = ftell(fp);
r = fread(buf, 1, size, fp);
if(r == size)
......
......@@ -377,7 +377,7 @@ static const struct lang2cp lang2cps[] =
void set_language( unsigned short lang, unsigned short sublang )
{
int i;
unsigned int i;
unsigned int cp = 0, defcp = 0;
for (i = 0; i < sizeof(lang2cps)/sizeof(lang2cps[0]); i++)
......
......@@ -175,9 +175,9 @@ enum res_e {
/* Raw bytes in a row... */
typedef struct raw_data {
int size;
char *data;
lvc_t lvc; /* Localized data */
unsigned int size;
char *data;
lvc_t lvc; /* Localized data */
} raw_data_t;
/* Dialog structures */
......
......@@ -511,14 +511,14 @@ static void count_resources(resource_t *top)
/*
*****************************************************************************
* Function : write_pe_segment
* Syntax : void write_pe_segment(FILE *fp, resource_t *top)
* Syntax : void write_pe_segment(FILE *fp)
* Input :
* Output :
* Description :
* Remarks :
*****************************************************************************
*/
static void write_pe_segment(FILE *fp, resource_t *top)
static void write_pe_segment(FILE *fp)
{
int i;
......@@ -711,14 +711,14 @@ static void write_pe_segment(FILE *fp, resource_t *top)
/*
*****************************************************************************
* Function : write_ne_segment
* Syntax : void write_ne_segment(FILE *fp, resource_t *top)
* Syntax : void write_ne_segment(FILE *fp)
* Input :
* Output :
* Description :
* Remarks :
*****************************************************************************
*/
static void write_ne_segment(FILE *fp, resource_t *top)
static void write_ne_segment(FILE *fp)
{
int i, j;
......@@ -790,14 +790,14 @@ static void write_ne_segment(FILE *fp, resource_t *top)
/*
*****************************************************************************
* Function : write_rsc_names
* Syntax : void write_rsc_names(FILE *fp, resource_t *top)
* Syntax : void write_rsc_names(FILE *fp)
* Input :
* Output :
* Description :
* Remarks :
*****************************************************************************
*/
static void write_rsc_names(FILE *fp, resource_t *top)
static void write_rsc_names(FILE *fp)
{
int i, j;
......@@ -909,13 +909,13 @@ void write_s_file(char *outname, resource_t *top)
if(create_dir)
{
if(win32)
write_pe_segment(fo, top);
write_pe_segment(fo);
else
write_ne_segment(fo, top);
write_ne_segment(fo);
}
/* Dump the names */
write_rsc_names(fo, top);
write_rsc_names(fo);
if(create_dir)
fprintf(fo, ".LResTabEnd:\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment