From 3ec2b351bd81ef7a827c8853e04c5612d00be84a Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 5 Jul 2005 15:07:46 +0000 Subject: Fix compile time warnings from a GCC 4.0 compiler --- cpu/ChangeLog | 10 ++++++++++ cpu/iq2000.opc | 4 ++-- cpu/ms1.opc | 31 +++++++++++-------------------- 3 files changed, 23 insertions(+), 22 deletions(-) (limited to 'cpu') diff --git a/cpu/ChangeLog b/cpu/ChangeLog index 0186195..7facd5a 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,3 +1,13 @@ +2005-07-05 Nick Clifton + + * iq2000.opc (parse_lo16, parse_mlo16): Make value parameter + unsigned in order to avoid compile time warnings about sign + conflicts. + + * ms1.opc (parse_*): Likewise. + (parse_imm16): Use a "void *" as it is passed both signed and + unsigned arguments. + 2005-07-01 Nick Clifton * frv.opc: Update to ISO C90 function declaration style. diff --git a/cpu/iq2000.opc b/cpu/iq2000.opc index 5da6911..63ef076 100644 --- a/cpu/iq2000.opc +++ b/cpu/iq2000.opc @@ -259,7 +259,7 @@ static const char * parse_lo16 (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + unsigned long *valuep) { if (strncasecmp (*strp, "%lo(", 4) == 0) { @@ -291,7 +291,7 @@ static const char * parse_mlo16 (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + unsigned long *valuep) { if (strncasecmp (*strp, "%lo(", 4) == 0) { diff --git a/cpu/ms1.opc b/cpu/ms1.opc index 57c2913..f61de6c 100644 --- a/cpu/ms1.opc +++ b/cpu/ms1.opc @@ -89,16 +89,6 @@ ms1_asm_hash (const char* insn) /* -- asm.c */ -static int signed_out_of_bounds (long); -static const char * parse_imm16 (CGEN_CPU_DESC, const char **, int, long *); -static const char * parse_dup (CGEN_CPU_DESC, const char **, int, long *); -static const char * parse_ball (CGEN_CPU_DESC, const char **, int, long *); -static const char * parse_xmode (CGEN_CPU_DESC, const char **, int, long *); -static const char * parse_rc (CGEN_CPU_DESC, const char **, int, long *); -static const char * parse_cbrb (CGEN_CPU_DESC, const char **, int, long *); -static const char * parse_rbbc (CGEN_CPU_DESC, const char **, int, long *); -static const char * parse_type (CGEN_CPU_DESC, const char **, int, long *); - /* Range checking for signed numbers. Returns 0 if acceptable and 1 if the value is out of bounds for a signed quantity. */ @@ -114,8 +104,9 @@ static const char * parse_imm16 (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + void *arg) { + signed long * valuep = (signed long *) arg; const char *errmsg; enum cgen_parse_operand_result result_type; bfd_reloc_code_real_type code = BFD_RELOC_NONE; @@ -218,9 +209,9 @@ parse_imm16 (CGEN_CPU_DESC cd, else { /* MS1_OPERAND_IMM16Z. Parse as an unsigned integer. */ - errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep); + errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, (unsigned long *) valuep); - if (opindex == (CGEN_OPERAND_TYPE)MS1_OPERAND_IMM16 + if (opindex == (CGEN_OPERAND_TYPE) MS1_OPERAND_IMM16 && *valuep >= 0x8000 && *valuep <= 0xffff) *valuep -= 0x10000; @@ -235,7 +226,7 @@ static const char * parse_dup (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + unsigned long *valuep) { const char *errmsg = NULL; @@ -260,7 +251,7 @@ static const char * parse_ball (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + unsigned long *valuep) { const char *errmsg = NULL; @@ -284,7 +275,7 @@ static const char * parse_xmode (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + unsigned long *valuep) { const char *errmsg = NULL; @@ -308,7 +299,7 @@ static const char * parse_rc (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + unsigned long *valuep) { const char *errmsg = NULL; @@ -332,7 +323,7 @@ static const char * parse_cbrb (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + unsigned long *valuep) { const char *errmsg = NULL; @@ -356,7 +347,7 @@ static const char * parse_rbbc (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + unsigned long *valuep) { const char *errmsg = NULL; @@ -390,7 +381,7 @@ static const char * parse_type (CGEN_CPU_DESC cd, const char **strp, int opindex, - long *valuep) + unsigned long *valuep) { const char *errmsg = NULL; -- cgit v1.1