winedump, loader: sign-compare fixes

Joris Huizer joris_huizer at yahoo.com
Wed Feb 7 11:05:47 CST 2007


Skipped content of type multipart/alternative-------------- next part --------------
>From b820f91c5c4a49a97c52c2b7e1a9f9d305595a7a Mon Sep 17 00:00:00 2001
From: Joris Huizer <jorishuizer at debian.(none)>
Date: Wed, 7 Feb 2007 18:02:07 +0100
Subject: [PATCH] winedump: sign-compare fixes
To: wine-patches <wine-patches at winehq.org>

---
 tools/winedump/minidump.c |    2 +-
 tools/winedump/msc.c      |   32 ++++++++++++++++++--------------
 tools/winedump/pdb.c      |    2 +-
 3 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/tools/winedump/minidump.c b/tools/winedump/minidump.c
index 2c61a7c..07108b8 100644
--- a/tools/winedump/minidump.c
+++ b/tools/winedump/minidump.c
@@ -44,7 +44,7 @@ static void dump_mdmp_string(DWORD rva)
         printf("<<?>>");
 }
 
-static const MINIDUMP_DIRECTORY* get_mdmp_dir(const MINIDUMP_HEADER* hdr, int str_idx)
+static const MINIDUMP_DIRECTORY* get_mdmp_dir(const MINIDUMP_HEADER* hdr, unsigned int str_idx)
 {
     const MINIDUMP_DIRECTORY*   dir;
     unsigned int                i;
diff --git a/tools/winedump/msc.c b/tools/winedump/msc.c
index 91ad8c1..af8ce5c 100644
--- a/tools/winedump/msc.c
+++ b/tools/winedump/msc.c
@@ -662,14 +662,16 @@ static void codeview_dump_one_type(unsig
         break;
 
     case LF_ARGLIST_V2:
-        printf("\t%x => Arglist V2(#%u):", curr_type, reftype->arglist_v2.num);
-        for (i = 0; i < reftype->arglist_v2.num; i++)
         {
-            printf("\t %x", reftype->arglist_v2.args[i]);
+            unsigned int i;
+            printf("\t%x => Arglist V2(#%u):", curr_type, reftype->arglist_v2.num);
+            for (i = 0; i < reftype->arglist_v2.num; i++)
+            {
+                printf("\t %x", reftype->arglist_v2.args[i]);
+            }
+            printf("\t\n");
+            break;
         }
-        printf("\t\n");
-        break;
-
     case LF_PROCEDURE_V1:
         /* FIXME: unknown could be the calling convention for the proc */
         printf("\t%x => Procedure V1 ret_type:%x call:%x (#%u args_type:%x)\n",
@@ -785,14 +787,16 @@ static void codeview_dump_one_type(unsig
         break;
 
     case LF_DERIVED_V2:
-        printf("\t%x => Derived V2(#%u):", curr_type, reftype->derived_v2.num);
-        for (i = 0; i < reftype->derived_v2.num; i++)
         {
-            printf(" %x", reftype->derived_v2.drvdcls[i]);
+            unsigned int i;
+            printf("\t%x => Derived V2(#%u):", curr_type, reftype->derived_v2.num);
+            for (i = 0; i < reftype->derived_v2.num; i++)
+            {
+                printf(" %x", reftype->derived_v2.drvdcls[i]);
+            }
+            printf("\n");
+            break;
         }
-        printf("\n");
-        break;
-
     default:
         printf(">>> Unsupported type-id %x for %x\n", type->generic.id, curr_type);
         dump_data((const void*)type, type->generic.len + 2, "");
@@ -818,7 +822,7 @@ int codeview_dump_types_from_block(const
     unsigned int        curr_type = 0x1000;
     const unsigned char*ptr = table;
 
-    while (ptr - (const unsigned char*)table < len)
+    while ((ULONG_PTR)(ptr - (const unsigned char*)table) < len)
     {
         const union codeview_type* type = (const union codeview_type*)ptr;
 
@@ -832,7 +836,7 @@ int codeview_dump_types_from_block(const
 
 int codeview_dump_symbols(const void* root, unsigned long size)
 {
-    int     i, length;
+    unsigned int     i, length;
     char*   curr_func = NULL;
     int     nest_block = 0;
     /*
diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c
index bd71ede..0294902 100644
--- a/tools/winedump/pdb.c
+++ b/tools/winedump/pdb.c
@@ -295,7 +295,7 @@ static void pdb_dump_symbols(struct pdb_
 
     /* Read per-module symbol / linenumber tables */
     file = (const char*)symbols + sizeof(PDB_SYMBOLS);
-    while (file - (const char*)symbols < sizeof(PDB_SYMBOLS) + symbols->module_size)
+    while ((ULONG_PTR)(file - (const char*)symbols) < sizeof(PDB_SYMBOLS) + symbols->module_size)
     {
         int file_nr, symbol_size, lineno_size;
         const char* file_name;
-- 
1.4.4

-------------- next part --------------
>From 6aaf84dbb83e59b26f527d6316ad37bde2345a5e Mon Sep 17 00:00:00 2001
From: Joris Huizer <jorishuizer at debian.(none)>
Date: Wed, 7 Feb 2007 18:03:11 +0100
Subject: [PATCH] loader: sign-compare fix
To: wine-patches <wine-patches at winehq.org>

---
 loader/preloader.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/loader/preloader.c b/loader/preloader.c
index 5648158..0034e9a 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -1006,7 +1006,8 @@ static int is_in_preload_range( const El
 /* set the process name if supported */
 static void set_process_name( int argc, char *argv[] )
 {
-    unsigned int i, off;
+    int i;
+    unsigned int off;
     char *p, *name, *end;
 
     /* set the process short name */
-- 
1.4.4



More information about the wine-patches mailing list