Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 15 May 2012 12:28:56 +0000 (14:28 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 15 May 2012 12:28:56 +0000 (14:28 +0200)
On 64bit systems with a single personality, they used to be sizeof(long),
which has type "long", not "int", which complicates printf formats.

* defs.h: Ensure that PERSONALITY0_WORDSIZE;s tyoe is int.
This in turn makes sure current_wordsize is also an int.
* count.c (call_summary): Revert the change which added cast to int.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
count.c
defs.h

diff --git a/count.c b/count.c
index 9496b0453c4e73ddc8ce34a5f2d76135a07aac99..78d14ed1002c582ce02b979535ecb1b5b98edfe9 100644 (file)
--- a/count.c
+++ b/count.c
@@ -220,7 +220,7 @@ call_summary(FILE *outf)
                if (i)
                        fprintf(outf,
                                "System call usage summary for %d bit mode:\n",
-                               (int) (current_wordsize * 8));
+                               current_wordsize * 8);
                call_summary_pers(outf);
        }
 
diff --git a/defs.h b/defs.h
index 3ccd8d55432dd7807c96da72a2e3d0423fd9648d..9979fcbd96a5c0d0813d5dccee9d2d46b5979122 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -249,7 +249,7 @@ extern long ptrace(int, int, char *, long);
 #endif
 
 #ifndef PERSONALITY0_WORDSIZE
-# define PERSONALITY0_WORDSIZE sizeof(long)
+# define PERSONALITY0_WORDSIZE (int)(sizeof(long))
 #endif
 
 #if !HAVE_DECL_PTRACE_SETOPTIONS