From: Denys Vlasenko Date: Tue, 15 May 2012 12:28:56 +0000 (+0200) Subject: Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches X-Git-Tag: v4.8~229 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c52826c267aaca5c976b10e13ee6debc0bdf3f43;p=strace Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches 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 --- diff --git a/count.c b/count.c index 9496b045..78d14ed1 100644 --- 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 3ccd8d55..9979fcbd 100644 --- 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