From 2d7e976eed37263bd38c631b02576c894c272ee4 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 10 Jul 2005 17:45:53 +0000 Subject: [PATCH] Fixed signedness warnings. --- libs/wine/loader.c | 4 ++-- tools/winebuild/res16.c | 2 +- tools/winebuild/res32.c | 2 +- tools/wrc/dumpres.c | 6 +++--- tools/wrc/genres.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/wine/loader.c b/libs/wine/loader.c index 43cc56cb78b..da9879250d8 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -305,7 +305,7 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr ) /* Build the code section */ - strcpy( sec->Name, ".text" ); + memcpy( sec->Name, ".text", sizeof(".text") ); sec->SizeOfRawData = data_start - code_start; sec->Misc.VirtualSize = sec->SizeOfRawData; sec->VirtualAddress = code_start; @@ -315,7 +315,7 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr ) /* Build the data section */ - strcpy( sec->Name, ".data" ); + memcpy( sec->Name, ".data", sizeof(".data") ); sec->SizeOfRawData = data_end - data_start; sec->Misc.VirtualSize = sec->SizeOfRawData; sec->VirtualAddress = data_start; diff --git a/tools/winebuild/res16.c b/tools/winebuild/res16.c index 9aad666bdfb..ad653003be0 100644 --- a/tools/winebuild/res16.c +++ b/tools/winebuild/res16.c @@ -142,7 +142,7 @@ static void get_string( struct string_id *str ) } else { - char *p = xmalloc( (strlen(file_pos) + 1) ); + char *p = xmalloc( (strlen((char*)file_pos) + 1) ); str->str = p; str->id = 0; while ((*p++ = get_byte())); diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c index 7ae34e7a17f..95b890a70f6 100644 --- a/tools/winebuild/res32.c +++ b/tools/winebuild/res32.c @@ -207,7 +207,7 @@ static void load_next_resource( DLLSPEC *spec ) get_dword(); /* skip version */ get_dword(); /* skip characteristics */ - file_pos = (const char *)res->data + res->data_size; + file_pos = (const unsigned char *)res->data + res->data_size; if (file_pos > file_end) fatal_error( "%s is a truncated file\n", file_name ); } diff --git a/tools/wrc/dumpres.c b/tools/wrc/dumpres.c index 53cc64eba3b..7af89e4d93b 100644 --- a/tools/wrc/dumpres.c +++ b/tools/wrc/dumpres.c @@ -78,13 +78,13 @@ const char *get_typename(const resource_t* r) * Remarks : No codepage translation is done. ***************************************************************************** */ -static char *strncpyWtoA(char *cs, const short *ws, int maxlen) +static char *strncpyWtoA(char *cs, const WCHAR *ws, int maxlen) { char *cptr = cs; - const short *wsMax = ws + maxlen - 1; + const WCHAR *wsMax = ws + maxlen - 1; while(*ws && ws < wsMax) { - if(*ws < -128 || *ws > 127) + if(*ws > 255) fprintf(stderr, "***Warning: Unicode string contains non-printable chars***\n"); *cptr++ = (char)*ws++; } diff --git a/tools/wrc/genres.c b/tools/wrc/genres.c index 722baea9369..9b6c5be74f6 100644 --- a/tools/wrc/genres.c +++ b/tools/wrc/genres.c @@ -1784,7 +1784,7 @@ char *prep_nid_for_label(const name_id_t *nid) if(nid->type == name_str && nid->name.s_name->type == str_unicode) { - short *sptr; + WCHAR *sptr; int i; sptr = nid->name.s_name->str.wstr; buf[0] = '\0'; -- 2.11.4.GIT