diff options
author | Alan Modra <amodra@gmail.com> | 2008-08-12 23:39:31 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2008-08-12 23:39:31 +0000 |
commit | 5a49b8acf456d4a049c002fae31b83a10b35e6f8 (patch) | |
tree | c55c2f40551c32d774a8dfd9c61b5ba503dc954a | |
parent | 11fa8e431388f2e50d86cd4af26b748eba56b10e (diff) | |
download | gdb-5a49b8acf456d4a049c002fae31b83a10b35e6f8.zip gdb-5a49b8acf456d4a049c002fae31b83a10b35e6f8.tar.gz gdb-5a49b8acf456d4a049c002fae31b83a10b35e6f8.tar.bz2 |
Banish PARAMS and PTR. Convert to ISO C.
Delete unnecessary forward declarations.
38 files changed, 921 insertions, 1959 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index fa31b7a..fbd8c4e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,16 @@ +2008-08-13 Alan Modra <amodra@bigpond.net.au> + + * as.c, as.h, ecoff.c, hash.c, macro.c, symbols.c, config/obj-evax.c, + config/obj-som.c, config/tc-alpha.c, config/tc-arm.c, config/tc-bfin.c, + config/tc-bfin.h, config/tc-crx.c, config/tc-frv.c, config/tc-frv.h, + config/tc-hppa.h, config/tc-i386.c, config/tc-i860.c, config/tc-i960.h, + config/tc-ia64.c, config/tc-ia64.h, config/tc-m32c.c, config/tc-m32c.h, + config/tc-m68k.c, config/tc-maxq.c, config/tc-s390.c, config/tc-s390.h, + config/tc-sparc.c, config/tc-sparc.h, config/tc-spu.c, config/tc-spu.h, + config/tc-tic4x.c, config/tc-tic4x.h, config/tc-tic54x.c, + config/tc-tic54x.h, config/tc-vax.c, doc/internals.texi: Banish PARAMS + and PTR. Convert to ISO C. Delete unnecessary forward declarations. + 2008-08-12 Alan Modra <amodra@bigpond.net.au> * config/tc-arm.c (s_unreq): Adjust hash_delete call. @@ -50,7 +50,7 @@ #ifdef HAVE_SBRK #ifdef NEED_DECLARATION_SBRK -extern PTR sbrk (); +extern void *sbrk (); #endif #endif @@ -1,6 +1,6 @@ /* as.h - global header file Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -171,8 +171,8 @@ extern int ffs (int); extern void free (); #endif #ifdef NEED_DECLARATION_MALLOC -extern PTR malloc (); -extern PTR realloc (); +extern void *malloc (); +extern void *realloc (); #endif #ifdef NEED_DECLARATION_STRSTR extern char *strstr (); diff --git a/gas/config/obj-evax.c b/gas/config/obj-evax.c index 6f484d0..a0cbae2 100644 --- a/gas/config/obj-evax.c +++ b/gas/config/obj-evax.c @@ -1,5 +1,5 @@ /* obj-evax.c - EVAX (openVMS/Alpha) object file format. - Copyright 1996, 1997, 2007 Free Software Foundation, Inc. + Copyright 1996, 1997, 2007, 2008 Free Software Foundation, Inc. Contributed by Klaus Kämpf (kkaempf@progis.de) of proGIS Software, Aachen, Germany. @@ -24,7 +24,7 @@ #include "as.h" -static void s_evax_weak PARAMS ((int)); +static void s_evax_weak (int); const pseudo_typeS obj_pseudo_table[] = { diff --git a/gas/config/obj-som.c b/gas/config/obj-som.c index 20301c5..99397a6 100644 --- a/gas/config/obj-som.c +++ b/gas/config/obj-som.c @@ -1,6 +1,6 @@ /* SOM object file format. Copyright 1993, 1994, 1998, 2000, 2002, 2003, 2004, 2005, 2006, - 2007 Free Software Foundation, Inc. + 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -263,7 +263,7 @@ obj_som_init_stab_section (segT seg) /* Fill in the counts in the first entry in a .stabs section. */ static void -adjust_stab_sections (bfd *abfd, asection *sec, PTR xxx ATTRIBUTE_UNUSED) +adjust_stab_sections (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) { asection *strsec; char *p; @@ -292,7 +292,7 @@ adjust_stab_sections (bfd *abfd, asection *sec, PTR xxx ATTRIBUTE_UNUSED) void som_frob_file (void) { - bfd_map_over_sections (stdoutput, adjust_stab_sections, (PTR) 0); + bfd_map_over_sections (stdoutput, adjust_stab_sections, (void *) 0); } static void diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 29fa922..a5b35fc 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -1,6 +1,6 @@ /* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU. Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by Carnegie Mellon University, 1993. Written by Alessandro Forin, based on earlier gas-1.38 target CPU files. Modified by Ken Raeburn for gas-2.x and ECOFF support. @@ -3723,7 +3723,7 @@ s_alpha_stab (int n) static void s_alpha_coff_wrapper (int which) { - static void (* const fns[]) PARAMS ((int)) = { + static void (* const fns[]) (int) = { ecoff_directive_begin, ecoff_directive_bend, ecoff_directive_def, @@ -4739,7 +4739,6 @@ const pseudo_typeS md_pseudo_table[] = /* @@@ GP selection voodoo. All of this seems overly complicated and unnecessary; which is the primary reason it's for ECOFF only. */ -static inline void maybe_set_gp PARAMS ((asection *)); static inline void maybe_set_gp (asection *sec) diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 85e1e2d..0d3fe7b 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -1988,7 +1988,7 @@ insert_reg_alias (char *str, int number, int type) new->builtin = FALSE; new->neon = NULL; - if (hash_insert (arm_reg_hsh, name, (PTR) new)) + if (hash_insert (arm_reg_hsh, name, (void *) new)) abort (); return new; @@ -19602,25 +19602,25 @@ md_begin (void) as_fatal (_("virtual memory exhausted")); for (i = 0; i < sizeof (insns) / sizeof (struct asm_opcode); i++) - hash_insert (arm_ops_hsh, insns[i].template, (PTR) (insns + i)); + hash_insert (arm_ops_hsh, insns[i].template, (void *) (insns + i)); for (i = 0; i < sizeof (conds) / sizeof (struct asm_cond); i++) - hash_insert (arm_cond_hsh, conds[i].template, (PTR) (conds + i)); + hash_insert (arm_cond_hsh, conds[i].template, (void *) (conds + i)); for (i = 0; i < sizeof (shift_names) / sizeof (struct asm_shift_name); i++) - hash_insert (arm_shift_hsh, shift_names[i].name, (PTR) (shift_names + i)); + hash_insert (arm_shift_hsh, shift_names[i].name, (void *) (shift_names + i)); for (i = 0; i < sizeof (psrs) / sizeof (struct asm_psr); i++) - hash_insert (arm_psr_hsh, psrs[i].template, (PTR) (psrs + i)); + hash_insert (arm_psr_hsh, psrs[i].template, (void *) (psrs + i)); for (i = 0; i < sizeof (v7m_psrs) / sizeof (struct asm_psr); i++) - hash_insert (arm_v7m_psr_hsh, v7m_psrs[i].template, (PTR) (v7m_psrs + i)); + hash_insert (arm_v7m_psr_hsh, v7m_psrs[i].template, (void *) (v7m_psrs + i)); for (i = 0; i < sizeof (reg_names) / sizeof (struct reg_entry); i++) - hash_insert (arm_reg_hsh, reg_names[i].name, (PTR) (reg_names + i)); + hash_insert (arm_reg_hsh, reg_names[i].name, (void *) (reg_names + i)); for (i = 0; i < sizeof (barrier_opt_names) / sizeof (struct asm_barrier_opt); i++) hash_insert (arm_barrier_opt_hsh, barrier_opt_names[i].template, - (PTR) (barrier_opt_names + i)); + (void *) (barrier_opt_names + i)); #ifdef OBJ_ELF for (i = 0; i < sizeof (reloc_names) / sizeof (struct reloc_entry); i++) - hash_insert (arm_reloc_hsh, reloc_names[i].name, (PTR) (reloc_names + i)); + hash_insert (arm_reloc_hsh, reloc_names[i].name, (void *) (reloc_names + i)); #endif set_constant_flonums (); diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c index 3703b9b..8dccdbc 100644 --- a/gas/config/tc-bfin.c +++ b/gas/config/tc-bfin.c @@ -1,5 +1,5 @@ /* tc-bfin.c -- Assembler for the ADI Blackfin. - Copyright 2005, 2006, 2007 + Copyright 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -37,8 +37,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; extern YY_BUFFER_STATE yy_scan_string (const char *yy_str); extern void yy_delete_buffer (YY_BUFFER_STATE b); static parse_state parse (char *line); -static void bfin_s_bss PARAMS ((int)); -static int md_chars_to_number PARAMS ((char *, int)); /* Global variables. */ struct bfin_insn *insn; diff --git a/gas/config/tc-bfin.h b/gas/config/tc-bfin.h index 9730825..5544dea 100644 --- a/gas/config/tc-bfin.h +++ b/gas/config/tc-bfin.h @@ -1,5 +1,5 @@ /* tc-bfin.h - header file for tc-bfin.c - Copyright 2005, 2007 + Copyright 2005, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -39,8 +39,8 @@ #define WORKING_DOT_WORD -extern void bfin_start_line_hook PARAMS ((void)); -extern bfd_boolean bfin_start_label PARAMS ((char *)); +extern void bfin_start_line_hook (void); +extern bfd_boolean bfin_start_label (char *); #define md_start_line_hook() bfin_start_line_hook() #define md_number_to_chars number_to_chars_littleendian @@ -50,7 +50,7 @@ extern bfd_boolean bfin_start_label PARAMS ((char *)); #define LEX_BR 6 #define TC_EOL_IN_INSN(PTR) (bfin_eol_in_insn(PTR) ? 1 : 0) -extern bfd_boolean bfin_eol_in_insn PARAMS ((char *)); +extern bfd_boolean bfin_eol_in_insn (char *); /* Almost all instructions of Blackfin contain an = character. */ #define TC_EQUAL_IN_INSN(C, NAME) 1 @@ -63,14 +63,14 @@ extern bfd_boolean bfin_eol_in_insn PARAMS ((char *)); #define TC_START_LABEL(ch ,ptr) (ch == ':' && bfin_start_label (ptr)) #define tc_fix_adjustable(FIX) bfin_fix_adjustable (FIX) -extern bfd_boolean bfin_fix_adjustable PARAMS ((struct fix *)); +extern bfd_boolean bfin_fix_adjustable (struct fix *); #define TC_FORCE_RELOCATION(FIX) bfin_force_relocation (FIX) -extern int bfin_force_relocation PARAMS ((struct fix *)); +extern int bfin_force_relocation (struct fix *); /* Call md_pcrel_from_section(), not md_pcrel_from(). */ #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC) -extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); +extern long md_pcrel_from_section (struct fix *, segT); /* Values passed to md_apply_fix3 don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c index 2306290..d74494b 100644 --- a/gas/config/tc-crx.c +++ b/gas/config/tc-crx.c @@ -1,5 +1,5 @@ /* tc-crx.c -- Assembler code for the CRX CPU core. - Copyright 2004, 2007 Free Software Foundation, Inc. + Copyright 2004, 2007, 2008 Free Software Foundation, Inc. Contributed by Tomer Levi, NSC, Israel. Originally written for GAS 2.12 by Tomer Levi, NSC, Israel. @@ -538,7 +538,7 @@ md_begin (void) const char *mnemonic = crx_instruction[i].mnemonic; hashret = hash_insert (crx_inst_hash, mnemonic, - (PTR) &crx_instruction[i]); + (void *) &crx_instruction[i]); if (hashret != NULL && *hashret != '\0') as_fatal (_("Can't hash `%s': %s\n"), crx_instruction[i].mnemonic, @@ -566,7 +566,7 @@ md_begin (void) for (regtab = crx_regtab; regtab < (crx_regtab + NUMREGS); regtab++) { - hashret = hash_insert (reg_hash, regtab->name, (PTR) regtab); + hashret = hash_insert (reg_hash, regtab->name, (void *) regtab); if (hashret) as_fatal (_("Internal Error: Can't hash %s: %s"), regtab->name, @@ -584,7 +584,8 @@ md_begin (void) for (copregtab = crx_copregtab; copregtab < (crx_copregtab + NUMCOPREGS); copregtab++) { - hashret = hash_insert (copreg_hash, copregtab->name, (PTR) copregtab); + hashret = hash_insert (copreg_hash, copregtab->name, + (void *) copregtab); if (hashret) as_fatal (_("Internal Error: Can't hash %s: %s"), copregtab->name, diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c index a008039..e58def9 100644 --- a/gas/config/tc-frv.c +++ b/gas/config/tc-frv.c @@ -1,5 +1,5 @@ /* tc-frv.c -- Assembler for the Fujitsu FRV. - Copyright 2002, 2003, 2004, 2005, 2006, 2007 + Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation. Inc. This file is part of GAS, the GNU Assembler. @@ -187,9 +187,8 @@ static int tomcat_doubles = 0; static int tomcat_singles = 0; /* Forward reference to static functions */ -static void frv_set_flags PARAMS ((int)); -static void frv_pic_ptr PARAMS ((int)); -static void frv_frob_file_section PARAMS ((bfd *, asection *, PTR)); +static void frv_set_flags (int); +static void frv_pic_ptr (int); /* The target specific pseudo-ops which we support. */ const pseudo_typeS md_pseudo_table[] = @@ -263,9 +262,7 @@ size_t md_longopts_size = sizeof (md_longopts); static int g_switch_value = 8; int -md_parse_option (c, arg) - int c; - char * arg; +md_parse_option (int c, char *arg) { switch (c) { @@ -484,7 +481,7 @@ md_show_usage (FILE * stream) void -md_begin () +md_begin (void) { /* Initialize the `cgen' interface. */ @@ -519,11 +516,8 @@ frv_md_fdpic_enabled (void) int chain_num = 0; -struct vliw_insn_list *frv_insert_vliw_insn PARAMS ((bfd_boolean)); - -struct vliw_insn_list * -frv_insert_vliw_insn (count) - bfd_boolean count; +static struct vliw_insn_list * +frv_insert_vliw_insn (bfd_boolean count) { struct vliw_insn_list *vliw_insn_list_entry; struct vliw_chain *vliw_chain_entry; @@ -592,14 +586,10 @@ frv_insert_vliw_insn (count) /* Check a vliw insn for an insn of type containing the sym passed in label_sym. */ -static struct vliw_insn_list *frv_find_in_vliw - PARAMS ((enum vliw_insn_type, struct vliw_chain *, symbolS *)); - static struct vliw_insn_list * -frv_find_in_vliw (vliw_insn_type, this_chain, label_sym) - enum vliw_insn_type vliw_insn_type; - struct vliw_chain *this_chain; - symbolS *label_sym; +frv_find_in_vliw (enum vliw_insn_type vliw_insn_type, + struct vliw_chain *this_chain, + symbolS *label_sym) { struct vliw_insn_list *the_insn; @@ -630,11 +620,8 @@ enum vliw_nop_type VLIW_DOUBLE_THEN_SINGLE_NOP }; -static void frv_debug_tomcat PARAMS ((struct vliw_chain *)); - static void -frv_debug_tomcat (start_chain) - struct vliw_chain *start_chain; +frv_debug_tomcat (struct vliw_chain *start_chain) { struct vliw_chain *this_chain; struct vliw_insn_list *this_insn; @@ -660,11 +647,8 @@ frv_debug_tomcat (start_chain) } } -static void frv_adjust_vliw_count PARAMS ((struct vliw_chain *)); - static void -frv_adjust_vliw_count (this_chain) - struct vliw_chain *this_chain; +frv_adjust_vliw_count (struct vliw_chain *this_chain) { struct vliw_insn_list *this_insn; @@ -683,14 +667,10 @@ frv_adjust_vliw_count (this_chain) /* Insert the desired nop combination in the vliw chain before insert_before_insn. Rechain the vliw insn. */ -static struct vliw_chain *frv_tomcat_shuffle - PARAMS ((enum vliw_nop_type, struct vliw_chain *, struct vliw_insn_list *)); - static struct vliw_chain * -frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn) - enum vliw_nop_type this_nop_type; - struct vliw_chain *vliw_to_split; - struct vliw_insn_list *insert_before_insn; +frv_tomcat_shuffle (enum vliw_nop_type this_nop_type, + struct vliw_chain *vliw_to_split, + struct vliw_insn_list *insert_before_insn) { bfd_boolean pack_prev = FALSE; @@ -854,10 +834,8 @@ frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn) return return_me; } -static void frv_tomcat_analyze_vliw_chains PARAMS ((void)); - static void -frv_tomcat_analyze_vliw_chains () +frv_tomcat_analyze_vliw_chains (void) { struct vliw_chain *vliw1 = NULL; struct vliw_chain *vliw2 = NULL; @@ -974,7 +952,7 @@ workaround_top: } void -frv_tomcat_workaround () +frv_tomcat_workaround (void) { if (frv_mach != bfd_mach_frvtomcat) return; @@ -1109,8 +1087,7 @@ target_implements_insn_p (const CGEN_INSN *insn) } void -md_assemble (str) - char * str; +md_assemble (char *str) { frv_insn insn; char *errmsg; @@ -1239,8 +1216,7 @@ md_assemble (str) We just ignore it. */ void -md_operand (expressionP) - expressionS * expressionP; +md_operand (expressionS *expressionP) { if (* input_line_pointer == '#') { @@ -1250,17 +1226,14 @@ md_operand (expressionP) } valueT -md_section_align (segment, size) - segT segment; - valueT size; +md_section_align (segT segment, valueT size) { int align = bfd_get_section_alignment (stdoutput, segment); return ((size + (1 << align) - 1) & (-1 << align)); } symbolS * -md_undefined_symbol (name) - char * name ATTRIBUTE_UNUSED; +md_undefined_symbol (char *name ATTRIBUTE_UNUSED) { return 0; } @@ -1277,9 +1250,7 @@ const relax_typeS md_relax_table[] = }; long -frv_relax_frag (fragP, stretch) - fragS *fragP ATTRIBUTE_UNUSED; - long stretch ATTRIBUTE_UNUSED; +frv_relax_frag (fragS *fragP ATTRIBUTE_UNUSED, long stretch ATTRIBUTE_UNUSED) { return 0; } @@ -1296,9 +1267,7 @@ frv_relax_frag (fragP, stretch) 0 value. */ int -md_estimate_size_before_relax (fragP, segment) - fragS * fragP; - segT segment ATTRIBUTE_UNUSED; +md_estimate_size_before_relax (fragS *fragP, segT segment ATTRIBUTE_UNUSED) { switch (fragP->fr_subtype) { @@ -1319,10 +1288,9 @@ md_estimate_size_before_relax (fragP, segment) fragP->fr_subtype is the subtype of what the address relaxed to. */ void -md_convert_frag (abfd, sec, fragP) - bfd * abfd ATTRIBUTE_UNUSED; - segT sec ATTRIBUTE_UNUSED; - fragS * fragP; +md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, + segT sec ATTRIBUTE_UNUSED, + fragS *fragP) { switch (fragP->fr_subtype) { @@ -1343,9 +1311,7 @@ md_convert_frag (abfd, sec, fragP) given a PC relative reloc. */ long -md_pcrel_from_section (fixP, sec) - fixS * fixP; - segT sec; +md_pcrel_from_section (fixS *fixP, segT sec) { if (TC_FORCE_RELOCATION (fixP) || (fixP->fx_addsy != (symbolS *) NULL @@ -1366,10 +1332,9 @@ md_pcrel_from_section (fixP, sec) *FIXP may be modified if desired. */ bfd_reloc_code_real_type -md_cgen_lookup_reloc (insn, operand, fixP) - const CGEN_INSN * insn ATTRIBUTE_UNUSED; - const CGEN_OPERAND * operand; - fixS * fixP; +md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED, + const CGEN_OPERAND *operand, + fixS *fixP) { switch (operand->type) { @@ -1418,8 +1383,7 @@ md_cgen_lookup_reloc (insn, operand, fixP) relaxing. */ int -frv_force_relocation (fix) - fixS * fix; +frv_force_relocation (fixS *fix) { switch (fix->fx_r_type < BFD_RELOC_UNUSED ? (int) fix->fx_r_type @@ -1467,10 +1431,7 @@ frv_force_relocation (fix) /* Apply a fixup that could be resolved within the assembler. */ void -md_apply_fix (fixP, valP, seg) - fixS * fixP; - valueT * valP; - segT seg; +md_apply_fix (fixS *fixP, valueT *valP, segT seg) { if (fixP->fx_addsy == 0) switch (fixP->fx_cgen.opinfo) @@ -1549,23 +1510,19 @@ md_apply_fix (fixP, valP, seg) /* Write a value out to the object file, using the appropriate endianness. */ void -frv_md_number_to_chars (buf, val, n) - char * buf; - valueT val; - int n; +frv_md_number_to_chars (char *buf, valueT val, int n) { number_to_chars_bigendian (buf, val, n); } char * -md_atof (int type, char * litP, int * sizeP) +md_atof (int type, char *litP, int *sizeP) { return ieee_md_atof (type, litP, sizeP, TRUE); } bfd_boolean -frv_fix_adjustable (fixP) - fixS * fixP; +frv_fix_adjustable (fixS *fixP) { bfd_reloc_code_real_type reloc_type; @@ -1591,8 +1548,7 @@ frv_fix_adjustable (fixP) /* Allow user to set flags bits. */ void -frv_set_flags (arg) - int arg ATTRIBUTE_UNUSED; +frv_set_flags (int arg ATTRIBUTE_UNUSED) { flagword new_flags = get_absolute_expression (); flagword new_mask = ~ (flagword)0; @@ -1614,8 +1570,7 @@ frv_set_flags (arg) BFD_RELOC_32 at that time. */ void -frv_pic_ptr (nbytes) - int nbytes; +frv_pic_ptr (int nbytes) { expressionS exp; char *p; @@ -1694,10 +1649,7 @@ frv_pic_ptr (nbytes) not possible, issue an error. */ static void -frv_frob_file_section (abfd, sec, ptr) - bfd *abfd; - asection *sec; - PTR ptr ATTRIBUTE_UNUSED; +frv_frob_file_section (bfd *abfd, asection *sec, void *ptr ATTRIBUTE_UNUSED) { segment_info_type *seginfo = seg_info (sec); fixS *fixp; @@ -1839,14 +1791,13 @@ frv_frob_file_section (abfd, sec, ptr) for any relocations that pic won't support. */ void -frv_frob_file () +frv_frob_file (void) { - bfd_map_over_sections (stdoutput, frv_frob_file_section, (PTR)0); + bfd_map_over_sections (stdoutput, frv_frob_file_section, (void *) 0); } void -frv_frob_label (this_label) - symbolS *this_label; +frv_frob_label (symbolS *this_label) { struct vliw_insn_list *vliw_insn_list_entry; @@ -1862,14 +1813,13 @@ frv_frob_label (this_label) } fixS * -frv_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) - fragS * frag; - int where; - const CGEN_INSN * insn; - int length; - const CGEN_OPERAND * operand; - int opinfo; - expressionS * exp; +frv_cgen_record_fixup_exp (fragS *frag, + int where, + const CGEN_INSN *insn, + int length, + const CGEN_OPERAND *operand, + int opinfo, + expressionS *exp) { fixS * fixP = gas_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp); diff --git a/gas/config/tc-frv.h b/gas/config/tc-frv.h index 9718a3b..ad7eee0 100644 --- a/gas/config/tc-frv.h +++ b/gas/config/tc-frv.h @@ -1,5 +1,5 @@ /* tc-frv.h -- Header file for tc-frv.c. - Copyright 2002, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright 2002, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -42,21 +42,21 @@ extern bfd_boolean frv_md_fdpic_enabled (void); /* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 -extern void frv_tomcat_workaround PARAMS ((void)); +extern void frv_tomcat_workaround (void); #define md_cleanup frv_tomcat_workaround #define md_number_to_chars frv_md_number_to_chars -extern long frv_relax_frag PARAMS ((fragS *, long)); +extern long frv_relax_frag (fragS *, long); #define md_relax_frag(segment, fragP, stretch) frv_relax_frag(fragP, stretch) #define tc_fix_adjustable(FIX) frv_fix_adjustable (FIX) struct fix; -extern bfd_boolean frv_fix_adjustable PARAMS ((struct fix *)); +extern bfd_boolean frv_fix_adjustable (struct fix *); /* When relaxing, we need to emit various relocs we otherwise wouldn't. */ #define TC_FORCE_RELOCATION(fix) frv_force_relocation (fix) -extern int frv_force_relocation PARAMS ((struct fix *)); +extern int frv_force_relocation (struct fix *); /* If we simplify subtractions that aren't SUB_SAME or SUB_ABS, we end up with PCrel fixups, but since we don't have any PCrel relocs, we @@ -66,7 +66,7 @@ extern int frv_force_relocation PARAMS ((struct fix *)); #undef GAS_CGEN_MAX_FIXUPS #define GAS_CGEN_MAX_FIXUPS 1 -void frv_frob_label PARAMS ((symbolS *)); +void frv_frob_label (symbolS *); #define tc_frob_label(sym) frv_frob_label(sym) #define tc_gen_reloc gas_cgen_tc_gen_reloc @@ -75,12 +75,12 @@ void frv_frob_label PARAMS ((symbolS *)); /* Call md_pcrel_from_section(), not md_pcrel_from(). */ #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC) -extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); +extern long md_pcrel_from_section (struct fix *, segT); /* After all of the symbols have been adjusted, go over the file looking for any relocations that pic won't support. */ #define tc_frob_file() frv_frob_file () -extern void frv_frob_file PARAMS ((void)); +extern void frv_frob_file (void); /* We don't want 0x00 for code alignment because this generates `add.p gr0, gr0, gr0' patterns. Although it's fine as a nop instruction, diff --git a/gas/config/tc-hppa.h b/gas/config/tc-hppa.h index 6af5c05..bf5b27f 100644 --- a/gas/config/tc-hppa.h +++ b/gas/config/tc-hppa.h @@ -1,6 +1,6 @@ /* tc-hppa.h -- Header file for the PA Copyright 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -198,7 +198,7 @@ void elf_hppa_final_processing (void); int hppa_force_reg_syms_absolute (expressionS *, operatorT, expressionS *); -#define TC_FIX_TYPE PTR +#define TC_FIX_TYPE void * #define TC_INIT_FIX_DATA(FIX) ((FIX)->tc_fix_data = NULL) #ifdef OBJ_ELF diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index ce3ce9b..97bdcb8 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2010,7 +2010,7 @@ md_begin () core_optab->end = optab; hash_err = hash_insert (op_hash, (optab - 1)->name, - (PTR) core_optab); + (void *) core_optab); if (hash_err) { as_fatal (_("Internal Error: Can't hash %s: %s"), @@ -2033,7 +2033,7 @@ md_begin () for (regtab = i386_regtab; regtab_size--; regtab++) { - hash_err = hash_insert (reg_hash, regtab->reg_name, (PTR) regtab); + hash_err = hash_insert (reg_hash, regtab->reg_name, (void *) regtab); if (hash_err) as_fatal (_("Internal Error: Can't hash %s: %s"), regtab->reg_name, diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c index b2ba1ec..b6ff7bc 100644 --- a/gas/config/tc-i860.c +++ b/gas/config/tc-i860.c @@ -1,6 +1,6 @@ /* tc-i860.c -- Assembler for the Intel i860 architecture. Copyright 1989, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, - 2003, 2006, 2007 Free Software Foundation, Inc. + 2003, 2006, 2007, 2008 Free Software Foundation, Inc. Brought back from the dead and completely reworked by Jason Eckhardt <jle@cygnus.com>. @@ -221,7 +221,7 @@ md_begin (void) while (i860_opcodes[i].name != NULL) { const char *name = i860_opcodes[i].name; - retval = hash_insert (op_hash, name, (PTR)&i860_opcodes[i]); + retval = hash_insert (op_hash, name, (void *) &i860_opcodes[i]); if (retval != NULL) { fprintf (stderr, _("internal error: can't hash `%s': %s\n"), diff --git a/gas/config/tc-i960.h b/gas/config/tc-i960.h index b50b779..521f4a4 100644 --- a/gas/config/tc-i960.h +++ b/gas/config/tc-i960.h @@ -1,6 +1,6 @@ /* tc-i960.h - Basic 80960 instruction formats. Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2007 + 2000, 2001, 2002, 2003, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -131,7 +131,7 @@ struct relocation_info /* reloc_callj() may replace a 'call' with a 'calls' or a 'bal', in which cases it modifies *fixP as appropriate. In the case of a 'calls', no further work is required. */ -extern int reloc_callj PARAMS ((struct fix *)); +extern int reloc_callj (struct fix *); #define TC_FORCE_RELOCATION_ABS(FIX) \ (TC_FORCE_RELOCATION (FIX) \ @@ -155,7 +155,7 @@ extern int reloc_callj PARAMS ((struct fix *)); } #endif -extern int i960_validate_fix PARAMS ((struct fix *, segT)); +extern int i960_validate_fix (struct fix *, segT); #define TC_VALIDATE_FIX(FIX,SEGTYPE,LABEL) \ if (!i960_validate_fix (FIX, SEGTYPE)) goto LABEL @@ -169,14 +169,14 @@ extern int i960_validate_fix PARAMS ((struct fix *, segT)); #define MD_APPLY_SYM_VALUE(FIX) 0 #endif -extern void brtab_emit PARAMS ((void)); +extern void brtab_emit (void); #define md_end() brtab_emit () -extern void tc_set_bal_of_call PARAMS ((symbolS *, symbolS *)); +extern void tc_set_bal_of_call (symbolS *, symbolS *); -extern struct symbol *tc_get_bal_of_call PARAMS ((symbolS *)); +extern struct symbol *tc_get_bal_of_call (symbolS *); -extern void i960_handle_align PARAMS ((struct frag *)); +extern void i960_handle_align (struct frag *); #define HANDLE_ALIGN(FRAG) i960_handle_align (FRAG) #define NO_RELOC -1 diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index e447021..e31bd26 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -167,14 +167,12 @@ extern int target_big_endian; /* This is the default endianness. */ static int default_big_endian = TARGET_BYTES_BIG_ENDIAN; -void (*ia64_number_to_chars) PARAMS ((char *, valueT, int)); +void (*ia64_number_to_chars) (char *, valueT, int); -static void ia64_float_to_chars_bigendian - PARAMS ((char *, LITTLENUM_TYPE *, int)); -static void ia64_float_to_chars_littleendian - PARAMS ((char *, LITTLENUM_TYPE *, int)); -static void (*ia64_float_to_chars) - PARAMS ((char *, LITTLENUM_TYPE *, int)); +static void ia64_float_to_chars_bigendian (char *, LITTLENUM_TYPE *, int); +static void ia64_float_to_chars_littleendian (char *, LITTLENUM_TYPE *, int); + +static void (*ia64_float_to_chars) (char *, LITTLENUM_TYPE *, int); static struct hash_control *alias_hash; static struct hash_control *alias_name_hash; @@ -776,211 +774,26 @@ static struct #define ENCODED_PSP_OFFSET(OFFSET) (((OFFSET) + 16) / 4) -typedef void (*vbyte_func) PARAMS ((int, char *, char *)); +typedef void (*vbyte_func) (int, char *, char *); /* Forward declarations: */ -static void set_section PARAMS ((char *name)); -static unsigned int set_regstack PARAMS ((unsigned int, unsigned int, - unsigned int, unsigned int)); -static void dot_align (int); -static void dot_radix PARAMS ((int)); -static void dot_special_section PARAMS ((int)); -static void dot_proc PARAMS ((int)); -static void dot_fframe PARAMS ((int)); -static void dot_vframe PARAMS ((int)); -static void dot_vframesp PARAMS ((int)); -static void dot_save PARAMS ((int)); -static void dot_restore PARAMS ((int)); -static void dot_restorereg PARAMS ((int)); -static void dot_handlerdata PARAMS ((int)); -static void dot_unwentry PARAMS ((int)); -static void dot_altrp PARAMS ((int)); -static void dot_savemem PARAMS ((int)); -static void dot_saveg PARAMS ((int)); -static void dot_savef PARAMS ((int)); -static void dot_saveb PARAMS ((int)); -static void dot_savegf PARAMS ((int)); -static void dot_spill PARAMS ((int)); -static void dot_spillreg PARAMS ((int)); -static void dot_spillmem PARAMS ((int)); -static void dot_label_state PARAMS ((int)); -static void dot_copy_state PARAMS ((int)); -static void dot_unwabi PARAMS ((int)); -static void dot_personality PARAMS ((int)); -static void dot_body PARAMS ((int)); -static void dot_prologue PARAMS ((int)); -static void dot_endp PARAMS ((int)); -static void dot_template PARAMS ((int)); -static void dot_regstk PARAMS ((int)); -static void dot_rot PARAMS ((int)); -static void dot_byteorder PARAMS ((int)); -static void dot_psr PARAMS ((int)); -static void dot_alias PARAMS ((int)); -static void dot_ln PARAMS ((int)); -static void cross_section PARAMS ((int ref, void (*cons) PARAMS((int)), int ua)); -static void dot_xdata PARAMS ((int)); -static void stmt_float_cons PARAMS ((int)); -static void stmt_cons_ua PARAMS ((int)); -static void dot_xfloat_cons PARAMS ((int)); -static void dot_xstringer PARAMS ((int)); -static void dot_xdata_ua PARAMS ((int)); -static void dot_xfloat_cons_ua PARAMS ((int)); -static void print_prmask PARAMS ((valueT mask)); -static void dot_pred_rel PARAMS ((int)); -static void dot_reg_val PARAMS ((int)); -static void dot_serialize PARAMS ((int)); -static void dot_dv_mode PARAMS ((int)); -static void dot_entry PARAMS ((int)); -static void dot_mem_offset PARAMS ((int)); -static void add_unwind_entry PARAMS((unw_rec_list *, int)); -static symbolS *declare_register PARAMS ((const char *name, unsigned int regnum)); -static void declare_register_set PARAMS ((const char *, unsigned int, unsigned int)); -static unsigned int operand_width PARAMS ((enum ia64_opnd)); -static enum operand_match_result operand_match PARAMS ((const struct ia64_opcode *idesc, - int index, - expressionS *e)); -static int parse_operand PARAMS ((expressionS *, int)); -static struct ia64_opcode * parse_operands PARAMS ((struct ia64_opcode *)); -static void build_insn PARAMS ((struct slot *, bfd_vma *)); -static void emit_one_bundle PARAMS ((void)); -static void fix_insn PARAMS ((fixS *, const struct ia64_operand *, valueT)); -static bfd_reloc_code_real_type ia64_gen_real_reloc_type PARAMS ((struct symbol *sym, - bfd_reloc_code_real_type r_type)); -static void insn_group_break PARAMS ((int, int, int)); -static void mark_resource PARAMS ((struct ia64_opcode *, const struct ia64_dependency *, - struct rsrc *, int depind, int path)); -static void add_qp_mutex PARAMS((valueT mask)); -static void add_qp_imply PARAMS((int p1, int p2)); -static void clear_qp_branch_flag PARAMS((valueT mask)); -static void clear_qp_mutex PARAMS((valueT mask)); -static void clear_qp_implies PARAMS((valueT p1_mask, valueT p2_mask)); -static int has_suffix_p PARAMS((const char *, const char *)); -static void clear_register_values PARAMS ((void)); -static void print_dependency PARAMS ((const char *action, int depind)); -static void instruction_serialization PARAMS ((void)); -static void data_serialization PARAMS ((void)); -static void remove_marked_resource PARAMS ((struct rsrc *)); -static int is_conditional_branch PARAMS ((struct ia64_opcode *)); -static int is_taken_branch PARAMS ((struct ia64_opcode *)); -static int is_interruption_or_rfi PARAMS ((struct ia64_opcode *)); -static int depends_on PARAMS ((int, struct ia64_opcode *)); -static int specify_resource PARAMS ((const struct ia64_dependency *, - struct ia64_opcode *, int, struct rsrc [], int, int)); -static int check_dv PARAMS((struct ia64_opcode *idesc)); -static void check_dependencies PARAMS((struct ia64_opcode *)); -static void mark_resources PARAMS((struct ia64_opcode *)); -static void update_dependencies PARAMS((struct ia64_opcode *)); -static void note_register_values PARAMS((struct ia64_opcode *)); -static int qp_mutex PARAMS ((int, int, int)); -static int resources_match PARAMS ((struct rsrc *, struct ia64_opcode *, int, int, int)); -static void output_vbyte_mem PARAMS ((int, char *, char *)); -static void count_output PARAMS ((int, char *, char *)); -static void output_R1_format PARAMS ((vbyte_func, unw_record_type, int)); -static void output_R2_format PARAMS ((vbyte_func, int, int, unsigned long)); -static void output_R3_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); -static void output_P1_format PARAMS ((vbyte_func, int)); -static void output_P2_format PARAMS ((vbyte_func, int, int)); -static void output_P3_format PARAMS ((vbyte_func, unw_record_type, int)); -static void output_P4_format PARAMS ((vbyte_func, unsigned char *, unsigned long)); -static void output_P5_format PARAMS ((vbyte_func, int, unsigned long)); -static void output_P6_format PARAMS ((vbyte_func, unw_record_type, int)); -static void output_P7_format PARAMS ((vbyte_func, unw_record_type, unsigned long, unsigned long)); -static void output_P8_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); -static void output_P9_format PARAMS ((vbyte_func, int, int)); -static void output_P10_format PARAMS ((vbyte_func, int, int)); -static void output_B1_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); -static void output_B2_format PARAMS ((vbyte_func, unsigned long, unsigned long)); -static void output_B3_format PARAMS ((vbyte_func, unsigned long, unsigned long)); -static void output_B4_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); -static char format_ab_reg PARAMS ((int, int)); -static void output_X1_format PARAMS ((vbyte_func, unw_record_type, int, int, unsigned long, - unsigned long)); -static void output_X2_format PARAMS ((vbyte_func, int, int, int, int, int, unsigned long)); -static void output_X3_format PARAMS ((vbyte_func, unw_record_type, int, int, int, unsigned long, - unsigned long)); -static void output_X4_format PARAMS ((vbyte_func, int, int, int, int, int, int, unsigned long)); -static unw_rec_list *output_endp PARAMS ((void)); -static unw_rec_list *output_prologue PARAMS ((void)); -static unw_rec_list *output_prologue_gr PARAMS ((unsigned int, unsigned int)); -static unw_rec_list *output_body PARAMS ((void)); -static unw_rec_list *output_mem_stack_f PARAMS ((unsigned int)); -static unw_rec_list *output_mem_stack_v PARAMS ((void)); -static unw_rec_list *output_psp_gr PARAMS ((unsigned int)); -static unw_rec_list *output_psp_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_rp_when PARAMS ((void)); -static unw_rec_list *output_rp_gr PARAMS ((unsigned int)); -static unw_rec_list *output_rp_br PARAMS ((unsigned int)); -static unw_rec_list *output_rp_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_rp_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_pfs_when PARAMS ((void)); -static unw_rec_list *output_pfs_gr PARAMS ((unsigned int)); -static unw_rec_list *output_pfs_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_pfs_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_preds_when PARAMS ((void)); -static unw_rec_list *output_preds_gr PARAMS ((unsigned int)); -static unw_rec_list *output_preds_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_preds_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_fr_mem PARAMS ((unsigned int)); -static unw_rec_list *output_frgr_mem PARAMS ((unsigned int, unsigned int)); -static unw_rec_list *output_gr_gr PARAMS ((unsigned int, unsigned int)); -static unw_rec_list *output_gr_mem PARAMS ((unsigned int)); -static unw_rec_list *output_br_mem PARAMS ((unsigned int)); -static unw_rec_list *output_br_gr PARAMS ((unsigned int, unsigned int)); -static unw_rec_list *output_spill_base PARAMS ((unsigned int)); -static unw_rec_list *output_unat_when PARAMS ((void)); -static unw_rec_list *output_unat_gr PARAMS ((unsigned int)); -static unw_rec_list *output_unat_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_unat_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_lc_when PARAMS ((void)); -static unw_rec_list *output_lc_gr PARAMS ((unsigned int)); -static unw_rec_list *output_lc_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_lc_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_fpsr_when PARAMS ((void)); -static unw_rec_list *output_fpsr_gr PARAMS ((unsigned int)); -static unw_rec_list *output_fpsr_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_fpsr_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_priunat_when_gr PARAMS ((void)); -static unw_rec_list *output_priunat_when_mem PARAMS ((void)); -static unw_rec_list *output_priunat_gr PARAMS ((unsigned int)); -static unw_rec_list *output_priunat_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_priunat_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_bsp_when PARAMS ((void)); -static unw_rec_list *output_bsp_gr PARAMS ((unsigned int)); -static unw_rec_list *output_bsp_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_bsp_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_bspstore_when PARAMS ((void)); -static unw_rec_list *output_bspstore_gr PARAMS ((unsigned int)); -static unw_rec_list *output_bspstore_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_bspstore_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_rnat_when PARAMS ((void)); -static unw_rec_list *output_rnat_gr PARAMS ((unsigned int)); -static unw_rec_list *output_rnat_psprel PARAMS ((unsigned int)); -static unw_rec_list *output_rnat_sprel PARAMS ((unsigned int)); -static unw_rec_list *output_unwabi PARAMS ((unsigned long, unsigned long)); -static unw_rec_list *output_epilogue PARAMS ((unsigned long)); -static unw_rec_list *output_label_state PARAMS ((unsigned long)); -static unw_rec_list *output_copy_state PARAMS ((unsigned long)); -static unw_rec_list *output_spill_psprel PARAMS ((unsigned int, unsigned int, unsigned int, - unsigned int)); -static unw_rec_list *output_spill_sprel PARAMS ((unsigned int, unsigned int, unsigned int, - unsigned int)); -static unw_rec_list *output_spill_reg PARAMS ((unsigned int, unsigned int, unsigned int, - unsigned int, unsigned int)); -static void process_one_record PARAMS ((unw_rec_list *, vbyte_func)); -static void process_unw_records PARAMS ((unw_rec_list *, vbyte_func)); -static int calc_record_size PARAMS ((unw_rec_list *)); -static void set_imask PARAMS ((unw_rec_list *, unsigned long, unsigned long, unsigned int)); -static unsigned long slot_index PARAMS ((unsigned long, fragS *, - unsigned long, fragS *, - int)); -static unw_rec_list *optimize_unw_records PARAMS ((unw_rec_list *)); -static void fixup_unw_records PARAMS ((unw_rec_list *, int)); -static int parse_predicate_and_operand PARAMS ((expressionS *, unsigned *, const char *)); -static void convert_expr_to_ab_reg PARAMS ((const expressionS *, unsigned int *, unsigned int *, const char *, int)); -static void convert_expr_to_xy_reg PARAMS ((const expressionS *, unsigned int *, unsigned int *, const char *, int)); -static unsigned int get_saved_prologue_count PARAMS ((unsigned long)); -static void save_prologue_count PARAMS ((unsigned long, unsigned int)); -static void free_saved_prologue_counts PARAMS ((void)); +static void dot_alias (int); +static int parse_operand (expressionS *, int); +static void emit_one_bundle (void); +static bfd_reloc_code_real_type ia64_gen_real_reloc_type (struct symbol *, + bfd_reloc_code_real_type); +static void insn_group_break (int, int, int); +static void add_qp_mutex (valueT); +static void add_qp_imply (int, int); +static void clear_qp_mutex (valueT); +static void clear_qp_implies (valueT, valueT); +static void print_dependency (const char *, int); +static void instruction_serialization (void); +static void data_serialization (void); +static void output_R3_format (vbyte_func, unw_record_type, unsigned long); +static void output_B3_format (vbyte_func, unsigned long, unsigned long); +static void output_B4_format (vbyte_func, unw_record_type, unsigned long); +static void free_saved_prologue_counts (void); /* Determine if application register REGNUM resides only in the integer unit (as opposed to the memory unit). */ @@ -1005,8 +818,7 @@ ar_is_only_in_memory_unit (int reg) don't see any other way to accomplish the same thing without changing obj-elf.c (which may be the Right Thing, in the end). */ static void -set_section (name) - char *name; +set_section (char *name) { char *saved_input_line_pointer; @@ -1019,9 +831,7 @@ set_section (name) /* Map 's' to SHF_IA_64_SHORT. */ int -ia64_elf_section_letter (letter, ptr_msg) - int letter; - char **ptr_msg; +ia64_elf_section_letter (int letter, char **ptr_msg) { if (letter == 's') return SHF_IA_64_SHORT; @@ -1035,9 +845,9 @@ ia64_elf_section_letter (letter, ptr_msg) /* Map SHF_IA_64_SHORT to SEC_SMALL_DATA. */ flagword -ia64_elf_section_flags (flags, attr, type) - flagword flags; - int attr, type ATTRIBUTE_UNUSED; +ia64_elf_section_flags (flagword flags, + int attr, + int type ATTRIBUTE_UNUSED) { if (attr & SHF_IA_64_SHORT) flags |= SEC_SMALL_DATA; @@ -1045,9 +855,7 @@ ia64_elf_section_flags (flags, attr, type) } int -ia64_elf_section_type (str, len) - const char *str; - size_t len; +ia64_elf_section_type (const char *str, size_t len) { #define STREQ(s) ((len == sizeof (s) - 1) && (strncmp (str, s, sizeof (s) - 1) == 0)) @@ -1071,8 +879,10 @@ ia64_elf_section_type (str, len) } static unsigned int -set_regstack (ins, locs, outs, rots) - unsigned int ins, locs, outs, rots; +set_regstack (unsigned int ins, + unsigned int locs, + unsigned int outs, + unsigned int rots) { /* Size of frame. */ unsigned int sof; @@ -1100,7 +910,7 @@ set_regstack (ins, locs, outs, rots) } void -ia64_flush_insns () +ia64_flush_insns (void) { struct label_fix *lfix; segT saved_seg; @@ -1195,8 +1005,7 @@ ia64_do_align (int nbytes) } void -ia64_cons_align (nbytes) - int nbytes; +ia64_cons_align (int nbytes) { if (md.auto_align) { @@ -1210,11 +1019,8 @@ ia64_cons_align (nbytes) /* Output COUNT bytes to a memory location. */ static char *vbyte_mem_ptr = NULL; -void -output_vbyte_mem (count, ptr, comment) - int count; - char *ptr; - char *comment ATTRIBUTE_UNUSED; +static void +output_vbyte_mem (int count, char *ptr, char *comment ATTRIBUTE_UNUSED) { int x; if (vbyte_mem_ptr == NULL) @@ -1228,20 +1034,16 @@ output_vbyte_mem (count, ptr, comment) /* Count the number of bytes required for records. */ static int vbyte_count = 0; -void -count_output (count, ptr, comment) - int count; - char *ptr ATTRIBUTE_UNUSED; - char *comment ATTRIBUTE_UNUSED; +static void +count_output (int count, + char *ptr ATTRIBUTE_UNUSED, + char *comment ATTRIBUTE_UNUSED) { vbyte_count += count; } static void -output_R1_format (f, rtype, rlen) - vbyte_func f; - unw_record_type rtype; - int rlen; +output_R1_format (vbyte_func f, unw_record_type rtype, int rlen) { int r = 0; char byte; @@ -1261,10 +1063,7 @@ output_R1_format (f, rtype, rlen) } static void -output_R2_format (f, mask, grsave, rlen) - vbyte_func f; - int mask, grsave; - unsigned long rlen; +output_R2_format (vbyte_func f, int mask, int grsave, unsigned long rlen) { char bytes[20]; int count = 2; @@ -1278,10 +1077,7 @@ output_R2_format (f, mask, grsave, rlen) } static void -output_R3_format (f, rtype, rlen) - vbyte_func f; - unw_record_type rtype; - unsigned long rlen; +output_R3_format (vbyte_func f, unw_record_type rtype, unsigned long rlen) { int r = 0, count; char bytes[20]; @@ -1301,9 +1097,7 @@ output_R3_format (f, rtype, rlen) } static void -output_P1_format (f, brmask) - vbyte_func f; - int brmask; +output_P1_format (vbyte_func f, int brmask) { char byte; byte = UNW_P1 | (brmask & 0x1f); @@ -1311,10 +1105,7 @@ output_P1_format (f, brmask) } static void -output_P2_format (f, brmask, gr) - vbyte_func f; - int brmask; - int gr; +output_P2_format (vbyte_func f, int brmask, int gr) { char bytes[2]; brmask = (brmask & 0x1f); @@ -1324,10 +1115,7 @@ output_P2_format (f, brmask, gr) } static void -output_P3_format (f, rtype, reg) - vbyte_func f; - unw_record_type rtype; - int reg; +output_P3_format (vbyte_func f, unw_record_type rtype, int reg) { char bytes[2]; int r = 0; @@ -1379,20 +1167,14 @@ output_P3_format (f, rtype, reg) } static void -output_P4_format (f, imask, imask_size) - vbyte_func f; - unsigned char *imask; - unsigned long imask_size; +output_P4_format (vbyte_func f, unsigned char *imask, unsigned long imask_size) { imask[0] = UNW_P4; (*f) (imask_size, (char *) imask, NULL); } static void -output_P5_format (f, grmask, frmask) - vbyte_func f; - int grmask; - unsigned long frmask; +output_P5_format (vbyte_func f, int grmask, unsigned long frmask) { char bytes[4]; grmask = (grmask & 0x0f); @@ -1405,10 +1187,7 @@ output_P5_format (f, grmask, frmask) } static void -output_P6_format (f, rtype, rmask) - vbyte_func f; - unw_record_type rtype; - int rmask; +output_P6_format (vbyte_func f, unw_record_type rtype, int rmask) { char byte; int r = 0; @@ -1422,11 +1201,10 @@ output_P6_format (f, rtype, rmask) } static void -output_P7_format (f, rtype, w1, w2) - vbyte_func f; - unw_record_type rtype; - unsigned long w1; - unsigned long w2; +output_P7_format (vbyte_func f, + unw_record_type rtype, + unsigned long w1, + unsigned long w2) { char bytes[20]; int count = 1; @@ -1491,10 +1269,7 @@ output_P7_format (f, rtype, w1, w2) } static void -output_P8_format (f, rtype, t) - vbyte_func f; - unw_record_type rtype; - unsigned long t; +output_P8_format (vbyte_func f, unw_record_type rtype, unsigned long t) { char bytes[20]; int r = 0; @@ -1568,10 +1343,7 @@ output_P8_format (f, rtype, t) } static void -output_P9_format (f, grmask, gr) - vbyte_func f; - int grmask; - int gr; +output_P9_format (vbyte_func f, int grmask, int gr) { char bytes[3]; bytes[0] = UNW_P9; @@ -1581,10 +1353,7 @@ output_P9_format (f, grmask, gr) } static void -output_P10_format (f, abi, context) - vbyte_func f; - int abi; - int context; +output_P10_format (vbyte_func f, int abi, int context) { char bytes[3]; bytes[0] = UNW_P10; @@ -1594,10 +1363,7 @@ output_P10_format (f, abi, context) } static void -output_B1_format (f, rtype, label) - vbyte_func f; - unw_record_type rtype; - unsigned long label; +output_B1_format (vbyte_func f, unw_record_type rtype, unsigned long label) { char byte; int r = 0; @@ -1616,10 +1382,7 @@ output_B1_format (f, rtype, label) } static void -output_B2_format (f, ecount, t) - vbyte_func f; - unsigned long ecount; - unsigned long t; +output_B2_format (vbyte_func f, unsigned long ecount, unsigned long t) { char bytes[20]; int count = 1; @@ -1634,10 +1397,7 @@ output_B2_format (f, ecount, t) } static void -output_B3_format (f, ecount, t) - vbyte_func f; - unsigned long ecount; - unsigned long t; +output_B3_format (vbyte_func f, unsigned long ecount, unsigned long t) { char bytes[20]; int count = 1; @@ -1653,10 +1413,7 @@ output_B3_format (f, ecount, t) } static void -output_B4_format (f, rtype, label) - vbyte_func f; - unw_record_type rtype; - unsigned long label; +output_B4_format (vbyte_func f, unw_record_type rtype, unsigned long label) { char bytes[20]; int r = 0; @@ -1678,9 +1435,7 @@ output_B4_format (f, rtype, label) } static char -format_ab_reg (ab, reg) - int ab; - int reg; +format_ab_reg (int ab, int reg) { int ret; ab = (ab & 3); @@ -1690,12 +1445,12 @@ format_ab_reg (ab, reg) } static void -output_X1_format (f, rtype, ab, reg, t, w1) - vbyte_func f; - unw_record_type rtype; - int ab, reg; - unsigned long t; - unsigned long w1; +output_X1_format (vbyte_func f, + unw_record_type rtype, + int ab, + int reg, + unsigned long t, + unsigned long w1) { char bytes[20]; int r = 0; @@ -1713,11 +1468,13 @@ output_X1_format (f, rtype, ab, reg, t, w1) } static void -output_X2_format (f, ab, reg, x, y, treg, t) - vbyte_func f; - int ab, reg; - int x, y, treg; - unsigned long t; +output_X2_format (vbyte_func f, + int ab, + int reg, + int x, + int y, + int treg, + unsigned long t) { char bytes[20]; int count = 3; @@ -1729,13 +1486,13 @@ output_X2_format (f, ab, reg, x, y, treg, t) } static void -output_X3_format (f, rtype, qp, ab, reg, t, w1) - vbyte_func f; - unw_record_type rtype; - int qp; - int ab, reg; - unsigned long t; - unsigned long w1; +output_X3_format (vbyte_func f, + unw_record_type rtype, + int qp, + int ab, + int reg, + unsigned long t, + unsigned long w1) { char bytes[20]; int r = 0; @@ -1754,12 +1511,14 @@ output_X3_format (f, rtype, qp, ab, reg, t, w1) } static void -output_X4_format (f, qp, ab, reg, x, y, treg, t) - vbyte_func f; - int qp; - int ab, reg; - int x, y, treg; - unsigned long t; +output_X4_format (vbyte_func f, + int qp, + int ab, + int reg, + int x, + int y, + int treg, + unsigned long t) { char bytes[20]; int count = 4; @@ -1837,14 +1596,14 @@ alloc_record (unw_record_type t) body region. */ static unw_rec_list * -output_endp () +output_endp (void) { unw_rec_list *ptr = alloc_record (endp); return ptr; } static unw_rec_list * -output_prologue () +output_prologue (void) { unw_rec_list *ptr = alloc_record (prologue); memset (&ptr->r.record.r.mask, 0, sizeof (ptr->r.record.r.mask)); @@ -1852,9 +1611,7 @@ output_prologue () } static unw_rec_list * -output_prologue_gr (saved_mask, reg) - unsigned int saved_mask; - unsigned int reg; +output_prologue_gr (unsigned int saved_mask, unsigned int reg) { unw_rec_list *ptr = alloc_record (prologue_gr); memset (&ptr->r.record.r.mask, 0, sizeof (ptr->r.record.r.mask)); @@ -1864,15 +1621,14 @@ output_prologue_gr (saved_mask, reg) } static unw_rec_list * -output_body () +output_body (void) { unw_rec_list *ptr = alloc_record (body); return ptr; } static unw_rec_list * -output_mem_stack_f (size) - unsigned int size; +output_mem_stack_f (unsigned int size) { unw_rec_list *ptr = alloc_record (mem_stack_f); ptr->r.record.p.size = size; @@ -1880,15 +1636,14 @@ output_mem_stack_f (size) } static unw_rec_list * -output_mem_stack_v () +output_mem_stack_v (void) { unw_rec_list *ptr = alloc_record (mem_stack_v); return ptr; } static unw_rec_list * -output_psp_gr (gr) - unsigned int gr; +output_psp_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (psp_gr); ptr->r.record.p.r.gr = gr; @@ -1896,8 +1651,7 @@ output_psp_gr (gr) } static unw_rec_list * -output_psp_sprel (offset) - unsigned int offset; +output_psp_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (psp_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -1905,15 +1659,14 @@ output_psp_sprel (offset) } static unw_rec_list * -output_rp_when () +output_rp_when (void) { unw_rec_list *ptr = alloc_record (rp_when); return ptr; } static unw_rec_list * -output_rp_gr (gr) - unsigned int gr; +output_rp_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (rp_gr); ptr->r.record.p.r.gr = gr; @@ -1921,8 +1674,7 @@ output_rp_gr (gr) } static unw_rec_list * -output_rp_br (br) - unsigned int br; +output_rp_br (unsigned int br) { unw_rec_list *ptr = alloc_record (rp_br); ptr->r.record.p.r.br = br; @@ -1930,8 +1682,7 @@ output_rp_br (br) } static unw_rec_list * -output_rp_psprel (offset) - unsigned int offset; +output_rp_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (rp_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -1939,8 +1690,7 @@ output_rp_psprel (offset) } static unw_rec_list * -output_rp_sprel (offset) - unsigned int offset; +output_rp_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (rp_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -1948,15 +1698,14 @@ output_rp_sprel (offset) } static unw_rec_list * -output_pfs_when () +output_pfs_when (void) { unw_rec_list *ptr = alloc_record (pfs_when); return ptr; } static unw_rec_list * -output_pfs_gr (gr) - unsigned int gr; +output_pfs_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (pfs_gr); ptr->r.record.p.r.gr = gr; @@ -1964,8 +1713,7 @@ output_pfs_gr (gr) } static unw_rec_list * -output_pfs_psprel (offset) - unsigned int offset; +output_pfs_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (pfs_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -1973,8 +1721,7 @@ output_pfs_psprel (offset) } static unw_rec_list * -output_pfs_sprel (offset) - unsigned int offset; +output_pfs_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (pfs_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -1982,15 +1729,14 @@ output_pfs_sprel (offset) } static unw_rec_list * -output_preds_when () +output_preds_when (void) { unw_rec_list *ptr = alloc_record (preds_when); return ptr; } static unw_rec_list * -output_preds_gr (gr) - unsigned int gr; +output_preds_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (preds_gr); ptr->r.record.p.r.gr = gr; @@ -1998,8 +1744,7 @@ output_preds_gr (gr) } static unw_rec_list * -output_preds_psprel (offset) - unsigned int offset; +output_preds_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (preds_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -2007,8 +1752,7 @@ output_preds_psprel (offset) } static unw_rec_list * -output_preds_sprel (offset) - unsigned int offset; +output_preds_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (preds_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -2016,8 +1760,7 @@ output_preds_sprel (offset) } static unw_rec_list * -output_fr_mem (mask) - unsigned int mask; +output_fr_mem (unsigned int mask) { unw_rec_list *ptr = alloc_record (fr_mem); unw_rec_list *cur = ptr; @@ -2041,9 +1784,7 @@ output_fr_mem (mask) } static unw_rec_list * -output_frgr_mem (gr_mask, fr_mask) - unsigned int gr_mask; - unsigned int fr_mask; +output_frgr_mem (unsigned int gr_mask, unsigned int fr_mask) { unw_rec_list *ptr = alloc_record (frgr_mem); unw_rec_list *cur = ptr; @@ -2082,9 +1823,7 @@ output_frgr_mem (gr_mask, fr_mask) } static unw_rec_list * -output_gr_gr (mask, reg) - unsigned int mask; - unsigned int reg; +output_gr_gr (unsigned int mask, unsigned int reg) { unw_rec_list *ptr = alloc_record (gr_gr); unw_rec_list *cur = ptr; @@ -2111,8 +1850,7 @@ output_gr_gr (mask, reg) } static unw_rec_list * -output_gr_mem (mask) - unsigned int mask; +output_gr_mem (unsigned int mask) { unw_rec_list *ptr = alloc_record (gr_mem); unw_rec_list *cur = ptr; @@ -2160,9 +1898,7 @@ output_br_mem (unsigned int mask) } static unw_rec_list * -output_br_gr (mask, reg) - unsigned int mask; - unsigned int reg; +output_br_gr (unsigned int mask, unsigned int reg) { unw_rec_list *ptr = alloc_record (br_gr); unw_rec_list *cur = ptr; @@ -2189,8 +1925,7 @@ output_br_gr (mask, reg) } static unw_rec_list * -output_spill_base (offset) - unsigned int offset; +output_spill_base (unsigned int offset) { unw_rec_list *ptr = alloc_record (spill_base); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -2198,15 +1933,14 @@ output_spill_base (offset) } static unw_rec_list * -output_unat_when () +output_unat_when (void) { unw_rec_list *ptr = alloc_record (unat_when); return ptr; } static unw_rec_list * -output_unat_gr (gr) - unsigned int gr; +output_unat_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (unat_gr); ptr->r.record.p.r.gr = gr; @@ -2214,8 +1948,7 @@ output_unat_gr (gr) } static unw_rec_list * -output_unat_psprel (offset) - unsigned int offset; +output_unat_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (unat_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -2223,8 +1956,7 @@ output_unat_psprel (offset) } static unw_rec_list * -output_unat_sprel (offset) - unsigned int offset; +output_unat_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (unat_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -2232,15 +1964,14 @@ output_unat_sprel (offset) } static unw_rec_list * -output_lc_when () +output_lc_when (void) { unw_rec_list *ptr = alloc_record (lc_when); return ptr; } static unw_rec_list * -output_lc_gr (gr) - unsigned int gr; +output_lc_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (lc_gr); ptr->r.record.p.r.gr = gr; @@ -2248,8 +1979,7 @@ output_lc_gr (gr) } static unw_rec_list * -output_lc_psprel (offset) - unsigned int offset; +output_lc_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (lc_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -2257,8 +1987,7 @@ output_lc_psprel (offset) } static unw_rec_list * -output_lc_sprel (offset) - unsigned int offset; +output_lc_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (lc_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -2266,15 +1995,14 @@ output_lc_sprel (offset) } static unw_rec_list * -output_fpsr_when () +output_fpsr_when (void) { unw_rec_list *ptr = alloc_record (fpsr_when); return ptr; } static unw_rec_list * -output_fpsr_gr (gr) - unsigned int gr; +output_fpsr_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (fpsr_gr); ptr->r.record.p.r.gr = gr; @@ -2282,8 +2010,7 @@ output_fpsr_gr (gr) } static unw_rec_list * -output_fpsr_psprel (offset) - unsigned int offset; +output_fpsr_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (fpsr_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -2291,8 +2018,7 @@ output_fpsr_psprel (offset) } static unw_rec_list * -output_fpsr_sprel (offset) - unsigned int offset; +output_fpsr_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (fpsr_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -2300,22 +2026,21 @@ output_fpsr_sprel (offset) } static unw_rec_list * -output_priunat_when_gr () +output_priunat_when_gr (void) { unw_rec_list *ptr = alloc_record (priunat_when_gr); return ptr; } static unw_rec_list * -output_priunat_when_mem () +output_priunat_when_mem (void) { unw_rec_list *ptr = alloc_record (priunat_when_mem); return ptr; } static unw_rec_list * -output_priunat_gr (gr) - unsigned int gr; +output_priunat_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (priunat_gr); ptr->r.record.p.r.gr = gr; @@ -2323,8 +2048,7 @@ output_priunat_gr (gr) } static unw_rec_list * -output_priunat_psprel (offset) - unsigned int offset; +output_priunat_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (priunat_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -2332,8 +2056,7 @@ output_priunat_psprel (offset) } static unw_rec_list * -output_priunat_sprel (offset) - unsigned int offset; +output_priunat_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (priunat_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -2341,15 +2064,14 @@ output_priunat_sprel (offset) } static unw_rec_list * -output_bsp_when () +output_bsp_when (void) { unw_rec_list *ptr = alloc_record (bsp_when); return ptr; } static unw_rec_list * -output_bsp_gr (gr) - unsigned int gr; +output_bsp_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (bsp_gr); ptr->r.record.p.r.gr = gr; @@ -2357,8 +2079,7 @@ output_bsp_gr (gr) } static unw_rec_list * -output_bsp_psprel (offset) - unsigned int offset; +output_bsp_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (bsp_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -2366,8 +2087,7 @@ output_bsp_psprel (offset) } static unw_rec_list * -output_bsp_sprel (offset) - unsigned int offset; +output_bsp_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (bsp_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -2375,15 +2095,14 @@ output_bsp_sprel (offset) } static unw_rec_list * -output_bspstore_when () +output_bspstore_when (void) { unw_rec_list *ptr = alloc_record (bspstore_when); return ptr; } static unw_rec_list * -output_bspstore_gr (gr) - unsigned int gr; +output_bspstore_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (bspstore_gr); ptr->r.record.p.r.gr = gr; @@ -2391,8 +2110,7 @@ output_bspstore_gr (gr) } static unw_rec_list * -output_bspstore_psprel (offset) - unsigned int offset; +output_bspstore_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (bspstore_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -2400,8 +2118,7 @@ output_bspstore_psprel (offset) } static unw_rec_list * -output_bspstore_sprel (offset) - unsigned int offset; +output_bspstore_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (bspstore_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -2409,15 +2126,14 @@ output_bspstore_sprel (offset) } static unw_rec_list * -output_rnat_when () +output_rnat_when (void) { unw_rec_list *ptr = alloc_record (rnat_when); return ptr; } static unw_rec_list * -output_rnat_gr (gr) - unsigned int gr; +output_rnat_gr (unsigned int gr) { unw_rec_list *ptr = alloc_record (rnat_gr); ptr->r.record.p.r.gr = gr; @@ -2425,8 +2141,7 @@ output_rnat_gr (gr) } static unw_rec_list * -output_rnat_psprel (offset) - unsigned int offset; +output_rnat_psprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (rnat_psprel); ptr->r.record.p.off.psp = ENCODED_PSP_OFFSET (offset); @@ -2434,8 +2149,7 @@ output_rnat_psprel (offset) } static unw_rec_list * -output_rnat_sprel (offset) - unsigned int offset; +output_rnat_sprel (unsigned int offset) { unw_rec_list *ptr = alloc_record (rnat_sprel); ptr->r.record.p.off.sp = offset / 4; @@ -2443,9 +2157,7 @@ output_rnat_sprel (offset) } static unw_rec_list * -output_unwabi (abi, context) - unsigned long abi; - unsigned long context; +output_unwabi (unsigned long abi, unsigned long context) { unw_rec_list *ptr = alloc_record (unwabi); ptr->r.record.p.abi = abi; @@ -2478,11 +2190,10 @@ output_copy_state (unsigned long label) } static unw_rec_list * -output_spill_psprel (ab, reg, offset, predicate) - unsigned int ab; - unsigned int reg; - unsigned int offset; - unsigned int predicate; +output_spill_psprel (unsigned int ab, + unsigned int reg, + unsigned int offset, + unsigned int predicate) { unw_rec_list *ptr = alloc_record (predicate ? spill_psprel_p : spill_psprel); ptr->r.record.x.ab = ab; @@ -2493,11 +2204,10 @@ output_spill_psprel (ab, reg, offset, predicate) } static unw_rec_list * -output_spill_sprel (ab, reg, offset, predicate) - unsigned int ab; - unsigned int reg; - unsigned int offset; - unsigned int predicate; +output_spill_sprel (unsigned int ab, + unsigned int reg, + unsigned int offset, + unsigned int predicate) { unw_rec_list *ptr = alloc_record (predicate ? spill_sprel_p : spill_sprel); ptr->r.record.x.ab = ab; @@ -2508,12 +2218,11 @@ output_spill_sprel (ab, reg, offset, predicate) } static unw_rec_list * -output_spill_reg (ab, reg, targ_reg, xy, predicate) - unsigned int ab; - unsigned int reg; - unsigned int targ_reg; - unsigned int xy; - unsigned int predicate; +output_spill_reg (unsigned int ab, + unsigned int reg, + unsigned int targ_reg, + unsigned int xy, + unsigned int predicate) { unw_rec_list *ptr = alloc_record (predicate ? spill_reg_p : spill_reg); ptr->r.record.x.ab = ab; @@ -2528,9 +2237,7 @@ output_spill_reg (ab, reg, targ_reg, xy, predicate) specified function. */ static void -process_one_record (ptr, f) - unw_rec_list *ptr; - vbyte_func f; +process_one_record (unw_rec_list *ptr, vbyte_func f) { unsigned int fr_mask, gr_mask; @@ -2723,9 +2430,7 @@ process_one_record (ptr, f) /* Given a unw_rec_list list, process all the records with the specified function. */ static void -process_unw_records (list, f) - unw_rec_list *list; - vbyte_func f; +process_unw_records (unw_rec_list *list, vbyte_func f) { unw_rec_list *ptr; for (ptr = list; ptr; ptr = ptr->next) @@ -2734,8 +2439,7 @@ process_unw_records (list, f) /* Determine the size of a record list in bytes. */ static int -calc_record_size (list) - unw_rec_list *list; +calc_record_size (unw_rec_list *list) { vbyte_count = 0; process_unw_records (list, count_output); @@ -2775,11 +2479,10 @@ popcount (unsigned x) 2: instruction saves next general reg 3: instruction saves next branch reg */ static void -set_imask (region, regmask, t, type) - unw_rec_list *region; - unsigned long regmask; - unsigned long t; - unsigned int type; +set_imask (unw_rec_list *region, + unsigned long regmask, + unsigned long t, + unsigned int type) { unsigned char *imask; unsigned long imask_size; @@ -2825,13 +2528,12 @@ set_imask (region, regmask, t, type) containing FIRST_ADDR. If BEFORE_RELAX, then we use worst-case estimates for frag sizes. */ -unsigned long -slot_index (slot_addr, slot_frag, first_addr, first_frag, before_relax) - unsigned long slot_addr; - fragS *slot_frag; - unsigned long first_addr; - fragS *first_frag; - int before_relax; +static unsigned long +slot_index (unsigned long slot_addr, + fragS *slot_frag, + unsigned long first_addr, + fragS *first_frag, + int before_relax) { unsigned long index = 0; @@ -2913,8 +2615,7 @@ slot_index (slot_addr, slot_frag, first_addr, first_frag, before_relax) /* Optimize unwind record directives. */ static unw_rec_list * -optimize_unw_records (list) - unw_rec_list *list; +optimize_unw_records (unw_rec_list *list) { if (!list) return NULL; @@ -2935,9 +2636,7 @@ optimize_unw_records (list) within each record to generate an image. */ static void -fixup_unw_records (list, before_relax) - unw_rec_list *list; - int before_relax; +fixup_unw_records (unw_rec_list *list, int before_relax) { unw_rec_list *ptr, *region = 0; unsigned long first_addr = 0, rlen = 0, t; @@ -3178,10 +2877,7 @@ ia64_convert_frag (fragS *frag) } static int -parse_predicate_and_operand (e, qp, po) - expressionS * e; - unsigned * qp; - const char * po; +parse_predicate_and_operand (expressionS *e, unsigned *qp, const char *po) { int sep = parse_operand (e, ','); @@ -3201,12 +2897,11 @@ parse_predicate_and_operand (e, qp, po) } static void -convert_expr_to_ab_reg (e, ab, regp, po, n) - const expressionS *e; - unsigned int *ab; - unsigned int *regp; - const char * po; - int n; +convert_expr_to_ab_reg (const expressionS *e, + unsigned int *ab, + unsigned int *regp, + const char *po, + int n) { unsigned int reg = e->X_add_number; @@ -3256,12 +2951,11 @@ convert_expr_to_ab_reg (e, ab, regp, po, n) } static void -convert_expr_to_xy_reg (e, xy, regp, po, n) - const expressionS *e; - unsigned int *xy; - unsigned int *regp; - const char * po; - int n; +convert_expr_to_xy_reg (const expressionS *e, + unsigned int *xy, + unsigned int *regp, + const char *po, + int n) { unsigned int reg = e->X_add_number; @@ -3298,8 +2992,7 @@ dot_align (int arg) } static void -dot_radix (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_radix (int dummy ATTRIBUTE_UNUSED) { char *radix; int ch; @@ -3330,8 +3023,7 @@ dot_loc (int x) /* .sbss, .bss etc. are macros that expand into ".section SECNAME". */ static void -dot_special_section (which) - int which; +dot_special_section (int which) { set_section ((char *) special_section_name[which]); } @@ -3400,9 +3092,7 @@ in_body (const char *directive) } static void -add_unwind_entry (ptr, sep) - unw_rec_list *ptr; - int sep; +add_unwind_entry (unw_rec_list *ptr, int sep) { if (ptr) { @@ -3445,8 +3135,7 @@ add_unwind_entry (ptr, sep) } static void -dot_fframe (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_fframe (int dummy ATTRIBUTE_UNUSED) { expressionS e; int sep; @@ -3465,8 +3154,7 @@ dot_fframe (dummy) } static void -dot_vframe (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_vframe (int dummy ATTRIBUTE_UNUSED) { expressionS e; unsigned reg; @@ -3491,8 +3179,7 @@ dot_vframe (dummy) } static void -dot_vframesp (psp) - int psp; +dot_vframesp (int psp) { expressionS e; int sep; @@ -3514,8 +3201,7 @@ dot_vframesp (psp) } static void -dot_save (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_save (int dummy ATTRIBUTE_UNUSED) { expressionS e1, e2; unsigned reg1, reg2; @@ -3604,8 +3290,7 @@ dot_save (dummy) } static void -dot_restore (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_restore (int dummy ATTRIBUTE_UNUSED) { expressionS e1; unsigned long ecount; /* # of _additional_ regions to pop */ @@ -3649,8 +3334,7 @@ dot_restore (dummy) } static void -dot_restorereg (pred) - int pred; +dot_restorereg (int pred) { unsigned int qp, ab, reg; expressionS e; @@ -3875,8 +3559,7 @@ generate_unwind_image (const segT text_seg) } static void -dot_handlerdata (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_handlerdata (int dummy ATTRIBUTE_UNUSED) { if (!in_procedure ("handlerdata")) return; @@ -3894,8 +3577,7 @@ dot_handlerdata (dummy) } static void -dot_unwentry (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_unwentry (int dummy ATTRIBUTE_UNUSED) { if (!in_procedure ("unwentry")) return; @@ -3904,8 +3586,7 @@ dot_unwentry (dummy) } static void -dot_altrp (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_altrp (int dummy ATTRIBUTE_UNUSED) { expressionS e; unsigned reg; @@ -3924,8 +3605,7 @@ dot_altrp (dummy) } static void -dot_savemem (psprel) - int psprel; +dot_savemem (int psprel) { expressionS e1, e2; int sep; @@ -4026,8 +3706,7 @@ dot_savemem (psprel) } static void -dot_saveg (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_saveg (int dummy ATTRIBUTE_UNUSED) { expressionS e; unsigned grmask; @@ -4071,8 +3750,7 @@ dot_saveg (dummy) } static void -dot_savef (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_savef (int dummy ATTRIBUTE_UNUSED) { expressionS e; @@ -4092,8 +3770,7 @@ dot_savef (dummy) } static void -dot_saveb (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_saveb (int dummy ATTRIBUTE_UNUSED) { expressionS e; unsigned brmask; @@ -4137,8 +3814,7 @@ dot_saveb (dummy) } static void -dot_savegf (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_savegf (int dummy ATTRIBUTE_UNUSED) { expressionS e1, e2; @@ -4176,8 +3852,7 @@ dot_savegf (dummy) } static void -dot_spill (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_spill (int dummy ATTRIBUTE_UNUSED) { expressionS e; @@ -4195,8 +3870,7 @@ dot_spill (dummy) } static void -dot_spillreg (pred) - int pred; +dot_spillreg (int pred) { int sep; unsigned int qp, ab, xy, reg, treg; @@ -4225,8 +3899,7 @@ dot_spillreg (pred) } static void -dot_spillmem (psprel) - int psprel; +dot_spillmem (int psprel) { expressionS e; int pred = (psprel < 0), sep; @@ -4270,8 +3943,7 @@ dot_spillmem (psprel) } static unsigned int -get_saved_prologue_count (lbl) - unsigned long lbl; +get_saved_prologue_count (unsigned long lbl) { label_prologue_count *lpc = unwind.saved_prologue_counts; @@ -4286,9 +3958,7 @@ get_saved_prologue_count (lbl) } static void -save_prologue_count (lbl, count) - unsigned long lbl; - unsigned int count; +save_prologue_count (unsigned long lbl, unsigned int count) { label_prologue_count *lpc = unwind.saved_prologue_counts; @@ -4325,8 +3995,7 @@ free_saved_prologue_counts () } static void -dot_label_state (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_label_state (int dummy ATTRIBUTE_UNUSED) { expressionS e; @@ -4345,8 +4014,7 @@ dot_label_state (dummy) } static void -dot_copy_state (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_copy_state (int dummy ATTRIBUTE_UNUSED) { expressionS e; @@ -4365,8 +4033,7 @@ dot_copy_state (dummy) } static void -dot_unwabi (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_unwabi (int dummy ATTRIBUTE_UNUSED) { expressionS e1, e2; unsigned char sep; @@ -4396,8 +4063,7 @@ dot_unwabi (dummy) } static void -dot_personality (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_personality (int dummy ATTRIBUTE_UNUSED) { char *name, *p, c; if (!in_procedure ("personality")) @@ -4414,8 +4080,7 @@ dot_personality (dummy) } static void -dot_proc (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_proc (int dummy ATTRIBUTE_UNUSED) { char *name, *p, c; symbolS *sym; @@ -4487,8 +4152,7 @@ dot_proc (dummy) } static void -dot_body (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_body (int dummy ATTRIBUTE_UNUSED) { if (!in_procedure ("body")) return; @@ -4504,8 +4168,7 @@ dot_body (dummy) } static void -dot_prologue (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_prologue (int dummy ATTRIBUTE_UNUSED) { unsigned mask = 0, grsave = 0; @@ -4574,8 +4237,7 @@ dot_prologue (dummy) } static void -dot_endp (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_endp (int dummy ATTRIBUTE_UNUSED) { expressionS e; int bytes_per_address; @@ -4747,15 +4409,13 @@ dot_endp (dummy) } static void -dot_template (template) - int template; +dot_template (int template) { CURR_SLOT.user_template = template; } static void -dot_regstk (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_regstk (int dummy ATTRIBUTE_UNUSED) { int ins, locs, outs, rots; @@ -4783,8 +4443,7 @@ dot_regstk (dummy) } static void -dot_rot (type) - int type; +dot_rot (int type) { offsetT num_regs; valueT num_alloced = 0; @@ -4906,8 +4565,7 @@ dot_rot (type) } static void -dot_byteorder (byteorder) - int byteorder; +dot_byteorder (int byteorder) { segment_info_type *seginfo = seg_info (now_seg); @@ -4937,8 +4595,7 @@ dot_byteorder (byteorder) } static void -dot_psr (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_psr (int dummy ATTRIBUTE_UNUSED) { char *option; int ch; @@ -4970,18 +4627,14 @@ dot_psr (dummy) } static void -dot_ln (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_ln (int dummy ATTRIBUTE_UNUSED) { new_logical_line (0, get_absolute_expression ()); demand_empty_rest_of_line (); } static void -cross_section (ref, cons, ua) - int ref; - void (*cons) PARAMS((int)); - int ua; +cross_section (int ref, void (*cons) (int), int ua) { char *start, *end; int saved_auto_align; @@ -5042,8 +4695,7 @@ cross_section (ref, cons, ua) } static void -dot_xdata (size) - int size; +dot_xdata (int size) { cross_section (size, cons, 0); } @@ -5051,8 +4703,7 @@ dot_xdata (size) /* Why doesn't float_cons() call md_cons_align() the way cons() does? */ static void -stmt_float_cons (kind) - int kind; +stmt_float_cons (int kind) { size_t alignment; @@ -5077,8 +4728,7 @@ stmt_float_cons (kind) } static void -stmt_cons_ua (size) - int size; +stmt_cons_ua (int size) { int saved_auto_align = md.auto_align; @@ -5088,8 +4738,7 @@ stmt_cons_ua (size) } static void -dot_xfloat_cons (kind) - int kind; +dot_xfloat_cons (int kind) { cross_section (kind, stmt_float_cons, 0); } @@ -5101,15 +4750,13 @@ dot_xstringer (int zero) } static void -dot_xdata_ua (size) - int size; +dot_xdata_ua (int size) { cross_section (size, cons, 1); } static void -dot_xfloat_cons_ua (kind) - int kind; +dot_xfloat_cons_ua (int kind) { cross_section (kind, float_cons, 1); } @@ -5117,8 +4764,7 @@ dot_xfloat_cons_ua (kind) /* .reg.val <regname>,value */ static void -dot_reg_val (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_reg_val (int dummy ATTRIBUTE_UNUSED) { expressionS reg; @@ -5154,8 +4800,7 @@ dot_reg_val (dummy) .serialize.instruction */ static void -dot_serialize (type) - int type; +dot_serialize (int type) { insn_group_break (0, 0, 0); if (type) @@ -5175,8 +4820,7 @@ dot_serialize (type) */ static void -dot_dv_mode (type) - int type; +dot_dv_mode (int type) { if (md.manual_bundling) as_warn (_("Directive invalid within a bundle")); @@ -5212,8 +4856,7 @@ dot_dv_mode (type) } static void -print_prmask (mask) - valueT mask; +print_prmask (valueT mask) { int regno; char *comma = ""; @@ -5235,8 +4878,7 @@ print_prmask (mask) */ static void -dot_pred_rel (type) - int type; +dot_pred_rel (int type) { valueT mask = 0; int count = 0; @@ -5397,8 +5039,7 @@ dot_pred_rel (type) Otherwise, only global labels are considered entry points. */ static void -dot_entry (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_entry (int dummy ATTRIBUTE_UNUSED) { const char *err; char *name; @@ -5411,7 +5052,7 @@ dot_entry (dummy) c = get_symbol_end (); symbolP = symbol_find_or_make (name); - err = hash_insert (md.entry_hash, S_GET_NAME (symbolP), (PTR) symbolP); + err = hash_insert (md.entry_hash, S_GET_NAME (symbolP), (void *) symbolP); if (err) as_fatal (_("Inserting \"%s\" into entry hint table failed: %s"), name, err); @@ -5436,8 +5077,7 @@ dot_entry (dummy) "base" is used to distinguish between offsets from a different base. */ static void -dot_mem_offset (dummy) - int dummy ATTRIBUTE_UNUSED; +dot_mem_offset (int dummy ATTRIBUTE_UNUSED) { md.mem_offset.hint = 1; md.mem_offset.offset = get_absolute_expression (); @@ -5608,16 +5248,14 @@ pseudo_opcode[] = the symbol table. */ static symbolS * -declare_register (name, regnum) - const char *name; - unsigned int regnum; +declare_register (const char *name, unsigned int regnum) { const char *err; symbolS *sym; sym = symbol_create (name, reg_section, regnum, &zero_address_frag); - err = hash_insert (md.reg_hash, S_GET_NAME (sym), (PTR) sym); + err = hash_insert (md.reg_hash, S_GET_NAME (sym), (void *) sym); if (err) as_fatal ("Inserting \"%s\" into register table failed: %s", name, err); @@ -5626,10 +5264,9 @@ declare_register (name, regnum) } static void -declare_register_set (prefix, num_regs, base_regnum) - const char *prefix; - unsigned int num_regs; - unsigned int base_regnum; +declare_register_set (const char *prefix, + unsigned int num_regs, + unsigned int base_regnum) { char name[8]; unsigned int i; @@ -5642,8 +5279,7 @@ declare_register_set (prefix, num_regs, base_regnum) } static unsigned int -operand_width (opnd) - enum ia64_opnd opnd; +operand_width (enum ia64_opnd opnd) { const struct ia64_operand *odesc = &elf64_ia64_operands[opnd]; unsigned int bits = 0; @@ -5657,10 +5293,7 @@ operand_width (opnd) } static enum operand_match_result -operand_match (idesc, index, e) - const struct ia64_opcode *idesc; - int index; - expressionS *e; +operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) { enum ia64_opnd opnd = idesc->operands[index]; int bits, relocatable = 0; @@ -6199,9 +5832,7 @@ operand_match (idesc, index, e) } static int -parse_operand (e, more) - expressionS *e; - int more; +parse_operand (expressionS *e, int more) { int sep = '\0'; @@ -6231,8 +5862,7 @@ get_next_opcode (struct ia64_opcode *idesc) matches the specified operands, or NULL if no match is possible. */ static struct ia64_opcode * -parse_operands (idesc) - struct ia64_opcode *idesc; +parse_operands (struct ia64_opcode *idesc) { int i = 0, highest_unmatched_operand, num_operands = 0, num_outputs = 0; int error_pos, out_of_range_pos, curr_out_of_range_pos, sep = 0; @@ -6548,9 +6178,7 @@ parse_operands (idesc) } static void -build_insn (slot, insnp) - struct slot *slot; - bfd_vma *insnp; +build_insn (struct slot *slot, bfd_vma *insnp) { const struct ia64_operand *odesc, *o2desc; struct ia64_opcode *idesc = slot->idesc; @@ -6673,7 +6301,7 @@ build_insn (slot, insnp) } static void -emit_one_bundle () +emit_one_bundle (void) { int manual_bundling_off = 0, manual_bundling = 0; enum ia64_unit required_unit, insn_unit = 0; @@ -7140,9 +6768,7 @@ emit_one_bundle () } int -md_parse_option (c, arg) - int c; - char *arg; +md_parse_option (int c, char *arg) { switch (c) @@ -7301,8 +6927,7 @@ md_parse_option (c, arg) } void -md_show_usage (stream) - FILE *stream; +md_show_usage (FILE *stream) { fputs (_("\ IA-64 options:\n\ @@ -7331,7 +6956,7 @@ IA-64 options:\n\ } void -ia64_after_parse_args () +ia64_after_parse_args (void) { if (debug_type == DEBUG_STABS) as_fatal (_("--gstabs is not supported for ia64")); @@ -7399,7 +7024,7 @@ extra_goodness (int templ, int slot) up all the tables, etc. that the MD part of the assembler will need that can be determined before arguments are parsed. */ void -md_begin () +md_begin (void) { int i, j, k, t, goodness, best, ok; const char *err; @@ -7625,7 +7250,7 @@ md_begin () for (i = 0; i < NELEMS (const_bits); ++i) { err = hash_insert (md.const_hash, const_bits[i].name, - (PTR) (const_bits + i)); + (void *) (const_bits + i)); if (err) as_fatal (_("Inserting \"%s\" into constant hash table failed: %s"), name, err); @@ -7665,9 +7290,7 @@ md_begin () options in md based on command line options. */ void -ia64_init (argc, argv) - int argc ATTRIBUTE_UNUSED; - char **argv ATTRIBUTE_UNUSED; +ia64_init (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { md.flags = MD_FLAGS_DEFAULT; md.detect_dv = 1; @@ -7680,7 +7303,7 @@ ia64_init (argc, argv) /* Return a string for the target object file format. */ const char * -ia64_target_format () +ia64_target_format (void) { if (OUTPUT_FLAVOR == bfd_target_elf_flavour) { @@ -7724,7 +7347,7 @@ ia64_target_format () } void -ia64_end_of_source () +ia64_end_of_source (void) { /* terminate insn group upon reaching end of file: */ insn_group_break (1, 0, 0); @@ -7738,7 +7361,7 @@ ia64_end_of_source () } void -ia64_start_line () +ia64_start_line (void) { static int first; @@ -7812,8 +7435,7 @@ ia64_start_line () static int defining_tag = 0; int -ia64_unrecognized_line (ch) - int ch; +ia64_unrecognized_line (int ch) { switch (ch) { @@ -7906,8 +7528,7 @@ ia64_unrecognized_line (ch) } void -ia64_frob_label (sym) - struct symbol *sym; +ia64_frob_label (struct symbol *sym) { struct label_fix *fix; @@ -7950,8 +7571,7 @@ ia64_frob_label (sym) that are declared but unused. This routine removes declared, unused symbols from an object. */ int -ia64_frob_symbol (sym) - struct symbol *sym; +ia64_frob_symbol (struct symbol *sym) { if ((S_GET_SEGMENT (sym) == &bfd_und_section && ! symbol_used_p (sym) && ELF_ST_VISIBILITY (S_GET_OTHER (sym)) == STV_DEFAULT) @@ -7963,7 +7583,7 @@ ia64_frob_symbol (sym) #endif void -ia64_flush_pending_output () +ia64_flush_pending_output (void) { if (!md.keep_pending_output && bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) @@ -7980,10 +7600,7 @@ ia64_flush_pending_output () of rotating registers or due to the indexing of indirect register sets. */ int -ia64_optimize_expr (l, op, r) - expressionS *l; - operatorT op; - expressionS *r; +ia64_optimize_expr (expressionS *l, operatorT op, expressionS *r) { if (op != O_index) return 0; @@ -8033,10 +7650,7 @@ ia64_optimize_expr (l, op, r) } int -ia64_parse_name (name, e, nextcharP) - char *name; - expressionS *e; - char *nextcharP; +ia64_parse_name (char *name, expressionS *e, char *nextcharP) { struct const_desc *cdesc; struct dynreg *dr = 0; @@ -8219,8 +7833,7 @@ ia64_parse_name (name, e, nextcharP) /* Remove the '#' suffix that indicates a symbol as opposed to a register. */ char * -ia64_canonicalize_symbol_name (name) - char *name; +ia64_canonicalize_symbol_name (char *name) { size_t len = strlen (name), full = len; @@ -8245,8 +7858,7 @@ ia64_canonicalize_symbol_name (name) through, and which use no resources if they do fall through. */ static int -is_conditional_branch (idesc) - struct ia64_opcode *idesc; +is_conditional_branch (struct ia64_opcode *idesc) { /* br is a conditional branch. Everything that starts with br. except br.ia, br.c{loop,top,exit}, and br.w{top,exit} is a conditional branch. @@ -8266,8 +7878,7 @@ is_conditional_branch (idesc) returns zero. */ static int -is_taken_branch (idesc) - struct ia64_opcode *idesc; +is_taken_branch (struct ia64_opcode *idesc) { return ((is_conditional_branch (idesc) && CURR_SLOT.qp_regno == 0) || strncmp (idesc->name, "br.ia", 5) == 0); @@ -8277,8 +7888,7 @@ is_taken_branch (idesc) doubt, returns zero. */ static int -is_interruption_or_rfi (idesc) - struct ia64_opcode *idesc; +is_interruption_or_rfi (struct ia64_opcode *idesc) { if (strcmp (idesc->name, "rfi") == 0) return 1; @@ -8289,9 +7899,7 @@ is_interruption_or_rfi (idesc) -1 if there is no dependency. */ static int -depends_on (depind, idesc) - int depind; - struct ia64_opcode *idesc; +depends_on (int depind, struct ia64_opcode *idesc) { int i; const struct ia64_opcode_dependency *dep = idesc->dependencies; @@ -8356,13 +7964,16 @@ depends_on (depind, idesc) #define DV_REG 0 static int -specify_resource (dep, idesc, type, specs, note, path) - const struct ia64_dependency *dep; - struct ia64_opcode *idesc; - int type; /* is this a DV chk or a DV reg? */ - struct rsrc specs[MAX_SPECS]; /* returned specific resources */ - int note; /* resource note for this insn's usage */ - int path; /* which execution path to examine */ +specify_resource (const struct ia64_dependency *dep, + struct ia64_opcode *idesc, + /* is this a DV chk or a DV reg? */ + int type, + /* returned specific resources */ + struct rsrc specs[MAX_SPECS], + /* resource note for this insn's usage */ + int note, + /* which execution path to examine */ + int path) { int count = 0; int i; @@ -9679,8 +9290,7 @@ dep->name, idesc->name, (rsrc_write?"write":"read"), note) QP of the marking instruction and a subsequent branch on the same QP. */ static void -clear_qp_branch_flag (mask) - valueT mask; +clear_qp_branch_flag (valueT mask) { int i; for (i = 0; i < regdepslen; i++) @@ -9769,8 +9379,7 @@ update_qp_mutex (valueT mask) Any changes to a PR clears the mutex relations which include that PR. */ static void -clear_qp_mutex (mask) - valueT mask; +clear_qp_mutex (valueT mask) { int i; @@ -9797,9 +9406,7 @@ clear_qp_mutex (mask) indicates the implied PR. */ static void -clear_qp_implies (p1_mask, p2_mask) - valueT p1_mask; - valueT p2_mask; +clear_qp_implies (valueT p1_mask, valueT p2_mask) { int i; @@ -9822,8 +9429,7 @@ clear_qp_implies (p1_mask, p2_mask) /* Add the PRs specified to the list of implied relations. */ static void -add_qp_imply (p1, p2) - int p1, p2; +add_qp_imply (int p1, int p2) { valueT mask; valueT bit; @@ -9886,8 +9492,7 @@ add_qp_imply (p1, p2) the mask. */ static void -add_qp_mutex (mask) - valueT mask; +add_qp_mutex (valueT mask) { if (mask & 0x1) abort (); @@ -9910,9 +9515,7 @@ add_qp_mutex (mask) } static int -has_suffix_p (name, suffix) - const char *name; - const char *suffix; +has_suffix_p (const char *name, const char *suffix) { size_t namelen = strlen (name); size_t sufflen = strlen (suffix); @@ -9923,7 +9526,7 @@ has_suffix_p (name, suffix) } static void -clear_register_values () +clear_register_values (void) { int i; if (md.debug_dv) @@ -9938,8 +9541,7 @@ clear_register_values () have to examine a group of strings to identify them. */ static void -note_register_values (idesc) - struct ia64_opcode *idesc; +note_register_values (struct ia64_opcode *idesc) { valueT qp_changemask = 0; int i; @@ -10138,10 +9740,7 @@ note_register_values (idesc) /* Return whether the given predicate registers are currently mutex. */ static int -qp_mutex (p1, p2, path) - int p1; - int p2; - int path; +qp_mutex (int p1, int p2, int path) { int i; valueT mask; @@ -10164,12 +9763,11 @@ qp_mutex (p1, p2, path) conflict. */ static int -resources_match (rs, idesc, note, qp_regno, path) - struct rsrc *rs; - struct ia64_opcode *idesc; - int note; - int qp_regno; - int path; +resources_match (struct rsrc *rs, + struct ia64_opcode *idesc, + int note, + int qp_regno, + int path) { struct rsrc specs[MAX_SPECS]; int count; @@ -10245,10 +9843,7 @@ resources_match (rs, idesc, note, qp_regno, path) instruction. */ static void -insn_group_break (insert_stop, qp_regno, save_current) - int insert_stop; - int qp_regno; - int save_current; +insn_group_break (int insert_stop, int qp_regno, int save_current) { int i; @@ -10312,12 +9907,11 @@ insn_group_break (insert_stop, qp_regno, save_current) /* Add the given resource usage spec to the list of active dependencies. */ static void -mark_resource (idesc, dep, spec, depind, path) - struct ia64_opcode *idesc ATTRIBUTE_UNUSED; - const struct ia64_dependency *dep ATTRIBUTE_UNUSED; - struct rsrc *spec; - int depind; - int path; +mark_resource (struct ia64_opcode *idesc ATTRIBUTE_UNUSED, + const struct ia64_dependency *dep ATTRIBUTE_UNUSED, + struct rsrc *spec, + int depind, + int path) { if (regdepslen == regdepstotlen) { @@ -10339,9 +9933,7 @@ mark_resource (idesc, dep, spec, depind, path) } static void -print_dependency (action, depind) - const char *action; - int depind; +print_dependency (const char *action, int depind) { if (md.debug_dv) { @@ -10362,7 +9954,7 @@ print_dependency (action, depind) } static void -instruction_serialization () +instruction_serialization (void) { int i; if (md.debug_dv) @@ -10373,7 +9965,7 @@ instruction_serialization () } static void -data_serialization () +data_serialization (void) { int i = 0; if (md.debug_dv) @@ -10396,8 +9988,7 @@ data_serialization () /* Insert stops and serializations as needed to avoid DVs. */ static void -remove_marked_resource (rs) - struct rsrc *rs; +remove_marked_resource (struct rsrc *rs) { switch (rs->dependency->semantics) { @@ -10472,8 +10063,7 @@ remove_marked_resource (rs) */ static void -check_dependencies (idesc) - struct ia64_opcode *idesc; +check_dependencies (struct ia64_opcode *idesc) { const struct ia64_opcode_dependency *opdeps = idesc->dependencies; int path; @@ -10597,8 +10187,7 @@ check_dependencies (idesc) /* Register new dependencies based on the given opcode. */ static void -mark_resources (idesc) - struct ia64_opcode *idesc; +mark_resources (struct ia64_opcode *idesc) { int i; const struct ia64_opcode_dependency *opdeps = idesc->dependencies; @@ -10671,8 +10260,7 @@ mark_resources (idesc) /* Remove dependencies when they no longer apply. */ static void -update_dependencies (idesc) - struct ia64_opcode *idesc; +update_dependencies (struct ia64_opcode *idesc) { int i; @@ -10752,8 +10340,7 @@ update_dependencies (idesc) /* Examine the current instruction for dependency violations. */ static int -check_dv (idesc) - struct ia64_opcode *idesc; +check_dv (struct ia64_opcode *idesc) { if (md.debug_dv) { @@ -10801,8 +10388,7 @@ check_dv (idesc) /* Translate one line of assembly. Pseudo ops and labels do not show here. */ void -md_assemble (str) - char *str; +md_assemble (char *str) { char *saved_input_line_pointer, *mnemonic; const struct pseudo_opcode *pdesc; @@ -11017,8 +10603,7 @@ md_assemble (str) Should be used for dynamic valued symbols only. */ symbolS * -md_undefined_symbol (name) - char *name ATTRIBUTE_UNUSED; +md_undefined_symbol (char *name ATTRIBUTE_UNUSED) { return 0; } @@ -11028,8 +10613,7 @@ md_undefined_symbol (name) the expression. */ void -md_operand (e) - expressionS *e; +md_operand (expressionS *e) { switch (*input_line_pointer) { @@ -11070,8 +10654,7 @@ md_operand (e) directives we don't want such adjustments since we need to have the original symbol's name in the reloc. */ int -ia64_fix_adjustable (fix) - fixS *fix; +ia64_fix_adjustable (fixS *fix) { /* Prevent all adjustments to global symbols */ if (S_IS_EXTERNAL (fix->fx_addsy) || S_IS_WEAK (fix->fx_addsy)) @@ -11095,8 +10678,7 @@ ia64_fix_adjustable (fix) } int -ia64_force_relocation (fix) - fixS *fix; +ia64_force_relocation (fixS *fix) { switch (fix->fx_r_type) { @@ -11129,9 +10711,7 @@ ia64_force_relocation (fix) /* Decide from what point a pc-relative relocation is relative to, relative to the pc-relative fixup. Er, relatively speaking. */ long -ia64_pcrel_from_section (fix, sec) - fixS *fix; - segT sec; +ia64_pcrel_from_section (fixS *fix, segT sec) { unsigned long off = fix->fx_frag->fr_address + fix->fx_where; @@ -11159,11 +10739,7 @@ ia64_dwarf2_emit_offset (symbolS *symbol, unsigned int size) fixup. We pick the right reloc code depending on the byteorder currently in effect. */ void -ia64_cons_fix_new (f, where, nbytes, exp) - fragS *f; - int where; - int nbytes; - expressionS *exp; +ia64_cons_fix_new (fragS *f, int where, int nbytes, expressionS *exp) { bfd_reloc_code_real_type code; fixS *fix; @@ -11244,9 +10820,7 @@ ia64_cons_fix_new (f, where, nbytes, exp) symbols in the pseudo_func array, or NULL. */ static bfd_reloc_code_real_type -ia64_gen_real_reloc_type (sym, r_type) - struct symbol *sym; - bfd_reloc_code_real_type r_type; +ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type) { bfd_reloc_code_real_type new = 0; const char *type = NULL, *suffix = ""; @@ -11497,8 +11071,7 @@ ia64_gen_real_reloc_type (sym, r_type) /* Here is where generate the appropriate reloc for pseudo relocation functions. */ void -ia64_validate_fix (fix) - fixS *fix; +ia64_validate_fix (fixS *fix) { switch (fix->fx_r_type) { @@ -11517,10 +11090,7 @@ ia64_validate_fix (fix) } static void -fix_insn (fix, odesc, value) - fixS *fix; - const struct ia64_operand *odesc; - valueT value; +fix_insn (fixS *fix, const struct ia64_operand *odesc, valueT value) { bfd_vma insn[3], t0, t1, control_bits; const char *err; @@ -11582,10 +11152,7 @@ fix_insn (fix, odesc, value) (if possible). */ void -md_apply_fix (fix, valP, seg) - fixS *fix; - valueT *valP; - segT seg ATTRIBUTE_UNUSED; +md_apply_fix (fixS *fix, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *fixpos; valueT value = *valP; @@ -11661,9 +11228,7 @@ md_apply_fix (fix, valP, seg) fixup used internally in the assembler. */ arelent * -tc_gen_reloc (sec, fixp) - asection *sec ATTRIBUTE_UNUSED; - fixS *fixp; +tc_gen_reloc (asection *sec ATTRIBUTE_UNUSED, fixS *fixp) { arelent *reloc; @@ -11748,11 +11313,10 @@ md_atof (int type, char *lit, int *size) /* Handle ia64 specific semantics of the align directive. */ void -ia64_md_do_align (n, fill, len, max) - int n ATTRIBUTE_UNUSED; - const char *fill ATTRIBUTE_UNUSED; - int len ATTRIBUTE_UNUSED; - int max ATTRIBUTE_UNUSED; +ia64_md_do_align (int n ATTRIBUTE_UNUSED, + const char *fill ATTRIBUTE_UNUSED, + int len ATTRIBUTE_UNUSED, + int max ATTRIBUTE_UNUSED) { if (subseg_text_p (now_seg)) ia64_flush_insns (); @@ -11762,8 +11326,7 @@ ia64_md_do_align (n, fill, len, max) of an rs_align_code fragment. */ void -ia64_handle_align (fragp) - fragS *fragp; +ia64_handle_align (fragS *fragp) { int bytes; char *p; @@ -11839,7 +11402,7 @@ ia64_float_to_chars_littleendian (char *lit, LITTLENUM_TYPE *words, } void -ia64_elf_section_change_hook (void) +ia64_elf_section_change_hook (void) { if (elf_section_type (now_seg) == SHT_IA_64_UNWIND && elf_linked_to_section (now_seg) == NULL) @@ -11960,7 +11523,7 @@ dot_alias (int section) as_where (&h->file, &h->line); h->name = name; - error_string = hash_jam (ahash, alias, (PTR) h); + error_string = hash_jam (ahash, alias, (void *) h); if (error_string) { as_fatal (_("inserting \"%s\" into %s alias hash table failed: %s"), @@ -11968,7 +11531,7 @@ dot_alias (int section) goto out; } - error_string = hash_jam (nhash, name, (PTR) alias); + error_string = hash_jam (nhash, name, (void *) alias); if (error_string) { as_fatal (_("inserting \"%s\" into %s name hash table failed: %s"), @@ -11983,7 +11546,7 @@ out: /* It renames the original symbol name to its alias. */ static void -do_alias (const char *alias, PTR value) +do_alias (const char *alias, void *value) { struct alias *h = (struct alias *) value; symbolS *sym = symbol_find (h->name); @@ -12005,7 +11568,7 @@ ia64_adjust_symtab (void) /* It renames the original section name to its alias. */ static void -do_secalias (const char *alias, PTR value) +do_secalias (const char *alias, void *value) { struct alias *h = (struct alias *) value; segT sec = bfd_get_section_by_name (stdoutput, h->name); diff --git a/gas/config/tc-ia64.h b/gas/config/tc-ia64.h index d0b0b1b..a5e15d9 100644 --- a/gas/config/tc-ia64.h +++ b/gas/config/tc-ia64.h @@ -1,5 +1,5 @@ /* tc-ia64.h -- Header file for tc-ia64.c. - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by David Mosberger-Tang <davidm@hpl.hp.com> @@ -34,10 +34,10 @@ #define MD_FLAGS_DEFAULT EF_IA_64_ABI64 #endif /* TE_HPUX */ -extern void (*ia64_number_to_chars) PARAMS ((char *, valueT, int)); +extern void (*ia64_number_to_chars) (char *, valueT, int); #define md_number_to_chars (*ia64_number_to_chars) -extern void ia64_elf_section_change_hook PARAMS ((void)); +extern void ia64_elf_section_change_hook (void); #define md_elf_section_change_hook ia64_elf_section_change_hook /* We record the endian for this section. 0 means default, 1 means @@ -49,10 +49,10 @@ struct ia64_segment_info_type #define TC_SEGMENT_INFO_TYPE struct ia64_segment_info_type -extern void ia64_adjust_symtab PARAMS ((void)); +extern void ia64_adjust_symtab (void); #define tc_adjust_symtab() ia64_adjust_symtab () -extern void ia64_frob_file PARAMS ((void)); +extern void ia64_frob_file (void); #define tc_frob_file() ia64_frob_file () /* We need to set the default object file format in ia64_init and not in @@ -61,10 +61,10 @@ extern void ia64_frob_file PARAMS ((void)); md_parse_args. */ #define HOST_SPECIAL_INIT ia64_init -extern void ia64_init PARAMS ((int, char **)); +extern void ia64_init (int, char **); #define TARGET_FORMAT ia64_target_format() -extern const char *ia64_target_format PARAMS ((void)); +extern const char *ia64_target_format (void); #define TARGET_ARCH bfd_arch_ia64 #define DOUBLESLASH_LINE_COMMENTS /* allow //-style comments */ @@ -90,34 +90,32 @@ struct ia64_fix enum ia64_opnd opnd; }; -extern void ia64_end_of_source PARAMS((void)); -extern void ia64_start_line PARAMS((void)); -extern int ia64_unrecognized_line PARAMS((int ch)); -extern void ia64_frob_label PARAMS((struct symbol *sym)); +extern void ia64_end_of_source (void); +extern void ia64_start_line (void); +extern int ia64_unrecognized_line (int); +extern void ia64_frob_label (struct symbol *); #ifdef TE_HPUX -extern int ia64_frob_symbol PARAMS((struct symbol *sym)); +extern int ia64_frob_symbol (struct symbol *); #endif -extern void ia64_flush_pending_output PARAMS((void)); -extern int ia64_parse_name PARAMS((char *name, expressionS *e, char *nextP)); -extern int ia64_optimize_expr PARAMS((expressionS *l, operatorT op, - expressionS *r)); -extern void ia64_cons_align PARAMS((int)); -extern void ia64_flush_insns PARAMS((void)); -extern int ia64_fix_adjustable PARAMS((struct fix *fix)); -extern int ia64_force_relocation PARAMS((struct fix *)); -extern void ia64_cons_fix_new PARAMS ((fragS *f, int where, int nbytes, - expressionS *exp)); -extern void ia64_validate_fix PARAMS ((struct fix *fix)); -extern char * ia64_canonicalize_symbol_name PARAMS ((char *)); -extern int ia64_elf_section_letter PARAMS ((int, char **)); -extern flagword ia64_elf_section_flags PARAMS ((flagword, int, int)); -extern int ia64_elf_section_type PARAMS ((const char *, size_t len)); -extern long ia64_pcrel_from_section PARAMS ((struct fix *fix, segT sec)); -extern void ia64_md_do_align PARAMS ((int, const char *, int, int)); -extern void ia64_handle_align PARAMS ((fragS *f)); -extern void ia64_after_parse_args PARAMS ((void)); -extern void ia64_dwarf2_emit_offset PARAMS ((symbolS *, unsigned int)); -extern void ia64_check_label PARAMS ((symbolS *)); +extern void ia64_flush_pending_output (void); +extern int ia64_parse_name (char *, expressionS *, char *); +extern int ia64_optimize_expr (expressionS *, operatorT, expressionS *); +extern void ia64_cons_align (int); +extern void ia64_flush_insns (void); +extern int ia64_fix_adjustable (struct fix *); +extern int ia64_force_relocation (struct fix *); +extern void ia64_cons_fix_new (fragS *, int, int, expressionS *); +extern void ia64_validate_fix (struct fix *); +extern char * ia64_canonicalize_symbol_name (char *); +extern int ia64_elf_section_letter (int, char **); +extern flagword ia64_elf_section_flags (flagword, int, int); +extern int ia64_elf_section_type (const char *, size_t); +extern long ia64_pcrel_from_section (struct fix *, segT); +extern void ia64_md_do_align (int, const char *, int, int); +extern void ia64_handle_align (fragS *); +extern void ia64_after_parse_args (void); +extern void ia64_dwarf2_emit_offset (symbolS *, unsigned int); +extern void ia64_check_label (symbolS *); extern int ia64_estimate_size_before_relax (fragS *, asection *); extern void ia64_convert_frag (fragS *); diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c index 615bcc5..db9cc06 100644 --- a/gas/config/tc-m32c.c +++ b/gas/config/tc-m32c.c @@ -1,5 +1,5 @@ /* tc-m32c.c -- Assembler for the Renesas M32C. - Copyright (C) 2005, 2006, 2007 Free Software Foundation. + Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation. Contributed by RedHat. This file is part of GAS, the GNU Assembler. @@ -1303,8 +1303,6 @@ m32c_fix_adjustable (fixS * fixP) } /* Worker function for m32c_is_colon_insn(). */ -static char restore_colon PARAMS ((int)); - static char restore_colon (int advance_i_l_p_by) { diff --git a/gas/config/tc-m32c.h b/gas/config/tc-m32c.h index 8fb0355..1b5a483 100644 --- a/gas/config/tc-m32c.h +++ b/gas/config/tc-m32c.h @@ -1,5 +1,5 @@ /* tc-m32c.h -- Header file for tc-m32c.c. - Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -36,7 +36,7 @@ extern void m32c_md_end (void); extern void m32c_start_line_hook (void); /* call md_pcrel_from_section, not md_pcrel_from */ -long md_pcrel_from_section PARAMS ((struct fix *, segT)); +long md_pcrel_from_section (struct fix *, segT); #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC) /* Permit temporary numeric labels. */ @@ -48,14 +48,14 @@ long md_pcrel_from_section PARAMS ((struct fix *, segT)); #define WORKING_DOT_WORD #define md_apply_fix m32c_apply_fix -extern void m32c_apply_fix PARAMS ((struct fix *, valueT *, segT)); +extern void m32c_apply_fix (struct fix *, valueT *, segT); #define tc_fix_adjustable(fixP) m32c_fix_adjustable (fixP) -extern bfd_boolean m32c_fix_adjustable PARAMS ((struct fix *)); +extern bfd_boolean m32c_fix_adjustable (struct fix *); /* When relaxing, we need to emit various relocs we otherwise wouldn't. */ #define TC_FORCE_RELOCATION(fix) m32c_force_relocation (fix) -extern int m32c_force_relocation PARAMS ((struct fix *)); +extern int m32c_force_relocation (struct fix *); #define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP) \ m32c_cons_fix_new (FRAG, WHERE, NBYTES, EXP) @@ -64,7 +64,7 @@ extern void m32c_cons_fix_new (fragS *, int, int, expressionS *); extern const struct relax_type md_relax_table[]; #define TC_GENERIC_RELAX_TABLE md_relax_table -extern void m32c_prepare_relax_scan PARAMS ((fragS *, offsetT *, relax_substateT state)); +extern void m32c_prepare_relax_scan (fragS *, offsetT *, relax_substateT); #define md_prepare_relax_scan(FRAGP, ADDR, AIM, STATE, TYPE) \ m32c_prepare_relax_scan(FRAGP, &AIM, STATE) @@ -73,7 +73,7 @@ extern void m32c_prepare_relax_scan PARAMS ((fragS *, offsetT *, relax_substateT /* Call md_pcrel_from_section(), not md_pcrel_from(). */ #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC) -extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); +extern long md_pcrel_from_section (struct fix *, segT); /* We need a special version of the TC_START_LABEL macro so that we allow the :Z, :S, :Q and :G suffixes to be @@ -85,6 +85,6 @@ extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); the local variable 'c' which is passed to this macro as 'character'. */ #define TC_START_LABEL(character, i_l_p) \ ((character) != ':' ? 0 : (character = m32c_is_colon_insn (s)) ? 0 : ((character = ':'), 1)) -extern char m32c_is_colon_insn PARAMS ((char *)); +extern char m32c_is_colon_insn (char *); #define H_TICK_HEX 1 diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 9e969c3..f3e3cf5 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -1,6 +1,7 @@ /* tc-m68k.c -- Assemble for the m68k family Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -4469,7 +4470,7 @@ md_begin (void) { const char *name = m68k_opcode_aliases[i].primary; const char *alias = m68k_opcode_aliases[i].alias; - PTR val = hash_find (op_hash, name); + void *val = hash_find (op_hash, name); if (!val) as_fatal (_("Internal Error: Can't find %s in hash table"), name); @@ -4508,7 +4509,7 @@ md_begin (void) { const char *name = mri_aliases[i].primary; const char *alias = mri_aliases[i].alias; - PTR val = hash_find (op_hash, name); + void *val = hash_find (op_hash, name); if (!val) as_fatal (_("Internal Error: Can't find %s in hash table"), name); diff --git a/gas/config/tc-maxq.c b/gas/config/tc-maxq.c index 58c5c30..96bfbc4 100644 --- a/gas/config/tc-maxq.c +++ b/gas/config/tc-maxq.c @@ -1,6 +1,6 @@ /* tc-maxq.c -- assembler code for a MAXQ chip. - Copyright 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by HCL Technologies Pvt. Ltd. @@ -2844,7 +2844,7 @@ md_begin (void) { hash_err = hash_insert (op_hash, (optab - 1)->name, - (PTR) core_optab); + (void *) core_optab); } } else if (max_version == bfd_mach_maxq20) @@ -2854,7 +2854,7 @@ md_begin (void) #endif hash_err = hash_insert (op_hash, (optab - 1)->name, - (PTR) core_optab); + (void *) core_optab); #if MAXQ10S } } @@ -2884,7 +2884,7 @@ md_begin (void) { case bfd_mach_maxq10: if ((reg_tab->arch == MAXQ10) || (reg_tab->arch == MAX)) - hash_err = hash_insert (reg_hash, reg_tab->reg_name, (PTR) reg_tab); + hash_err = hash_insert (reg_hash, reg_tab->reg_name, (void *) reg_tab); break; case bfd_mach_maxq20: @@ -2892,7 +2892,7 @@ md_begin (void) { #endif hash_err = - hash_insert (reg_hash, reg_tab->reg_name, (PTR) reg_tab); + hash_insert (reg_hash, reg_tab->reg_name, (void *) reg_tab); #if MAXQ10S } break; @@ -2910,7 +2910,7 @@ md_begin (void) for (reg_tab = new_reg_table; reg_tab < (new_reg_table + num_of_reg - 1); reg_tab++) { - hash_err = hash_insert (reg_hash, reg_tab->reg_name, (PTR) reg_tab); + hash_err = hash_insert (reg_hash, reg_tab->reg_name, (void *) reg_tab); if (hash_err) as_fatal (_("Internal Error : Can't Hash %s : %s"), @@ -2924,7 +2924,7 @@ md_begin (void) memtab < mem_table + ARRAY_SIZE (mem_table); memtab++) { - hash_err = hash_insert (mem_hash, memtab->name, (PTR) memtab); + hash_err = hash_insert (mem_hash, memtab->name, (void *) memtab); if (hash_err) as_fatal (_("Internal Error : Can't Hash %s : %s"), memtab->name, hash_err); @@ -2936,7 +2936,7 @@ md_begin (void) bittab < bit_table + ARRAY_SIZE (bit_table); bittab++) { - hash_err = hash_insert (bit_hash, bittab->name, (PTR) bittab); + hash_err = hash_insert (bit_hash, bittab->name, (void *) bittab); if (hash_err) as_fatal (_("Internal Error : Can't Hash %s : %s"), bittab->name, hash_err); @@ -2949,7 +2949,7 @@ md_begin (void) memsyntab++) { hash_err = - hash_insert (mem_syntax_hash, memsyntab->name, (PTR) memsyntab); + hash_insert (mem_syntax_hash, memsyntab->name, (void *) memsyntab); if (hash_err) as_fatal (_("Internal Error : Can't Hash %s : %s"), memsyntab->name, hash_err); diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index b2c412a..da7d4c5 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -1,5 +1,5 @@ /* tc-s390.c -- Assemble for the S390 - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -77,11 +77,11 @@ int s390_cie_data_alignment; /* The target specific pseudo-ops which we support. */ /* Define the prototypes for the pseudo-ops */ -static void s390_byte PARAMS ((int)); -static void s390_elf_cons PARAMS ((int)); -static void s390_bss PARAMS ((int)); -static void s390_insn PARAMS ((int)); -static void s390_literals PARAMS ((int)); +static void s390_byte (int); +static void s390_elf_cons (int); +static void s390_bss (int); +static void s390_insn (int); +static void s390_literals (int); const pseudo_typeS md_pseudo_table[] = { @@ -205,24 +205,11 @@ static const struct pd_reg pre_defined_registers[] = #define REG_NAME_CNT (sizeof (pre_defined_registers) / sizeof (struct pd_reg)) -static int reg_name_search - PARAMS ((const struct pd_reg *, int, const char *)); -static bfd_boolean register_name PARAMS ((expressionS *)); -static void init_default_arch PARAMS ((void)); -static void s390_insert_operand - PARAMS ((unsigned char *, const struct s390_operand *, offsetT, char *, - unsigned int)); -static char *md_gather_operands - PARAMS ((char *, unsigned char *, const struct s390_opcode *)); - /* Given NAME, find the register number associated with that name, return the integer value associated with the given name or -1 on failure. */ static int -reg_name_search (regs, regcount, name) - const struct pd_reg *regs; - int regcount; - const char *name; +reg_name_search (const struct pd_reg *regs, int regcount, const char *name) { int middle, low, high; int cmp; @@ -260,8 +247,7 @@ reg_name_search (regs, regcount, name) */ static bfd_boolean -register_name (expressionP) - expressionS *expressionP; +register_name (expressionS *expressionP) { int reg_number; char *name; @@ -325,7 +311,7 @@ size_t md_longopts_size = sizeof (md_longopts); /* Initialize the default opcode arch and word size from the default architecture name if not specified by an option. */ static void -init_default_arch () +init_default_arch (void) { if (strcmp (default_arch, "s390") == 0) { @@ -358,7 +344,7 @@ init_default_arch () /* Called by TARGET_FORMAT. */ const char * -s390_target_format () +s390_target_format (void) { /* We don't get a chance to initialize anything before we're called, so handle that now. */ @@ -368,9 +354,7 @@ s390_target_format () } int -md_parse_option (c, arg) - int c; - char *arg; +md_parse_option (int c, char *arg) { switch (c) { @@ -457,8 +441,7 @@ md_parse_option (c, arg) } void -md_show_usage (stream) - FILE *stream; +md_show_usage (FILE *stream) { fprintf (stream, _("\ S390 options:\n\ @@ -477,7 +460,7 @@ md_show_usage (stream) opened. */ void -md_begin () +md_begin (void) { register const struct s390_opcode *op; const struct s390_opcode *op_end; @@ -500,7 +483,7 @@ md_begin () op_end = s390_opformats + s390_num_opformats; for (op = s390_opformats; op < op_end; op++) { - retval = hash_insert (s390_opformat_hash, op->name, (PTR) op); + retval = hash_insert (s390_opformat_hash, op->name, (void *) op); if (retval != (const char *) NULL) { as_bad (_("Internal assembler error for instruction format %s"), @@ -521,7 +504,7 @@ md_begin () break; op++; } - retval = hash_insert (s390_opcode_hash, op->name, (PTR) op); + retval = hash_insert (s390_opcode_hash, op->name, (void *) op); if (retval != (const char *) NULL) { as_bad (_("Internal assembler error for instruction %s"), @@ -543,7 +526,7 @@ md_begin () /* Called after all assembly has been done. */ void -s390_md_end () +s390_md_end (void) { if (s390_arch_size == 64) bfd_set_arch_mach (stdoutput, bfd_arch_s390, bfd_mach_s390_64); @@ -554,12 +537,11 @@ s390_md_end () /* Insert an operand value into an instruction. */ static void -s390_insert_operand (insn, operand, val, file, line) - unsigned char *insn; - const struct s390_operand *operand; - offsetT val; - char *file; - unsigned int line; +s390_insert_operand (unsigned char *insn, + const struct s390_operand *operand, + offsetT val, + char *file, + unsigned int line) { addressT uval; int offset; @@ -643,14 +625,9 @@ struct map_tls bfd_reloc_code_real_type reloc; }; -static bfd_reloc_code_real_type s390_tls_suffix - PARAMS ((char **, expressionS *)); - /* Parse tls marker and return the desired relocation. */ static bfd_reloc_code_real_type -s390_tls_suffix (str_p, exp_p) - char **str_p; - expressionS *exp_p; +s390_tls_suffix (char **str_p, expressionS *exp_p) { static struct map_tls mapping[] = { @@ -723,17 +700,10 @@ struct map_bfd elf_suffix_type suffix; }; -static elf_suffix_type s390_elf_suffix PARAMS ((char **, expressionS *)); -static int s390_exp_compare PARAMS ((expressionS *exp1, expressionS *exp2)); -static elf_suffix_type s390_lit_suffix - PARAMS ((char **, expressionS *, elf_suffix_type)); - /* Parse @got/@plt/@gotoff. and return the desired relocation. */ static elf_suffix_type -s390_elf_suffix (str_p, exp_p) - char **str_p; - expressionS *exp_p; +s390_elf_suffix (char **str_p, expressionS *exp_p) { static struct map_bfd mapping[] = { @@ -840,9 +810,7 @@ static int lp_count = 0; static int lpe_count = 0; static int -s390_exp_compare (exp1, exp2) - expressionS *exp1; - expressionS *exp2; +s390_exp_compare (expressionS *exp1, expressionS *exp2) { if (exp1->X_op != exp2->X_op) return 0; @@ -894,10 +862,7 @@ s390_exp_compare (exp1, exp2) /* Test for @lit and if its present make an entry in the literal pool and modify the current expression to be an offset into the literal pool. */ static elf_suffix_type -s390_lit_suffix (str_p, exp_p, suffix) - char **str_p; - expressionS *exp_p; - elf_suffix_type suffix; +s390_lit_suffix (char **str_p, expressionS *exp_p, elf_suffix_type suffix) { bfd_reloc_code_real_type reloc; char tmp_name[64]; @@ -1040,8 +1005,7 @@ s390_lit_suffix (str_p, exp_p, suffix) /* Like normal .long/.short/.word, except support @got, etc. clobbers input_line_pointer, checks end-of-line. */ static void -s390_elf_cons (nbytes) - register int nbytes; /* 1=.byte, 2=.word, 4=.long */ +s390_elf_cons (int nbytes /* 1=.byte, 2=.word, 4=.long */) { expressionS exp; elf_suffix_type suffix; @@ -1170,10 +1134,9 @@ struct s390_fixup /* This routine is called for each instruction to be assembled. */ static char * -md_gather_operands (str, insn, opcode) - char *str; - unsigned char *insn; - const struct s390_opcode *opcode; +md_gather_operands (char *str, + unsigned char *insn, + const struct s390_opcode *opcode) { struct s390_fixup fixups[MAX_INSN_FIXUPS]; const struct s390_operand *operand; @@ -1545,8 +1508,7 @@ md_gather_operands (str, insn, opcode) /* This routine is called for each instruction to be assembled. */ void -md_assemble (str) - char *str; +md_assemble (char *str) { const struct s390_opcode *opcode; unsigned char insn[6]; @@ -1598,8 +1560,7 @@ md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol) #endif void -s390_bss (ignore) - int ignore ATTRIBUTE_UNUSED; +s390_bss (int ignore ATTRIBUTE_UNUSED) { /* We don't support putting frags in the BSS segment, we fake it by marking in_bss, then looking at s_skip for clues. */ @@ -1611,8 +1572,7 @@ s390_bss (ignore) /* Pseudo-op handling. */ void -s390_insn (ignore) - int ignore ATTRIBUTE_UNUSED; +s390_insn (int ignore ATTRIBUTE_UNUSED) { expressionS exp; const struct s390_opcode *opformat; @@ -1681,8 +1641,7 @@ s390_insn (ignore) pseudo-op, but it can also take a single ASCII string. */ static void -s390_byte (ignore) - int ignore ATTRIBUTE_UNUSED; +s390_byte (int ignore ATTRIBUTE_UNUSED) { if (*input_line_pointer != '\"') { @@ -1717,8 +1676,7 @@ s390_byte (ignore) @lit suffix. */ static void -s390_literals (ignore) - int ignore ATTRIBUTE_UNUSED; +s390_literals (int ignore ATTRIBUTE_UNUSED) { struct s390_lpe *lpe; @@ -1785,9 +1743,7 @@ md_atof (int type, char *litp, int *sizep) /* Align a section (I don't know why this is machine dependent). */ valueT -md_section_align (seg, addr) - asection *seg; - valueT addr; +md_section_align (asection *seg, valueT addr) { int align = bfd_get_section_alignment (stdoutput, seg); @@ -1797,9 +1753,8 @@ md_section_align (seg, addr) /* We don't have any form of relaxing. */ int -md_estimate_size_before_relax (fragp, seg) - fragS *fragp ATTRIBUTE_UNUSED; - asection *seg ATTRIBUTE_UNUSED; +md_estimate_size_before_relax (fragS *fragp ATTRIBUTE_UNUSED, + asection *seg ATTRIBUTE_UNUSED) { abort (); return 0; @@ -1808,17 +1763,15 @@ md_estimate_size_before_relax (fragp, seg) /* Convert a machine dependent frag. We never generate these. */ void -md_convert_frag (abfd, sec, fragp) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - fragS *fragp ATTRIBUTE_UNUSED; +md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + fragS *fragp ATTRIBUTE_UNUSED) { abort (); } symbolS * -md_undefined_symbol (name) - char *name; +md_undefined_symbol (char *name) { if (*name == '_' && *(name + 1) == 'G' && strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) @@ -1841,9 +1794,7 @@ md_undefined_symbol (name) given a PC relative reloc. */ long -md_pcrel_from_section (fixp, sec) - fixS *fixp; - segT sec ATTRIBUTE_UNUSED; +md_pcrel_from_section (fixS *fixp, segT sec ATTRIBUTE_UNUSED) { return fixp->fx_frag->fr_address + fixp->fx_where; } @@ -1853,8 +1804,7 @@ md_pcrel_from_section (fixp, sec) to make sure that the dynamic relocations are done correctly, so in some cases we force the original symbol to be used. */ int -tc_s390_fix_adjustable (fixP) - fixS *fixP; +tc_s390_fix_adjustable (fixS *fixP) { /* Don't adjust references to merge sections. */ if ((S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE) != 0) @@ -1912,8 +1862,7 @@ tc_s390_fix_adjustable (fixP) /* Return true if we must always emit a reloc for a type and false if there is some hope of resolving it at assembly time. */ int -tc_s390_force_relocation (fixp) - struct fix *fixp; +tc_s390_force_relocation (struct fix *fixp) { /* Ensure we emit a relocation for every reference to the global offset table or to the procedure link table. */ @@ -1960,10 +1909,7 @@ tc_s390_force_relocation (fixp) fixup. */ void -md_apply_fix (fixP, valP, seg) - fixS *fixP; - valueT *valP; - segT seg ATTRIBUTE_UNUSED; +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *where; valueT value = *valP; @@ -2247,9 +2193,7 @@ md_apply_fix (fixP, valP, seg) /* Generate a reloc for a fixup. */ arelent * -tc_gen_reloc (seg, fixp) - asection *seg ATTRIBUTE_UNUSED; - fixS *fixp; +tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) { bfd_reloc_code_real_type code; arelent *reloc; @@ -2284,7 +2228,7 @@ tc_gen_reloc (seg, fixp) } void -s390_cfi_frame_initial_instructions () +s390_cfi_frame_initial_instructions (void) { cfi_add_CFA_def_cfa (15, s390_arch_size == 64 ? 160 : 96); } diff --git a/gas/config/tc-s390.h b/gas/config/tc-s390.h index 541b642..1636400 100644 --- a/gas/config/tc-s390.h +++ b/gas/config/tc-s390.h @@ -1,5 +1,5 @@ /* tc-s390.h -- Header file for tc-s390.c. - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Written by Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -25,25 +25,25 @@ struct fix; #define TC_FORCE_RELOCATION(FIX) tc_s390_force_relocation(FIX) -extern int tc_s390_force_relocation PARAMS ((struct fix *)); +extern int tc_s390_force_relocation (struct fix *); /* Don't resolve foo@PLT-bar to offset@PLT. */ #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \ (! SEG_NORMAL (SEG) || TC_FORCE_RELOCATION (FIX)) #define tc_fix_adjustable(X) tc_s390_fix_adjustable(X) -extern int tc_s390_fix_adjustable PARAMS ((struct fix *)); +extern int tc_s390_fix_adjustable (struct fix *); /* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 /* The target BFD architecture. */ #define TARGET_ARCH bfd_arch_s390 -extern enum bfd_architecture s390_arch PARAMS ((void)); +extern enum bfd_architecture s390_arch (void); /* The target BFD format. */ #define TARGET_FORMAT s390_target_format() -extern const char *s390_target_format PARAMS ((void)); +extern const char *s390_target_format (void); /* Set the endianness we are using. */ #define TARGET_BYTES_BIG_ENDIAN 1 @@ -75,20 +75,20 @@ extern int target_big_endian; /* call md_pcrel_from_section, not md_pcrel_from */ #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section(FIX, SEC) -extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); +extern long md_pcrel_from_section (struct fix *, segT); #define md_operand(x) -extern void s390_md_end PARAMS ((void)); +extern void s390_md_end (void); #define md_end() s390_md_end () #define TARGET_USE_CFIPOP 1 #define tc_cfi_frame_initial_instructions s390_cfi_frame_initial_instructions -extern void s390_cfi_frame_initial_instructions PARAMS ((void)); +extern void s390_cfi_frame_initial_instructions (void); #define tc_regname_to_dw2regnum tc_s390_regname_to_dw2regnum -extern int tc_s390_regname_to_dw2regnum PARAMS ((char *regname)); +extern int tc_s390_regname_to_dw2regnum (char *regname); extern int s390_cie_data_alignment; diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index f8a283c..5f325f6 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1,6 +1,6 @@ /* tc-sparc.c -- Assemble for the SPARC Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -37,21 +37,10 @@ #define U0xffffffff ((((unsigned long) 1 << 16) << 16) - 1) #define U0x80000000 ((((unsigned long) 1 << 16) << 15)) -static struct sparc_arch *lookup_arch PARAMS ((char *)); -static void init_default_arch PARAMS ((void)); -static int sparc_ip PARAMS ((char *, const struct sparc_opcode **)); -static int in_signed_range PARAMS ((bfd_signed_vma, bfd_signed_vma)); -static int in_unsigned_range PARAMS ((bfd_vma, bfd_vma)); -static int in_bitfield_range PARAMS ((bfd_signed_vma, bfd_signed_vma)); -static int sparc_ffs PARAMS ((unsigned int)); -static void synthetize_setuw PARAMS ((const struct sparc_opcode *)); -static void synthetize_setsw PARAMS ((const struct sparc_opcode *)); -static void synthetize_setx PARAMS ((const struct sparc_opcode *)); -static bfd_vma BSR PARAMS ((bfd_vma, int)); -static int cmp_reg_entry PARAMS ((const PTR, const PTR)); -static int parse_keyword_arg PARAMS ((int (*) (const char *), char **, int *)); -static int parse_const_expr_arg PARAMS ((char **, int *)); -static int get_expression PARAMS ((char *str)); +static int sparc_ip (char *, const struct sparc_opcode **); +static int parse_keyword_arg (int (*) (const char *), char **, int *); +static int parse_const_expr_arg (char **, int *); +static int get_expression (char *); /* Default architecture. */ /* ??? The default value should be V8, but sparclite support was added @@ -131,17 +120,16 @@ int sparc_cie_data_alignment; /* Handle of the OPCODE hash table. */ static struct hash_control *op_hash; -static int mylog2 PARAMS ((int)); -static void s_data1 PARAMS ((void)); -static void s_seg PARAMS ((int)); -static void s_proc PARAMS ((int)); -static void s_reserve PARAMS ((int)); -static void s_common PARAMS ((int)); -static void s_empty PARAMS ((int)); -static void s_uacons PARAMS ((int)); -static void s_ncons PARAMS ((int)); +static void s_data1 (void); +static void s_seg (int); +static void s_proc (int); +static void s_reserve (int); +static void s_common (int); +static void s_empty (int); +static void s_uacons (int); +static void s_ncons (int); #ifdef OBJ_ELF -static void s_register PARAMS ((int)); +static void s_register (int); #endif const pseudo_typeS md_pseudo_table[] = @@ -217,8 +205,7 @@ struct sparc_it struct sparc_it the_insn, set_insn; -static void output_insn - PARAMS ((const struct sparc_opcode *, struct sparc_it *)); +static void output_insn (const struct sparc_opcode *, struct sparc_it *); /* Table of arguments to -A. The sparc_opcode_arch table in sparc-opc.c is insufficient and incorrect @@ -260,8 +247,7 @@ static struct sparc_arch { static enum sparc_arch_types default_arch_type; static struct sparc_arch * -lookup_arch (name) - char *name; +lookup_arch (char *name) { struct sparc_arch *sa; @@ -277,7 +263,7 @@ lookup_arch (name) architecture name. */ static void -init_default_arch () +init_default_arch (void) { struct sparc_arch *sa = lookup_arch (default_arch); @@ -296,7 +282,7 @@ init_default_arch () /* Called by TARGET_FORMAT. */ const char * -sparc_target_format () +sparc_target_format (void) { /* We don't get a chance to initialize anything before we're called, so handle that now. */ @@ -451,9 +437,7 @@ struct option md_longopts[] = { size_t md_longopts_size = sizeof (md_longopts); int -md_parse_option (c, arg) - int c; - char *arg; +md_parse_option (int c, char *arg) { /* We don't get a chance to initialize anything before we're called, so handle that now. */ @@ -622,8 +606,7 @@ md_parse_option (c, arg) } void -md_show_usage (stream) - FILE *stream; +md_show_usage (FILE *stream) { const struct sparc_arch *arch; int column; @@ -791,9 +774,7 @@ struct priv_reg_entry v9a_asr_table[] = }; static int -cmp_reg_entry (parg, qarg) - const PTR parg; - const PTR qarg; +cmp_reg_entry (const void *parg, const void *qarg) { const struct priv_reg_entry *p = (const struct priv_reg_entry *) parg; const struct priv_reg_entry *q = (const struct priv_reg_entry *) qarg; @@ -806,7 +787,7 @@ cmp_reg_entry (parg, qarg) need. */ void -md_begin () +md_begin (void) { register const char *retval = NULL; int lose = 0; @@ -824,7 +805,7 @@ md_begin () while (i < (unsigned int) sparc_num_opcodes) { const char *name = sparc_opcodes[i].name; - retval = hash_insert (op_hash, name, (PTR) &sparc_opcodes[i]); + retval = hash_insert (op_hash, name, (void *) &sparc_opcodes[i]); if (retval != NULL) { as_bad (_("Internal error: can't hash `%s': %s\n"), @@ -860,7 +841,8 @@ md_begin () } else { - retval = hash_insert (op_hash, native_op_table[i].name, (PTR) insn); + retval = hash_insert (op_hash, native_op_table[i].name, + (void *) insn); if (retval != NULL) { as_bad (_("Internal error: can't hash `%s': %s\n"), @@ -904,7 +886,7 @@ md_begin () /* Called after all assembly has been done. */ void -sparc_md_end () +sparc_md_end (void) { unsigned long mach = bfd_mach_sparc; @@ -932,9 +914,8 @@ sparc_md_end () /* Return non-zero if VAL is in the range -(MAX+1) to MAX. */ -static INLINE int -in_signed_range (val, max) - bfd_signed_vma val, max; +static inline int +in_signed_range (bfd_signed_vma val, bfd_signed_vma max) { if (max <= 0) abort (); @@ -954,9 +935,8 @@ in_signed_range (val, max) /* Return non-zero if VAL is in the range 0 to MAX. */ -static INLINE int -in_unsigned_range (val, max) - bfd_vma val, max; +static inline int +in_unsigned_range (bfd_vma val, bfd_vma max) { if (val > max) return 0; @@ -966,9 +946,8 @@ in_unsigned_range (val, max) /* Return non-zero if VAL is in the range -(MAX/2+1) to MAX. (e.g. -15 to +31). */ -static INLINE int -in_bitfield_range (val, max) - bfd_signed_vma val, max; +static inline int +in_bitfield_range (bfd_signed_vma val, bfd_signed_vma max) { if (max <= 0) abort (); @@ -980,8 +959,7 @@ in_bitfield_range (val, max) } static int -sparc_ffs (mask) - unsigned int mask; +sparc_ffs (unsigned int mask) { int i; @@ -995,9 +973,7 @@ sparc_ffs (mask) /* Implement big shift right. */ static bfd_vma -BSR (val, amount) - bfd_vma val; - int amount; +BSR (bfd_vma val, int amount) { if (sizeof (bfd_vma) <= 4 && amount >= 32) as_fatal (_("Support for 64-bit arithmetic not compiled in.")); @@ -1034,8 +1010,7 @@ static unsigned long last_opcode; /* Handle the set and setuw synthetic instructions. */ static void -synthetize_setuw (insn) - const struct sparc_opcode *insn; +synthetize_setuw (const struct sparc_opcode *insn) { int need_hi22_p = 0; int rd = (the_insn.opcode & RD (~0)) >> 25; @@ -1093,8 +1068,7 @@ synthetize_setuw (insn) /* Handle the setsw synthetic instruction. */ static void -synthetize_setsw (insn) - const struct sparc_opcode *insn; +synthetize_setsw (const struct sparc_opcode *insn) { int low32, rd, opc; @@ -1145,8 +1119,7 @@ synthetize_setsw (insn) /* Handle the setsw synthetic instruction. */ static void -synthetize_setx (insn) - const struct sparc_opcode *insn; +synthetize_setx (const struct sparc_opcode *insn) { int upper32, lower32; int tmpreg = (the_insn.opcode & RS1 (~0)) >> 14; @@ -1312,8 +1285,7 @@ synthetize_setx (insn) /* Main entry point to assemble one instruction. */ void -md_assemble (str) - char *str; +md_assemble (char *str) { const struct sparc_opcode *insn; int special_case; @@ -1394,9 +1366,7 @@ md_assemble (str) /* Subroutine of md_assemble to do the actual parsing. */ static int -sparc_ip (str, pinsn) - char *str; - const struct sparc_opcode **pinsn; +sparc_ip (char *str, const struct sparc_opcode **pinsn) { char *error_message = ""; char *s; @@ -2832,10 +2802,9 @@ sparc_ip (str, pinsn) If successful, INPUT_POINTER is updated. */ static int -parse_keyword_arg (lookup_fn, input_pointerP, valueP) - int (*lookup_fn) PARAMS ((const char *)); - char **input_pointerP; - int *valueP; +parse_keyword_arg (int (*lookup_fn) (const char *), + char **input_pointerP, + int *valueP) { int value; char c, *p, *q; @@ -2860,9 +2829,7 @@ parse_keyword_arg (lookup_fn, input_pointerP, valueP) The result is a boolean indicating success. */ static int -parse_const_expr_arg (input_pointerP, valueP) - char **input_pointerP; - int *valueP; +parse_const_expr_arg (char **input_pointerP, int *valueP) { char *save = input_line_pointer; expressionS exp; @@ -2892,8 +2859,7 @@ parse_const_expr_arg (input_pointerP, valueP) /* Subroutine of sparc_ip to parse an expression. */ static int -get_expression (str) - char *str; +get_expression (char *str) { char *save_in; segT seg; @@ -2920,9 +2886,7 @@ get_expression (str) /* Subroutine of md_assemble to output one insn. */ static void -output_insn (insn, the_insn) - const struct sparc_opcode *insn; - struct sparc_it *the_insn; +output_insn (const struct sparc_opcode *insn, struct sparc_it *the_insn) { char *toP = frag_more (4); @@ -2968,10 +2932,7 @@ md_atof (int type, char *litP, int *sizeP) endianness. */ void -md_number_to_chars (buf, val, n) - char *buf; - valueT val; - int n; +md_number_to_chars (char *buf, valueT val, int n) { if (target_big_endian) number_to_chars_bigendian (buf, val, n); @@ -2988,10 +2949,7 @@ md_number_to_chars (buf, val, n) hold. */ void -md_apply_fix (fixP, valP, segment) - fixS *fixP; - valueT *valP; - segT segment ATTRIBUTE_UNUSED; +md_apply_fix (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED) { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; offsetT val = * (offsetT *) valP; @@ -3379,9 +3337,7 @@ md_apply_fix (fixP, valP, segment) format. */ arelent ** -tc_gen_reloc (section, fixp) - asection *section; - fixS *fixp; +tc_gen_reloc (asection *section, fixS *fixp) { static arelent *relocs[3]; arelent *reloc; @@ -3609,8 +3565,7 @@ tc_gen_reloc (section, fixp) /* We have no need to default values of symbols. */ symbolS * -md_undefined_symbol (name) - char *name ATTRIBUTE_UNUSED; +md_undefined_symbol (char *name ATTRIBUTE_UNUSED) { return 0; } @@ -3618,9 +3573,7 @@ md_undefined_symbol (name) /* Round up a section size to the appropriate boundary. */ valueT -md_section_align (segment, size) - segT segment ATTRIBUTE_UNUSED; - valueT size; +md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size) { #ifndef OBJ_ELF /* This is not right for ELF; a.out wants it, and COFF will force @@ -3643,8 +3596,7 @@ md_section_align (segment, size) its size. This gets us to the following instruction. (??? Is this right? FIXME-SOON) */ long -md_pcrel_from (fixP) - fixS *fixP; +md_pcrel_from (fixS *fixP) { long ret; @@ -3660,8 +3612,7 @@ md_pcrel_from (fixP) of two. */ static int -mylog2 (value) - int value; +mylog2 (int value) { int shift; @@ -3681,8 +3632,7 @@ static int max_alignment = 15; #endif static void -s_reserve (ignore) - int ignore ATTRIBUTE_UNUSED; +s_reserve (int ignore ATTRIBUTE_UNUSED) { char *name; char *p; @@ -3826,8 +3776,7 @@ s_reserve (ignore) } static void -s_common (ignore) - int ignore ATTRIBUTE_UNUSED; +s_common (int ignore ATTRIBUTE_UNUSED) { char *name; char c; @@ -4006,8 +3955,7 @@ s_common (ignore) invalid delay slot usage. */ static void -s_empty (ignore) - int ignore ATTRIBUTE_UNUSED; +s_empty (int ignore ATTRIBUTE_UNUSED) { /* The easy way to implement is to just forget about the last instruction. */ @@ -4015,8 +3963,7 @@ s_empty (ignore) } static void -s_seg (ignore) - int ignore ATTRIBUTE_UNUSED; +s_seg (int ignore ATTRIBUTE_UNUSED) { if (strncmp (input_line_pointer, "\"text\"", 6) == 0) @@ -4051,15 +3998,14 @@ s_seg (ignore) } static void -s_data1 () +s_data1 (void) { subseg_set (data_section, 1); demand_empty_rest_of_line (); } static void -s_proc (ignore) - int ignore ATTRIBUTE_UNUSED; +s_proc (int ignore ATTRIBUTE_UNUSED) { while (!is_end_of_line[(unsigned char) *input_line_pointer]) { @@ -4083,8 +4029,7 @@ static const char *sparc_cons_special_reloc; to be aligned. */ static void -s_uacons (bytes) - int bytes; +s_uacons (int bytes) { /* Tell sparc_cons_align not to align this value. */ sparc_no_align_cons = 1; @@ -4097,8 +4042,7 @@ s_uacons (bytes) sparc_arch_size 64 it is equivalent to .xword. */ static void -s_ncons (bytes) - int bytes ATTRIBUTE_UNUSED; +s_ncons (int bytes ATTRIBUTE_UNUSED) { cons (sparc_arch_size == 32 ? 4 : 8); } @@ -4112,8 +4056,7 @@ s_ncons (bytes) */ static void -s_register (ignore) - int ignore ATTRIBUTE_UNUSED; +s_register (int ignore ATTRIBUTE_UNUSED) { char c; int reg; @@ -4201,7 +4144,7 @@ s_register (ignore) symbols which need it. */ void -sparc_adjust_symtab () +sparc_adjust_symtab (void) { symbolS *sym; @@ -4232,8 +4175,7 @@ sparc_adjust_symtab () option to check for it. */ void -sparc_cons_align (nbytes) - int nbytes; +sparc_cons_align (int nbytes) { int nalign; char *p; @@ -4268,8 +4210,7 @@ sparc_cons_align (nbytes) /* This is called from HANDLE_ALIGN in tc-sparc.h. */ void -sparc_handle_align (fragp) - fragS *fragp; +sparc_handle_align (fragS *fragp) { int count, fix; char *p; @@ -4325,7 +4266,7 @@ sparc_handle_align (fragp) /* Some special processing for a Sparc ELF file. */ void -sparc_elf_final_processing () +sparc_elf_final_processing (void) { /* Set the Sparc ELF flag bits. FIXME: There should probably be some sort of BFD interface for this. */ @@ -4352,9 +4293,7 @@ sparc_elf_final_processing () } void -sparc_cons (exp, size) - expressionS *exp; - int size; +sparc_cons (expressionS *exp, int size) { char *save; @@ -4495,11 +4434,10 @@ sparc_cons (exp, size) we want to handle little endian relocs specially. */ void -cons_fix_new_sparc (frag, where, nbytes, exp) - fragS *frag; - int where; - unsigned int nbytes; - expressionS *exp; +cons_fix_new_sparc (fragS *frag, + int where, + unsigned int nbytes, + expressionS *exp) { bfd_reloc_code_real_type r; @@ -4552,7 +4490,7 @@ cons_fix_new_sparc (frag, where, nbytes, exp) } void -sparc_cfi_frame_initial_instructions () +sparc_cfi_frame_initial_instructions (void) { cfi_add_CFA_def_cfa (14, sparc_arch_size == 64 ? 0x7ff : 0); } diff --git a/gas/config/tc-sparc.h b/gas/config/tc-sparc.h index 869f943..7f9d20a 100644 --- a/gas/config/tc-sparc.h +++ b/gas/config/tc-sparc.h @@ -1,6 +1,6 @@ /* tc-sparc.h - Macros and type defines for the sparc. Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2005, 2007 + 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -45,7 +45,7 @@ struct frag; #define ELF64_TARGET_FORMAT "elf64-sparc" #endif -extern const char *sparc_target_format PARAMS ((void)); +extern const char *sparc_target_format (void); #define TARGET_FORMAT sparc_target_format () #define RELOC_EXPANSION_POSSIBLE @@ -67,10 +67,10 @@ extern int sparc_pic_code; /* We require .word, et. al., to be aligned correctly. */ #define md_cons_align(nbytes) sparc_cons_align (nbytes) -extern void sparc_cons_align PARAMS ((int)); +extern void sparc_cons_align (int); #define HANDLE_ALIGN(fragp) sparc_handle_align (fragp) -extern void sparc_handle_align PARAMS ((struct frag *)); +extern void sparc_handle_align (struct frag *); #define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4 + 4) @@ -125,7 +125,7 @@ extern void sparc_handle_align PARAMS ((struct frag *)); /* Finish up the entire symtab. */ #define tc_adjust_symtab() sparc_adjust_symtab () -extern void sparc_adjust_symtab PARAMS ((void)); +extern void sparc_adjust_symtab (void); #endif #ifdef OBJ_AOUT @@ -143,23 +143,23 @@ extern void sparc_adjust_symtab PARAMS ((void)); #endif #define elf_tc_final_processing sparc_elf_final_processing -extern void sparc_elf_final_processing PARAMS ((void)); +extern void sparc_elf_final_processing (void); #define md_operand(x) -extern void sparc_md_end PARAMS ((void)); +extern void sparc_md_end (void); #define md_end() sparc_md_end () #endif #ifdef OBJ_ELF #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) sparc_cons (EXP, NBYTES) -extern void sparc_cons PARAMS ((expressionS *, int)); +extern void sparc_cons (expressionS *, int); #endif #define TC_CONS_FIX_NEW cons_fix_new_sparc extern void cons_fix_new_sparc - PARAMS ((struct frag *, int, unsigned int, struct expressionS *)); + (struct frag *, int, unsigned int, struct expressionS *); #define TC_FIX_TYPE valueT @@ -181,13 +181,13 @@ extern void cons_fix_new_sparc #define TARGET_USE_CFIPOP 1 #define tc_cfi_frame_initial_instructions sparc_cfi_frame_initial_instructions -extern void sparc_cfi_frame_initial_instructions PARAMS ((void)); +extern void sparc_cfi_frame_initial_instructions (void); #define tc_regname_to_dw2regnum sparc_regname_to_dw2regnum -extern int sparc_regname_to_dw2regnum PARAMS ((char *regname)); +extern int sparc_regname_to_dw2regnum (char *regname); #define tc_cfi_emit_pcrel_expr sparc_cfi_emit_pcrel_expr -extern void sparc_cfi_emit_pcrel_expr PARAMS ((expressionS *, unsigned int)); +extern void sparc_cfi_emit_pcrel_expr (expressionS *, unsigned int); extern int sparc_cie_data_alignment; diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c index 3b579d4..e159e34 100644 --- a/gas/config/tc-spu.c +++ b/gas/config/tc-spu.c @@ -1,6 +1,6 @@ /* spu.c -- Assembler for the IBM Synergistic Processing Unit (SPU) - Copyright 2006, 2007 Free Software Foundation, Inc. + Copyright 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -99,7 +99,7 @@ const pseudo_typeS md_pseudo_table[] = /* Likewise for eqv. */ {"eqv", NULL, 0}, {".eqv", s_set, -1}, - {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 }, + {"file", (void (*) (int)) dwarf2_directive_file, 0 }, {"loc", dwarf2_directive_loc, 0}, {0,0,0} }; @@ -120,7 +120,8 @@ md_begin (void) { /* hash each mnemonic and record its position */ - retval = hash_insert (op_hash, spu_opcodes[i].mnemonic, (PTR)&spu_opcodes[i]); + retval = hash_insert (op_hash, spu_opcodes[i].mnemonic, + (void *) &spu_opcodes[i]); if (retval != NULL && strcmp (retval, "exists") != 0) as_fatal (_("Can't hash instruction '%s':%s"), diff --git a/gas/config/tc-spu.h b/gas/config/tc-spu.h index 0670853..11f7dc1 100644 --- a/gas/config/tc-spu.h +++ b/gas/config/tc-spu.h @@ -1,6 +1,6 @@ /* spu.h -- Assembler for spu - Copyright 2006, 2007 Free Software Foundation, Inc. + Copyright 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -99,7 +99,7 @@ extern symbolS *section_symbol (asection *); } while (0) /* Fill in rs_align_code fragments. */ -extern void spu_handle_align PARAMS ((fragS *)); +extern void spu_handle_align (fragS *); #define HANDLE_ALIGN(frag) spu_handle_align (frag) #define MAX_MEM_FOR_RS_ALIGN_CODE (7 + 8) diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c index 4c80c19..398a864 100644 --- a/gas/config/tc-tic4x.c +++ b/gas/config/tc-tic4x.c @@ -144,78 +144,17 @@ tic4x_insn_t; static tic4x_insn_t the_insn; /* Info about our instruction. */ static tic4x_insn_t *insn = &the_insn; -static int tic4x_gen_to_words - PARAMS ((FLONUM_TYPE, LITTLENUM_TYPE *, int )); -static char *tic4x_atof - PARAMS ((char *, char, LITTLENUM_TYPE * )); -static void tic4x_insert_reg - PARAMS ((char *, int )); -static void tic4x_insert_sym - PARAMS ((char *, int )); -static char *tic4x_expression - PARAMS ((char *, expressionS *)); -static char *tic4x_expression_abs - PARAMS ((char *, offsetT *)); -static void tic4x_emit_char - PARAMS ((char, int)); -static void tic4x_seg_alloc - PARAMS ((char *, segT, int, symbolS *)); -static void tic4x_asg - PARAMS ((int)); -static void tic4x_bss - PARAMS ((int)); -static void tic4x_globl - PARAMS ((int)); -static void tic4x_cons - PARAMS ((int)); -static void tic4x_stringer - PARAMS ((int)); -static void tic4x_eval - PARAMS ((int)); -static void tic4x_newblock - PARAMS ((int)); -static void tic4x_sect - PARAMS ((int)); -static void tic4x_set - PARAMS ((int)); -static void tic4x_usect - PARAMS ((int)); -static void tic4x_version - PARAMS ((int)); -static void tic4x_init_regtable - PARAMS ((void)); -static void tic4x_init_symbols - PARAMS ((void)); -static int tic4x_inst_insert (const tic4x_inst_t *); -static tic4x_inst_t *tic4x_inst_make - PARAMS ((char *, unsigned long, char *)); -static int tic4x_inst_add (const tic4x_inst_t *); -void tic4x_end - PARAMS ((void)); -static int tic4x_indirect_parse - PARAMS ((tic4x_operand_t *, const tic4x_indirect_t *)); -static char *tic4x_operand_parse - PARAMS ((char *, tic4x_operand_t *)); -static int tic4x_operands_match - PARAMS ((tic4x_inst_t *, tic4x_insn_t *, int)); -static void tic4x_insn_check - PARAMS ((tic4x_insn_t *)); -static void tic4x_insn_output - PARAMS ((tic4x_insn_t *)); -static int tic4x_operands_parse - PARAMS ((char *, tic4x_operand_t *, int )); -void tic4x_cleanup - PARAMS ((void)); -int tic4x_unrecognized_line - PARAMS ((int)); -static int tic4x_pc_offset - PARAMS ((unsigned int)); -int tic4x_do_align - PARAMS ((int, const char *, int, int)); -void tic4x_start_line - PARAMS ((void)); -arelent *tc_gen_reloc - PARAMS ((asection *, fixS *)); +static void tic4x_asg (int); +static void tic4x_bss (int); +static void tic4x_globl (int); +static void tic4x_cons (int); +static void tic4x_stringer (int); +static void tic4x_eval (int); +static void tic4x_newblock (int); +static void tic4x_sect (int); +static void tic4x_set (int); +static void tic4x_usect (int); +static void tic4x_version (int); const pseudo_typeS @@ -300,10 +239,7 @@ extern FLONUM_TYPE generic_floating_point_number; /* Turn generic_floating_point_number into a real short/float/double. */ static int -tic4x_gen_to_words (flonum, words, precision) - FLONUM_TYPE flonum; - LITTLENUM_TYPE *words; - int precision; +tic4x_gen_to_words (FLONUM_TYPE flonum, LITTLENUM_TYPE *words, int precision) { int return_value = 0; LITTLENUM_TYPE *p; /* Littlenum pointer. */ @@ -617,10 +553,7 @@ tic4x_gen_to_words (flonum, words, precision) /* Returns pointer past text consumed. */ static char * -tic4x_atof (str, what_kind, words) - char *str; - char what_kind; - LITTLENUM_TYPE *words; +tic4x_atof (char *str, char what_kind, LITTLENUM_TYPE *words) { /* Extra bits for zeroed low-order bits. The 1st MAX_PRECISION are zeroed, the last contain flonum bits. */ @@ -693,9 +626,7 @@ tic4x_atof (str, what_kind, words) } static void -tic4x_insert_reg (regname, regnum) - char *regname; - int regnum; +tic4x_insert_reg (char *regname, int regnum) { char buf[32]; int i; @@ -711,9 +642,7 @@ tic4x_insert_reg (regname, regnum) } static void -tic4x_insert_sym (symname, value) - char *symname; - int value; +tic4x_insert_sym (char *symname, int value) { symbolS *symbolP; @@ -724,9 +653,7 @@ tic4x_insert_sym (symname, value) } static char * -tic4x_expression (str, exp) - char *str; - expressionS *exp; +tic4x_expression (char *str, expressionS *exp) { char *s; char *t; @@ -740,9 +667,7 @@ tic4x_expression (str, exp) } static char * -tic4x_expression_abs (str, value) - char *str; - offsetT *value; +tic4x_expression_abs (char *str, offsetT *value) { char *s; char *t; @@ -756,9 +681,7 @@ tic4x_expression_abs (str, value) } static void -tic4x_emit_char (c,b) - char c; - int b; +tic4x_emit_char (char c, int b) { expressionS exp; @@ -768,11 +691,10 @@ tic4x_emit_char (c,b) } static void -tic4x_seg_alloc (name, seg, size, symbolP) - char *name ATTRIBUTE_UNUSED; - segT seg ATTRIBUTE_UNUSED; - int size; - symbolS *symbolP; +tic4x_seg_alloc (char *name ATTRIBUTE_UNUSED, + segT seg ATTRIBUTE_UNUSED, + int size, + symbolS *symbolP) { /* Note that the size is in words so we multiply it by 4 to get the number of bytes to allocate. */ @@ -794,8 +716,7 @@ tic4x_seg_alloc (name, seg, size, symbolP) /* .asg ["]character-string["], symbol */ static void -tic4x_asg (x) - int x ATTRIBUTE_UNUSED; +tic4x_asg (int x ATTRIBUTE_UNUSED) { char c; char *name; @@ -823,17 +744,16 @@ tic4x_asg (x) strcpy (tmp, name); name = tmp; if (hash_find (tic4x_asg_hash, name)) - hash_replace (tic4x_asg_hash, name, (PTR) str); + hash_replace (tic4x_asg_hash, name, (void *) str); else - hash_insert (tic4x_asg_hash, name, (PTR) str); + hash_insert (tic4x_asg_hash, name, (void *) str); *input_line_pointer = c; demand_empty_rest_of_line (); } /* .bss symbol, size */ static void -tic4x_bss (x) - int x ATTRIBUTE_UNUSED; +tic4x_bss (int x ATTRIBUTE_UNUSED) { char c; char *name; @@ -887,8 +807,7 @@ tic4x_bss (x) } static void -tic4x_globl (ignore) - int ignore ATTRIBUTE_UNUSED; +tic4x_globl (int ignore ATTRIBUTE_UNUSED) { char *name; int c; @@ -917,8 +836,7 @@ tic4x_globl (ignore) /* Handle .byte, .word. .int, .long */ static void -tic4x_cons (bytes) - int bytes; +tic4x_cons (int bytes) { register unsigned int c; do @@ -961,8 +879,7 @@ tic4x_cons (bytes) /* Handle .ascii, .asciz, .string */ static void -tic4x_stringer (append_zero) - int append_zero; /*ex: bytes */ +tic4x_stringer (int append_zero) { int bytes; register unsigned int c; @@ -1015,8 +932,7 @@ tic4x_stringer (append_zero) /* .eval expression, symbol */ static void -tic4x_eval (x) - int x ATTRIBUTE_UNUSED; +tic4x_eval (int x ATTRIBUTE_UNUSED) { char c; offsetT value; @@ -1038,8 +954,7 @@ tic4x_eval (x) /* Reset local labels. */ static void -tic4x_newblock (x) - int x ATTRIBUTE_UNUSED; +tic4x_newblock (int x ATTRIBUTE_UNUSED) { dollar_label_clear (); } @@ -1047,8 +962,7 @@ tic4x_newblock (x) /* .sect "section-name" [, value] */ /* .sect ["]section-name[:subsection-name]["] [, value] */ static void -tic4x_sect (x) - int x ATTRIBUTE_UNUSED; +tic4x_sect (int x ATTRIBUTE_UNUSED) { char c; char *section_name; @@ -1121,8 +1035,7 @@ tic4x_sect (x) /* symbol[:] .set value or .set symbol, value */ static void -tic4x_set (x) - int x ATTRIBUTE_UNUSED; +tic4x_set (int x ATTRIBUTE_UNUSED) { symbolS *symbolP; @@ -1152,8 +1065,7 @@ tic4x_set (x) /* [symbol] .usect ["]section-name["], size-in-words [, alignment-flag] */ static void -tic4x_usect (x) - int x ATTRIBUTE_UNUSED; +tic4x_usect (int x ATTRIBUTE_UNUSED) { char c; char *name; @@ -1219,8 +1131,7 @@ tic4x_usect (x) /* .version cpu-version. */ static void -tic4x_version (x) - int x ATTRIBUTE_UNUSED; +tic4x_version (int x ATTRIBUTE_UNUSED) { offsetT temp; @@ -1237,7 +1148,7 @@ tic4x_version (x) } static void -tic4x_init_regtable () +tic4x_init_regtable (void) { unsigned int i; @@ -1255,7 +1166,7 @@ tic4x_init_regtable () } static void -tic4x_init_symbols () +tic4x_init_symbols (void) { /* The TI tools accept case insensitive versions of these symbols, we don't ! @@ -1321,7 +1232,7 @@ tic4x_inst_insert (const tic4x_inst_t *inst) if (!strcmp (inst->name, prev_name) || inst->name[0] == '\0') return 1; - retval = hash_insert (tic4x_op_hash, inst->name, (PTR) inst); + retval = hash_insert (tic4x_op_hash, inst->name, (void *) inst); if (retval != NULL) fprintf (stderr, "internal error: can't hash `%s': %s\n", inst->name, retval); @@ -1332,10 +1243,7 @@ tic4x_inst_insert (const tic4x_inst_t *inst) /* Make a new instruction template. */ static tic4x_inst_t * -tic4x_inst_make (name, opcode, args) - char *name; - unsigned long opcode; - char *args; +tic4x_inst_make (char *name, unsigned long opcode, char *args) { static tic4x_inst_t *insts = NULL; static char *names = NULL; @@ -1436,7 +1344,7 @@ tic4x_inst_add (const tic4x_inst_t *insts) set up all the tables, etc., that the MD part of the assembler will need. */ void -md_begin () +md_begin (void) { int ok = 1; unsigned int i; @@ -1493,16 +1401,15 @@ md_begin () } void -tic4x_end () +tic4x_end (void) { bfd_set_arch_mach (stdoutput, bfd_arch_tic4x, IS_CPU_TIC4X (tic4x_cpu) ? bfd_mach_tic4x : bfd_mach_tic3x); } static int -tic4x_indirect_parse (operand, indirect) - tic4x_operand_t *operand; - const tic4x_indirect_t *indirect; +tic4x_indirect_parse (tic4x_operand_t *operand, + const tic4x_indirect_t *indirect) { char *n = indirect->name; char *s = input_line_pointer; @@ -1600,9 +1507,7 @@ tic4x_indirect_parse (operand, indirect) } static char * -tic4x_operand_parse (s, operand) - char *s; - tic4x_operand_t *operand; +tic4x_operand_parse (char *s, tic4x_operand_t *operand) { unsigned int i; char c; @@ -1766,10 +1671,7 @@ tic4x_operand_parse (s, operand) } static int -tic4x_operands_match (inst, insn, check) - tic4x_inst_t *inst; - tic4x_insn_t *insn; - int check; +tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) { const char *args = inst->args; unsigned long opcode = inst->opcode; @@ -2440,8 +2342,7 @@ tic4x_operands_match (inst, insn, check) } static void -tic4x_insn_check (insn) - tic4x_insn_t *insn; +tic4x_insn_check (tic4x_insn_t *insn) { if (!strcmp(insn->name, "lda")) @@ -2472,8 +2373,7 @@ tic4x_insn_check (insn) } static void -tic4x_insn_output (insn) - tic4x_insn_t *insn; +tic4x_insn_output (tic4x_insn_t *insn) { char *dst; @@ -2498,10 +2398,7 @@ tic4x_insn_output (insn) /* Parse the operands. */ int -tic4x_operands_parse (s, operands, num_operands) - char *s; - tic4x_operand_t *operands; - int num_operands; +tic4x_operands_parse (char *s, tic4x_operand_t *operands, int num_operands) { if (!*s) return num_operands; @@ -2522,8 +2419,7 @@ tic4x_operands_parse (s, operands, num_operands) by the generic front end. We just parse mnemonic and operands, and produce the bytes of data and relocation. */ void -md_assemble (str) - char *str; +md_assemble (char *str) { int ok = 0; char *s; @@ -2648,7 +2544,7 @@ md_assemble (str) } void -tic4x_cleanup () +tic4x_cleanup (void) { if (insn->in_use) md_assemble (NULL); @@ -2733,10 +2629,7 @@ md_atof (int type, char *litP, int *sizeP) } void -md_apply_fix (fixP, value, seg) - fixS *fixP; - valueT *value; - segT seg ATTRIBUTE_UNUSED; +md_apply_fix (fixS *fixP, valueT *value, segT seg ATTRIBUTE_UNUSED) { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; valueT val = *value; @@ -2780,43 +2673,39 @@ md_apply_fix (fixP, value, seg) /* Should never be called for tic4x. */ void -md_convert_frag (headers, sec, fragP) - bfd *headers ATTRIBUTE_UNUSED; - segT sec ATTRIBUTE_UNUSED; - fragS *fragP ATTRIBUTE_UNUSED; +md_convert_frag (bfd *headers ATTRIBUTE_UNUSED, + segT sec ATTRIBUTE_UNUSED, + fragS *fragP ATTRIBUTE_UNUSED) { as_fatal ("md_convert_frag"); } /* Should never be called for tic4x. */ void -md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol) - char *ptr ATTRIBUTE_UNUSED; - addressT from_addr ATTRIBUTE_UNUSED; - addressT to_addr ATTRIBUTE_UNUSED; - fragS *frag ATTRIBUTE_UNUSED; - symbolS *to_symbol ATTRIBUTE_UNUSED; +md_create_short_jump (char *ptr ATTRIBUTE_UNUSED, + addressT from_addr ATTRIBUTE_UNUSED, + addressT to_addr ATTRIBUTE_UNUSED, + fragS *frag ATTRIBUTE_UNUSED, + symbolS *to_symbol ATTRIBUTE_UNUSED) { as_fatal ("md_create_short_jmp\n"); } /* Should never be called for tic4x. */ void -md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol) - char *ptr ATTRIBUTE_UNUSED; - addressT from_addr ATTRIBUTE_UNUSED; - addressT to_addr ATTRIBUTE_UNUSED; - fragS *frag ATTRIBUTE_UNUSED; - symbolS *to_symbol ATTRIBUTE_UNUSED; +md_create_long_jump (char *ptr ATTRIBUTE_UNUSED, + addressT from_addr ATTRIBUTE_UNUSED, + addressT to_addr ATTRIBUTE_UNUSED, + fragS *frag ATTRIBUTE_UNUSED, + symbolS *to_symbol ATTRIBUTE_UNUSED) { as_fatal ("md_create_long_jump\n"); } /* Should never be called for tic4x. */ int -md_estimate_size_before_relax (fragP, segtype) - register fragS *fragP ATTRIBUTE_UNUSED; - segT segtype ATTRIBUTE_UNUSED; +md_estimate_size_before_relax (fragS *fragP ATTRIBUTE_UNUSED, + segT segtype ATTRIBUTE_UNUSED) { as_fatal ("md_estimate_size_before_relax\n"); return 0; @@ -2824,9 +2713,7 @@ md_estimate_size_before_relax (fragP, segtype) int -md_parse_option (c, arg) - int c; - char *arg; +md_parse_option (int c, char *arg) { switch (c) { @@ -2886,8 +2773,7 @@ md_parse_option (c, arg) } void -md_show_usage (stream) - FILE *stream; +md_show_usage (FILE *stream) { fprintf (stream, _("\nTIC4X options:\n" @@ -2915,8 +2801,7 @@ md_show_usage (stream) definitions of TI C3x tools style local labels $n where n is a single decimal digit. */ int -tic4x_unrecognized_line (c) - int c; +tic4x_unrecognized_line (int c) { int lab; char *s; @@ -2949,8 +2834,7 @@ tic4x_unrecognized_line (c) /* Handle local labels peculiar to us referred to in an expression. */ symbolS * -md_undefined_symbol (name) - char *name; +md_undefined_symbol (char *name) { /* Look for local labels of the form $n. */ if (name[0] == '$' && ISDIGIT (name[1])) @@ -2982,23 +2866,19 @@ md_undefined_symbol (name) /* Parse an operand that is machine-specific. */ void -md_operand (expressionP) - expressionS *expressionP ATTRIBUTE_UNUSED; +md_operand (expressionS *expressionP ATTRIBUTE_UNUSED) { } /* Round up a section size to the appropriate boundary---do we need this? */ valueT -md_section_align (segment, size) - segT segment ATTRIBUTE_UNUSED; - valueT size; +md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size) { return size; /* Byte (i.e., 32-bit) alignment is fine? */ } static int -tic4x_pc_offset (op) - unsigned int op; +tic4x_pc_offset (unsigned int op) { /* Determine the PC offset for a C[34]x instruction. This could be simplified using some boolean algebra @@ -3060,8 +2940,7 @@ tic4x_pc_offset (op) DBcondD, BcondD disp + PC + 3 => PC */ long -md_pcrel_from (fixP) - fixS *fixP; +md_pcrel_from (fixS *fixP) { unsigned char *buf; unsigned int op; @@ -3076,11 +2955,10 @@ md_pcrel_from (fixP) /* Fill the alignment area with NOP's on .text, unless fill-data was specified. */ int -tic4x_do_align (alignment, fill, len, max) - int alignment ATTRIBUTE_UNUSED; - const char *fill ATTRIBUTE_UNUSED; - int len ATTRIBUTE_UNUSED; - int max ATTRIBUTE_UNUSED; +tic4x_do_align (int alignment ATTRIBUTE_UNUSED, + const char *fill ATTRIBUTE_UNUSED, + int len ATTRIBUTE_UNUSED, + int max ATTRIBUTE_UNUSED) { unsigned long nop = TIC_NOP_OPCODE; @@ -3109,7 +2987,7 @@ tic4x_do_align (alignment, fill, len, max) /* Look for and remove parallel instruction operator ||. */ void -tic4x_start_line () +tic4x_start_line (void) { char *s = input_line_pointer; @@ -3137,9 +3015,7 @@ tic4x_start_line () } arelent * -tc_gen_reloc (seg, fixP) - asection *seg ATTRIBUTE_UNUSED; - fixS *fixP; +tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixP) { arelent *reloc; diff --git a/gas/config/tc-tic4x.h b/gas/config/tc-tic4x.h index 7bde3c9..b35eaa7 100644 --- a/gas/config/tc-tic4x.h +++ b/gas/config/tc-tic4x.h @@ -1,5 +1,5 @@ /* tc-tic4x.h -- Assemble for the Texas TMS320C[34]X. - Copyright (C) 1997, 2002, 2003, 2005, 2007 + Copyright (C) 1997, 2002, 2003, 2005, 2007, 2008 Free Software Foundation. Inc. Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz) @@ -74,21 +74,21 @@ /* Accept numbers with a suffix, e.g. 0ffffh, 1010b. */ #define NUMBERS_WITH_SUFFIX 1 -extern int tic4x_unrecognized_line PARAMS ((int)); +extern int tic4x_unrecognized_line (int); #define tc_unrecognized_line(c) tic4x_unrecognized_line (c) #define md_number_to_chars number_to_chars_littleendian -extern int tic4x_do_align PARAMS ((int, const char *, int, int)); +extern int tic4x_do_align (int, const char *, int, int); #define md_do_align(n,fill,len,max,label) if( tic4x_do_align (n,fill,len,max) ) goto label; /* Start of line hook to remove parallel instruction operator || */ -extern void tic4x_start_line PARAMS ((void)); +extern void tic4x_start_line (void); #define md_start_line_hook() tic4x_start_line() -extern void tic4x_cleanup PARAMS ((void)); +extern void tic4x_cleanup (void); #define md_cleanup() tic4x_cleanup() -extern void tic4x_end PARAMS ((void)); +extern void tic4x_end (void); #define md_end() tic4x_end() diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c index 823015a..68d541a 100644 --- a/gas/config/tc-tic54x.c +++ b/gas/config/tc-tic54x.c @@ -1,5 +1,5 @@ /* tc-tic54x.c -- Assembly code for the Texas Instruments TMS320C54X - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Timothy Wall (twall@cygnus.com) @@ -222,125 +222,14 @@ static struct hash_control *misc_symbol_hash; } \ while (0) -static void tic54x_emit_char PARAMS ((char)); -static fragS * frag_prev PARAMS ((fragS *, segT)); -static fragS * bit_offset_frag PARAMS ((fragS *, segT)); -static int frag_bit_offset PARAMS ((fragS *, segT)); -static char * parse_expression PARAMS ((char *, expressionS *)); -static void tic54x_asg PARAMS ((int)); -static void tic54x_eval PARAMS ((int)); -static void tic54x_bss PARAMS ((int)); -static void stag_add_field_symbols PARAMS ((struct stag *, const char *, bfd_vma, symbolS *, const char *)); -static void stag_add_field PARAMS ((struct stag *, const char *, bfd_vma, struct stag *)); -static void tic54x_struct PARAMS ((int)); -static void tic54x_endstruct PARAMS ((int)); -static void tic54x_tag PARAMS ((int)); -static void tic54x_struct_field PARAMS ((int)); -static void tic54x_cons PARAMS ((int)); -static void tic54x_remove_local_label PARAMS ((const char *, PTR)); -static void tic54x_clear_local_labels PARAMS ((int)); -static void tic54x_sect PARAMS ((int)); -static void tic54x_space PARAMS ((int)); -static void tic54x_usect PARAMS ((int)); -static enum cpu_version lookup_version PARAMS ((const char *)); -static void set_cpu PARAMS ((enum cpu_version)); -static void tic54x_version PARAMS ((int)); -static void tic54x_float_cons PARAMS ((int)); -static void tic54x_stringer PARAMS ((int)); -static void tic54x_p2align PARAMS ((int)); -static void tic54x_align_words PARAMS ((int)); -static void tic54x_field PARAMS ((int)); -static int tic54x_initialized_section PARAMS ((segT)); -static void tic54x_clink PARAMS ((int)); -static void tic54x_set_default_include PARAMS ((int)); -static void tic54x_include PARAMS ((int)); -static void tic54x_message PARAMS ((int)); -static void tic54x_label PARAMS ((int)); -static void tic54x_mmregs PARAMS ((int)); -static void tic54x_loop PARAMS ((int)); -static void tic54x_endloop PARAMS ((int)); -static void tic54x_break PARAMS ((int)); -static void set_address_mode PARAMS ((int)); -static void tic54x_address_mode PARAMS ((int)); -static void tic54x_sblock PARAMS ((int)); -static void tic54x_set PARAMS ((int)); -static void tic54x_fclist PARAMS ((int)); -static void tic54x_sslist PARAMS ((int)); -static void tic54x_var PARAMS ((int)); -static void tic54x_mlib PARAMS ((int)); -static int subsym_symlen PARAMS ((char *, char *)); -static int subsym_symcmp PARAMS ((char *, char *)); -static int subsym_firstch PARAMS ((char *, char *)); -static int subsym_lastch PARAMS ((char *, char *)); -static int subsym_isdefed PARAMS ((char *, char *)); -static int subsym_ismember PARAMS ((char *, char *)); -static int subsym_iscons PARAMS ((char *, char *)); -static int subsym_isname PARAMS ((char *, char *)); -static int subsym_isreg PARAMS ((char *, char *)); -static int subsym_structsz PARAMS ((char *, char *)); -static int subsym_structacc PARAMS ((char *, char *)); -static float math_ceil PARAMS ((float, float)); -static float math_cvi PARAMS ((float, float)); -static float math_floor PARAMS ((float, float)); -static float math_fmod PARAMS ((float, float)); -static float math_int PARAMS ((float, float)); -static float math_round PARAMS ((float, float)); -static float math_sgn PARAMS ((float, float)); -static float math_trunc PARAMS ((float, float)); -static float math_acos PARAMS ((float, float)); -static float math_asin PARAMS ((float, float)); -static float math_atan PARAMS ((float, float)); -static float math_atan2 PARAMS ((float, float)); -static float math_cosh PARAMS ((float, float)); -static float math_cos PARAMS ((float, float)); -static float math_cvf PARAMS ((float, float)); -static float math_exp PARAMS ((float, float)); -static float math_fabs PARAMS ((float, float)); -static float math_ldexp PARAMS ((float, float)); -static float math_log10 PARAMS ((float, float)); -static float math_log PARAMS ((float, float)); -static float math_max PARAMS ((float, float)); -static float math_min PARAMS ((float, float)); -static float math_pow PARAMS ((float, float)); -static float math_sin PARAMS ((float, float)); -static float math_sinh PARAMS ((float, float)); -static float math_sqrt PARAMS ((float, float)); -static float math_tan PARAMS ((float, float)); -static float math_tanh PARAMS ((float, float)); -static int is_accumulator PARAMS ((struct opstruct *)); -static int get_operands PARAMS ((struct opstruct operands[], char *)); -static int is_immediate PARAMS ((struct opstruct *)); -static int is_absolute PARAMS ((struct opstruct *)); -static int is_indirect PARAMS ((struct opstruct *)); -static int is_dual PARAMS ((struct opstruct *)); -static int is_mmreg PARAMS ((struct opstruct *)); -static int is_type PARAMS ((struct opstruct *, enum optype)); -static int operands_match PARAMS ((tic54x_insn *, struct opstruct *, int, const enum optype *, int, int)); -static int encode_dmad PARAMS ((tic54x_insn *, struct opstruct *, int)); -static int encode_address PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_indirect PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_integer PARAMS ((tic54x_insn *, struct opstruct *, int, int, int, unsigned short)); -static int encode_condition PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_cc3 PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_arx PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_cc2 PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_operand PARAMS ((tic54x_insn *, enum optype, struct opstruct *)); -static void emit_insn PARAMS ((tic54x_insn *)); -static int build_insn PARAMS ((tic54x_insn *)); -static int optimize_insn PARAMS ((tic54x_insn *)); -static int tic54x_parse_insn PARAMS ((tic54x_insn *, char *)); -static int next_line_shows_parallel PARAMS ((char *)); -static int tic54x_parse_parallel_insn_firstline PARAMS ((tic54x_insn *, char *)); -static int tic54x_parse_parallel_insn_lastline PARAMS ((tic54x_insn *, char *)); -static char * subsym_get_arg PARAMS ((char *, char *, char **, int)); -static void subsym_create_or_replace PARAMS ((char *, char *)); -static char * subsym_lookup PARAMS ((char *, int)); -static char * subsym_substitute PARAMS ((char *, int)); + +static void subsym_create_or_replace (char *, char *); +static char *subsym_lookup (char *, int); +static char *subsym_substitute (char *, int); void -md_show_usage (stream) - FILE *stream; +md_show_usage (FILE *stream) { fprintf (stream, _("C54x-specific command line options:\n")); fprintf (stream, _("-mfar-mode | -mf Use extended addressing\n")); @@ -352,8 +241,7 @@ md_show_usage (stream) /* Output a single character (upper octect is zero). */ static void -tic54x_emit_char (c) - char c; +tic54x_emit_char (char c) { expressionS exp; @@ -365,9 +253,7 @@ tic54x_emit_char (c) /* Walk backwards in the frag chain. */ static fragS * -frag_prev (frag, seg) - fragS *frag; - segT seg; +frag_prev (fragS *frag, segT seg) { segment_info_type *seginfo = seg_info (seg); fragS *fragp; @@ -380,9 +266,7 @@ frag_prev (frag, seg) } static fragS * -bit_offset_frag (frag, seg) - fragS *frag; - segT seg; +bit_offset_frag (fragS *frag, segT seg) { while (frag != NULL) { @@ -400,9 +284,7 @@ bit_offset_frag (frag, seg) none. .field/.space/.bes may leave words partially allocated. */ static int -frag_bit_offset (frag, seg) - fragS *frag; - segT seg; +frag_bit_offset (fragS *frag, segT seg) { frag = bit_offset_frag (frag, seg); @@ -416,9 +298,7 @@ frag_bit_offset (frag, seg) expression. */ static char * -parse_expression (str, exp) - char *str; - expressionS * exp; +parse_expression (char *str, expressionS *exp) { char *s; char *tmp; @@ -438,8 +318,7 @@ parse_expression (str, exp) unsupported. */ static void -tic54x_asg (x) - int x ATTRIBUTE_UNUSED; +tic54x_asg (int x ATTRIBUTE_UNUSED) { int c; char *name; @@ -500,8 +379,7 @@ tic54x_asg (x) table, since that's what works best. */ static void -tic54x_eval (x) - int x ATTRIBUTE_UNUSED; +tic54x_eval (int x ATTRIBUTE_UNUSED) { char c; int value; @@ -577,8 +455,7 @@ tic54x_eval (x) (not yet implemented). */ static void -tic54x_bss (x) - int x ATTRIBUTE_UNUSED; +tic54x_bss (int x ATTRIBUTE_UNUSED) { char c; char *name; @@ -667,12 +544,11 @@ tic54x_bss (x) } static void -stag_add_field_symbols (stag, path, base_offset, rootsym, root_stag_name) - struct stag *stag; - const char *path; - bfd_vma base_offset; - symbolS *rootsym; - const char *root_stag_name; +stag_add_field_symbols (struct stag *stag, + const char *path, + bfd_vma base_offset, + symbolS *rootsym, + const char *root_stag_name) { char prefix[strlen (path) + 2]; struct stag_field *field = stag->field; @@ -725,11 +601,10 @@ stag_add_field_symbols (stag, path, base_offset, rootsym, root_stag_name) complete dereferencing symbols to the symbol table. */ static void -stag_add_field (parent, name, offset, stag) - struct stag *parent; - const char *name; - bfd_vma offset; - struct stag *stag; +stag_add_field (struct stag *parent, + const char *name, + bfd_vma offset, + struct stag *stag) { struct stag_field *sfield = xmalloc (sizeof (struct stag_field)); @@ -761,8 +636,7 @@ stag_add_field (parent, name, offset, stag) Start defining structure offsets (symbols in absolute section). */ static void -tic54x_struct (arg) - int arg; +tic54x_struct (int arg) { int start_offset = 0; int is_union = arg; @@ -842,8 +716,7 @@ tic54x_struct (arg) of the structure. */ static void -tic54x_endstruct (is_union) - int is_union; +tic54x_endstruct (int is_union) { int size; const char *path = @@ -908,8 +781,7 @@ tic54x_endstruct (is_union) format on the existing allocated space. */ static void -tic54x_tag (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_tag (int ignore ATTRIBUTE_UNUSED) { char *name = input_line_pointer; int c = get_symbol_end (); @@ -968,8 +840,7 @@ tic54x_tag (ignore) and .word. */ static void -tic54x_struct_field (type) - int type; +tic54x_struct_field (int type) { int size; int count = 1; @@ -1088,8 +959,7 @@ tic54x_struct_field (type) /* Handle .byte, .word. .int, .long and all variants. */ static void -tic54x_cons (type) - int type; +tic54x_cons (int type) { unsigned int c; int octets; @@ -1227,8 +1097,7 @@ tic54x_cons (type) these, so we ignore the type here. */ void -tic54x_global (type) - int type; +tic54x_global (int type) { char *name; int c; @@ -1262,19 +1131,16 @@ tic54x_global (type) /* Remove the symbol from the local label hash lookup. */ static void -tic54x_remove_local_label (key, value) - const char *key; - PTR value ATTRIBUTE_UNUSED; +tic54x_remove_local_label (const char *key, void *value ATTRIBUTE_UNUSED) { - PTR *elem = hash_delete (local_label_hash[macro_level], key, FALSE); + void *elem = hash_delete (local_label_hash[macro_level], key, FALSE); free (elem); } /* Reset all local labels. */ static void -tic54x_clear_local_labels (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_clear_local_labels (int ignored ATTRIBUTE_UNUSED) { hash_traverse (local_label_hash[macro_level], tic54x_remove_local_label); } @@ -1293,8 +1159,7 @@ tic54x_clear_local_labels (ignored) */ static void -tic54x_sect (arg) - int arg; +tic54x_sect (int arg) { ILLEGAL_WITHIN_STRUCT (); @@ -1355,8 +1220,7 @@ tic54x_sect (arg) cribbed from s_space. */ static void -tic54x_space (arg) - int arg; +tic54x_space (int arg) { expressionS exp; char *p = 0; @@ -1487,8 +1351,7 @@ tic54x_space (arg) Has no effect on the current section. */ static void -tic54x_usect (x) - int x ATTRIBUTE_UNUSED; +tic54x_usect (int x ATTRIBUTE_UNUSED) { char c; char *name; @@ -1584,8 +1447,7 @@ tic54x_usect (x) } static enum cpu_version -lookup_version (ver) - const char *ver; +lookup_version (const char *ver) { enum cpu_version version = VNONE; @@ -1606,8 +1468,7 @@ lookup_version (ver) } static void -set_cpu (version) - enum cpu_version version; +set_cpu (enum cpu_version version) { cpu = version; if (version == V545LP || version == V546LP) @@ -1634,8 +1495,7 @@ set_cpu (version) static int cpu_needs_set = 1; static void -tic54x_version (x) - int x ATTRIBUTE_UNUSED; +tic54x_version (int x ATTRIBUTE_UNUSED) { enum cpu_version version = VNONE; enum cpu_version old_version = cpu; @@ -1678,8 +1538,7 @@ tic54x_version (x) /* 'f' = float, 'x' = xfloat, 'd' = double, 'l' = ldouble. */ static void -tic54x_float_cons (type) - int type; +tic54x_float_cons (int type) { if (current_stag != 0) tic54x_struct_field ('f'); @@ -1709,8 +1568,7 @@ tic54x_float_cons (type) and encoded into the correct octets. */ static void -tic54x_stringer (type) - int type; +tic54x_stringer (int type) { unsigned int c; char *start; @@ -1797,15 +1655,13 @@ tic54x_stringer (type) } static void -tic54x_p2align (arg) - int arg ATTRIBUTE_UNUSED; +tic54x_p2align (int arg ATTRIBUTE_UNUSED) { as_bad (_("p2align not supported on this target")); } static void -tic54x_align_words (arg) - int arg; +tic54x_align_words (int arg) { /* Only ".align" with no argument is allowed within .struct/.union. */ int count = arg; @@ -1837,8 +1693,7 @@ tic54x_align_words (arg) /* Initialize multiple-bit fields withing a single word of memory. */ static void -tic54x_field (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_field (int ignore ATTRIBUTE_UNUSED) { expressionS exp; int size = 16; @@ -1961,8 +1816,7 @@ tic54x_field (ignore) available yet. seg_info ()->bss is the next best thing. */ static int -tic54x_initialized_section (seg) - segT seg; +tic54x_initialized_section (segT seg) { return !seg_info (seg)->bss; } @@ -1975,8 +1829,7 @@ tic54x_initialized_section (seg) Name is required for uninitialized sections. */ static void -tic54x_clink (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_clink (int ignored ATTRIBUTE_UNUSED) { segT seg = now_seg; @@ -2023,8 +1876,7 @@ tic54x_clink (ignored) set to "." instead. */ static void -tic54x_set_default_include (dot) - int dot; +tic54x_set_default_include (int dot) { char *dir = "."; char *tmp = NULL; @@ -2069,8 +1921,7 @@ tic54x_set_default_include (dot) Entering/exiting included/copied file clears all local labels. */ static void -tic54x_include (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_include (int ignored ATTRIBUTE_UNUSED) { char newblock[] = " .newblock\n"; char *filename; @@ -2113,8 +1964,7 @@ tic54x_include (ignored) } static void -tic54x_message (type) - int type; +tic54x_message (int type) { char *msg; char c; @@ -2160,8 +2010,7 @@ tic54x_message (type) run address (vma). */ static void -tic54x_label (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_label (int ignored ATTRIBUTE_UNUSED) { char *name = input_line_pointer; symbolS *symbolP; @@ -2182,8 +2031,7 @@ tic54x_label (ignored) absolute local symbols. */ static void -tic54x_mmregs (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_mmregs (int ignored ATTRIBUTE_UNUSED) { symbol *sym; @@ -2202,8 +2050,7 @@ tic54x_mmregs (ignored) Count defaults to 1024. */ static void -tic54x_loop (count) - int count; +tic54x_loop (int count) { ILLEGAL_WITHIN_STRUCT (); @@ -2217,8 +2064,7 @@ tic54x_loop (count) /* Normally, endloop gets eaten by the preceding loop. */ static void -tic54x_endloop (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_endloop (int ignore ATTRIBUTE_UNUSED) { as_bad (_("ENDLOOP without corresponding LOOP")); ignore_rest_of_line (); @@ -2227,8 +2073,7 @@ tic54x_endloop (ignore) /* .break [condition]. */ static void -tic54x_break (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_break (int ignore ATTRIBUTE_UNUSED) { int cond = 1; @@ -2243,8 +2088,7 @@ tic54x_break (ignore) } static void -set_address_mode (mode) - int mode; +set_address_mode (int mode) { amode = mode; if (mode == far_mode) @@ -2259,8 +2103,7 @@ set_address_mode (mode) static int address_mode_needs_set = 1; static void -tic54x_address_mode (mode) - int mode; +tic54x_address_mode (int mode) { if (assembly_begun && amode != (unsigned) mode) { @@ -2283,8 +2126,7 @@ tic54x_address_mode (mode) Designate initialized sections for blocking. */ static void -tic54x_sblock (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_sblock (int ignore ATTRIBUTE_UNUSED) { int c = ','; @@ -2341,8 +2183,7 @@ tic54x_sblock (ignore) symbols assigned with .set/.equ may not be redefined. */ static void -tic54x_set (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_set (int ignore ATTRIBUTE_UNUSED) { symbolS *symbolP; char *name; @@ -2376,8 +2217,7 @@ tic54x_set (ignore) List false conditional blocks. */ static void -tic54x_fclist (show) - int show; +tic54x_fclist (int show) { if (show) listing &= ~LISTING_NOCOND; @@ -2387,8 +2227,7 @@ tic54x_fclist (show) } static void -tic54x_sslist (show) - int show; +tic54x_sslist (int show) { ILLEGAL_WITHIN_STRUCT (); @@ -2399,8 +2238,7 @@ tic54x_sslist (show) Define a substitution string to be local to a macro. */ static void -tic54x_var (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_var (int ignore ATTRIBUTE_UNUSED) { static char empty[] = ""; char *name; @@ -2448,8 +2286,7 @@ tic54x_var (ignore) FIXME need to try the source file directory as well. */ static void -tic54x_mlib (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_mlib (int ignore ATTRIBUTE_UNUSED) { char *filename; char *path; @@ -2638,9 +2475,7 @@ const pseudo_typeS md_pseudo_table[] = }; int -md_parse_option (c, arg) - int c; - char *arg; +md_parse_option (int c, char *arg) { switch (c) { @@ -2690,7 +2525,7 @@ md_parse_option (c, arg) deleting the local label hash between macro invocations. */ void -tic54x_macro_start () +tic54x_macro_start (void) { ++macro_level; subsym_hash[macro_level] = hash_new (); @@ -2698,8 +2533,7 @@ tic54x_macro_start () } void -tic54x_macro_info (macro) - const macro_entry *macro; +tic54x_macro_info (const macro_entry *macro) { const formal_entry *entry; @@ -2720,7 +2554,7 @@ tic54x_macro_info (macro) /* Get rid of this macro's .var's, arguments, and local labels. */ void -tic54x_macro_end () +tic54x_macro_end (void) { hash_die (subsym_hash[macro_level]); subsym_hash[macro_level] = NULL; @@ -2730,9 +2564,7 @@ tic54x_macro_end () } static int -subsym_symlen (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_symlen (char *a, char *ignore ATTRIBUTE_UNUSED) { return strlen (a); } @@ -2740,9 +2572,7 @@ subsym_symlen (a, ignore) /* Compare symbol A to string B. */ static int -subsym_symcmp (a, b) - char *a; - char *b; +subsym_symcmp (char *a, char *b) { return strcmp (a, b); } @@ -2751,9 +2581,7 @@ subsym_symcmp (a, b) assumes b is an integer char value as a string. Index is one-based. */ static int -subsym_firstch (a, b) - char *a; - char *b; +subsym_firstch (char *a, char *b) { int val = atoi (b); char *tmp = strchr (a, val); @@ -2764,9 +2592,7 @@ subsym_firstch (a, b) /* Similar to firstch, but returns index of last occurrence of B in A. */ static int -subsym_lastch (a, b) - char *a; - char *b; +subsym_lastch (char *a, char *b) { int val = atoi (b); char *tmp = strrchr (a, val); @@ -2778,9 +2604,7 @@ subsym_lastch (a, b) symbol table). */ static int -subsym_isdefed (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_isdefed (char *a, char *ignore ATTRIBUTE_UNUSED) { symbolS *symbolP = symbol_find (a); @@ -2792,9 +2616,7 @@ subsym_isdefed (a, ignore) symbols, unsubstituted. */ static int -subsym_ismember (sym, list) - char *sym; - char *list; +subsym_ismember (char *sym, char *list) { char *elem, *ptr, *listv; @@ -2832,9 +2654,7 @@ subsym_ismember (sym, list) 5 if decimal. */ static int -subsym_iscons (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_iscons (char *a, char *ignore ATTRIBUTE_UNUSED) { expressionS exp; @@ -2873,9 +2693,7 @@ subsym_iscons (a, ignore) /* Return 1 if A is a valid symbol name. Expects string input. */ static int -subsym_isname (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_isname (char *a, char *ignore ATTRIBUTE_UNUSED) { if (!is_name_beginner (*a)) return 0; @@ -2893,9 +2711,7 @@ subsym_isname (a, ignore) Note this does not recognize "A" or "B" accumulators. */ static int -subsym_isreg (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_isreg (char *a, char *ignore ATTRIBUTE_UNUSED) { if (hash_find (reg_hash, a)) return 1; @@ -2907,9 +2723,7 @@ subsym_isreg (a, ignore) /* Return the structure size, given the stag. */ static int -subsym_structsz (name, ignore) - char *name; - char *ignore ATTRIBUTE_UNUSED; +subsym_structsz (char *name, char *ignore ATTRIBUTE_UNUSED) { struct stag *stag = (struct stag *) hash_find (stag_hash, name); @@ -2927,145 +2741,110 @@ subsym_structsz (name, ignore) return zero, we punt and return zero. */ static int -subsym_structacc (stag_name, ignore) - char *stag_name ATTRIBUTE_UNUSED; - char *ignore ATTRIBUTE_UNUSED; +subsym_structacc (char *stag_name ATTRIBUTE_UNUSED, + char *ignore ATTRIBUTE_UNUSED) { return 0; } static float -math_ceil (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_ceil (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) ceil (arg1); } static float -math_cvi (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_cvi (float arg1, float ignore ATTRIBUTE_UNUSED) { return (int) arg1; } static float -math_floor (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_floor (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) floor (arg1); } static float -math_fmod (arg1, arg2) - float arg1; - float arg2; +math_fmod (float arg1, float arg2) { return (int) arg1 % (int) arg2; } static float -math_int (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_int (float arg1, float ignore ATTRIBUTE_UNUSED) { return ((float) ((int) arg1)) == arg1; } static float -math_round (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_round (float arg1, float ignore ATTRIBUTE_UNUSED) { return arg1 > 0 ? (int) (arg1 + 0.5) : (int) (arg1 - 0.5); } static float -math_sgn (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_sgn (float arg1, float ignore ATTRIBUTE_UNUSED) { return (arg1 < 0) ? -1 : (arg1 ? 1 : 0); } static float -math_trunc (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_trunc (float arg1, float ignore ATTRIBUTE_UNUSED) { return (int) arg1; } static float -math_acos (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_acos (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) acos (arg1); } static float -math_asin (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_asin (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) asin (arg1); } static float -math_atan (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_atan (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) atan (arg1); } static float -math_atan2 (arg1, arg2) - float arg1; - float arg2; +math_atan2 (float arg1, float arg2) { return (float) atan2 (arg1, arg2); } static float -math_cosh (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_cosh (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) cosh (arg1); } static float -math_cos (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_cos (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) cos (arg1); } static float -math_cvf (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_cvf (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) arg1; } static float -math_exp (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_exp (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) exp (arg1); } static float -math_fabs (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_fabs (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) fabs (arg1); } @@ -3073,89 +2852,67 @@ math_fabs (arg1, ignore) /* expr1 * 2^expr2. */ static float -math_ldexp (arg1, arg2) - float arg1; - float arg2; +math_ldexp (float arg1, float arg2) { return arg1 * (float) pow (2.0, arg2); } static float -math_log10 (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_log10 (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) log10 (arg1); } static float -math_log (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_log (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) log (arg1); } static float -math_max (arg1, arg2) - float arg1; - float arg2; +math_max (float arg1, float arg2) { return (arg1 > arg2) ? arg1 : arg2; } static float -math_min (arg1, arg2) - float arg1; - float arg2; +math_min (float arg1, float arg2) { return (arg1 < arg2) ? arg1 : arg2; } static float -math_pow (arg1, arg2) - float arg1; - float arg2; +math_pow (float arg1, float arg2) { return (float) pow (arg1, arg2); } static float -math_sin (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_sin (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) sin (arg1); } static float -math_sinh (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_sinh (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) sinh (arg1); } static float -math_sqrt (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_sqrt (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) sqrt (arg1); } static float -math_tan (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_tan (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) tan (arg1); } static float -math_tanh (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_tanh (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) tanh (arg1); } @@ -3164,7 +2921,7 @@ math_tanh (arg1, ignore) typedef struct { char *name; - int (*proc) PARAMS ((char *, char *)); + int (*proc) (char *, char *); int nargs; } subsym_proc_entry; @@ -3188,7 +2945,7 @@ static const subsym_proc_entry subsym_procs[] = typedef struct { char *name; - float (*proc) PARAMS ((float, float)); + float (*proc) (float, float); int nargs; int int_return; } math_proc_entry; @@ -3230,7 +2987,7 @@ static const math_proc_entry math_procs[] = }; void -md_begin () +md_begin (void) { template *tm; symbol *sym; @@ -3339,8 +3096,7 @@ md_begin () } static int -is_accumulator (operand) - struct opstruct *operand; +is_accumulator (struct opstruct *operand) { return strcasecmp (operand->buf, "a") == 0 || strcasecmp (operand->buf, "b") == 0; @@ -3351,9 +3107,7 @@ is_accumulator (operand) the next array. */ static int -get_operands (operands, line) - struct opstruct operands[]; - char *line; +get_operands (struct opstruct operands[], char *line) { char *lptr = line; int numexp = 0; @@ -3482,8 +3236,7 @@ get_operands (operands, line) /* Predicates for different operand types. */ static int -is_immediate (operand) - struct opstruct *operand; +is_immediate (struct opstruct *operand) { return *operand->buf == '#'; } @@ -3492,8 +3245,7 @@ is_immediate (operand) and must *not* have the '#' prefix. */ static int -is_absolute (operand) - struct opstruct *operand; +is_absolute (struct opstruct *operand) { return operand->exp.X_op == O_constant && !is_immediate (operand); } @@ -3501,8 +3253,7 @@ is_absolute (operand) /* Is this an indirect operand? */ static int -is_indirect (operand) - struct opstruct *operand; +is_indirect (struct opstruct *operand) { return operand->buf[0] == '*'; } @@ -3510,8 +3261,7 @@ is_indirect (operand) /* Is this a valid dual-memory operand? */ static int -is_dual (operand) - struct opstruct *operand; +is_dual (struct opstruct *operand) { if (is_indirect (operand) && strncasecmp (operand->buf, "*ar", 3) == 0) { @@ -3531,8 +3281,7 @@ is_dual (operand) } static int -is_mmreg (operand) - struct opstruct *operand; +is_mmreg (struct opstruct *operand) { return (is_absolute (operand) || is_immediate (operand) @@ -3540,9 +3289,7 @@ is_mmreg (operand) } static int -is_type (operand, type) - struct opstruct *operand; - enum optype type; +is_type (struct opstruct *operand, enum optype type) { switch (type) { @@ -3646,13 +3393,12 @@ is_type (operand, type) } static int -operands_match (insn, operands, opcount, refoptype, minops, maxops) - tic54x_insn *insn; - struct opstruct *operands; - int opcount; - const enum optype *refoptype; - int minops; - int maxops; +operands_match (tic54x_insn *insn, + struct opstruct *operands, + int opcount, + const enum optype *refoptype, + int minops, + int maxops) { int op = 0, refop = 0; @@ -3715,10 +3461,7 @@ operands_match (insn, operands, opcount, refoptype, minops, maxops) 2 for the upper 7 bits of a 23-bit address (LDX). */ static int -encode_dmad (insn, operand, xpc_code) - tic54x_insn *insn; - struct opstruct *operand; - int xpc_code; +encode_dmad (tic54x_insn *insn, struct opstruct *operand, int xpc_code) { int op = 1 + insn->is_lkaddr; @@ -3779,9 +3522,7 @@ encode_dmad (insn, operand, xpc_code) /* 7-bit direct address encoding. */ static int -encode_address (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_address (tic54x_insn *insn, struct opstruct *operand) { /* Assumes that dma addresses are *always* in word 0 of the opcode. */ insn->opcode[0].addr_expr = operand->exp; @@ -3802,9 +3543,7 @@ encode_address (insn, operand) } static int -encode_indirect (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_indirect (tic54x_insn *insn, struct opstruct *operand) { int arf; int mod; @@ -3876,13 +3615,12 @@ encode_indirect (insn, operand) } static int -encode_integer (insn, operand, which, min, max, mask) - tic54x_insn *insn; - struct opstruct *operand; - int which; - int min; - int max; - unsigned short mask; +encode_integer (tic54x_insn *insn, + struct opstruct *operand, + int which, + int min, + int max, + unsigned short mask) { long parse, integer; @@ -3937,9 +3675,7 @@ encode_integer (insn, operand, which, min, max, mask) } static int -encode_condition (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_condition (tic54x_insn *insn, struct opstruct *operand) { symbol *cc = (symbol *) hash_find (cc_hash, operand->buf); if (!cc) @@ -3999,9 +3735,7 @@ encode_condition (insn, operand) } static int -encode_cc3 (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_cc3 (tic54x_insn *insn, struct opstruct *operand) { symbol *cc3 = (symbol *) hash_find (cc3_hash, operand->buf); int value = cc3 ? cc3->value : operand->exp.X_add_number << 8; @@ -4016,9 +3750,7 @@ encode_cc3 (insn, operand) } static int -encode_arx (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_arx (tic54x_insn *insn, struct opstruct *operand) { int arf = strlen (operand->buf) >= 3 ? operand->buf[2] - '0' : -1; @@ -4032,9 +3764,7 @@ encode_arx (insn, operand) } static int -encode_cc2 (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_cc2 (tic54x_insn *insn, struct opstruct *operand) { symbol *cc2 = (symbol *) hash_find (cc2_hash, operand->buf); @@ -4048,10 +3778,7 @@ encode_cc2 (insn, operand) } static int -encode_operand (insn, type, operand) - tic54x_insn *insn; - enum optype type; - struct opstruct *operand; +encode_operand (tic54x_insn *insn, enum optype type, struct opstruct *operand) { int ext = (insn->tm->flags & FL_EXT) != 0; @@ -4274,8 +4001,7 @@ encode_operand (insn, type, operand) } static void -emit_insn (insn) - tic54x_insn *insn; +emit_insn (tic54x_insn *insn) { int i; flagword oldflags = bfd_get_section_flags (stdoutput, now_seg); @@ -4308,8 +4034,7 @@ emit_insn (insn) return the total number of words used by the instruction. */ static int -build_insn (insn) - tic54x_insn *insn; +build_insn (tic54x_insn *insn) { int i; @@ -4359,8 +4084,7 @@ build_insn (insn) } static int -optimize_insn (insn) - tic54x_insn *insn; +optimize_insn (tic54x_insn *insn) { /* Optimize some instructions, helping out the brain-dead programmer. */ #define is_zero(op) ((op).exp.X_op == O_constant && (op).exp.X_add_number == 0) @@ -4453,9 +4177,7 @@ optimize_insn (insn) /* Find a matching template if possible, and get the operand strings. */ static int -tic54x_parse_insn (insn, line) - tic54x_insn *insn; - char *line; +tic54x_parse_insn (tic54x_insn *insn, char *line) { insn->tm = (template *) hash_find (op_hash, insn->mnemonic); if (!insn->tm) @@ -4502,8 +4224,7 @@ static int parallel_on_next_line_hint = 0; Look for a subsequent line starting with "||". */ static int -next_line_shows_parallel (next_line) - char *next_line; +next_line_shows_parallel (char *next_line) { /* Look for the second half. */ while (ISSPACE (*next_line)) @@ -4514,9 +4235,7 @@ next_line_shows_parallel (next_line) } static int -tic54x_parse_parallel_insn_firstline (insn, line) - tic54x_insn *insn; - char *line; +tic54x_parse_parallel_insn_firstline (tic54x_insn *insn, char *line) { insn->tm = (template *) hash_find (parop_hash, insn->mnemonic); if (!insn->tm) @@ -4547,9 +4266,7 @@ tic54x_parse_parallel_insn_firstline (insn, line) /* Parse the second line of a two-line parallel instruction. */ static int -tic54x_parse_parallel_insn_lastline (insn, line) - tic54x_insn *insn; - char *line; +tic54x_parse_parallel_insn_lastline (tic54x_insn *insn, char *line) { int valid_mnemonic = 0; @@ -4587,11 +4304,7 @@ tic54x_parse_parallel_insn_lastline (insn, line) replacement on the value. */ static char * -subsym_get_arg (line, terminators, str, nosub) - char *line; - char *terminators; - char **str; - int nosub; +subsym_get_arg (char *line, char *terminators, char **str, int nosub) { char *ptr = line; char *endp; @@ -4654,9 +4367,7 @@ subsym_get_arg (line, terminators, str, nosub) that's compatible w/TI's assembler. */ static void -subsym_create_or_replace (name, value) - char *name; - char *value; +subsym_create_or_replace (char *name, char *value) { int i; @@ -4679,9 +4390,7 @@ subsym_create_or_replace (name, value) outwards. */ static char * -subsym_lookup (name, nest_level) - char *name; - int nest_level; +subsym_lookup (char *name, int nest_level) { char *value = hash_find (subsym_hash[nest_level], name); @@ -4699,9 +4408,7 @@ subsym_lookup (name, nest_level) If FORCED is set, look for forced substitutions of the form ':SYMBOL:'. */ static char * -subsym_substitute (line, forced) - char * line; - int forced; +subsym_substitute (char *line, int forced) { /* For each apparent symbol, see if it's a substitution symbol, and if so, replace it in the input. */ @@ -5060,7 +4767,7 @@ subsym_substitute (line, forced) returns the new buffer limit. */ void -tic54x_start_line_hook () +tic54x_start_line_hook (void) { char *line, *endp; char *replacement = NULL; @@ -5132,8 +4839,7 @@ tic54x_start_line_hook () machine dependent instruction. This function is supposed to emit the frags/bytes it assembles to. */ void -md_assemble (line) - char *line; +md_assemble (char *line) { static int repeat_slot = 0; static int delay_slots = 0; /* How many delay slots left to fill? */ @@ -5299,7 +5005,7 @@ md_assemble (line) a ".file" symbol. */ void -tic54x_adjust_symtab () +tic54x_adjust_symtab (void) { if (symbol_rootP == NULL || S_GET_STORAGE_CLASS (symbol_rootP) != C_FILE) @@ -5327,8 +5033,7 @@ tic54x_unrecognized_line (int c) FIXME -- obviously this isn't done yet. These locals still show up in the symbol table. */ void -tic54x_define_label (sym) - symbolS *sym; +tic54x_define_label (symbolS *sym) { /* Just in case we need this later; note that this is not necessarily the same thing as line_label... @@ -5342,8 +5047,7 @@ tic54x_define_label (sym) /* Try to parse something that normal parsing failed at. */ symbolS * -tic54x_undefined_symbol (name) - char *name; +tic54x_undefined_symbol (char *name) { symbol *sym; @@ -5375,9 +5079,8 @@ tic54x_undefined_symbol (name) it. */ int -tic54x_parse_name (name, exp) - char *name ATTRIBUTE_UNUSED; - expressionS *exp ATTRIBUTE_UNUSED; +tic54x_parse_name (char *name ATTRIBUTE_UNUSED, + expressionS *exp ATTRIBUTE_UNUSED) { return 0; } @@ -5391,9 +5094,7 @@ md_atof (int type, char *literalP, int *sizeP) } arelent * -tc_gen_reloc (section, fixP) - asection *section; - fixS *fixP; +tc_gen_reloc (asection *section, fixS *fixP) { arelent *rel; bfd_reloc_code_real_type code = fixP->fx_r_type; @@ -5424,11 +5125,7 @@ tc_gen_reloc (section, fixP) /* Handle cons expressions. */ void -tic54x_cons_fix_new (frag, where, octets, exp) - fragS *frag; - int where; - int octets; - expressionS *exp; +tic54x_cons_fix_new (fragS *frag, int where, int octets, expressionS *exp) { bfd_reloc_code_real_type r; @@ -5460,10 +5157,7 @@ tic54x_cons_fix_new (frag, where, octets, exp) If fixp->fx_addsy is non-NULL, we'll have to generate a reloc entry. */ void -md_apply_fix (fixP, valP, seg) - fixS *fixP; - valueT * valP; - segT seg ATTRIBUTE_UNUSED; +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; valueT val = * valP; @@ -5514,16 +5208,13 @@ md_apply_fix (fixP, valP, seg) don't need to do anything here, since BFD does the proper encoding. */ valueT -md_section_align (segment, section_size) - segT segment ATTRIBUTE_UNUSED; - valueT section_size; +md_section_align (segT segment ATTRIBUTE_UNUSED, valueT section_size) { return section_size; } long -md_pcrel_from (fixP) - fixS *fixP ATTRIBUTE_UNUSED; +md_pcrel_from (fixS *fixP ATTRIBUTE_UNUSED) { return 0; } @@ -5532,10 +5223,7 @@ md_pcrel_from (fixP) first. */ void -tic54x_number_to_chars (buf, val, n) - char *buf; - valueT val; - int n; +tic54x_number_to_chars (char *buf, valueT val, int n) { if (n != 4) number_to_chars_littleendian (buf, val, n); @@ -5547,9 +5235,8 @@ tic54x_number_to_chars (buf, val, n) } int -tic54x_estimate_size_before_relax (frag, seg) - fragS *frag ATTRIBUTE_UNUSED; - segT seg ATTRIBUTE_UNUSED; +tic54x_estimate_size_before_relax (fragS *frag ATTRIBUTE_UNUSED, + segT seg ATTRIBUTE_UNUSED) { return 0; } @@ -5558,9 +5245,7 @@ tic54x_estimate_size_before_relax (frag, seg) to symbols being in different frags. return number of octets added. */ int -tic54x_relax_frag (frag, stretch) - fragS *frag; - long stretch ATTRIBUTE_UNUSED; +tic54x_relax_frag (fragS *frag, long stretch ATTRIBUTE_UNUSED) { symbolS *sym = frag->fr_symbol; int growth = 0; @@ -5659,10 +5344,9 @@ tic54x_relax_frag (frag, stretch) } void -tic54x_convert_frag (abfd, seg, frag) - bfd *abfd ATTRIBUTE_UNUSED; - segT seg ATTRIBUTE_UNUSED; - fragS *frag; +tic54x_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, + segT seg ATTRIBUTE_UNUSED, + fragS *frag) { /* Offset is in bytes. */ frag->fr_offset = (frag->fr_next->fr_address @@ -5688,9 +5372,7 @@ tic54x_convert_frag (abfd, seg, frag) Don't allow labels to start with '.' */ int -tic54x_start_label (c, rest) - int c; - char *rest; +tic54x_start_label (int c, char *rest) { /* If within .struct/.union, no auto line labels, please. */ if (current_stag != NULL) diff --git a/gas/config/tc-tic54x.h b/gas/config/tc-tic54x.h index 78ef2e4..1942378 100644 --- a/gas/config/tc-tic54x.h +++ b/gas/config/tc-tic54x.h @@ -1,5 +1,5 @@ /* tc-tic54x.h -- Header file for tc-tic54x.c - Copyright 1999, 2000, 2001, 2007 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2007, 2008 Free Software Foundation, Inc. Contributed by Timothy Wall (twall@alum.mit.edu) This file is part of GAS, the GNU Assembler. @@ -66,11 +66,11 @@ struct bit_info /* tell GAS whether the given token is indeed a code label */ #define TC_START_LABEL_WITHOUT_COLON(c,ptr) tic54x_start_label(c,ptr) -extern int tic54x_start_label PARAMS((int, char *)); +extern int tic54x_start_label (int, char *); /* custom handling for relocations in cons expressions */ #define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) tic54x_cons_fix_new(FRAG,OFF,LEN,EXP) -extern void tic54x_cons_fix_new PARAMS((fragS *,int,int,expressionS *)); +extern void tic54x_cons_fix_new (fragS *,int,int,expressionS *); /* Define md_number_to_chars as the appropriate standard big endian or little endian function. Mostly littleendian, but longwords and floats are @@ -93,9 +93,9 @@ extern void tic54x_macro_start (void); extern void tic54x_macro_end (void); #define md_macro_info(args) tic54x_macro_info(args) struct macro_struct; -extern void tic54x_macro_info PARAMS((const struct macro_struct *)); +extern void tic54x_macro_info (const struct macro_struct *); #define tc_frob_label(sym) tic54x_define_label (sym) -extern void tic54x_define_label PARAMS((symbolS *)); +extern void tic54x_define_label (symbolS *); #define md_start_line_hook() tic54x_start_line_hook() extern void tic54x_start_line_hook (void); diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c index 980f759..b8cdec9 100644 --- a/gas/config/tc-vax.c +++ b/gas/config/tc-vax.c @@ -1,6 +1,6 @@ /* tc-vax.c - vax-specific - Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007 + 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -959,11 +959,11 @@ vip_begin (int synthetic_too, /* 1 means include jXXX op-codes. */ op_hash = hash_new (); for (vP = votstrs; *vP->vot_name && !retval; vP++) - retval = hash_insert (op_hash, vP->vot_name, (PTR) &vP->vot_detail); + retval = hash_insert (op_hash, vP->vot_name, (void *) &vP->vot_detail); if (synthetic_too) for (vP = synthetic_votstrs; *vP->vot_name && !retval; vP++) - retval = hash_insert (op_hash, vP->vot_name, (PTR) &vP->vot_detail); + retval = hash_insert (op_hash, vP->vot_name, (void *) &vP->vot_detail); #ifndef CONST_TABLE vip_op_defaults (immediate, indirect, displen); diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi index e025e88..cfb9a93 100644 --- a/gas/doc/internals.texi +++ b/gas/doc/internals.texi @@ -1921,23 +1921,23 @@ Creates the hash table control structure. Destroy a hash table. @end deftypefun -@deftypefun @{@} PTR hash_delete (struct hash_control *, const char *, int) +@deftypefun @{@} void *hash_delete (struct hash_control *, const char *, int) Deletes entry from the hash table, returns the value it had. If the last arg is non-zero, free memory allocated for this entry and all entries allocated more recently than this entry. @end deftypefun -@deftypefun @{@} PTR hash_replace (struct hash_control *, const char *, PTR) +@deftypefun @{@} void *hash_replace (struct hash_control *, const char *, void *) Updates the value for an entry already in the table, returning the old value. If no entry was found, just returns NULL. @end deftypefun -@deftypefun @{@} @{const char *@} hash_insert (struct hash_control *, const char *, PTR) +@deftypefun @{@} @{const char *@} hash_insert (struct hash_control *, const char *, void *) Inserting a value already in the table is an error. Returns an error message or NULL. @end deftypefun -@deftypefun @{@} @{const char *@} hash_jam (struct hash_control *, const char *, PTR) +@deftypefun @{@} @{const char *@} hash_jam (struct hash_control *, const char *, void *) Inserts if the value isn't already present, updates it if it is. @end deftypefun diff --git a/gas/ecoff.c b/gas/ecoff.c index 531c32a..2fecf73 100644 --- a/gas/ecoff.c +++ b/gas/ecoff.c @@ -1,6 +1,6 @@ /* ECOFF debugging support. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007 + 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Cygnus Support. This file was put together by Ian Lance Taylor <ian@cygnus.com>. A @@ -3890,7 +3890,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend, unsigned long offset) { const bfd_size_type external_sym_size = backend->external_sym_size; - void (* const swap_sym_out) (bfd *, const SYMR *, PTR) + void (* const swap_sym_out) (bfd *, const SYMR *, void *) = backend->swap_sym_out; char *sym_out; long isym; @@ -4255,7 +4255,7 @@ ecoff_build_procs (const struct ecoff_debug_swap *backend, unsigned long offset) { const bfd_size_type external_pdr_size = backend->external_pdr_size; - void (* const swap_pdr_out) (bfd *, const PDR *, PTR) + void (* const swap_pdr_out) (bfd *, const PDR *, void *) = backend->swap_pdr_out; char *pdr_out; long iproc; @@ -4540,7 +4540,7 @@ ecoff_build_fdr (const struct ecoff_debug_swap *backend, unsigned long offset) { const bfd_size_type external_fdr_size = backend->external_fdr_size; - void (* const swap_fdr_out) (bfd *, const FDR *, PTR) + void (* const swap_fdr_out) (bfd *, const FDR *, void *) = backend->swap_fdr_out; long ifile; char *fdr_out; @@ -4876,7 +4876,7 @@ free_scope (scope_t *ptr) ptr->free = alloc_counts[(int) alloc_type_scope].free_list.f_scope; alloc_counts[(int) alloc_type_scope].free_list.f_scope = ptr; #else - free ((PTR) ptr); + free ((void *) ptr); #endif } @@ -290,7 +290,7 @@ hash_jam (struct hash_control *table, const char *key, void *value) value stored for the entry. If the entry is not found in the hash table, this does nothing and returns NULL. */ -PTR +void * hash_replace (struct hash_control *table, const char *key, void *value) { struct hash_entry *p; @@ -314,7 +314,7 @@ hash_replace (struct hash_control *table, const char *key, void *value) /* Find an entry in a hash table, returning its value. Returns NULL if the entry is not found. */ -PTR +void * hash_find (struct hash_control *table, const char *key) { struct hash_entry *p; @@ -329,7 +329,7 @@ hash_find (struct hash_control *table, const char *key) /* As hash_find, but KEY is of length LEN and is not guaranteed to be NUL-terminated. */ -PTR +void * hash_find_n (struct hash_control *table, const char *key, size_t len) { struct hash_entry *p; @@ -344,7 +344,7 @@ hash_find_n (struct hash_control *table, const char *key, size_t len) /* Delete an entry from a hash table. This returns the value stored for that entry, or NULL if there is no such entry. */ -PTR +void * hash_delete (struct hash_control *table, const char *key, int freeme) { struct hash_entry *p; diff --git a/gas/macro.c b/gas/macro.c index 0cde3d6..2c72331 100644 --- a/gas/macro.c +++ b/gas/macro.c @@ -676,7 +676,7 @@ define_macro (int idx, sb *in, sb *label, if (hash_find (macro_hash, macro->name)) error = _("Macro `%s' was already defined"); if (!error) - error = hash_jam (macro_hash, macro->name, (PTR) macro); + error = hash_jam (macro_hash, macro->name, (void *) macro); if (namep != NULL) *namep = macro->name; diff --git a/gas/symbols.c b/gas/symbols.c index c7262b8..3020710 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -204,7 +204,7 @@ local_symbol_make (const char *name, segT section, valueT value, fragS *frag) local_symbol_set_frag (ret, frag); ret->lsy_value = value; - hash_jam (local_hash, name_copy, (PTR) ret); + hash_jam (local_hash, name_copy, (void *) ret); return ret; } @@ -489,14 +489,14 @@ symbol_table_insert (symbolS *symbolP) if (LOCAL_SYMBOL_CHECK (symbolP)) { error_string = hash_jam (local_hash, S_GET_NAME (symbolP), - (PTR) symbolP); + (void *) symbolP); if (error_string != NULL) as_fatal (_("inserting \"%s\" into symbol table failed: %s"), S_GET_NAME (symbolP), error_string); return; } - if ((error_string = hash_jam (sy_hash, S_GET_NAME (symbolP), (PTR) symbolP))) + if ((error_string = hash_jam (sy_hash, S_GET_NAME (symbolP), (void *) symbolP))) { as_fatal (_("inserting \"%s\" into symbol table failed: %s"), S_GET_NAME (symbolP), error_string); @@ -1438,12 +1438,12 @@ exit_dont_set_value: return final_val; } -static void resolve_local_symbol (const char *, PTR); +static void resolve_local_symbol (const char *, void *); /* A static function passed to hash_traverse. */ static void -resolve_local_symbol (const char *key ATTRIBUTE_UNUSED, PTR value) +resolve_local_symbol (const char *key ATTRIBUTE_UNUSED, void *value) { if (value != NULL) resolve_symbol_value (value); |