From 47b0e7ad8c60ea4b45b22ad5cb376f068991bc88 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 1 Jul 2005 11:16:33 +0000 Subject: Update function declarations to ISO C90 formatting --- cpu/m32r.opc | 122 ++++++++++++++++++++++++++--------------------------------- 1 file changed, 53 insertions(+), 69 deletions(-) (limited to 'cpu/m32r.opc') diff --git a/cpu/m32r.opc b/cpu/m32r.opc index 909def6..63f41a5 100644 --- a/cpu/m32r.opc +++ b/cpu/m32r.opc @@ -24,7 +24,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ /* This file is an addendum to m32r.cpu. Heavy use of C code isn't appropriate in .cpu files, so it resides here. This especially applies @@ -55,56 +56,46 @@ : X (buffer) == 0x30 ? ((((unsigned char *) (buffer))[1] & 0x70) >> 4) \ : ((((unsigned char *) (buffer))[1] & 0xf0) >> 4))) #else -#define CGEN_DIS_HASH(buffer, value) m32r_cgen_dis_hash(buffer, value) -extern unsigned int m32r_cgen_dis_hash(const char *, CGEN_INSN_INT); +#define CGEN_DIS_HASH(buffer, value) m32r_cgen_dis_hash (buffer, value) +extern unsigned int m32r_cgen_dis_hash (const char *, CGEN_INSN_INT); #endif /* -- */ /* -- opc.c */ unsigned int -m32r_cgen_dis_hash (buf, value) - const char * buf ATTRIBUTE_UNUSED; - CGEN_INSN_INT value; +m32r_cgen_dis_hash (const char * buf ATTRIBUTE_UNUSED, CGEN_INSN_INT value) { unsigned int x; - - if (value & 0xffff0000) /* 32bit instructions */ + + if (value & 0xffff0000) /* 32bit instructions. */ value = (value >> 16) & 0xffff; - - x = (value>>8) & 0xf0; + + x = (value >> 8) & 0xf0; if (x == 0x40 || x == 0xe0 || x == 0x60 || x == 0x50) return x; - + if (x == 0x70 || x == 0xf0) - return x | ((value>>8) & 0x0f); - + return x | ((value >> 8) & 0x0f); + if (x == 0x30) return x | ((value & 0x70) >> 4); else return x | ((value & 0xf0) >> 4); } - + /* -- */ /* -- asm.c */ -static const char * parse_hash - PARAMS ((CGEN_CPU_DESC, const char **, int, long *)); -static const char * parse_hi16 - PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *)); -static const char * parse_slo16 - PARAMS ((CGEN_CPU_DESC, const char **, int, long *)); -static const char * parse_ulo16 - PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *)); +static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'"); /* Handle '#' prefixes (i.e. skip over them). */ static const char * -parse_hash (cd, strp, opindex, valuep) - CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; - const char **strp; - int opindex ATTRIBUTE_UNUSED; - long *valuep ATTRIBUTE_UNUSED; +parse_hash (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + const char **strp, + int opindex ATTRIBUTE_UNUSED, + long *valuep ATTRIBUTE_UNUSED) { if (**strp == '#') ++*strp; @@ -114,11 +105,10 @@ parse_hash (cd, strp, opindex, valuep) /* Handle shigh(), high(). */ static const char * -parse_hi16 (cd, strp, opindex, valuep) - CGEN_CPU_DESC cd; - const char **strp; - int opindex; - unsigned long *valuep; +parse_hi16 (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + unsigned long *valuep) { const char *errmsg; enum cgen_parse_operand_result result_type; @@ -131,9 +121,9 @@ parse_hi16 (cd, strp, opindex, valuep) { *strp += 5; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_M32R_HI16_ULO, - &result_type, &value); + & result_type, & value); if (**strp != ')') - return "missing `)'"; + return MISSING_CLOSING_PARENTHESIS; ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) @@ -145,9 +135,9 @@ parse_hi16 (cd, strp, opindex, valuep) { *strp += 6; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_M32R_HI16_SLO, - &result_type, &value); + & result_type, & value); if (**strp != ')') - return "missing `)'"; + return MISSING_CLOSING_PARENTHESIS; ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) @@ -167,11 +157,10 @@ parse_hi16 (cd, strp, opindex, valuep) handles the case where low() isn't present. */ static const char * -parse_slo16 (cd, strp, opindex, valuep) - CGEN_CPU_DESC cd; - const char **strp; - int opindex; - long *valuep; +parse_slo16 (CGEN_CPU_DESC cd, + const char ** strp, + int opindex, + long * valuep) { const char *errmsg; enum cgen_parse_operand_result result_type; @@ -184,9 +173,9 @@ parse_slo16 (cd, strp, opindex, valuep) { *strp += 4; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_M32R_LO16, - &result_type, &value); + & result_type, & value); if (**strp != ')') - return "missing `)'"; + return MISSING_CLOSING_PARENTHESIS; ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) @@ -203,9 +192,9 @@ parse_slo16 (cd, strp, opindex, valuep) { *strp += 4; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_M32R_SDA16, - NULL, &value); + NULL, & value); if (**strp != ')') - return "missing `)'"; + return MISSING_CLOSING_PARENTHESIS; ++*strp; *valuep = value; return errmsg; @@ -219,11 +208,10 @@ parse_slo16 (cd, strp, opindex, valuep) handles the case where low() isn't present. */ static const char * -parse_ulo16 (cd, strp, opindex, valuep) - CGEN_CPU_DESC cd; - const char **strp; - int opindex; - unsigned long *valuep; +parse_ulo16 (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + unsigned long *valuep) { const char *errmsg; enum cgen_parse_operand_result result_type; @@ -236,9 +224,9 @@ parse_ulo16 (cd, strp, opindex, valuep) { *strp += 4; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_M32R_LO16, - &result_type, &value); + & result_type, & value); if (**strp != ')') - return "missing `)'"; + return MISSING_CLOSING_PARENTHESIS; ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) @@ -253,9 +241,6 @@ parse_ulo16 (cd, strp, opindex, valuep) /* -- */ /* -- dis.c */ -static void print_hash PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned, bfd_vma, int)); -static int my_print_insn PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *)); - /* Immediate values are prefixed with '#'. */ #define CGEN_PRINT_NORMAL(cd, info, value, attrs, pc, length) \ @@ -269,15 +254,15 @@ static int my_print_insn PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *)); /* Handle '#' prefixes as operands. */ static void -print_hash (cd, dis_info, value, attrs, pc, length) - CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; - PTR dis_info; - long value ATTRIBUTE_UNUSED; - unsigned int attrs ATTRIBUTE_UNUSED; - bfd_vma pc ATTRIBUTE_UNUSED; - int length ATTRIBUTE_UNUSED; +print_hash (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void * dis_info, + long value ATTRIBUTE_UNUSED, + unsigned int attrs ATTRIBUTE_UNUSED, + bfd_vma pc ATTRIBUTE_UNUSED, + int length ATTRIBUTE_UNUSED) { disassemble_info *info = (disassemble_info *) dis_info; + (*info->fprintf_func) (info->stream, "#"); } @@ -285,17 +270,16 @@ print_hash (cd, dis_info, value, attrs, pc, length) #define CGEN_PRINT_INSN my_print_insn static int -my_print_insn (cd, pc, info) - CGEN_CPU_DESC cd; - bfd_vma pc; - disassemble_info *info; +my_print_insn (CGEN_CPU_DESC cd, + bfd_vma pc, + disassemble_info *info) { - char buffer[CGEN_MAX_INSN_SIZE]; - char *buf = buffer; + bfd_byte buffer[CGEN_MAX_INSN_SIZE]; + bfd_byte *buf = buffer; int status; int buflen = (pc & 3) == 0 ? 4 : 2; int big_p = CGEN_CPU_INSN_ENDIAN (cd) == CGEN_ENDIAN_BIG; - char *x; + bfd_byte *x; /* Read the base part of the insn. */ -- cgit v1.1