From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58878 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCHW7-0004Ev-0S for qemu-devel@nongnu.org; Wed, 12 May 2010 15:22:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCHW5-0005em-9g for qemu-devel@nongnu.org; Wed, 12 May 2010 15:22:50 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:43872) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCHW5-0005ea-49 for qemu-devel@nongnu.org; Wed, 12 May 2010 15:22:49 -0400 Received: by pxi19 with SMTP id 19so216174pxi.4 for ; Wed, 12 May 2010 12:22:47 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1273689279-9297-1-git-send-email-weil@mail.berlios.de> References: <1273689279-9297-1-git-send-email-weil@mail.berlios.de> Date: Wed, 12 May 2010 22:22:47 +0300 Message-ID: From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] Re: [PATCH] target-sparc: Fix wrong printf argument List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-devel@nongnu.org Thanks, applied. Another solution would have been to change the return value to uint32_t. On 5/12/10, Stefan Weil wrote: > cpu_get_ccr() returns a target_ulong, so a type cast is needed to avoid > wrong output on big endian hosts. We could also use TARGET_FMT_lx, > but that would print 8 instead of 2 digits. > > Cc: Blue Swirl > Signed-off-by: Stefan Weil > --- > target-sparc/helper.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/target-sparc/helper.c b/target-sparc/helper.c > index 4642122..582de10 100644 > --- a/target-sparc/helper.c > +++ b/target-sparc/helper.c > @@ -1490,7 +1490,7 @@ void cpu_dump_state(CPUState *env, FILE *f, > } > #ifdef TARGET_SPARC64 > cpu_fprintf(f, "pstate: %08x ccr: %02x (icc: ", env->pstate, > - cpu_get_ccr(env)); > + (unsigned)cpu_get_ccr(env)); > cpu_print_cc(f, cpu_fprintf, cpu_get_ccr(env) << PSR_CARRY_SHIFT); > cpu_fprintf(f, " xcc: "); > cpu_print_cc(f, cpu_fprintf, cpu_get_ccr(env) << (PSR_CARRY_SHIFT - 4)); > > -- > 1.7.1 > >