[patch] gas/[h-i]*: Convert to ISO-C.
Kazu Hirata
kazu@cs.umass.edu
Mon Nov 24 03:38:00 GMT 2003
More information about the Binutils mailing list
Mon Nov 24 03:38:00 GMT 2003
- Previous message (by thread): [PATCH] Fix (p7) hint @pause (was Re: ionice kills vanilla 2.6.0-test9 was [Re: [PATCH] cfq + io priorities (fwd)])
- Next message (by thread): New Romanian PO file for `bfd'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, Committed as preapproved. Kazu Hirata 2003-11-23 Kazu Hirata <kazu@cs.umass.edu> * hash.c: Convert to ISO-C. * hash.h: Likewise. * input-file.c: Likewise. * input-file.h: Likewise. * input-scrub.c: Likewise. * itbl-ops.c: Likewise. * itbl-ops.h: Likewise. Index: hash.c =================================================================== RCS file: /cvs/src/src/gas/hash.c,v retrieving revision 1.10 diff -u -r1.10 hash.c --- hash.c 27 Oct 2003 12:45:17 -0000 1.10 +++ hash.c 22 Nov 2003 02:17:13 -0000 @@ -75,7 +75,7 @@ /* Create a hash table. This return a control block. */ struct hash_control * -hash_new () +hash_new (void) { unsigned int size; struct hash_control *ret; @@ -105,8 +105,7 @@ /* Delete a hash table, freeing all allocated memory. */ void -hash_die (table) - struct hash_control *table; +hash_die (struct hash_control *table) { obstack_free (&table->memory, 0); free (table); @@ -121,17 +120,14 @@ Each time we look up a string, we move it to the start of the list for its hash code, to take advantage of referential locality. */ -static struct hash_entry *hash_lookup PARAMS ((struct hash_control *, - const char *, - struct hash_entry ***, - unsigned long *)); +static struct hash_entry *hash_lookup (struct hash_control *, + const char *, + struct hash_entry ***, + unsigned long *); static struct hash_entry * -hash_lookup (table, key, plist, phash) - struct hash_control *table; - const char *key; - struct hash_entry ***plist; - unsigned long *phash; +hash_lookup (struct hash_control *table, const char *key, + struct hash_entry ***plist, unsigned long *phash) { register unsigned long hash; unsigned int len; @@ -205,10 +201,7 @@ hash table. */ const char * -hash_insert (table, key, value) - struct hash_control *table; - const char *key; - PTR value; +hash_insert (struct hash_control *table, const char *key, PTR value) { struct hash_entry *p; struct hash_entry **list; @@ -238,10 +231,7 @@ error. If an entry already exists, its value is replaced. */ const char * -hash_jam (table, key, value) - struct hash_control *table; - const char *key; - PTR value; +hash_jam (struct hash_control *table, const char *key, PTR value) { struct hash_entry *p; struct hash_entry **list; @@ -279,10 +269,7 @@ table, this does nothing and returns NULL. */ PTR -hash_replace (table, key, value) - struct hash_control *table; - const char *key; - PTR value; +hash_replace (struct hash_control *table, const char *key, PTR value) { struct hash_entry *p; PTR ret; @@ -306,9 +293,7 @@ if the entry is not found. */ PTR -hash_find (table, key) - struct hash_control *table; - const char *key; +hash_find (struct hash_control *table, const char *key) { struct hash_entry *p; @@ -323,9 +308,7 @@ for that entry, or NULL if there is no such entry. */ PTR -hash_delete (table, key) - struct hash_control *table; - const char *key; +hash_delete (struct hash_control *table, const char *key) { struct hash_entry *p; struct hash_entry **list; @@ -354,9 +337,8 @@ hash table. */ void -hash_traverse (table, pfn) - struct hash_control *table; - void (*pfn) PARAMS ((const char *key, PTR value)); +hash_traverse (struct hash_control *table, + void (*pfn) (const char *key, PTR value)) { unsigned int i; @@ -373,10 +355,9 @@ name of the hash table, used for printing a header. */ void -hash_print_statistics (f, name, table) - FILE *f ATTRIBUTE_UNUSED; - const char *name ATTRIBUTE_UNUSED; - struct hash_control *table ATTRIBUTE_UNUSED; +hash_print_statistics (FILE *f ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + struct hash_control *table ATTRIBUTE_UNUSED) { #ifdef HASH_STATISTICS unsigned int i; Index: hash.h =================================================================== RCS file: /cvs/src/src/gas/hash.h,v retrieving revision 1.4 diff -u -r1.4 hash.h --- hash.h 8 Mar 2001 23:24:22 -0000 1.4 +++ hash.h 22 Nov 2003 02:17:13 -0000 @@ -25,54 +25,54 @@ /* Create a hash table. This return a control block. */ -extern struct hash_control *hash_new PARAMS ((void)); +extern struct hash_control *hash_new (void); /* Delete a hash table, freeing all allocated memory. */ -extern void hash_die PARAMS ((struct hash_control *)); +extern void hash_die (struct hash_control *); /* Insert an entry into a hash table. This returns NULL on success. On error, it returns a printable string indicating the error. It is considered to be an error if the entry already exists in the hash table. */ -extern const char *hash_insert PARAMS ((struct hash_control *, - const char *key, PTR value)); +extern const char *hash_insert (struct hash_control *, + const char *key, PTR value); /* Insert or replace an entry in a hash table. This returns NULL on success. On error, it returns a printable string indicating the error. If an entry already exists, its value is replaced. */ -extern const char *hash_jam PARAMS ((struct hash_control *, - const char *key, PTR value)); +extern const char *hash_jam (struct hash_control *, + const char *key, PTR value); /* Replace an existing entry in a hash table. This returns the old value stored for the entry. If the entry is not found in the hash table, this does nothing and returns NULL. */ -extern PTR hash_replace PARAMS ((struct hash_control *, const char *key, - PTR value)); +extern PTR hash_replace (struct hash_control *, const char *key, + PTR value); /* Find an entry in a hash table, returning its value. Returns NULL if the entry is not found. */ -extern PTR hash_find PARAMS ((struct hash_control *, const char *key)); +extern PTR hash_find (struct hash_control *, const char *key); /* Delete an entry from a hash table. This returns the value stored for that entry, or NULL if there is no such entry. */ -extern PTR hash_delete PARAMS ((struct hash_control *, const char *key)); +extern PTR hash_delete (struct hash_control *, const char *key); /* Traverse a hash table. Call the function on every entry in the hash table. */ -extern void hash_traverse PARAMS ((struct hash_control *, - void (*pfn) (const char *key, PTR value))); +extern void hash_traverse (struct hash_control *, + void (*pfn) (const char *key, PTR value)); /* Print hash table statistics on the specified file. NAME is the name of the hash table, used for printing a header. */ -extern void hash_print_statistics PARAMS ((FILE *, const char *name, - struct hash_control *)); +extern void hash_print_statistics (FILE *, const char *name, + struct hash_control *); #endif /* HASH_H */ Index: input-file.c =================================================================== RCS file: /cvs/src/src/gas/input-file.c,v retrieving revision 1.12 diff -u -r1.12 input-file.c --- input-file.c 7 Nov 2003 12:19:34 -0000 1.12 +++ input-file.c 22 Nov 2003 02:17:13 -0000 @@ -31,7 +31,7 @@ #include "input-file.h" #include "safe-ctype.h" -static int input_file_get PARAMS ((char *, int)); +static int input_file_get (char *, int); /* This variable is non-zero if the file currently being read should be preprocessed by app. It is zero if the file can be read straight in. */ @@ -62,25 +62,25 @@ /* These hooks accommodate most operating systems. */ void -input_file_begin () +input_file_begin (void) { f_in = (FILE *) 0; } void -input_file_end () +input_file_end (void) { } /* Return BUFFER_SIZE. */ unsigned int -input_file_buffer_size () +input_file_buffer_size (void) { return (BUFFER_SIZE); } int -input_file_is_open () +input_file_is_open (void) { return f_in != (FILE *) 0; } @@ -89,7 +89,7 @@ can be restored with input_file_pop (). */ char * -input_file_push () +input_file_push (void) { register struct saved_file *saved; @@ -108,8 +108,7 @@ } void -input_file_pop (arg) - char *arg; +input_file_pop (char *arg) { register struct saved_file *saved = (struct saved_file *) arg; @@ -125,9 +124,8 @@ } void -input_file_open (filename, pre) - char *filename; /* "" means use stdin. Must not be 0. */ - int pre; +input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ + int pre) { int c; char buf[80]; @@ -205,7 +203,7 @@ /* Close input file. */ void -input_file_close () +input_file_close (void) { /* Don't close a null file pointer. */ if (f_in != NULL) @@ -217,9 +215,7 @@ /* This function is passed to do_scrub_chars. */ static int -input_file_get (buf, buflen) - char *buf; - int buflen; +input_file_get (char *buf, int buflen) { int size; @@ -235,8 +231,7 @@ /* Read a buffer from the input file. */ char * -input_file_give_next_buffer (where) - char *where; /* Where to place 1st character of new buffer. */ +input_file_give_next_buffer (char *where /* Where to place 1st character of new buffer. */) { char *return_value; /* -> Last char of what we read, + 1. */ register int size; Index: input-file.h =================================================================== RCS file: /cvs/src/src/gas/input-file.h,v retrieving revision 1.3 diff -u -r1.3 input-file.h --- input-file.h 8 Mar 2001 23:24:22 -0000 1.3 +++ input-file.h 22 Nov 2003 02:17:13 -0000 @@ -55,12 +55,12 @@ * about I/O errors. No I/O errors are fatal: an end-of-file may be faked. */ -char *input_file_give_next_buffer PARAMS ((char *where)); -char *input_file_push PARAMS ((void)); -unsigned int input_file_buffer_size PARAMS ((void)); -int input_file_is_open PARAMS ((void)); -void input_file_begin PARAMS ((void)); -void input_file_close PARAMS ((void)); -void input_file_end PARAMS ((void)); -void input_file_open PARAMS ((char *filename, int pre)); -void input_file_pop PARAMS ((char *arg)); +char *input_file_give_next_buffer (char *where); +char *input_file_push (void); +unsigned int input_file_buffer_size (void); +int input_file_is_open (void); +void input_file_begin (void); +void input_file_close (void); +void input_file_end (void); +void input_file_open (char *filename, int pre); +void input_file_pop (char *arg); Index: input-scrub.c =================================================================== RCS file: /cvs/src/src/gas/input-scrub.c,v retrieving revision 1.10 diff -u -r1.10 input-scrub.c --- input-scrub.c 27 Oct 2003 12:45:17 -0000 1.10 +++ input-scrub.c 22 Nov 2003 02:17:13 -0000 @@ -121,9 +121,9 @@ char * saved_position; /* Caller's saved position in buf. */ }; -static struct input_save *input_scrub_push PARAMS ((char *saved_position)); -static char *input_scrub_pop PARAMS ((struct input_save *arg)); -static void as_1_char PARAMS ((unsigned int c, FILE * stream)); +static struct input_save *input_scrub_push (char *saved_position); +static char *input_scrub_pop (struct input_save *arg); +static void as_1_char (unsigned int c, FILE * stream); /* Saved information about the file that .include'd this one. When we hit EOF, we automatically pop to that file. */ @@ -135,8 +135,7 @@ area, which can be restored by passing it to input_scrub_pop(). */ static struct input_save * -input_scrub_push (saved_position) - char *saved_position; +input_scrub_push (char *saved_position) { register struct input_save *saved; @@ -171,8 +170,7 @@ } static char * -input_scrub_pop (saved) - struct input_save *saved; +input_scrub_pop (struct input_save *saved) { char *saved_position; @@ -199,7 +197,7 @@ } void -input_scrub_begin () +input_scrub_begin (void) { know (strlen (BEFORE_STRING) == BEFORE_SIZE); know (strlen (AFTER_STRING) == AFTER_SIZE @@ -221,7 +219,7 @@ } void -input_scrub_end () +input_scrub_end (void) { if (buffer_start) { @@ -235,8 +233,7 @@ Return start of caller's part of buffer. */ char * -input_scrub_new_file (filename) - char *filename; +input_scrub_new_file (char *filename) { input_file_open (filename, !flag_no_comments); physical_input_file = filename[0] ? filename : _("{standard input}"); @@ -251,9 +248,7 @@ input_scrub_new_file. */ char * -input_scrub_include_file (filename, position) - char *filename; - char *position; +input_scrub_include_file (char *filename, char *position) { next_saved_file = input_scrub_push (position); return input_scrub_new_file (filename); @@ -263,10 +258,7 @@ expanding a macro. */ void -input_scrub_include_sb (from, position, is_expansion) - sb *from; - char *position; - int is_expansion; +input_scrub_include_sb (sb *from, char *position, int is_expansion) { if (macro_nest > max_macro_nest) as_fatal (_("macros nested too deeply")); @@ -298,14 +290,13 @@ } void -input_scrub_close () +input_scrub_close (void) { input_file_close (); } char * -input_scrub_next_buffer (bufp) - char **bufp; +input_scrub_next_buffer (char **bufp) { register char *limit; /*->just after last char of buffer. */ @@ -414,13 +405,13 @@ messages and so on. Return TRUE if we opened any file. */ int -seen_at_least_1_file () +seen_at_least_1_file (void) { return (physical_input_file != NULL); } void -bump_line_counters () +bump_line_counters (void) { if (sb_index < 0) { @@ -439,9 +430,8 @@ Returns nonzero if the filename actually changes. */ int -new_logical_line (fname, line_number) - char *fname; /* DON'T destroy it! We point to it! */ - int line_number; +new_logical_line (char *fname, /* DON'T destroy it! We point to it! */ + int line_number) { if (line_number >= 0) logical_input_line = line_number; @@ -464,9 +454,7 @@ up declarations like that, and it's easier to avoid it. */ void -as_where (namep, linep) - char **namep; - unsigned int *linep; +as_where (char **namep, unsigned int *linep) { if (logical_input_file != NULL && (linep == NULL || logical_input_line >= 0)) @@ -494,8 +482,7 @@ No free '\n' at end of line. */ void -as_howmuch (stream) - FILE *stream; /* Opened for write please. */ +as_howmuch (FILE *stream /* Opened for write please. */) { register char *p; /* Scan input line. */ @@ -511,9 +498,7 @@ } static void -as_1_char (c, stream) - unsigned int c; - FILE *stream; +as_1_char (unsigned int c, FILE *stream) { if (c > 127) { Index: itbl-ops.c =================================================================== RCS file: /cvs/src/src/gas/itbl-ops.c,v retrieving revision 1.12 diff -u -r1.12 itbl-ops.c --- itbl-ops.c 27 Oct 2003 12:45:17 -0000 1.12 +++ itbl-ops.c 22 Nov 2003 02:17:14 -0000 @@ -154,23 +154,21 @@ }; /* local prototypes */ -static unsigned long build_opcode PARAMS ((struct itbl_entry *e)); -static e_type get_type PARAMS ((int yytype)); -static e_processor get_processor PARAMS ((int yyproc)); -static struct itbl_entry **get_entries PARAMS ((e_processor processor, - e_type type)); -static struct itbl_entry *find_entry_byname PARAMS ((e_processor processor, - e_type type, char *name)); -static struct itbl_entry *find_entry_byval PARAMS ((e_processor processor, - e_type type, unsigned long val, struct itbl_range *r)); -static struct itbl_entry *alloc_entry PARAMS ((e_processor processor, - e_type type, char *name, unsigned long value)); -static unsigned long apply_range PARAMS ((unsigned long value, - struct itbl_range r)); -static unsigned long extract_range PARAMS ((unsigned long value, - struct itbl_range r)); -static struct itbl_field *alloc_field PARAMS ((e_type type, int sbit, - int ebit, unsigned long flags)); +static unsigned long build_opcode (struct itbl_entry *e); +static e_type get_type (int yytype); +static e_processor get_processor (int yyproc); +static struct itbl_entry **get_entries (e_processor processor, + e_type type); +static struct itbl_entry *find_entry_byname (e_processor processor, + e_type type, char *name); +static struct itbl_entry *find_entry_byval (e_processor processor, + e_type type, unsigned long val, struct itbl_range *r); +static struct itbl_entry *alloc_entry (e_processor processor, + e_type type, char *name, unsigned long value); +static unsigned long apply_range (unsigned long value, struct itbl_range r); +static unsigned long extract_range (unsigned long value, struct itbl_range r); +static struct itbl_field *alloc_field (e_type type, int sbit, + int ebit, unsigned long flags); /*======================================================================*/ /* Interfaces to the parser */ Index: itbl-ops.h =================================================================== RCS file: /cvs/src/src/gas/itbl-ops.h,v retrieving revision 1.4 diff -u -r1.4 itbl-ops.h --- itbl-ops.h 8 Mar 2001 23:24:22 -0000 1.4 +++ itbl-ops.h 22 Nov 2003 02:17:14 -0000 @@ -86,24 +86,23 @@ /* These routines are visible to the main part of the assembler */ -int itbl_parse PARAMS ((char *insntbl)); -void itbl_init PARAMS ((void)); -char *itbl_get_field PARAMS ((char **s)); -unsigned long itbl_assemble PARAMS ((char *name, char *operands)); -int itbl_disassemble PARAMS ((char *str, unsigned long insn)); -int itbl_parse PARAMS ((char *tbl)); /* parses insn tbl */ -int itbl_get_reg_val PARAMS ((char *name, unsigned long *pval)); -int itbl_get_val PARAMS ((e_processor processor, e_type type, char *name, - unsigned long *pval)); -char *itbl_get_name PARAMS ((e_processor processor, e_type type, - unsigned long val)); +int itbl_parse (char *insntbl); +void itbl_init (void); +char *itbl_get_field (char **s); +unsigned long itbl_assemble (char *name, char *operands); +int itbl_disassemble (char *str, unsigned long insn); +int itbl_parse (char *tbl); /* parses insn tbl */ +int itbl_get_reg_val (char *name, unsigned long *pval); +int itbl_get_val (e_processor processor, e_type type, char *name, + unsigned long *pval); +char *itbl_get_name (e_processor processor, e_type type, unsigned long val); /* These routines are called by the table parser used to build the dynamic list of new processor instructions and registers. */ -struct itbl_entry *itbl_add_reg PARAMS ((int yyproc, int yytype, - char *regname, int regnum)); -struct itbl_entry *itbl_add_insn PARAMS ((int yyproc, char *name, - unsigned long value, int sbit, int ebit, unsigned long flags)); -struct itbl_field *itbl_add_operand PARAMS ((struct itbl_entry * e, int yytype, - int sbit, int ebit, unsigned long flags)); +struct itbl_entry *itbl_add_reg (int yyproc, int yytype, + char *regname, int regnum); +struct itbl_entry *itbl_add_insn (int yyproc, char *name, + unsigned long value, int sbit, int ebit, unsigned long flags); +struct itbl_field *itbl_add_operand (struct itbl_entry * e, int yytype, + int sbit, int ebit, unsigned long flags);
- Previous message (by thread): [PATCH] Fix (p7) hint @pause (was Re: ionice kills vanilla 2.6.0-test9 was [Re: [PATCH] cfq + io priorities (fwd)])
- Next message (by thread): New Romanian PO file for `bfd'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list