Hello,
I'm trying to get rid of some of the signed/unsigned comparison and
unused initializer warnings that you get when compiling with -Wall -W.
So I thought that tools/ would be a good start - oh well... please
have a look at the attached results of this attempt and let me know
whether you think that what I did is correct (aka doesn't add errors)
and where you think I should have done things differently.
The following things were left unresolved for now:
- tools/spec32.c: 110 unused 'nr_names': It looks like some of the
nb_names should be nr_names, but I don't know which.
- tools/wrc/readres.c: 374ff the alignment calculation looks a bit
weird to me (in case ressize & 3 == 0)
Any hints / improvements for the points above?
Ciao
Joerg
PS: Earlier this evening there were 3260 warnings (2357 unused params,
864 signed/unsigned comparison, 39 others). I'm trying to take up
the task to reduce that number and reveal some bug in doing so :-)
So if you don't agree with what I'm doing and how I'm doing it:
Now is the best time to let me know.
--
Joerg Mayer <[EMAIL PROTECTED]>
I found out that "pro" means "instead of" (as in proconsul). Now I know
what proactive means.
Changelog: <[EMAIL PROTECTED]>
First try to get rid of all warnings in the tools/ subtree.
Index: wine/configure.in
===================================================================
RCS file: /home/wine/wine/configure.in,v
retrieving revision 1.155
diff -u -r1.155 configure.in
--- wine/configure.in 2000/10/23 21:32:05 1.155
+++ wine/configure.in 2000/11/05 23:47:10
@@ -435,7 +435,7 @@
if test "x${GCC}" = "xyes"
then
- CFLAGS="$CFLAGS -Wall"
+ CFLAGS="$CFLAGS -Wall -W"
AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
AC_TRY_RUN([
int main(void) {
Index: wine/tools/bin2res.c
===================================================================
RCS file: /home/wine/wine/tools/bin2res.c,v
retrieving revision 1.6
diff -u -r1.6 bin2res.c
--- wine/tools/bin2res.c 2000/02/26 13:17:59 1.6
+++ wine/tools/bin2res.c 2000/11/05 23:47:14
@@ -102,7 +102,7 @@
int insert_hex (char * infile, FILE * outfile)
{
- int i;
+ unsigned int n;
int fd;
struct stat st;
@@ -119,12 +119,12 @@
}
fprintf (outfile, "{\n '");
- i = 0;
+ n = 0;
while (1)
{
- fprintf(outfile, "%02X", p_in_file[i]);
- if (++i >= st.st_size) break;
- fprintf(outfile, "%s", (i == (i & 0xfffffff0)) ? "'\n '" :" ");
+ fprintf(outfile, "%02X", p_in_file[n]);
+ if ((int)++n >= st.st_size) break;
+ fprintf(outfile, "%s", (n == (n & 0xfffffff0)) ? "'\n '" :" ");
}
fprintf (outfile, "'\n}");
munmap(p_in_file, st.st_size);
Index: wine/tools/fnt2bdf.c
===================================================================
RCS file: /home/wine/wine/tools/fnt2bdf.c,v
retrieving revision 1.9
diff -u -r1.9 fnt2bdf.c
--- wine/tools/fnt2bdf.c 2000/07/25 12:25:41 1.9
+++ wine/tools/fnt2bdf.c 2000/11/05 23:47:14
@@ -493,7 +493,7 @@
size -= s;
offset = s + return_data_value(dfShort, &mz_header.e_lfanew);
- if( size <= sizeof(NE_TYPEINFO) ) return FILE_ERROR;
+ if( size <= (int)sizeof(NE_TYPEINFO) ) return FILE_ERROR;
retval = FILE_DLL;
}
else if( s == 0x300 || s == 0x200 ) /* maybe .fnt ? */
@@ -575,7 +575,7 @@
}
lseek( fd, offset, SEEK_SET );
- if( read(fd, lpfont, length) != length )
+ if( read(fd, lpfont, length) != (int)length )
{
fprintf(stderr, errorDLLRead );
exit(1);
Index: wine/tools/winebuild/main.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/main.c,v
retrieving revision 1.9
diff -u -r1.9 main.c
--- wine/tools/winebuild/main.c 2000/11/05 04:49:13 1.9
+++ wine/tools/winebuild/main.c 2000/11/05 23:47:15
@@ -147,12 +147,12 @@
/* parse options from the argv array and remove all the recognized ones */
-static void parse_options( char *argv[] )
+static void parse_options( int argc, char *argv[] )
{
const struct option *opt;
int i;
- for (i = 1; argv[i]; i++)
+ for (i = 1; i < argc; i++)
{
for (opt = option_table; opt->name; opt++)
if (!strcmp( argv[i], opt->name )) break;
@@ -175,7 +175,7 @@
int main(int argc, char **argv)
{
output_file = stdout;
- parse_options( argv );
+ parse_options( argc, argv );
switch(exec_mode)
{
Index: wine/tools/winebuild/parser.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/parser.c,v
retrieving revision 1.7
diff -u -r1.7 parser.c
--- wine/tools/winebuild/parser.c 2000/11/05 04:49:13 1.7
+++ wine/tools/winebuild/parser.c 2000/11/05 23:47:15
@@ -183,7 +183,7 @@
static void ParseExportFunction( ORDDEF *odp )
{
char *token;
- int i;
+ unsigned int n;
switch(SpecType)
{
@@ -204,30 +204,30 @@
token = GetToken();
if (*token != '(') fatal_error( "Expected '(' got '%s'\n", token );
- for (i = 0; i < sizeof(odp->u.func.arg_types); i++)
+ for (n = 0; n < sizeof(odp->u.func.arg_types); n++)
{
token = GetToken();
if (*token == ')')
break;
if (!strcmp(token, "word"))
- odp->u.func.arg_types[i] = 'w';
+ odp->u.func.arg_types[n] = 'w';
else if (!strcmp(token, "s_word"))
- odp->u.func.arg_types[i] = 's';
+ odp->u.func.arg_types[n] = 's';
else if (!strcmp(token, "long") || !strcmp(token, "segptr"))
- odp->u.func.arg_types[i] = 'l';
+ odp->u.func.arg_types[n] = 'l';
else if (!strcmp(token, "ptr"))
- odp->u.func.arg_types[i] = 'p';
+ odp->u.func.arg_types[n] = 'p';
else if (!strcmp(token, "str"))
- odp->u.func.arg_types[i] = 't';
+ odp->u.func.arg_types[n] = 't';
else if (!strcmp(token, "wstr"))
- odp->u.func.arg_types[i] = 'W';
+ odp->u.func.arg_types[n] = 'W';
else if (!strcmp(token, "segstr"))
- odp->u.func.arg_types[i] = 'T';
+ odp->u.func.arg_types[n] = 'T';
else if (!strcmp(token, "double"))
{
- odp->u.func.arg_types[i++] = 'l';
- if (i < sizeof(odp->u.func.arg_types)) odp->u.func.arg_types[i] = 'l';
+ odp->u.func.arg_types[n++] = 'l';
+ if (n < sizeof(odp->u.func.arg_types)) odp->u.func.arg_types[n] = 'l';
}
else fatal_error( "Unknown variable type '%s'\n", token );
@@ -243,11 +243,11 @@
}
}
}
- if ((*token != ')') || (i >= sizeof(odp->u.func.arg_types)))
+ if ((*token != ')') || (n >= sizeof(odp->u.func.arg_types)))
fatal_error( "Too many arguments\n" );
- odp->u.func.arg_types[i] = '\0';
- if ((odp->type == TYPE_STDCALL) && !i)
+ odp->u.func.arg_types[n] = '\0';
+ if ((odp->type == TYPE_STDCALL) && !n)
odp->type = TYPE_CDECL; /* stdcall is the same as cdecl for 0 args */
strcpy(odp->u.func.link_name, GetToken());
}
Index: wine/tools/winebuild/res16.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/res16.c,v
retrieving revision 1.1
diff -u -r1.1 res16.c
--- wine/tools/winebuild/res16.c 2000/10/25 20:33:58 1.1
+++ wine/tools/winebuild/res16.c 2000/11/05 23:47:15
@@ -244,7 +244,8 @@
/* output the resource definitions */
int output_res16_directory( unsigned char *buffer )
{
- int i, j, offset, res_offset = 0;
+ unsigned int n;
+ int i, offset, res_offset = 0;
const struct res_type *type;
const struct resource *res;
unsigned char *start = buffer;
@@ -273,7 +274,7 @@
put_word( &buffer, 0 );
put_word( &buffer, 0 );
- for (j = 0, res = type->res; j < type->nb_names; j++, res++)
+ for (n = 0, res = type->res; n < type->nb_names; n++, res++)
{
put_word( &buffer, res_offset >> ALIGNMENT );
put_word( &buffer, (res->data_size + ALIGN_MASK) >> ALIGNMENT );
@@ -297,7 +298,7 @@
for (i = 0, type = res_types; i < nb_types; i++, type++)
{
if (type->type->str) output_string( &buffer, type->type->str );
- for (j = 0, res = type->res; j < type->nb_names; j++, res++)
+ for (n = 0, res = type->res; n < type->nb_names; n++, res++)
{
if (res->name.str) output_string( &buffer, res->name.str );
}
Index: wine/tools/winebuild/res32.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/res32.c,v
retrieving revision 1.3
diff -u -r1.3 res32.c
--- wine/tools/winebuild/res32.c 2000/10/25 20:33:58 1.3
+++ wine/tools/winebuild/res32.c 2000/11/05 23:47:16
@@ -264,6 +264,7 @@
/* output the resource definitions */
int output_resources( FILE *outfile )
{
+ unsigned int n;
int i, j, k;
const struct res_type *type;
const struct res_name *name;
@@ -316,11 +317,11 @@
{
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 @@
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 @@
{
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 @@
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)
{
Index: wine/tools/wmc/lang.c
===================================================================
RCS file: /home/wine/wine/tools/wmc/lang.c,v
retrieving revision 1.1
diff -u -r1.1 lang.c
--- wine/tools/wmc/lang.c 2000/06/13 04:34:42 1.1
+++ wine/tools/wmc/lang.c 2000/11/05 23:47:16
@@ -111,16 +111,16 @@
void show_languages(void)
{
- int i;
+ unsigned int n;
printf(" Code | DOS-cp | WIN-cp | Language | Country\n");
printf("-------+--------+--------+--------------+---------\n");
- for(i = 0; i < NLAN; i++)
+ for(n = 0; n < NLAN; n++)
printf("0x%04x | %5d | %5d | %-12s | %s\n",
- languages[i].id,
- languages[i].doscp,
- languages[i].wincp,
- languages[i].name,
- languages[i].country);
+ languages[n].id,
+ languages[n].doscp,
+ languages[n].wincp,
+ languages[n].name,
+ languages[n].country);
}
static int langcmp(const void *p1, const void *p2)
Index: wine/tools/wmc/utils.c
===================================================================
RCS file: /home/wine/wine/tools/wmc/utils.c,v
retrieving revision 1.1
diff -u -r1.1 utils.c
--- wine/tools/wmc/utils.c 2000/06/13 04:34:42 1.1
+++ wine/tools/wmc/utils.c 2000/11/05 23:47:16
@@ -18,7 +18,7 @@
#include "utils.h"
#include "wmc.h"
-#define SUPPRESS_YACC_ERROR_MESSAGE
+#undef SUPPRESS_YACC_ERROR_MESSAGE
static void generic_msg(const char *s, const char *t, va_list ap)
{
Index: wine/tools/wmc/wmc.c
===================================================================
RCS file: /home/wine/wine/tools/wmc/wmc.c,v
retrieving revision 1.1
diff -u -r1.1 wmc.c
--- wine/tools/wmc/wmc.c 2000/06/13 04:34:42 1.1
+++ wine/tools/wmc/wmc.c 2000/11/05 23:47:16
@@ -260,7 +260,11 @@
static void segvhandler(int sig)
{
- fprintf(stderr, "\n%s:%d: Oops, segment violation\n", input_name, line_number);
+ if ( sig == SIGSEGV ) {
+ fprintf(stderr, "\n%s:%d: Oops, segment violation\n", input_name,
+line_number);
+ } else {
+ fprintf(stderr, "\n%s:%d: Unexpected Signal %d\n", input_name,
+line_number, sig);
+ }
fflush(stdout);
fflush(stderr);
abort();
Index: wine/tools/wrc/dumpres.c
===================================================================
RCS file: /home/wine/wine/tools/wrc/dumpres.c,v
retrieving revision 1.10
diff -u -r1.10 dumpres.c
--- wine/tools/wrc/dumpres.c 2000/06/13 03:37:56 1.10
+++ wine/tools/wrc/dumpres.c 2000/11/05 23:47:17
@@ -216,7 +216,7 @@
*/
static void dump_raw_data(raw_data_t *d)
{
- int n;
+ unsigned int n;
int i;
int j;
Index: wine/tools/wrc/genres.c
===================================================================
RCS file: /home/wine/wine/tools/wrc/genres.c,v
retrieving revision 1.15
diff -u -r1.15 genres.c
--- wine/tools/wrc/genres.c 2000/10/24 21:29:28 1.15
+++ wine/tools/wrc/genres.c 2000/11/05 23:47:18
@@ -63,7 +63,7 @@
*/
void put_byte(res_t *res, unsigned c)
{
- if(res->allocsize - res->size < sizeof(char))
+ if(res->allocsize - res->size < (int)sizeof(char))
grow_res(res, RES_BLOCKSIZE);
*(char *)&(res->data[res->size]) = (char)c;
res->size += sizeof(char);
@@ -71,7 +71,7 @@
void put_word(res_t *res, unsigned w)
{
- if(res->allocsize - res->size < sizeof(WORD))
+ if(res->allocsize - res->size < (int)sizeof(WORD))
grow_res(res, RES_BLOCKSIZE);
switch(byteorder)
{
@@ -91,7 +91,7 @@
void put_dword(res_t *res, unsigned d)
{
- if(res->allocsize - res->size < sizeof(DWORD))
+ if(res->allocsize - res->size < (int)sizeof(DWORD))
grow_res(res, RES_BLOCKSIZE);
switch(byteorder)
{
Index: wine/tools/wrc/newstruc.c
===================================================================
RCS file: /home/wine/wine/tools/wrc/newstruc.c,v
retrieving revision 1.14
diff -u -r1.14 newstruc.c
--- wine/tools/wrc/newstruc.c 2000/06/13 03:37:56 1.14
+++ wine/tools/wrc/newstruc.c 2000/11/05 23:47:19
@@ -987,7 +987,7 @@
}
#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);
Index: wine/tools/wrc/newstruc.h
===================================================================
RCS file: /home/wine/wine/tools/wrc/newstruc.h,v
retrieving revision 1.6
diff -u -r1.6 newstruc.h
--- wine/tools/wrc/newstruc.h 2000/06/08 00:38:48 1.6
+++ wine/tools/wrc/newstruc.h 2000/11/05 23:47:19
@@ -63,7 +63,7 @@
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);
Index: wine/tools/wrc/parser.y
===================================================================
RCS file: /home/wine/wine/tools/wrc/parser.y,v
retrieving revision 1.22
diff -u -r1.22 parser.y
--- wine/tools/wrc/parser.y 2000/08/25 21:32:18 1.22
+++ wine/tools/wrc/parser.y 2000/11/05 23:47:22
@@ -2717,7 +2717,7 @@
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;
Index: wine/tools/wrc/ppy.y
===================================================================
RCS file: /home/wine/wine/tools/wrc/ppy.y,v
retrieving revision 1.3
diff -u -r1.3 ppy.y
--- wine/tools/wrc/ppy.y 2000/06/13 03:37:56 1.3
+++ wine/tools/wrc/ppy.y 2000/11/05 23:47:22
@@ -45,9 +45,9 @@
if(cv_signed(v1) && cv_signed(v2)) \
r.val.si = v1.val.si OP v2.val.si; \
else if(cv_signed(v1) && !cv_signed(v2)) \
- r.val.si = v1.val.si OP v2.val.ui; \
+ r.val.si = v1.val.si OP (int)v2.val.ui; \
else if(!cv_signed(v1) && cv_signed(v2)) \
- r.val.ui = v1.val.ui OP v2.val.si; \
+ r.val.ui = (int)v1.val.ui OP v2.val.si; \
else \
r.val.ui = v1.val.ui OP v2.val.ui;
@@ -56,9 +56,9 @@
if(cv_signed(v1) && cv_signed(v2)) \
r.val.sl = v1.val.sl OP v2.val.sl; \
else if(cv_signed(v1) && !cv_signed(v2)) \
- r.val.sl = v1.val.sl OP v2.val.ul; \
+ r.val.sl = v1.val.sl OP (long)v2.val.ul; \
else if(!cv_signed(v1) && cv_signed(v2)) \
- r.val.ul = v1.val.ul OP v2.val.sl; \
+ r.val.ul = (long)v1.val.ul OP v2.val.sl; \
else \
r.val.ul = v1.val.ul OP v2.val.ul;
@@ -67,9 +67,9 @@
if(cv_signed(v1) && cv_signed(v2)) \
r.val.sll = v1.val.sll OP v2.val.sll; \
else if(cv_signed(v1) && !cv_signed(v2)) \
- r.val.sll = v1.val.sll OP v2.val.ull; \
+ r.val.sll = v1.val.sll OP (long long)v2.val.ull; \
else if(!cv_signed(v1) && cv_signed(v2)) \
- r.val.ull = v1.val.ull OP v2.val.sll; \
+ r.val.ull = (long long)v1.val.ull OP v2.val.sll; \
else \
r.val.ull = v1.val.ull OP v2.val.ull;
Index: wine/tools/wrc/readres.c
===================================================================
RCS file: /home/wine/wine/tools/wrc/readres.c,v
retrieving revision 1.4
diff -u -r1.4 readres.c
--- wine/tools/wrc/readres.c 2000/05/09 22:35:10 1.4
+++ wine/tools/wrc/readres.c 2000/11/05 23:47:22
@@ -65,7 +65,7 @@
*/
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)
@@ -181,7 +181,7 @@
/* Read in entire data-block */
fseek(fp, -8, SEEK_CUR);
res = new_res();
- if(res->allocsize < totsize)
+ if((unsigned int)res->allocsize < totsize)
grow_res(res, totsize - res->allocsize + 8);
err = read_data(fp, totsize, res->data);
if(err)
@@ -314,7 +314,7 @@
*/
static resource_t *read_res16(FILE *fp)
{
- internal_error(__FILE__, __LINE__, "Can't yet read 16 bit .res files");
+ internal_error(__FILE__, __LINE__, "Can't yet read 16 bit .res files (fp=%p)",
+fp);
return NULL;
}
Index: wine/tools/wrc/utils.c
===================================================================
RCS file: /home/wine/wine/tools/wrc/utils.c,v
retrieving revision 1.7
diff -u -r1.7 utils.c
--- wine/tools/wrc/utils.c 2000/10/24 21:29:28 1.7
+++ wine/tools/wrc/utils.c 2000/11/05 23:47:23
@@ -21,7 +21,7 @@
#include "parser.h"
#include "preproc.h"
-/* #define WANT_NEAR_INDICATION */
+#define WANT_NEAR_INDICATION
static const union cptable *current_codepage;
@@ -377,18 +377,18 @@
void set_language( unsigned short lang, unsigned short sublang )
{
- int i;
+ unsigned int n;
unsigned int cp = 0, defcp = 0;
- for (i = 0; i < sizeof(lang2cps)/sizeof(lang2cps[0]); i++)
+ for (n = 0; n < sizeof(lang2cps)/sizeof(lang2cps[0]); n++)
{
- if (lang2cps[i].lang != lang) continue;
- if (lang2cps[i].sublang == sublang)
+ if (lang2cps[n].lang != lang) continue;
+ if (lang2cps[n].sublang == sublang)
{
- cp = lang2cps[i].cp;
+ cp = lang2cps[n].cp;
break;
}
- if (lang2cps[i].sublang == SUBLANG_NEUTRAL) defcp = lang2cps[i].cp;
+ if (lang2cps[n].sublang == SUBLANG_NEUTRAL) defcp = lang2cps[n].cp;
}
if (!cp) cp = defcp;
Index: wine/tools/wrc/wrc.c
===================================================================
RCS file: /home/wine/wine/tools/wrc/wrc.c,v
retrieving revision 1.9
diff -u -r1.9 wrc.c
--- wine/tools/wrc/wrc.c 2000/07/08 11:49:29 1.9
+++ wine/tools/wrc/wrc.c 2000/11/05 23:47:24
@@ -742,7 +742,11 @@
static void segvhandler(int sig)
{
- fprintf(stderr, "\n%s:%d: Oops, segment violation\n", input_name, line_number);
+ if ( sig == SIGSEGV) {
+ fprintf(stderr, "\n%s:%d: Oops, segment violation\n", input_name,
+line_number);
+ } else {
+ fprintf(stderr, "\n%s:%d: Unexpected signal %d\n", input_name,
+line_number, sig);
+ }
fflush(stdout);
fflush(stderr);
abort();
Index: wine/tools/wrc/wrctypes.h
===================================================================
RCS file: /home/wine/wine/tools/wrc/wrctypes.h,v
retrieving revision 1.11
diff -u -r1.11 wrctypes.h
--- wine/tools/wrc/wrctypes.h 2000/06/08 00:38:48 1.11
+++ wine/tools/wrc/wrctypes.h 2000/11/05 23:47:24
@@ -175,7 +175,7 @@
/* Raw bytes in a row... */
typedef struct raw_data {
- int size;
+ unsigned int size;
char *data;
lvc_t lvc; /* Localized data */
} raw_data_t;
Index: wine/tools/wrc/writeres.c
===================================================================
RCS file: /home/wine/wine/tools/wrc/writeres.c,v
retrieving revision 1.18
diff -u -r1.18 writeres.c
--- wine/tools/wrc/writeres.c 2000/10/25 20:31:51 1.18
+++ wine/tools/wrc/writeres.c 2000/11/05 23:47:25
@@ -511,14 +511,14 @@
/*
*****************************************************************************
* 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 @@
/*
*****************************************************************************
* 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 @@
/*
*****************************************************************************
* 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 @@
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");