diff options
author | Kazu Hirata <kazu@codesourcery.com> | 2003-11-22 16:03:03 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@codesourcery.com> | 2003-11-22 16:03:03 +0000 |
commit | dd625418be793812f132dbb9e08a4b00fbea9868 (patch) | |
tree | 08abaf6dcca5d1720692732ce1156ef343fa97a4 | |
parent | 369864a44db723c61b3bc457e869abfe73ec7664 (diff) | |
download | gdb-dd625418be793812f132dbb9e08a4b00fbea9868.zip gdb-dd625418be793812f132dbb9e08a4b00fbea9868.tar.gz gdb-dd625418be793812f132dbb9e08a4b00fbea9868.tar.bz2 |
* ehopt.c: Convert to ISO-C.
* emul.h: Likewise.
* expr.c: Likewise.
* expr.h: Likewise.
* flonum-copy.c: Likewise.
* flonum-mult.c: Likewise.
* flonum.h: Likewise.
* frags.c: Likewise.
* frags.h: Likewise.
-rw-r--r-- | gas/ChangeLog | 12 | ||||
-rw-r--r-- | gas/ehopt.c | 18 | ||||
-rw-r--r-- | gas/emul.h | 10 | ||||
-rw-r--r-- | gas/expr.c | 79 | ||||
-rw-r--r-- | gas/expr.h | 25 | ||||
-rw-r--r-- | gas/flonum-copy.c | 4 | ||||
-rw-r--r-- | gas/flonum-mult.c | 6 | ||||
-rw-r--r-- | gas/flonum.h | 16 | ||||
-rw-r--r-- | gas/frags.c | 65 | ||||
-rw-r--r-- | gas/frags.h | 60 |
10 files changed, 125 insertions, 170 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index d2ed7ff..164b424 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,15 @@ +2003-11-22 Kazu Hirata <kazu@cs.umass.edu> + + * ehopt.c: Convert to ISO-C. + * emul.h: Likewise. + * expr.c: Likewise. + * expr.h: Likewise. + * flonum-copy.c: Likewise. + * flonum-mult.c: Likewise. + * flonum.h: Likewise. + * frags.c: Likewise. + * frags.h: Likewise. + 2003-11-22 Alan Modra <amodra@bigpond.net.au> * doc/c-ppc.texi (PowerPC-Pseudo): Add section. diff --git a/gas/ehopt.c b/gas/ehopt.c index 6e19ae6..451aaff 100644 --- a/gas/ehopt.c +++ b/gas/ehopt.c @@ -94,13 +94,12 @@ struct cie_info int z_augmentation; }; -static int get_cie_info PARAMS ((struct cie_info *)); +static int get_cie_info (struct cie_info *); /* Extract information from the CIE. */ static int -get_cie_info (info) - struct cie_info *info; +get_cie_info (struct cie_info *info) { fragS *f; fixS *fix; @@ -248,9 +247,7 @@ get_cie_info (info) change *EXP and *PNBYTES. */ int -check_eh_frame (exp, pnbytes) - expressionS *exp; - unsigned int *pnbytes; +check_eh_frame (expressionS *exp, unsigned int *pnbytes) { struct frame_data { @@ -457,8 +454,7 @@ check_eh_frame (exp, pnbytes) relaxation loop. We set fr_subtype{0:2} to the expected length. */ int -eh_frame_estimate_size_before_relax (frag) - fragS *frag; +eh_frame_estimate_size_before_relax (fragS *frag) { offsetT diff; int ca = frag->fr_subtype >> 3; @@ -485,8 +481,7 @@ eh_frame_estimate_size_before_relax (frag) the frag. This returns the change in frag length. */ int -eh_frame_relax_frag (frag) - fragS *frag; +eh_frame_relax_frag (fragS *frag) { int oldsize, newsize; @@ -500,8 +495,7 @@ eh_frame_relax_frag (frag) fr_subtype{0:2} will be the desired length of the frag. */ void -eh_frame_convert_frag (frag) - fragS *frag; +eh_frame_convert_frag (fragS *frag) { offsetT diff; fragS *loc4_frag; @@ -23,10 +23,10 @@ struct emulation { - void (* match) PARAMS ((const char *)); + void (* match) (const char *); const char * name; - void (* init) PARAMS ((void)); - const char *(* bfd_name) PARAMS ((void)); + void (* init) (void); + const char *(* bfd_name) (void); unsigned local_labels_fb : 1; unsigned local_labels_dollar : 1; unsigned leading_underscore : 2; @@ -38,7 +38,7 @@ struct emulation COMMON struct emulation * this_emulation; -extern const char * default_emul_bfd_name PARAMS ((void)); -extern void common_emul_init PARAMS ((void)); +extern const char * default_emul_bfd_name (void); +extern void common_emul_init (void); #endif @@ -32,17 +32,17 @@ #include "safe-ctype.h" #include "obstack.h" -static void floating_constant PARAMS ((expressionS * expressionP)); -static valueT generic_bignum_to_int32 PARAMS ((void)); +static void floating_constant (expressionS * expressionP); +static valueT generic_bignum_to_int32 (void); #ifdef BFD64 -static valueT generic_bignum_to_int64 PARAMS ((void)); +static valueT generic_bignum_to_int64 (void); #endif -static void integer_constant PARAMS ((int radix, expressionS * expressionP)); -static void mri_char_constant PARAMS ((expressionS *)); -static void current_location PARAMS ((expressionS *)); -static void clean_up_expression PARAMS ((expressionS * expressionP)); -static segT operand PARAMS ((expressionS *)); -static operatorT operator PARAMS ((int *)); +static void integer_constant (int radix, expressionS * expressionP); +static void mri_char_constant (expressionS *); +static void current_location (expressionS *); +static void clean_up_expression (expressionS * expressionP); +static segT operand (expressionS *); +static operatorT operator (int *); extern const char EXP_CHARS[], FLT_CHARS[]; @@ -63,8 +63,7 @@ static struct expr_symbol_line *expr_symbol_lines; into the fake section expr_section. */ symbolS * -make_expr_symbol (expressionP) - expressionS *expressionP; +make_expr_symbol (expressionS *expressionP) { expressionS zero; symbolS *symbolP; @@ -118,10 +117,7 @@ make_expr_symbol (expressionP) the symbol. */ int -expr_symbol_where (sym, pfile, pline) - symbolS *sym; - char **pfile; - unsigned int *pline; +expr_symbol_where (symbolS *sym, char **pfile, unsigned int *pline) { register struct expr_symbol_line *l; @@ -151,8 +147,7 @@ expr_symbol_where (sym, pfile, pline) but that seems more clumsy. */ symbolS * -expr_build_uconstant (value) - offsetT value; +expr_build_uconstant (offsetT value) { expressionS e; @@ -165,9 +160,7 @@ expr_build_uconstant (value) /* Build an expression for OP s1. */ symbolS * -expr_build_unary (op, s1) - operatorT op; - symbolS *s1; +expr_build_unary (operatorT op, symbolS *s1) { expressionS e; @@ -180,10 +173,7 @@ expr_build_unary (op, s1) /* Build an expression for s1 OP s2. */ symbolS * -expr_build_binary (op, s1, s2) - operatorT op; - symbolS *s1; - symbolS *s2; +expr_build_binary (operatorT op, symbolS *s1, symbolS *s2) { expressionS e; @@ -197,7 +187,7 @@ expr_build_binary (op, s1, s2) /* Build an expression for the current location ('.'). */ symbolS * -expr_build_dot () +expr_build_dot (void) { expressionS e; @@ -227,8 +217,7 @@ FLONUM_TYPE generic_floating_point_number = { int generic_floating_point_magic; static void -floating_constant (expressionP) - expressionS *expressionP; +floating_constant (expressionS *expressionP) { /* input_line_pointer -> floating-point constant. */ int error_code; @@ -255,7 +244,7 @@ floating_constant (expressionP) } static valueT -generic_bignum_to_int32 () +generic_bignum_to_int32 (void) { valueT number = ((generic_bignum[1] & LITTLENUM_MASK) << LITTLENUM_NUMBER_OF_BITS) @@ -266,7 +255,7 @@ generic_bignum_to_int32 () #ifdef BFD64 static valueT -generic_bignum_to_int64 () +generic_bignum_to_int64 (void) { valueT number = ((((((((valueT) generic_bignum[3] & LITTLENUM_MASK) @@ -281,9 +270,7 @@ generic_bignum_to_int64 () #endif static void -integer_constant (radix, expressionP) - int radix; - expressionS *expressionP; +integer_constant (int radix, expressionS *expressionP) { char *start; /* Start of number. */ char *suffix = NULL; @@ -642,8 +629,7 @@ integer_constant (radix, expressionP) /* Parse an MRI multi character constant. */ static void -mri_char_constant (expressionP) - expressionS *expressionP; +mri_char_constant (expressionS *expressionP) { int i; @@ -732,8 +718,7 @@ mri_char_constant (expressionP) handles the magic symbol `.'. */ static void -current_location (expressionp) - expressionS *expressionp; +current_location (expressionS *expressionp) { if (now_seg == absolute_section) { @@ -756,8 +741,7 @@ current_location (expressionp) Input_line_pointer->(next non-blank) char after operand. */ static segT -operand (expressionP) - expressionS *expressionP; +operand (expressionS *expressionP) { char c; symbolS *symbolP; /* Points to symbol. */ @@ -1354,8 +1338,7 @@ operand (expressionP) Unused fields zeroed to help expr (). */ static void -clean_up_expression (expressionP) - expressionS *expressionP; +clean_up_expression (expressionS *expressionP) { switch (expressionP->X_op) { @@ -1506,7 +1489,7 @@ static operator_rankT op_rank[] = { #define MRI_MUL_PRECEDENCE 6 void -expr_set_precedence () +expr_set_precedence (void) { if (flag_m68k_mri) { @@ -1525,7 +1508,7 @@ expr_set_precedence () /* Initialize the expression parser. */ void -expr_begin () +expr_begin (void) { expr_set_precedence (); @@ -1542,8 +1525,7 @@ expr_begin () Does not advance INPUT_LINE_POINTER. */ static inline operatorT -operator (num_chars) - int *num_chars; +operator (int *num_chars) { int c; operatorT ret; @@ -1631,9 +1613,8 @@ operator (num_chars) /* Parse an expression. */ segT -expr (rankarg, resultP) - int rankarg; /* Larger # is higher rank. */ - expressionS *resultP; /* Deliver result here. */ +expr (int rankarg, /* Larger # is higher rank. */ + expressionS *resultP /* Deliver result here. */) { operator_rankT rank = (operator_rankT) rankarg; segT retval; @@ -1891,7 +1872,7 @@ expr (rankarg, resultP) lines end in end-of-line. */ char -get_symbol_end () +get_symbol_end (void) { char c; @@ -1910,7 +1891,7 @@ get_symbol_end () } unsigned int -get_single_number () +get_single_number (void) { expressionS exp; operand (&exp); @@ -157,16 +157,15 @@ extern LITTLENUM_TYPE generic_bignum[]; typedef char operator_rankT; -extern char get_symbol_end PARAMS ((void)); -extern void expr_begin PARAMS ((void)); -extern void expr_set_precedence PARAMS ((void)); -extern segT expr PARAMS ((int rank, expressionS * resultP)); -extern unsigned int get_single_number PARAMS ((void)); -extern symbolS *make_expr_symbol PARAMS ((expressionS * expressionP)); -extern int expr_symbol_where - PARAMS ((symbolS *, char **, unsigned int *)); - -extern symbolS *expr_build_uconstant PARAMS ((offsetT)); -extern symbolS *expr_build_unary PARAMS ((operatorT, symbolS *)); -extern symbolS *expr_build_binary PARAMS ((operatorT, symbolS *, symbolS *)); -extern symbolS *expr_build_dot PARAMS ((void)); +extern char get_symbol_end (void); +extern void expr_begin (void); +extern void expr_set_precedence (void); +extern segT expr (int rank, expressionS * resultP); +extern unsigned int get_single_number (void); +extern symbolS *make_expr_symbol (expressionS * expressionP); +extern int expr_symbol_where (symbolS *, char **, unsigned int *); + +extern symbolS *expr_build_uconstant (offsetT); +extern symbolS *expr_build_unary (operatorT, symbolS *); +extern symbolS *expr_build_binary (operatorT, symbolS *, symbolS *); +extern symbolS *expr_build_dot (void); diff --git a/gas/flonum-copy.c b/gas/flonum-copy.c index 1e6b40b..e3aba2c 100644 --- a/gas/flonum-copy.c +++ b/gas/flonum-copy.c @@ -22,9 +22,7 @@ #include "as.h" void -flonum_copy (in, out) - FLONUM_TYPE *in; - FLONUM_TYPE *out; +flonum_copy (FLONUM_TYPE *in, FLONUM_TYPE *out) { unsigned int in_length; /* 0 origin */ unsigned int out_length; /* 0 origin */ diff --git a/gas/flonum-mult.c b/gas/flonum-mult.c index e23579a..6d17f0a 100644 --- a/gas/flonum-mult.c +++ b/gas/flonum-mult.c @@ -71,10 +71,8 @@ (C style also gives deeper insight [to me] ... oh well ...) */ void -flonum_multip (a, b, product) - const FLONUM_TYPE *a; - const FLONUM_TYPE *b; - FLONUM_TYPE *product; +flonum_multip (const FLONUM_TYPE *a, const FLONUM_TYPE *b, + FLONUM_TYPE *product) { int size_of_a; /* 0 origin */ int size_of_b; /* 0 origin */ diff --git a/gas/flonum.h b/gas/flonum.h index e50d9bf..22aa755 100644 --- a/gas/flonum.h +++ b/gas/flonum.h @@ -84,14 +84,14 @@ extern const int table_size_of_flonum_powers_of_ten; * * \***********************************************************************/ -int atof_generic PARAMS ((char **address_of_string_pointer, - const char *string_of_decimal_marks, - const char *string_of_decimal_exponent_marks, - FLONUM_TYPE * address_of_generic_floating_point_number)); - -void flonum_copy PARAMS ((FLONUM_TYPE * in, FLONUM_TYPE * out)); -void flonum_multip PARAMS ((const FLONUM_TYPE * a, const FLONUM_TYPE * b, - FLONUM_TYPE * product)); +int atof_generic (char **address_of_string_pointer, + const char *string_of_decimal_marks, + const char *string_of_decimal_exponent_marks, + FLONUM_TYPE * address_of_generic_floating_point_number); + +void flonum_copy (FLONUM_TYPE * in, FLONUM_TYPE * out); +void flonum_multip (const FLONUM_TYPE * a, const FLONUM_TYPE * b, + FLONUM_TYPE * product); /***********************************************************************\ * * diff --git a/gas/frags.c b/gas/frags.c index 47f828a..1521d4b 100644 --- a/gas/frags.c +++ b/gas/frags.c @@ -30,7 +30,7 @@ extern fragS bss_address_frag; /* Initialization for frag routines. */ void -frag_init () +frag_init (void) { zero_address_frag.fr_type = rs_fill; bss_address_frag.fr_type = rs_fill; @@ -61,8 +61,7 @@ frag_alloc_check (const struct obstack *ob) hackery can be done in just one place. */ fragS * -frag_alloc (ob) - struct obstack *ob; +frag_alloc (struct obstack *ob) { fragS *ptr; int oalign; @@ -82,8 +81,7 @@ frag_alloc (ob) do not return. Do not set up any fields of *now_frag. */ void -frag_grow (nchars) - unsigned int nchars; +frag_grow (unsigned int nchars) { if (obstack_room (&frchain_now->frch_obstack) < nchars) { @@ -125,10 +123,9 @@ frag_grow (nchars) of frchain_now. */ void -frag_new (old_frags_var_max_size) - /* Number of chars (already allocated on obstack frags) in - variable_length part of frag. */ - int old_frags_var_max_size; +frag_new (int old_frags_var_max_size + /* Number of chars (already allocated on obstack frags) in + variable_length part of frag. */) { fragS *former_last_fragP; frchainS *frchP; @@ -178,8 +175,7 @@ frag_new (old_frags_var_max_size) frag_now_growth past the new chars. */ char * -frag_more (nchars) - int nchars; +frag_more (int nchars) { register char *retval; @@ -198,14 +194,8 @@ frag_more (nchars) to write into. */ char * -frag_var (type, max_chars, var, subtype, symbol, offset, opcode) - relax_stateT type; - int max_chars; - int var; - relax_substateT subtype; - symbolS *symbol; - offsetT offset; - char *opcode; +frag_var (relax_stateT type, int max_chars, int var, relax_substateT subtype, + symbolS *symbol, offsetT offset, char *opcode) { register char *retval; @@ -236,14 +226,9 @@ frag_var (type, max_chars, var, subtype, symbol, offset, opcode) No call to frag_grow is done. */ char * -frag_variant (type, max_chars, var, subtype, symbol, offset, opcode) - relax_stateT type; - int max_chars; - int var; - relax_substateT subtype; - symbolS *symbol; - offsetT offset; - char *opcode; +frag_variant (relax_stateT type, int max_chars, int var, + relax_substateT subtype, symbolS *symbol, offsetT offset, + char *opcode) { register char *retval; @@ -270,8 +255,7 @@ frag_variant (type, max_chars, var, subtype, symbol, offset, opcode) /* Reduce the variable end of a frag to a harmless state. */ void -frag_wane (fragP) - register fragS *fragP; +frag_wane (register fragS *fragP) { fragP->fr_type = rs_fill; fragP->fr_offset = 0; @@ -286,10 +270,7 @@ frag_wane (fragP) or 0 if there is no maximum. */ void -frag_align (alignment, fill_character, max) - int alignment; - int fill_character; - int max; +frag_align (int alignment, int fill_character, int max) { if (now_seg == absolute_section) { @@ -319,11 +300,8 @@ frag_align (alignment, fill_character, max) doing the alignment, or 0 if there is no maximum. */ void -frag_align_pattern (alignment, fill_pattern, n_fill, max) - int alignment; - const char *fill_pattern; - int n_fill; - int max; +frag_align_pattern (int alignment, const char *fill_pattern, + int n_fill, int max) { char *p; @@ -353,9 +331,7 @@ frag_align_pattern (alignment, fill_pattern, n_fill, max) #endif void -frag_align_code (alignment, max) - int alignment; - int max; +frag_align_code (int alignment, int max) { char *p; @@ -366,7 +342,7 @@ frag_align_code (alignment, max) } addressT -frag_now_fix_octets () +frag_now_fix_octets (void) { if (now_seg == absolute_section) return abs_section_offset; @@ -376,14 +352,13 @@ frag_now_fix_octets () } addressT -frag_now_fix () +frag_now_fix (void) { return frag_now_fix_octets () / OCTETS_PER_BYTE; } void -frag_append_1_char (datum) - int datum; +frag_append_1_char (int datum) { frag_alloc_check (&frchain_now->frch_obstack); if (obstack_room (&frchain_now->frch_obstack) <= 1) diff --git a/gas/frags.h b/gas/frags.h index 82bf7c8..73b7182 100644 --- a/gas/frags.h +++ b/gas/frags.h @@ -106,8 +106,8 @@ struct frag { however, included in frchain_now. The fr_fix field is bogus; instead, use frag_now_fix (). */ COMMON fragS *frag_now; -extern addressT frag_now_fix PARAMS ((void)); -extern addressT frag_now_fix_octets PARAMS ((void)); +extern addressT frag_now_fix (void); +extern addressT frag_now_fix_octets (void); /* For foreign-segment symbol fixups. */ COMMON fragS zero_address_frag; @@ -127,37 +127,35 @@ COMMON fragS bss_address_frag; obstack_1grow (&frags, datum); \ } #else -extern void frag_append_1_char PARAMS ((int)); +extern void frag_append_1_char (int); #define FRAG_APPEND_1_CHAR(X) frag_append_1_char (X) #endif -void frag_init PARAMS ((void)); -fragS *frag_alloc PARAMS ((struct obstack *)); -void frag_grow PARAMS ((unsigned int nchars)); -char *frag_more PARAMS ((int nchars)); -void frag_align PARAMS ((int alignment, int fill_character, int max)); -void frag_align_pattern PARAMS ((int alignment, - const char *fill_pattern, - int n_fill, - int max)); -void frag_align_code PARAMS ((int alignment, int max)); -void frag_new PARAMS ((int old_frags_var_max_size)); -void frag_wane PARAMS ((fragS * fragP)); - -char *frag_variant PARAMS ((relax_stateT type, - int max_chars, - int var, - relax_substateT subtype, - symbolS * symbol, - offsetT offset, - char *opcode)); - -char *frag_var PARAMS ((relax_stateT type, - int max_chars, - int var, - relax_substateT subtype, - symbolS * symbol, - offsetT offset, - char *opcode)); +void frag_init (void); +fragS *frag_alloc (struct obstack *); +void frag_grow (unsigned int nchars); +char *frag_more (int nchars); +void frag_align (int alignment, int fill_character, int max); +void frag_align_pattern (int alignment, const char *fill_pattern, + int n_fill, int max); +void frag_align_code (int alignment, int max); +void frag_new (int old_frags_var_max_size); +void frag_wane (fragS * fragP); + +char *frag_variant (relax_stateT type, + int max_chars, + int var, + relax_substateT subtype, + symbolS * symbol, + offsetT offset, + char *opcode); + +char *frag_var (relax_stateT type, + int max_chars, + int var, + relax_substateT subtype, + symbolS * symbol, + offsetT offset, + char *opcode); #endif /* FRAGS_H */ |