X-Git-Url: https://oss.titaniummirror.com/gitweb?p=msp430-binutils.git;a=blobdiff_plain;f=opcodes%2Fcris-dis.c;fp=opcodes%2Fcris-dis.c;h=01ada9d8f977a2976564239c049495ba303c1da7;hp=64e55e239ab0f9a0f22f46a1fecbf434aa96b1cf;hb=d5da4f291af551c0b8b79e1d4a9b173d60e5c10e;hpb=7b5ea4fcdf2819e070665ab5610f8b48e3867c10 diff --git a/opcodes/cris-dis.c b/opcodes/cris-dis.c index 64e55e2..01ada9d 100644 --- a/opcodes/cris-dis.c +++ b/opcodes/cris-dis.c @@ -1,5 +1,5 @@ /* Disassembler code for CRIS. - Copyright 2000, 2001, 2002, 2004, 2005, 2006, 2007 + Copyright 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Axis Communications AB, Lund, Sweden. Written by Hans-Peter Nilsson. @@ -581,7 +581,10 @@ static char * format_dec (long number, char *outbuffer, int signedp) { last_immediate = number; - sprintf (outbuffer, signedp ? "%ld" : "%lu", number); + if (signedp) + sprintf (outbuffer, "%ld", number); + else + sprintf (outbuffer, "%lu", (unsigned long) number); return outbuffer + strlen (outbuffer); } @@ -657,17 +660,17 @@ bytes_to_skip (unsigned int insn, { /* Each insn is a word plus "immediate" operands. */ unsigned to_skip = 2; - const char *template = matchedp->args; + const char *template_name = (const char *) matchedp->args; const char *s; - for (s = template; *s; s++) + for (s = template_name; *s; s++) if ((*s == 's' || *s == 'N' || *s == 'Y') && (insn & 0x400) && (insn & 15) == 15 && prefix_matchedp == NULL) { /* Immediate via [pc+], so we have to check the size of the operand. */ - int mode_size = 1 << ((insn >> 4) & (*template == 'z' ? 1 : 3)); + int mode_size = 1 << ((insn >> 4) & (*template_name == 'z' ? 1 : 3)); if (matchedp->imm_oprnd_size == SIZE_FIX_32) to_skip += 4;