From 47d8304e8837825ab4fd60922b28f30c623f2c02 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 24 Feb 2005 13:38:01 +0000 Subject: [PATCH] * cris-dis.c (format_hex): Remove ineffective warning fix. * crx-dis.c (make_instruction): Warning fix. * frv-asm.c: Regenerate. --- opcodes/ChangeLog | 6 ++++++ opcodes/cris-dis.c | 6 ++---- opcodes/crx-dis.c | 3 ++- opcodes/frv-asm.c | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index e01507f95a..e8c62ade31 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2005-02-24 Alan Modra + + * cris-dis.c (format_hex): Remove ineffective warning fix. + * crx-dis.c (make_instruction): Warning fix. + * frv-asm.c: Regenerate. + 2005-02-23 Nick Clifton * cgen-dis.in: Use bfd_byte for buffers that are passed to diff --git a/opcodes/cris-dis.c b/opcodes/cris-dis.c index 372f08512b..b6b7559ed6 100644 --- a/opcodes/cris-dis.c +++ b/opcodes/cris-dis.c @@ -448,10 +448,8 @@ format_hex (number, outbuffer, disdata) char *outbuffer; struct cris_disasm_data *disdata; { - /* Obfuscate to avoid warning on 32-bit host, but properly truncate - negative numbers on >32-bit hosts. */ - if (sizeof (number) > 4) - number &= (1 << (sizeof (number) > 4 ? 32 : 1)) - 1; + /* Truncate negative numbers on >32-bit hosts. */ + number &= 0xffffffff; sprintf (outbuffer, "0x%lx", number); diff --git a/opcodes/crx-dis.c b/opcodes/crx-dis.c index 928b0117c4..640a90a5e5 100644 --- a/opcodes/crx-dis.c +++ b/opcodes/crx-dis.c @@ -658,8 +658,9 @@ make_instruction (void) for (i = 0; i < currInsn.nargs; i++) { - argument a = { 0 }; + argument a; + memset (&a, 0, sizeof (a)); a.type = getargtype (instruction->operands[i].op_type); if (instruction->operands[i].op_type == cst4 || instruction->operands[i].op_type == rbase_dispu4) diff --git a/opcodes/frv-asm.c b/opcodes/frv-asm.c index 635f9c742c..2632e87777 100644 --- a/opcodes/frv-asm.c +++ b/opcodes/frv-asm.c @@ -71,7 +71,7 @@ static const char * parse_A0 static const char * parse_A1 PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *)); static const char * parse_A - PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *, long)); + PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *, unsigned long)); inline static const char * parse_symbolic_address (CGEN_CPU_DESC cd, @@ -924,7 +924,7 @@ parse_A (cd, strp, opindex, valuep, A) const char **strp; int opindex; unsigned long *valuep; - long A; + unsigned long A; { const char *errmsg;