From 4d11eba003fb887b539f1e2607f97c9fe369313d Mon Sep 17 00:00:00 2001 From: Stefan Huehner Date: Thu, 30 Jun 2005 18:10:08 +0000 Subject: [PATCH] Fix some -Wsign-compare warnings. --- tools/wrc/genres.c | 4 ++-- tools/wrc/genres.h | 2 +- tools/wrc/wrctypes.h | 8 ++++---- tools/wrc/writeres.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/wrc/genres.c b/tools/wrc/genres.c index 7a33e923aae..620134c4455 100644 --- a/tools/wrc/genres.c +++ b/tools/wrc/genres.c @@ -55,7 +55,7 @@ res_t *new_res(void) return r; } -res_t *grow_res(res_t *r, int add) +res_t *grow_res(res_t *r, unsigned int add) { r->allocsize += add; r->data = (char *)xrealloc(r->data, r->allocsize); @@ -407,7 +407,7 @@ static void put_lvc(res_t *res, lvc_t *lvc) */ static void put_raw_data(res_t *res, raw_data_t *raw, int offset) { - int wsize = raw->size - offset; + unsigned int wsize = raw->size - offset; if(res->allocsize - res->size < wsize) grow_res(res, wsize); memcpy(&(res->data[res->size]), raw->data + offset, wsize); diff --git a/tools/wrc/genres.h b/tools/wrc/genres.h index 5feb83a3fa1..afdf1e82832 100644 --- a/tools/wrc/genres.h +++ b/tools/wrc/genres.h @@ -24,7 +24,7 @@ #include "wrctypes.h" res_t *new_res(void); -res_t *grow_res(res_t *r, int add); +res_t *grow_res(res_t *r, unsigned int add); void put_byte(res_t *res, unsigned c); void put_word(res_t *res, unsigned w); void put_dword(res_t *res, unsigned d); diff --git a/tools/wrc/wrctypes.h b/tools/wrc/wrctypes.h index d776d268879..eb5e907b7fb 100644 --- a/tools/wrc/wrctypes.h +++ b/tools/wrc/wrctypes.h @@ -87,10 +87,10 @@ #define RES_BLOCKSIZE 512 typedef struct res { - int allocsize; /* Allocated datablock size */ - int size; /* Actual size of data */ - int dataidx; /* Tag behind the resource-header */ - char *data; + unsigned int allocsize; /* Allocated datablock size */ + unsigned int size; /* Actual size of data */ + unsigned int dataidx; /* Tag behind the resource-header */ + char *data; } res_t; /* Resource strings are slightly more complex because they include '\0' */ diff --git a/tools/wrc/writeres.c b/tools/wrc/writeres.c index c33ea6c0950..c1d64336a2b 100644 --- a/tools/wrc/writeres.c +++ b/tools/wrc/writeres.c @@ -47,7 +47,7 @@ void write_resfile(char *outname, resource_t *top) { FILE *fo; - int ret; + unsigned int ret; char zeros[3] = {0, 0, 0}; fo = fopen(outname, "wb");