From 49b1fae4309ab5b9833f0af388483c2b6b4b3d50 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Mon, 28 Mar 2005 02:09:01 +0000 Subject: [PATCH] merge from gcc --- include/ChangeLog | 12 ++ include/dyn-string.h | 39 +++--- include/fibheap.h | 28 ++--- include/floatformat.h | 9 +- include/hashtab.h | 90 +++++++------- include/md5.h | 25 ++-- include/ternary.h | 8 +- libiberty/ChangeLog | 200 +++++++++++++++++++++++-------- libiberty/configure | 2 +- libiberty/configure.ac | 2 +- libiberty/dyn-string.c | 74 +++--------- libiberty/fdmatch.c | 4 +- libiberty/ffs.c | 3 +- libiberty/fibheap.c | 121 ++++++------------- libiberty/floatformat.c | 74 +++++------- libiberty/fnmatch.c | 5 +- libiberty/getcwd.c | 4 +- libiberty/getopt.c | 31 ++--- libiberty/getopt1.c | 20 +--- libiberty/getpagesize.c | 4 +- libiberty/getpwd.c | 4 +- libiberty/getruntime.c | 2 +- libiberty/gettimeofday.c | 4 +- libiberty/hashtab.c | 148 +++++++---------------- libiberty/hex.c | 2 +- libiberty/index.c | 6 +- libiberty/insque.c | 7 +- libiberty/lbasename.c | 3 +- libiberty/lrealpath.c | 3 +- libiberty/make-relative-prefix.c | 23 ++-- libiberty/make-temp-file.c | 12 +- libiberty/md5.c | 30 ++--- libiberty/memchr.c | 9 +- libiberty/memcmp.c | 9 +- libiberty/memcpy.c | 7 +- libiberty/memmove.c | 7 +- libiberty/strerror.c | 17 ++- libiberty/strncasecmp.c | 8 +- libiberty/strncmp.c | 8 +- libiberty/strndup.c | 14 +-- libiberty/strrchr.c | 4 +- libiberty/strsignal.c | 27 ++--- libiberty/strstr.c | 3 +- libiberty/strtod.c | 6 +- libiberty/strtol.c | 5 +- libiberty/strtoul.c | 5 +- libiberty/ternary.c | 17 +-- libiberty/tmpnam.c | 5 +- libiberty/unlink-if-ordinary.c | 3 +- libiberty/vasprintf.c | 25 ++-- libiberty/vfork.c | 4 +- libiberty/vfprintf.c | 9 +- libiberty/vprintf.c | 8 +- libiberty/vsnprintf.c | 18 +-- libiberty/vsprintf.c | 9 +- libiberty/waitpid.c | 4 +- libiberty/xatexit.c | 17 +-- libiberty/xexit.c | 5 +- libiberty/xmalloc.c | 29 ++--- libiberty/xmemdup.c | 5 +- libiberty/xstrdup.c | 3 +- libiberty/xstrerror.c | 11 +- libiberty/xstrndup.c | 4 +- 63 files changed, 522 insertions(+), 782 deletions(-) diff --git a/include/ChangeLog b/include/ChangeLog index 04b7e460466..6b1b233b7e3 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,15 @@ +2005-03-27 Gabriel Dos Reis + + * ternary.h: Don't use PARAMS anymore. + +2005-03-27 Gabriel Dos Reis + + * md5.h: Remove definition and uses of __P. + * dyn-string.h: Remove uses of PARAMS. + * fibheap.h: Likewise. + * floatformat.h: Likewise. + * hashtab.h: Likewise. + 2005-03-26 Gabriel Dos Reis * demangle.h: Remove uses of PARAMS. diff --git a/include/dyn-string.h b/include/dyn-string.h index 85f88b12cf6..a351ec3bdcc 100644 --- a/include/dyn-string.h +++ b/include/dyn-string.h @@ -40,24 +40,21 @@ typedef struct dyn_string (strcmp ((DS1)->s, (DS2)->s)) -extern int dyn_string_init PARAMS ((struct dyn_string *, int)); -extern dyn_string_t dyn_string_new PARAMS ((int)); -extern void dyn_string_delete PARAMS ((dyn_string_t)); -extern char *dyn_string_release PARAMS ((dyn_string_t)); -extern dyn_string_t dyn_string_resize PARAMS ((dyn_string_t, int)); -extern void dyn_string_clear PARAMS ((dyn_string_t)); -extern int dyn_string_copy PARAMS ((dyn_string_t, dyn_string_t)); -extern int dyn_string_copy_cstr PARAMS ((dyn_string_t, const char *)); -extern int dyn_string_prepend PARAMS ((dyn_string_t, dyn_string_t)); -extern int dyn_string_prepend_cstr PARAMS ((dyn_string_t, const char *)); -extern int dyn_string_insert PARAMS ((dyn_string_t, int, - dyn_string_t)); -extern int dyn_string_insert_cstr PARAMS ((dyn_string_t, int, - const char *)); -extern int dyn_string_insert_char PARAMS ((dyn_string_t, int, int)); -extern int dyn_string_append PARAMS ((dyn_string_t, dyn_string_t)); -extern int dyn_string_append_cstr PARAMS ((dyn_string_t, const char *)); -extern int dyn_string_append_char PARAMS ((dyn_string_t, int)); -extern int dyn_string_substring PARAMS ((dyn_string_t, - dyn_string_t, int, int)); -extern int dyn_string_eq PARAMS ((dyn_string_t, dyn_string_t)); +extern int dyn_string_init (struct dyn_string *, int); +extern dyn_string_t dyn_string_new (int); +extern void dyn_string_delete (dyn_string_t); +extern char *dyn_string_release (dyn_string_t); +extern dyn_string_t dyn_string_resize (dyn_string_t, int); +extern void dyn_string_clear (dyn_string_t); +extern int dyn_string_copy (dyn_string_t, dyn_string_t); +extern int dyn_string_copy_cstr (dyn_string_t, const char *); +extern int dyn_string_prepend (dyn_string_t, dyn_string_t); +extern int dyn_string_prepend_cstr (dyn_string_t, const char *); +extern int dyn_string_insert (dyn_string_t, int, dyn_string_t); +extern int dyn_string_insert_cstr (dyn_string_t, int, const char *); +extern int dyn_string_insert_char (dyn_string_t, int, int); +extern int dyn_string_append (dyn_string_t, dyn_string_t); +extern int dyn_string_append_cstr (dyn_string_t, const char *); +extern int dyn_string_append_char (dyn_string_t, int); +extern int dyn_string_substring (dyn_string_t, dyn_string_t, int, int); +extern int dyn_string_eq (dyn_string_t, dyn_string_t); diff --git a/include/fibheap.h b/include/fibheap.h index e1e843ddbb1..bfd82da2cb0 100644 --- a/include/fibheap.h +++ b/include/fibheap.h @@ -68,19 +68,19 @@ typedef struct fibnode #endif } *fibnode_t; -extern fibheap_t fibheap_new PARAMS ((void)); -extern fibnode_t fibheap_insert PARAMS ((fibheap_t, fibheapkey_t, void *)); -extern int fibheap_empty PARAMS ((fibheap_t)); -extern fibheapkey_t fibheap_min_key PARAMS ((fibheap_t)); -extern fibheapkey_t fibheap_replace_key PARAMS ((fibheap_t, fibnode_t, - fibheapkey_t)); -extern void *fibheap_replace_key_data PARAMS ((fibheap_t, fibnode_t, - fibheapkey_t, void *)); -extern void *fibheap_extract_min PARAMS ((fibheap_t)); -extern void *fibheap_min PARAMS ((fibheap_t)); -extern void *fibheap_replace_data PARAMS ((fibheap_t, fibnode_t, void *)); -extern void *fibheap_delete_node PARAMS ((fibheap_t, fibnode_t)); -extern void fibheap_delete PARAMS ((fibheap_t)); -extern fibheap_t fibheap_union PARAMS ((fibheap_t, fibheap_t)); +extern fibheap_t fibheap_new (void); +extern fibnode_t fibheap_insert (fibheap_t, fibheapkey_t, void *); +extern int fibheap_empty (fibheap_t); +extern fibheapkey_t fibheap_min_key (fibheap_t); +extern fibheapkey_t fibheap_replace_key (fibheap_t, fibnode_t, + fibheapkey_t); +extern void *fibheap_replace_key_data (fibheap_t, fibnode_t, + fibheapkey_t, void *); +extern void *fibheap_extract_min (fibheap_t); +extern void *fibheap_min (fibheap_t); +extern void *fibheap_replace_data (fibheap_t, fibnode_t, void *); +extern void *fibheap_delete_node (fibheap_t, fibnode_t); +extern void fibheap_delete (fibheap_t); +extern fibheap_t fibheap_union (fibheap_t, fibheap_t); #endif /* _FIBHEAP_H_ */ diff --git a/include/floatformat.h b/include/floatformat.h index a8244ada5c7..40911b33694 100644 --- a/include/floatformat.h +++ b/include/floatformat.h @@ -82,7 +82,7 @@ struct floatformat const char *name; /* Validator method. */ - int (*is_valid) PARAMS ((const struct floatformat *fmt, const char *from)); + int (*is_valid) (const struct floatformat *fmt, const char *from); }; /* floatformats for IEEE single and double, big and little endian. */ @@ -116,18 +116,17 @@ extern const struct floatformat floatformat_ia64_quad_little; Store the double in *TO. */ extern void -floatformat_to_double PARAMS ((const struct floatformat *, const char *, double *)); +floatformat_to_double (const struct floatformat *, const char *, double *); /* The converse: convert the double *FROM to FMT and store where TO points. */ extern void -floatformat_from_double PARAMS ((const struct floatformat *, - const double *, char *)); +floatformat_from_double (const struct floatformat *, const double *, char *); /* Return non-zero iff the data at FROM is a valid number in format FMT. */ extern int -floatformat_is_valid PARAMS ((const struct floatformat *fmt, const char *from)); +floatformat_is_valid (const struct floatformat *fmt, const char *from); #endif /* defined (FLOATFORMAT_H) */ diff --git a/include/hashtab.h b/include/hashtab.h index de24dedb91b..c75b23c8f05 100644 --- a/include/hashtab.h +++ b/include/hashtab.h @@ -48,38 +48,38 @@ typedef unsigned int hashval_t; /* Callback function pointer types. */ /* Calculate hash of a table entry. */ -typedef hashval_t (*htab_hash) PARAMS ((const void *)); +typedef hashval_t (*htab_hash) (const void *); /* Compare a table entry with a possible entry. The entry already in the table always comes first, so the second element can be of a different type (but in this case htab_find and htab_find_slot cannot be used; instead the variants that accept a hash value must be used). */ -typedef int (*htab_eq) PARAMS ((const void *, const void *)); +typedef int (*htab_eq) (const void *, const void *); /* Cleanup function called whenever a live element is removed from the hash table. */ -typedef void (*htab_del) PARAMS ((void *)); +typedef void (*htab_del) (void *); /* Function called by htab_traverse for each live element. The first arg is the slot of the element (which can be passed to htab_clear_slot if desired), the second arg is the auxiliary pointer handed to htab_traverse. Return 1 to continue scan, 0 to stop. */ -typedef int (*htab_trav) PARAMS ((void **, void *)); +typedef int (*htab_trav) (void **, void *); /* Memory-allocation function, with the same functionality as calloc(). Iff it returns NULL, the hash table implementation will pass an error code back to the user, so if your code doesn't handle errors, best if you use xcalloc instead. */ -typedef PTR (*htab_alloc) PARAMS ((size_t, size_t)); +typedef PTR (*htab_alloc) (size_t, size_t); /* We also need a free() routine. */ -typedef void (*htab_free) PARAMS ((PTR)); +typedef void (*htab_free) (PTR); /* Memory allocation and deallocation; variants which take an extra argument. */ -typedef PTR (*htab_alloc_with_arg) PARAMS ((void *, size_t, size_t)); -typedef void (*htab_free_with_arg) PARAMS ((void *, void *)); +typedef PTR (*htab_alloc_with_arg) (void *, size_t, size_t); +typedef void (*htab_free_with_arg) (void *, void *); /* Hash tables are of the following type. The structure (implementation) of this type is not needed for using the hash @@ -139,45 +139,43 @@ enum insert_option {NO_INSERT, INSERT}; /* The prototypes of the package functions. */ -extern htab_t htab_create_alloc PARAMS ((size_t, htab_hash, - htab_eq, htab_del, - htab_alloc, htab_free)); +extern htab_t htab_create_alloc (size_t, htab_hash, + htab_eq, htab_del, + htab_alloc, htab_free); -extern htab_t htab_create_alloc_ex PARAMS ((size_t, htab_hash, - htab_eq, htab_del, - PTR, htab_alloc_with_arg, - htab_free_with_arg)); +extern htab_t htab_create_alloc_ex (size_t, htab_hash, + htab_eq, htab_del, + PTR, htab_alloc_with_arg, + htab_free_with_arg); /* Backward-compatibility functions. */ -extern htab_t htab_create PARAMS ((size_t, htab_hash, htab_eq, htab_del)); -extern htab_t htab_try_create PARAMS ((size_t, htab_hash, htab_eq, htab_del)); - -extern void htab_set_functions_ex PARAMS ((htab_t, htab_hash, - htab_eq, htab_del, - PTR, htab_alloc_with_arg, - htab_free_with_arg)); - -extern void htab_delete PARAMS ((htab_t)); -extern void htab_empty PARAMS ((htab_t)); - -extern PTR htab_find PARAMS ((htab_t, const void *)); -extern PTR *htab_find_slot PARAMS ((htab_t, const void *, - enum insert_option)); -extern PTR htab_find_with_hash PARAMS ((htab_t, const void *, - hashval_t)); -extern PTR *htab_find_slot_with_hash PARAMS ((htab_t, const void *, - hashval_t, - enum insert_option)); -extern void htab_clear_slot PARAMS ((htab_t, void **)); -extern void htab_remove_elt PARAMS ((htab_t, void *)); -extern void htab_remove_elt_with_hash PARAMS ((htab_t, void *, hashval_t)); - -extern void htab_traverse PARAMS ((htab_t, htab_trav, void *)); -extern void htab_traverse_noresize PARAMS ((htab_t, htab_trav, void *)); - -extern size_t htab_size PARAMS ((htab_t)); -extern size_t htab_elements PARAMS ((htab_t)); -extern double htab_collisions PARAMS ((htab_t)); +extern htab_t htab_create (size_t, htab_hash, htab_eq, htab_del); +extern htab_t htab_try_create (size_t, htab_hash, htab_eq, htab_del); + +extern void htab_set_functions_ex (htab_t, htab_hash, + htab_eq, htab_del, + PTR, htab_alloc_with_arg, + htab_free_with_arg); + +extern void htab_delete (htab_t); +extern void htab_empty (htab_t); + +extern PTR htab_find (htab_t, const void *); +extern PTR *htab_find_slot (htab_t, const void *, enum insert_option); +extern PTR htab_find_with_hash (htab_t, const void *, hashval_t); +extern PTR *htab_find_slot_with_hash (htab_t, const void *, + hashval_t, + enum insert_option); +extern void htab_clear_slot (htab_t, void **); +extern void htab_remove_elt (htab_t, void *); +extern void htab_remove_elt_with_hash (htab_t, void *, hashval_t); + +extern void htab_traverse (htab_t, htab_trav, void *); +extern void htab_traverse_noresize (htab_t, htab_trav, void *); + +extern size_t htab_size (htab_t); +extern size_t htab_elements (htab_t); +extern double htab_collisions (htab_t); /* A hash function for pointers. */ extern htab_hash htab_hash_pointer; @@ -186,10 +184,10 @@ extern htab_hash htab_hash_pointer; extern htab_eq htab_eq_pointer; /* A hash function for null-terminated strings. */ -extern hashval_t htab_hash_string PARAMS ((const PTR)); +extern hashval_t htab_hash_string (const PTR); /* An iterative hash function for arbitrary data. */ -extern hashval_t iterative_hash PARAMS ((const PTR, size_t, hashval_t)); +extern hashval_t iterative_hash (const PTR, size_t, hashval_t); /* Shorthand for hashing something with an intrinsic size. */ #define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT) diff --git a/include/md5.h b/include/md5.h index ad51f19877a..4cdad889a10 100644 --- a/include/md5.h +++ b/include/md5.h @@ -66,13 +66,6 @@ typedef u_int32_t md5_uint32; # endif #endif -#undef __P -#if defined (__STDC__) && __STDC__ -#define __P(x) x -#else -#define __P(x) () -#endif - /* Structure to save state of computation between the single steps. */ struct md5_ctx { @@ -93,21 +86,21 @@ struct md5_ctx /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ -extern void md5_init_ctx __P ((struct md5_ctx *ctx)); +extern void md5_init_ctx (struct md5_ctx *ctx); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is necessary that LEN is a multiple of 64!!! */ -extern void md5_process_block __P ((const void *buffer, size_t len, - struct md5_ctx *ctx)); +extern void md5_process_block (const void *buffer, size_t len, + struct md5_ctx *ctx); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 64. */ -extern void md5_process_bytes __P ((const void *buffer, size_t len, - struct md5_ctx *ctx)); +extern void md5_process_bytes (const void *buffer, size_t len, + struct md5_ctx *ctx); /* Process the remaining bytes in the buffer and put result from CTX in first 16 bytes following RESBUF. The result is always in little @@ -116,7 +109,7 @@ extern void md5_process_bytes __P ((const void *buffer, size_t len, IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ -extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); +extern void *md5_finish_ctx (struct md5_ctx *ctx, void *resbuf); /* Put result from CTX in first 16 bytes following RESBUF. The result is @@ -125,18 +118,18 @@ extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ -extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); +extern void *md5_read_ctx (const struct md5_ctx *ctx, void *resbuf); /* Compute MD5 message digest for bytes read from STREAM. The resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ -extern int md5_stream __P ((FILE *stream, void *resblock)); +extern int md5_stream (FILE *stream, void *resblock); /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ -extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); +extern void *md5_buffer (const char *buffer, size_t len, void *resblock); #endif diff --git a/include/ternary.h b/include/ternary.h index 40d442e6223..c8de76ac0c8 100644 --- a/include/ternary.h +++ b/include/ternary.h @@ -38,14 +38,14 @@ ternary_node; already there, and replace is 0. Otherwise, replaces if it it exists, inserts if it doesn't, and returns the data you passed in. */ -PTR ternary_insert PARAMS ((ternary_tree *p, const char *s, - PTR data, int replace)); +PTR ternary_insert (ternary_tree *p, const char *s, + PTR data, int replace); /* Delete the ternary search tree rooted at P. Does NOT delete the data you associated with the strings. */ -void ternary_cleanup PARAMS ((ternary_tree p)); +void ternary_cleanup (ternary_tree p); /* Search the ternary tree for string S, returning the data associated with it if found. */ -PTR ternary_search PARAMS ((const ternary_node *p, const char *s)); +PTR ternary_search (const ternary_node *p, const char *s); #endif diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 70ba7debc04..60cbe919d08 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,31 +1,133 @@ +2005-03-27 Gabriel Dos Reis + + Convert libiberty to use ISO C prototype style 6/n. + * strerror.c (init_error_tables, errno_max, strerror, strerrno, + strtoerrno, main): Use ISO C prototype style. + * strncasecmp.c (strncasecmp): Likewise. + * strncmp.c (strncmp): Likewise. + * strndup.c (strndup): Likewise. + * strrchr.c (strrchr): Likewise. + * strsignal.c (init_signal_tables, signo_max, strsignal, + strsigno, strtosigno, psignal, main): Likewise. + * strstr.c (strstr): Likewise. + * strtod.c (strtod, atof): Likewise. + * strtol.c (strtol): Likewise. + * strtoul.c (strtoul): Likewise. + * ternary.c (ternary_insert, ternary_cleanup, ternary_search, + ternary_recursivesearch): Likewise. + * tmpnam.c (tmpnam): Likewise. + * unlink-if-ordinary.c (unlink_if_ordinary): Likewise. + * vasprintf.c (int_vasprintf, vasprintf, checkit, main): Likewise. + * vfork.c (vfork): Likewise. + * vfprintf.c (vfprintf): Likewise. + * vprintf.c (vprintf): Likewise. + * vsnprintf.c (vsnprintf, checkit, main): Likewise. + * vsprintf.c (vsprintf): Likewise. + * waitpid.c (waitpid): Likewise. + * xatexit.c (xatexit, xatexit_cleanup): Likewise. + * xexit.c (xexit): Likewise. + * xmalloc.c (xmalloc_set_program_name, xmalloc_failed, xmalloc, + xcalloc, xrealloc): Likewise. + * xmemdup.c (xmemdup): Likewise. + * xstrdup.c (xstrdup): Likewise. + * xstrerror.c (xstrerror): Likewise. + * xstrndup.c (xstrndup): Likewise. + +2005-03-27 Andreas Jaeger + + * configure.ac (ac_c_preproc_warn_flag): Remove -Wtraditional + flags. + * configure: Regenerated. + +2005-03-27 Gabriel Dos Reis + + * getopt1.c (getopt_long_only): Fix thinko. + +2005-03-27 Gabriel Dos Reis + + Convert libiberty to use ISO C prototype style 4/n. + * hashtab.c (higher_prime_index, hash_pointer, eq_pointer, + htab_size, htab_elements, htab_mod_1, htab_mod, htab_mod_m2, + htab_create_alloc, htab_set_functions_ex, htab_create, + htab_try_create, htab_delete, htab_empty, + find_empty_slot_for_expand, htab_expand, htab_find_with_hash, + htab_find, htab_find_slot_with_hash, htab_find_slot, + htab_remove_elt, htab_remove_elt_with_hash, htab_clear_slot, + htab_traverse_noresize, htab_traverse, htab_collisions, + htab_hash_string, iterative_hash): Use ISO C prototype. + * hex.c (hex_init): Likewise. + * index.c (index): Likewise. + * insque.c (insque, remque): Likewise. + * lbasename.c (lbasename): Likewise. + * lrealpath.c (lrealpath): Likewise. + * make-relative-prefix.c (save_string, split_directories, + free_split_directories, make_relative_prefix): Likewise. + * make-temp-file.c (try, choose_tmpdir, make_temp_file): Likewise. + * md5.c (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream, + md5_buffer, md5_process_bytes, md5_process_block): Likewise. + * memchr.c (memchr): Likewise. + * memcpy.c (memcpy): Likewise. + * memmove.c (memmove): Likewise. + * gettimeofday.c (gettimeofday): Likewise. + * getruntime.c (get_run_time): Likewise. + * getpwd.c (getpwd, getpwd): Likewise. + * getpagesize.c (getpagesize): Likewise. + * getopt1.c (getopt_long, getopt_long_only, main): Likewise. + * getopt.c (my_index, exchange, _getopt_initialize, + _getopt_internal, getopt, main): Likewise. + * getcwd.c (getcwd): Likewise. + * fnmatch.c (fnmatch): Likewise. + * floatformat.c (floatformat_always_valid, + floatformat_i387_ext_is_valid, get_field, floatformat_to_double, + put_field, floatformat_from_double, floatformat_is_valid, + ieee_test, main): Likewise. + * fibheap.c (fibheap_new, fibnode_new, fibheap_compare, + fibheap_comp_data, fibheap_insert, fibheap_min, fibheap_min_key, + fibheap_union, fibheap_extract_min, fibheap_replace_key_data, + fibheap_replace_key, fibheap_replace_data, fibheap_delete_node, + fibheap_delete, fibheap_empty, fibheap_extr_min_node, + fibheap_ins_root, fibheap_rem_root, fibheap_consolidate, + fibheap_link, fibheap_cut, fibheap_cascading_cut, + fibnode_insert_after, fibnode_remove): Likewise. + * ffs.c (ffs): Likewise. + * fdmatch.c (fdmatch): Likewise. + * dyn-string.c (dyn_string_init, dyn_string_new, + dyn_string_delete, dyn_string_release, dyn_string_resize, + dyn_string_clear, dyn_string_copy, dyn_string_copy_cstr, + dyn_string_prepend, dyn_string_prepend_cstr, dyn_string_insert, + dyn_string_insert_cstr, dyn_string_insert_char, + dyn_string_append, dyn_string_append_cstr, + dyn_string_append_char, dyn_string_substring, dyn_string_eq): + Likewise. + 2005-03-27 Gabriel Dos Reis Convert libiberty to use ISO C prototype style 3/n. - * cplus-dem.c (set_cplus_marker_for_demangling, consume_count, - consume_count_with_underscores, code_for_qualifier, - qualifier_string, demangle_qualifier, cplus_demangle_opname, - cplus_mangle_opname, cplus_demangle_set_style, - cplus_demangle_name_to_style, cplus_demangle, grow_vect, + * cplus-dem.c (set_cplus_marker_for_demangling, consume_count, + consume_count_with_underscores, code_for_qualifier, + qualifier_string, demangle_qualifier, cplus_demangle_opname, + cplus_mangle_opname, cplus_demangle_set_style, + cplus_demangle_name_to_style, cplus_demangle, grow_vect, ada_demangle, internal_cplus_demangle, squangle_mop_up, - work_stuff_copy_to_from, delete_non_B_K_work_stuff, - delete_work_stuff, mop_up, demangle_signature, - demangle_method_args, demangle_template_template_parm, - demangle_expression, demangle_integral_value, - demangle_real_value, demangle_template_value_parm, - demangle_template, arm_pt, demangle_arm_hp_template, - demangle_class_name, demangle_class, iterate_demangle_function, - demangle_prefix, gnu_special, recursively_demangle, arm_special, - demangle_qualified, get_count, do_type, demangle_fund_type, - do_hpacc_template_const_value, do_hpacc_template_literal, - snarf_numeric_literal, do_arg, remember_type, remember_Ktype, - register_Btype, remember_Btype, forget_B_and_K_types, - forget_types, demangle_args, demangle_nested_args, - demangle_function_name, string_need, string_delete, string_init, - string_clear, string_empty, string_append, string_appends, + work_stuff_copy_to_from, delete_non_B_K_work_stuff, + delete_work_stuff, mop_up, demangle_signature, + demangle_method_args, demangle_template_template_parm, + demangle_expression, demangle_integral_value, + demangle_real_value, demangle_template_value_parm, + demangle_template, arm_pt, demangle_arm_hp_template, + demangle_class_name, demangle_class, iterate_demangle_function, + demangle_prefix, gnu_special, recursively_demangle, arm_special, + demangle_qualified, get_count, do_type, demangle_fund_type, + do_hpacc_template_const_value, do_hpacc_template_literal, + snarf_numeric_literal, do_arg, remember_type, remember_Ktype, + register_Btype, remember_Btype, forget_B_and_K_types, + forget_types, demangle_args, demangle_nested_args, + demangle_function_name, string_need, string_delete, string_init, + string_clear, string_empty, string_append, string_appends, string_appendn, string_prepend, string_prepends, string_prependn, string_append_template_idx): Use ISO C prootype style. * cp-demint.c (cplus_demangle_fill_component, - cplus_demangle_fill_builtin_type, cplus_demangle_fill_operator, + cplus_demangle_fill_builtin_type, cplus_demangle_fill_operator, cplus_demangle_v3_components): Likewise. 2005-03-26 Gabriel Dos Reis @@ -33,28 +135,28 @@ Convert libiberty to use ISO C prototype style 2/n. * cp-demangle.h: Remove uses of PARAMS. * cp-demangle.c: Likewise. - (d_dump, cplus_demangle_fill_name, - cplus_demangle_fill_extended_operator, cplus_demangle_fill_ctor, - cplus_demangle_fill_dtor, d_make_empty, d_make_comp, d_make_name, - d_make_builtin_type, d_make_operator, d_make_extended_operator, - d_make_ctor, d_make_dtor, d_make_template_param, d_make_sub, - cplus_demangle_mangled_name, has_return_type, - is_ctor_dtor_or_conversion, d_encoding, d_name, d_nested_name, - d_prefix, d_unqualified_name, d_source_name, d_number, - d_identifier, d_operator_name, d_special_name, d_call_offset, - d_ctor_dtor_name, cplus_demangle_type, d_cv_qualifiers, - d_function_type, d_bare_function_type, d_class_enum_type, - d_array_type, d_pointer_to_member_type, d_template_param, - d_template_args, d_template_arg, d_expression, d_expr_primary, - d_local_name, d_discriminator, d_add_substitution, - d_substitution, d_print_resize, d_print_append_char, - d_print_append_buffer, d_print_error, cplus_demangle_print, - d_print_comp, d_print_java_identifier, d_print_mod_list, - d_print_mod, d_print_function_type, d_print_array_type, - d_print_expr_op, d_print_cast, cplus_demangle_init_info, - d_demangle, __cxa_demangle, cplus_demangle_v3, java_demangle_v3, + (d_dump, cplus_demangle_fill_name, + cplus_demangle_fill_extended_operator, cplus_demangle_fill_ctor, + cplus_demangle_fill_dtor, d_make_empty, d_make_comp, d_make_name, + d_make_builtin_type, d_make_operator, d_make_extended_operator, + d_make_ctor, d_make_dtor, d_make_template_param, d_make_sub, + cplus_demangle_mangled_name, has_return_type, + is_ctor_dtor_or_conversion, d_encoding, d_name, d_nested_name, + d_prefix, d_unqualified_name, d_source_name, d_number, + d_identifier, d_operator_name, d_special_name, d_call_offset, + d_ctor_dtor_name, cplus_demangle_type, d_cv_qualifiers, + d_function_type, d_bare_function_type, d_class_enum_type, + d_array_type, d_pointer_to_member_type, d_template_param, + d_template_args, d_template_arg, d_expression, d_expr_primary, + d_local_name, d_discriminator, d_add_substitution, + d_substitution, d_print_resize, d_print_append_char, + d_print_append_buffer, d_print_error, cplus_demangle_print, + d_print_comp, d_print_java_identifier, d_print_mod_list, + d_print_mod, d_print_function_type, d_print_array_type, + d_print_expr_op, d_print_cast, cplus_demangle_init_info, + d_demangle, __cxa_demangle, cplus_demangle_v3, java_demangle_v3, is_ctor_or_dtor, is_gnu_v3_mangled_ctor, is_gnu_v3_mangled_dtor, - print_usage, main): + print_usage, main): 2005-03-26 Gabriel Dos Reis @@ -64,10 +166,10 @@ (_doprnt, checkit, main): Use ISO C prototype. * alloca.c (find_stack_direction, C_alloca): Use ISO C prototype. * argv.c: Remove conditional #includes on ANSI_PROTOTYPES. - (dupargv, freeargv, buildargv, main): Use ISO C prototype. + (dupargv, freeargv, buildargv, main): Use ISO C prototype. * atexit.c (atexit): Likewise * asprintf.c: Remove conditional include on ANSI_PROTOTYPES. - (asprintf): Use ISO C prototype. + (asprintf): Use ISO C prototype. * basename.c (basename): Likewise * bcmp.c (bcmp): Likewise. * bcopy.c (bcopy): Likewise. @@ -78,7 +180,7 @@ (calloc): Use ISO C prototype. * clock.c (clock): Likewise. * concat.c: Remove conditional #include on ANSI_PROTOTYPES. - (vconcat_length, vconcat_copy, concat_length, concat_copy, + (vconcat_length, vconcat_copy, concat_length, concat_copy, concat_copy2, concat, reconcat, main): Use ISO C prototype. * copysign.c (copysign): Likewise. @@ -154,7 +256,7 @@ * hex.c (hex_value): Group 'unsigned int' together to get correct markup. * functions.texi: Regenerated. - + 2004-12-27 H.J. Lu * Makefile.in: Undo to 2004-12-17. @@ -267,15 +369,15 @@ * vasprintf.c: Accept __va_copy in addition to va_copy. -2004-09-03 Paolo Bonzini +2004-09-03 Paolo Bonzini * configure: Regenerate. -2004-09-02 Paolo Bonzini +2004-09-02 Paolo Bonzini * configure.ac: Do not enable multilibs for build-side libiberty. -2004-06-29 Danny Smith +2004-06-29 Danny Smith * lrealpath.c (lrealpath): Add _WIN32 support. diff --git a/libiberty/configure b/libiberty/configure index 88da64294db..1435cd26f5d 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -2930,7 +2930,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_c_preproc_warn_flag=yes if test x$GCC = xyes; then - ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic' + ac_libiberty_warn_cflags='-W -Wall -pedantic' fi diff --git a/libiberty/configure.ac b/libiberty/configure.ac index 99250533cd6..e000825e383 100644 --- a/libiberty/configure.ac +++ b/libiberty/configure.ac @@ -114,7 +114,7 @@ AC_PROG_CC AC_PROG_CPP_WERROR if test x$GCC = xyes; then - ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic' + ac_libiberty_warn_cflags='-W -Wall -pedantic' fi AC_SUBST(ac_libiberty_warn_cflags) diff --git a/libiberty/dyn-string.c b/libiberty/dyn-string.c index 5d48cdc6955..b6f5d4b0bf4 100644 --- a/libiberty/dyn-string.c +++ b/libiberty/dyn-string.c @@ -56,9 +56,7 @@ Boston, MA 02111-1307, USA. */ fails, returns 0. Otherwise returns 1. */ int -dyn_string_init (ds_struct_ptr, space) - struct dyn_string *ds_struct_ptr; - int space; +dyn_string_init (struct dyn_string *ds_struct_ptr, int space) { /* We need at least one byte in which to store the terminating NUL. */ if (space == 0) @@ -85,8 +83,7 @@ dyn_string_init (ds_struct_ptr, space) returns the newly allocated string. */ dyn_string_t -dyn_string_new (space) - int space; +dyn_string_new (int space) { dyn_string_t result; #ifdef RETURN_ON_ALLOCATION_FAILURE @@ -108,8 +105,7 @@ dyn_string_new (space) /* Free the memory used by DS. */ void -dyn_string_delete (ds) - dyn_string_t ds; +dyn_string_delete (dyn_string_t ds) { free (ds->s); free (ds); @@ -120,8 +116,7 @@ dyn_string_delete (ds) DS is then set to the empty string. Deletes DS itself. */ char* -dyn_string_release (ds) - dyn_string_t ds; +dyn_string_release (dyn_string_t ds) { /* Store the old buffer. */ char* result = ds->s; @@ -141,9 +136,7 @@ dyn_string_release (ds) operation fails, deletes DS and returns NULL. */ dyn_string_t -dyn_string_resize (ds, space) - dyn_string_t ds; - int space; +dyn_string_resize (dyn_string_t ds, int space) { int new_allocated = ds->allocated; @@ -176,8 +169,7 @@ dyn_string_resize (ds, space) /* Sets the contents of DS to the empty string. */ void -dyn_string_clear (ds) - dyn_string_t ds; +dyn_string_clear (dyn_string_t ds) { /* A dyn_string always has room for at least the NUL terminator. */ ds->s[0] = '\0'; @@ -189,9 +181,7 @@ dyn_string_clear (ds) RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ int -dyn_string_copy (dest, src) - dyn_string_t dest; - dyn_string_t src; +dyn_string_copy (dyn_string_t dest, dyn_string_t src) { if (dest == src) abort (); @@ -211,9 +201,7 @@ dyn_string_copy (dest, src) and returns 0. */ int -dyn_string_copy_cstr (dest, src) - dyn_string_t dest; - const char *src; +dyn_string_copy_cstr (dyn_string_t dest, const char *src) { int length = strlen (src); /* Make room in DEST. */ @@ -232,9 +220,7 @@ dyn_string_copy_cstr (dest, src) returns 0. */ int -dyn_string_prepend (dest, src) - dyn_string_t dest; - dyn_string_t src; +dyn_string_prepend (dyn_string_t dest, dyn_string_t src) { return dyn_string_insert (dest, 0, src); } @@ -244,9 +230,7 @@ dyn_string_prepend (dest, src) if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ int -dyn_string_prepend_cstr (dest, src) - dyn_string_t dest; - const char *src; +dyn_string_prepend_cstr (dyn_string_t dest, const char *src) { return dyn_string_insert_cstr (dest, 0, src); } @@ -257,10 +241,7 @@ dyn_string_prepend_cstr (dest, src) and returns 0. */ int -dyn_string_insert (dest, pos, src) - dyn_string_t dest; - int pos; - dyn_string_t src; +dyn_string_insert (dyn_string_t dest, int pos, dyn_string_t src) { int i; @@ -285,10 +266,7 @@ dyn_string_insert (dest, pos, src) and returns 0. */ int -dyn_string_insert_cstr (dest, pos, src) - dyn_string_t dest; - int pos; - const char *src; +dyn_string_insert_cstr (dyn_string_t dest, int pos, const char *src) { int i; int length = strlen (src); @@ -310,10 +288,7 @@ dyn_string_insert_cstr (dest, pos, src) RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ int -dyn_string_insert_char (dest, pos, c) - dyn_string_t dest; - int pos; - int c; +dyn_string_insert_char (dyn_string_t dest, int pos, int c) { int i; @@ -334,9 +309,7 @@ dyn_string_insert_char (dest, pos, c) returns 0. */ int -dyn_string_append (dest, s) - dyn_string_t dest; - dyn_string_t s; +dyn_string_append (dyn_string_t dest, dyn_string_t s) { if (dyn_string_resize (dest, dest->length + s->length) == 0) return 0; @@ -350,9 +323,7 @@ dyn_string_append (dest, s) deletes DEST and returns 0. */ int -dyn_string_append_cstr (dest, s) - dyn_string_t dest; - const char *s; +dyn_string_append_cstr (dyn_string_t dest, const char *s) { int len = strlen (s); @@ -369,9 +340,7 @@ dyn_string_append_cstr (dest, s) if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ int -dyn_string_append_char (dest, c) - dyn_string_t dest; - int c; +dyn_string_append_char (dyn_string_t dest, int c) { /* Make room for the extra character. */ if (dyn_string_resize (dest, dest->length + 1) == NULL) @@ -392,11 +361,8 @@ dyn_string_append_char (dest, c) deletes DEST and returns 0. */ int -dyn_string_substring (dest, src, start, end) - dyn_string_t dest; - dyn_string_t src; - int start; - int end; +dyn_string_substring (dyn_string_t dest, dyn_string_t src, + int start, int end) { int i; int length = end - start; @@ -421,9 +387,7 @@ dyn_string_substring (dest, src, start, end) /* Returns non-zero if DS1 and DS2 have the same contents. */ int -dyn_string_eq (ds1, ds2) - dyn_string_t ds1; - dyn_string_t ds2; +dyn_string_eq (dyn_string_t ds1, dyn_string_t ds2) { /* If DS1 and DS2 have different lengths, they must not be the same. */ if (ds1->length != ds2->length) diff --git a/libiberty/fdmatch.c b/libiberty/fdmatch.c index 979c214d5d4..76ad36f1de8 100644 --- a/libiberty/fdmatch.c +++ b/libiberty/fdmatch.c @@ -46,9 +46,7 @@ BUGS #include #include -int fdmatch (fd1, fd2) - int fd1; - int fd2; +int fdmatch (int fd1, int fd2) { struct stat sbuf1; struct stat sbuf2; diff --git a/libiberty/ffs.c b/libiberty/ffs.c index de047e217eb..603cbe8ed99 100644 --- a/libiberty/ffs.c +++ b/libiberty/ffs.c @@ -11,8 +11,7 @@ value 1). If @var{valu} is zero, zero is returned. */ int -ffs (valu) - register int valu; +ffs (register int valu) { register int bit; diff --git a/libiberty/fibheap.c b/libiberty/fibheap.c index bcecf80251f..e1d818c2893 100644 --- a/libiberty/fibheap.c +++ b/libiberty/fibheap.c @@ -37,32 +37,31 @@ Boston, MA 02111-1307, USA. */ #define FIBHEAPKEY_MIN LONG_MIN -static void fibheap_ins_root PARAMS ((fibheap_t, fibnode_t)); -static void fibheap_rem_root PARAMS ((fibheap_t, fibnode_t)); -static void fibheap_consolidate PARAMS ((fibheap_t)); -static void fibheap_link PARAMS ((fibheap_t, fibnode_t, fibnode_t)); -static void fibheap_cut PARAMS ((fibheap_t, fibnode_t, fibnode_t)); -static void fibheap_cascading_cut PARAMS ((fibheap_t, fibnode_t)); -static fibnode_t fibheap_extr_min_node PARAMS ((fibheap_t)); -static int fibheap_compare PARAMS ((fibheap_t, fibnode_t, fibnode_t)); -static int fibheap_comp_data PARAMS ((fibheap_t, fibheapkey_t, void *, - fibnode_t)); -static fibnode_t fibnode_new PARAMS ((void)); -static void fibnode_insert_after PARAMS ((fibnode_t, fibnode_t)); +static void fibheap_ins_root (fibheap_t, fibnode_t); +static void fibheap_rem_root (fibheap_t, fibnode_t); +static void fibheap_consolidate (fibheap_t); +static void fibheap_link (fibheap_t, fibnode_t, fibnode_t); +static void fibheap_cut (fibheap_t, fibnode_t, fibnode_t); +static void fibheap_cascading_cut (fibheap_t, fibnode_t); +static fibnode_t fibheap_extr_min_node (fibheap_t); +static int fibheap_compare (fibheap_t, fibnode_t, fibnode_t); +static int fibheap_comp_data (fibheap_t, fibheapkey_t, void *, fibnode_t); +static fibnode_t fibnode_new (void); +static void fibnode_insert_after (fibnode_t, fibnode_t); #define fibnode_insert_before(a, b) fibnode_insert_after (a->left, b) -static fibnode_t fibnode_remove PARAMS ((fibnode_t)); +static fibnode_t fibnode_remove (fibnode_t); /* Create a new fibonacci heap. */ fibheap_t -fibheap_new () +fibheap_new (void) { return (fibheap_t) xcalloc (1, sizeof (struct fibheap)); } /* Create a new fibonacci heap node. */ static fibnode_t -fibnode_new () +fibnode_new (void) { fibnode_t node; @@ -74,10 +73,7 @@ fibnode_new () } static inline int -fibheap_compare (heap, a, b) - fibheap_t heap ATTRIBUTE_UNUSED; - fibnode_t a; - fibnode_t b; +fibheap_compare (fibheap_t heap ATTRIBUTE_UNUSED, fibnode_t a, fibnode_t b) { if (a->key < b->key) return -1; @@ -87,11 +83,7 @@ fibheap_compare (heap, a, b) } static inline int -fibheap_comp_data (heap, key, data, b) - fibheap_t heap; - fibheapkey_t key; - void *data; - fibnode_t b; +fibheap_comp_data (fibheap_t heap, fibheapkey_t key, void *data, fibnode_t b) { struct fibnode a; @@ -103,10 +95,7 @@ fibheap_comp_data (heap, key, data, b) /* Insert DATA, with priority KEY, into HEAP. */ fibnode_t -fibheap_insert (heap, key, data) - fibheap_t heap; - fibheapkey_t key; - void *data; +fibheap_insert (fibheap_t heap, fibheapkey_t key, void *data) { fibnode_t node; @@ -132,8 +121,7 @@ fibheap_insert (heap, key, data) /* Return the data of the minimum node (if we know it). */ void * -fibheap_min (heap) - fibheap_t heap; +fibheap_min (fibheap_t heap) { /* If there is no min, we can't easily return it. */ if (heap->min == NULL) @@ -143,8 +131,7 @@ fibheap_min (heap) /* Return the key of the minimum node (if we know it). */ fibheapkey_t -fibheap_min_key (heap) - fibheap_t heap; +fibheap_min_key (fibheap_t heap) { /* If there is no min, we can't easily return it. */ if (heap->min == NULL) @@ -154,9 +141,7 @@ fibheap_min_key (heap) /* Union HEAPA and HEAPB into a new heap. */ fibheap_t -fibheap_union (heapa, heapb) - fibheap_t heapa; - fibheap_t heapb; +fibheap_union (fibheap_t heapa, fibheap_t heapb) { fibnode_t a_root, b_root, temp; @@ -190,8 +175,7 @@ fibheap_union (heapa, heapb) /* Extract the data of the minimum node from HEAP. */ void * -fibheap_extract_min (heap) - fibheap_t heap; +fibheap_extract_min (fibheap_t heap) { fibnode_t z; void *ret = NULL; @@ -211,11 +195,8 @@ fibheap_extract_min (heap) /* Replace both the KEY and the DATA associated with NODE. */ void * -fibheap_replace_key_data (heap, node, key, data) - fibheap_t heap; - fibnode_t node; - fibheapkey_t key; - void *data; +fibheap_replace_key_data (fibheap_t heap, fibnode_t node, + fibheapkey_t key, void *data) { void *odata; fibheapkey_t okey; @@ -253,20 +234,14 @@ fibheap_replace_key_data (heap, node, key, data) /* Replace the DATA associated with NODE. */ void * -fibheap_replace_data (heap, node, data) - fibheap_t heap; - fibnode_t node; - void *data; +fibheap_replace_data (fibheap_t heap, fibnode_t node, void *data) { return fibheap_replace_key_data (heap, node, node->key, data); } /* Replace the KEY associated with NODE. */ fibheapkey_t -fibheap_replace_key (heap, node, key) - fibheap_t heap; - fibnode_t node; - fibheapkey_t key; +fibheap_replace_key (fibheap_t heap, fibnode_t node, fibheapkey_t key) { int okey = node->key; fibheap_replace_key_data (heap, node, key, node->data); @@ -275,9 +250,7 @@ fibheap_replace_key (heap, node, key) /* Delete NODE from HEAP. */ void * -fibheap_delete_node (heap, node) - fibheap_t heap; - fibnode_t node; +fibheap_delete_node (fibheap_t heap, fibnode_t node) { void *ret = node->data; @@ -290,8 +263,7 @@ fibheap_delete_node (heap, node) /* Delete HEAP. */ void -fibheap_delete (heap) - fibheap_t heap; +fibheap_delete (fibheap_t heap) { while (heap->min != NULL) free (fibheap_extr_min_node (heap)); @@ -301,16 +273,14 @@ fibheap_delete (heap) /* Determine if HEAP is empty. */ int -fibheap_empty (heap) - fibheap_t heap; +fibheap_empty (fibheap_t heap) { return heap->nodes == 0; } /* Extract the minimum node of the heap. */ static fibnode_t -fibheap_extr_min_node (heap) - fibheap_t heap; +fibheap_extr_min_node (fibheap_t heap) { fibnode_t ret = heap->min; fibnode_t x, y, orig; @@ -346,9 +316,7 @@ fibheap_extr_min_node (heap) /* Insert NODE into the root list of HEAP. */ static void -fibheap_ins_root (heap, node) - fibheap_t heap; - fibnode_t node; +fibheap_ins_root (fibheap_t heap, fibnode_t node) { /* If the heap is currently empty, the new node becomes the singleton circular root list. */ @@ -367,9 +335,7 @@ fibheap_ins_root (heap, node) /* Remove NODE from the rootlist of HEAP. */ static void -fibheap_rem_root (heap, node) - fibheap_t heap; - fibnode_t node; +fibheap_rem_root (fibheap_t heap, fibnode_t node) { if (node->left == node) heap->root = NULL; @@ -379,8 +345,7 @@ fibheap_rem_root (heap, node) /* Consolidate the heap. */ static void -fibheap_consolidate (heap) - fibheap_t heap; +fibheap_consolidate (fibheap_t heap) { fibnode_t a[1 + 8 * sizeof (long)]; fibnode_t w; @@ -427,10 +392,8 @@ fibheap_consolidate (heap) /* Make NODE a child of PARENT. */ static void -fibheap_link (heap, node, parent) - fibheap_t heap ATTRIBUTE_UNUSED; - fibnode_t node; - fibnode_t parent; +fibheap_link (fibheap_t heap ATTRIBUTE_UNUSED, + fibnode_t node, fibnode_t parent) { if (parent->child == NULL) parent->child = node; @@ -443,10 +406,7 @@ fibheap_link (heap, node, parent) /* Remove NODE from PARENT's child list. */ static void -fibheap_cut (heap, node, parent) - fibheap_t heap; - fibnode_t node; - fibnode_t parent; +fibheap_cut (fibheap_t heap, fibnode_t node, fibnode_t parent) { fibnode_remove (node); parent->degree--; @@ -456,9 +416,7 @@ fibheap_cut (heap, node, parent) } static void -fibheap_cascading_cut (heap, y) - fibheap_t heap; - fibnode_t y; +fibheap_cascading_cut (fibheap_t heap, fibnode_t y) { fibnode_t z; @@ -478,9 +436,7 @@ fibheap_cascading_cut (heap, y) } static void -fibnode_insert_after (a, b) - fibnode_t a; - fibnode_t b; +fibnode_insert_after (fibnode_t a, fibnode_t b) { if (a == a->right) { @@ -499,8 +455,7 @@ fibnode_insert_after (a, b) } static fibnode_t -fibnode_remove (node) - fibnode_t node; +fibnode_remove (fibnode_t node) { fibnode_t ret; diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c index a0f65354e48..c950b79f7e4 100644 --- a/libiberty/floatformat.c +++ b/libiberty/floatformat.c @@ -46,18 +46,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define NAN (0.0 / 0.0) #endif -static unsigned long get_field PARAMS ((const unsigned char *, - enum floatformat_byteorders, - unsigned int, - unsigned int, - unsigned int)); -static int floatformat_always_valid PARAMS ((const struct floatformat *fmt, - const char *from)); +static unsigned long get_field (const unsigned char *, + enum floatformat_byteorders, + unsigned int, + unsigned int, + unsigned int); +static int floatformat_always_valid (const struct floatformat *fmt, + const char *from); static int -floatformat_always_valid (fmt, from) - const struct floatformat *fmt ATTRIBUTE_UNUSED; - const char *from ATTRIBUTE_UNUSED; +floatformat_always_valid (const struct floatformat *fmt ATTRIBUTE_UNUSED, + const char *from ATTRIBUTE_UNUSED) { return 1; } @@ -108,12 +107,10 @@ const struct floatformat floatformat_ieee_double_littlebyte_bigword = floatformat_always_valid }; -static int floatformat_i387_ext_is_valid PARAMS ((const struct floatformat *fmt, const char *from)); +static int floatformat_i387_ext_is_valid (const struct floatformat *fmt, const char *from); static int -floatformat_i387_ext_is_valid (fmt, from) - const struct floatformat *fmt; - const char *from; +floatformat_i387_ext_is_valid (const struct floatformat *fmt, const char *from) { /* In the i387 double-extended format, if the exponent is all ones, then the integer bit must be set. If the exponent is neither 0 @@ -220,12 +217,8 @@ const struct floatformat floatformat_ia64_quad_little = /* Extract a field which starts at START and is LEN bits long. DATA and TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */ static unsigned long -get_field (data, order, total_len, start, len) - const unsigned char *data; - enum floatformat_byteorders order; - unsigned int total_len; - unsigned int start; - unsigned int len; +get_field (const unsigned char *data, enum floatformat_byteorders order, + unsigned int total_len, unsigned int start, unsigned int len) { unsigned long result; unsigned int cur_byte; @@ -273,10 +266,8 @@ get_field (data, order, total_len, start, len) Store the double in *TO. */ void -floatformat_to_double (fmt, from, to) - const struct floatformat *fmt; - const char *from; - double *to; +floatformat_to_double (const struct floatformat *fmt, + const char *from, double *to) { const unsigned char *ufrom = (const unsigned char *)from; double dto; @@ -381,22 +372,18 @@ floatformat_to_double (fmt, from, to) *to = dto; } -static void put_field PARAMS ((unsigned char *, enum floatformat_byteorders, - unsigned int, - unsigned int, - unsigned int, - unsigned long)); +static void put_field (unsigned char *, enum floatformat_byteorders, + unsigned int, + unsigned int, + unsigned int, + unsigned long); /* Set a field which starts at START and is LEN bits long. DATA and TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */ static void -put_field (data, order, total_len, start, len, stuff_to_put) - unsigned char *data; - enum floatformat_byteorders order; - unsigned int total_len; - unsigned int start; - unsigned int len; - unsigned long stuff_to_put; +put_field (unsigned char *data, enum floatformat_byteorders order, + unsigned int total_len, unsigned int start, unsigned int len, + unsigned long stuff_to_put) { unsigned int cur_byte; int cur_bitshift; @@ -443,10 +430,8 @@ put_field (data, order, total_len, start, len, stuff_to_put) restrictions. */ void -floatformat_from_double (fmt, from, to) - const struct floatformat *fmt; - const double *from; - char *to; +floatformat_from_double (const struct floatformat *fmt, + const double *from, char *to) { double dfrom; int exponent; @@ -541,9 +526,7 @@ floatformat_from_double (fmt, from, to) /* Return non-zero iff the data at FROM is a valid number in format FMT. */ int -floatformat_is_valid (fmt, from) - const struct floatformat *fmt; - const char *from; +floatformat_is_valid (const struct floatformat *fmt, const char *from) { return fmt->is_valid (fmt, from); } @@ -556,8 +539,7 @@ floatformat_is_valid (fmt, from) /* This is to be run on a host which uses IEEE floating point. */ void -ieee_test (n) - double n; +ieee_test (double n) { double result; @@ -597,7 +579,7 @@ ieee_test (n) } int -main () +main (void) { ieee_test (0.0); ieee_test (0.5); diff --git a/libiberty/fnmatch.c b/libiberty/fnmatch.c index eb898ee14d8..7424f91a374 100644 --- a/libiberty/fnmatch.c +++ b/libiberty/fnmatch.c @@ -65,10 +65,7 @@ extern int errno; /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ int -fnmatch (pattern, string, flags) - const char *pattern; - const char *string; - int flags; +fnmatch (const char *pattern, const char *string, int flags) { register const char *p = pattern, *n = string; register unsigned char c; diff --git a/libiberty/getcwd.c b/libiberty/getcwd.c index a19d26796d5..28f26eb179f 100644 --- a/libiberty/getcwd.c +++ b/libiberty/getcwd.c @@ -38,9 +38,7 @@ extern int errno; #endif char * -getcwd (buf, len) - char *buf; - size_t len; +getcwd (char *buf, size_t len) { char ourbuf[MAXPATHLEN]; char *result; diff --git a/libiberty/getopt.c b/libiberty/getopt.c index a1e482763c1..785c7aad2fc 100644 --- a/libiberty/getopt.c +++ b/libiberty/getopt.c @@ -217,9 +217,7 @@ extern char *getenv (); #endif static char * -my_index (str, chr) - const char *str; - int chr; +my_index (const char *str, int chr) { while (*str) { @@ -307,8 +305,7 @@ static void exchange (char **); #endif static void -exchange (argv) - char **argv; +exchange (char **argv) { int bottom = first_nonopt; int middle = last_nonopt; @@ -392,10 +389,7 @@ exchange (argv) static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; +_getopt_initialize (int argc, char *const *argv, const char *optstring) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped @@ -514,13 +508,9 @@ _getopt_initialize (argc, argv, optstring) long-named options. */ int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; +_getopt_internal (int argc, char *const *argv, const char *optstring, + const struct option *longopts, + int *longind, int long_only) { optarg = NULL; @@ -970,10 +960,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) } int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; +getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, @@ -989,9 +976,7 @@ getopt (argc, argv, optstring) the above definition of `getopt'. */ int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int c; int digit_optind = 0; diff --git a/libiberty/getopt1.c b/libiberty/getopt1.c index a3637c2d0e0..81371d52b4d 100644 --- a/libiberty/getopt1.c +++ b/libiberty/getopt1.c @@ -66,12 +66,8 @@ #endif int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; +getopt_long (int argc, char *const *argv, const char *options, + const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } @@ -82,12 +78,8 @@ getopt_long (argc, argv, options, long_options, opt_index) instead. */ int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; +getopt_long_only (int argc, char *const *argv, const char *options, + const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } @@ -100,9 +92,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index) #include int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int c; int digit_optind = 0; diff --git a/libiberty/getpagesize.c b/libiberty/getpagesize.c index eed9680378a..1c3a26304ea 100644 --- a/libiberty/getpagesize.c +++ b/libiberty/getpagesize.c @@ -61,7 +61,7 @@ BUGS #endif /* GNU_OUR_PAGESIZE */ int -getpagesize () +getpagesize (void) { return (GNU_OUR_PAGESIZE); } @@ -76,7 +76,7 @@ getpagesize () #endif extern unsigned long lib$getsyi(const unsigned short *,...); -int getpagesize () +int getpagesize (void) { long pagsiz = 0L; unsigned short itmcod = SYI$_PAGE_SIZE; diff --git a/libiberty/getpwd.c b/libiberty/getpwd.c index 31c7d20f307..e57ef47e947 100644 --- a/libiberty/getpwd.c +++ b/libiberty/getpwd.c @@ -67,7 +67,7 @@ extern char *getwd (); yield 0 and set errno. */ char * -getpwd () +getpwd (void) { static char *pwd; static int failure_errno; @@ -114,7 +114,7 @@ getpwd () #endif char * -getpwd () +getpwd (void) { static char *pwd = 0; diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c index 3f7dc0d117a..c5aa018d2cc 100644 --- a/libiberty/getruntime.c +++ b/libiberty/getruntime.c @@ -90,7 +90,7 @@ process started. */ long -get_run_time () +get_run_time (void) { #if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H) struct rusage rusage; diff --git a/libiberty/gettimeofday.c b/libiberty/gettimeofday.c index f7e6c5dd377..a7f7836d24e 100644 --- a/libiberty/gettimeofday.c +++ b/libiberty/gettimeofday.c @@ -19,9 +19,7 @@ that @var{tz} be NULL. Returns 0 on success, -1 on failure. */ int -gettimeofday (tp, tz) - struct timeval *tp; - void *tz; +gettimeofday (struct timeval *tp, void *tz) { if (tz) abort (); diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 5882c1f3dad..d2b9c748157 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -73,14 +73,14 @@ Boston, MA 02111-1307, USA. */ #define DELETED_ENTRY ((PTR) 1) -static unsigned int higher_prime_index PARAMS ((unsigned long)); -static hashval_t htab_mod_1 PARAMS ((hashval_t, hashval_t, hashval_t, int)); -static hashval_t htab_mod PARAMS ((hashval_t, htab_t)); -static hashval_t htab_mod_m2 PARAMS ((hashval_t, htab_t)); -static hashval_t hash_pointer PARAMS ((const void *)); -static int eq_pointer PARAMS ((const void *, const void *)); -static int htab_expand PARAMS ((htab_t)); -static PTR *find_empty_slot_for_expand PARAMS ((htab_t, hashval_t)); +static unsigned int higher_prime_index (unsigned long); +static hashval_t htab_mod_1 (hashval_t, hashval_t, hashval_t, int); +static hashval_t htab_mod (hashval_t, htab_t); +static hashval_t htab_mod_m2 (hashval_t, htab_t); +static hashval_t hash_pointer (const void *); +static int eq_pointer (const void *, const void *); +static int htab_expand (htab_t); +static PTR *find_empty_slot_for_expand (htab_t, hashval_t); /* At some point, we could make these be NULL, and modify the hash-table routines to handle NULL specially; that would avoid @@ -176,8 +176,7 @@ static struct prime_ent const prime_tab[] = { nearest prime number which is greater than N, and near a power of two. */ static unsigned int -higher_prime_index (n) - unsigned long n; +higher_prime_index (unsigned long n) { unsigned int low = 0; unsigned int high = sizeof(prime_tab) / sizeof(prime_tab[0]); @@ -204,8 +203,7 @@ higher_prime_index (n) /* Returns a hash code for P. */ static hashval_t -hash_pointer (p) - const PTR p; +hash_pointer (const PTR p) { return (hashval_t) ((long)p >> 3); } @@ -213,9 +211,7 @@ hash_pointer (p) /* Returns non-zero if P1 and P2 are equal. */ static int -eq_pointer (p1, p2) - const PTR p1; - const PTR p2; +eq_pointer (const PTR p1, const PTR p2) { return p1 == p2; } @@ -223,8 +219,7 @@ eq_pointer (p1, p2) /* Return the current size of given hash table. */ inline size_t -htab_size (htab) - htab_t htab; +htab_size (htab_t htab) { return htab->size; } @@ -232,8 +227,7 @@ htab_size (htab) /* Return the current number of elements in given hash table. */ inline size_t -htab_elements (htab) - htab_t htab; +htab_elements (htab_t htab) { return htab->n_elements - htab->n_deleted; } @@ -241,9 +235,7 @@ htab_elements (htab) /* Return X % Y. */ static inline hashval_t -htab_mod_1 (x, y, inv, shift) - hashval_t x, y, inv; - int shift; +htab_mod_1 (hashval_t x, hashval_t y, hashval_t inv, int shift) { /* The multiplicative inverses computed above are for 32-bit types, and requires that we be able to compute a highpart multiply. */ @@ -271,9 +263,7 @@ htab_mod_1 (x, y, inv, shift) /* Compute the primary hash for HASH given HTAB's current size. */ static inline hashval_t -htab_mod (hash, htab) - hashval_t hash; - htab_t htab; +htab_mod (hashval_t hash, htab_t htab) { const struct prime_ent *p = &prime_tab[htab->size_prime_index]; return htab_mod_1 (hash, p->prime, p->inv, p->shift); @@ -282,9 +272,7 @@ htab_mod (hash, htab) /* Compute the secondary hash for HASH given HTAB's current size. */ static inline hashval_t -htab_mod_m2 (hash, htab) - hashval_t hash; - htab_t htab; +htab_mod_m2 (hashval_t hash, htab_t htab) { const struct prime_ent *p = &prime_tab[htab->size_prime_index]; return 1 + htab_mod_1 (hash, p->prime - 2, p->inv_m2, p->shift); @@ -296,13 +284,8 @@ htab_mod_m2 (hash, htab) created hash table, or NULL if memory allocation fails. */ htab_t -htab_create_alloc (size, hash_f, eq_f, del_f, alloc_f, free_f) - size_t size; - htab_hash hash_f; - htab_eq eq_f; - htab_del del_f; - htab_alloc alloc_f; - htab_free free_f; +htab_create_alloc (size_t size, htab_hash hash_f, htab_eq eq_f, + htab_del del_f, htab_alloc alloc_f, htab_free free_f) { htab_t result; unsigned int size_prime_index; @@ -374,14 +357,9 @@ htab_create_alloc_ex (size, hash_f, eq_f, del_f, alloc_arg, alloc_f, /* Update the function pointers and allocation parameter in the htab_t. */ void -htab_set_functions_ex (htab, hash_f, eq_f, del_f, alloc_arg, alloc_f, free_f) - htab_t htab; - htab_hash hash_f; - htab_eq eq_f; - htab_del del_f; - PTR alloc_arg; - htab_alloc_with_arg alloc_f; - htab_free_with_arg free_f; +htab_set_functions_ex (htab_t htab, htab_hash hash_f, htab_eq eq_f, + htab_del del_f, PTR alloc_arg, + htab_alloc_with_arg alloc_f, htab_free_with_arg free_f) { htab->hash_f = hash_f; htab->eq_f = eq_f; @@ -395,21 +373,13 @@ htab_set_functions_ex (htab, hash_f, eq_f, del_f, alloc_arg, alloc_f, free_f) #undef htab_create htab_t -htab_create (size, hash_f, eq_f, del_f) - size_t size; - htab_hash hash_f; - htab_eq eq_f; - htab_del del_f; +htab_create (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f) { return htab_create_alloc (size, hash_f, eq_f, del_f, xcalloc, free); } htab_t -htab_try_create (size, hash_f, eq_f, del_f) - size_t size; - htab_hash hash_f; - htab_eq eq_f; - htab_del del_f; +htab_try_create (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f) { return htab_create_alloc (size, hash_f, eq_f, del_f, calloc, free); } @@ -418,8 +388,7 @@ htab_try_create (size, hash_f, eq_f, del_f) Naturally the hash table must already exist. */ void -htab_delete (htab) - htab_t htab; +htab_delete (htab_t htab) { size_t size = htab_size (htab); PTR *entries = htab->entries; @@ -445,8 +414,7 @@ htab_delete (htab) /* This function clears all entries in the given hash table. */ void -htab_empty (htab) - htab_t htab; +htab_empty (htab_t htab) { size_t size = htab_size (htab); PTR *entries = htab->entries; @@ -468,9 +436,7 @@ htab_empty (htab) HASH is the hash value for the element to be inserted. */ static PTR * -find_empty_slot_for_expand (htab, hash) - htab_t htab; - hashval_t hash; +find_empty_slot_for_expand (htab_t htab, hashval_t hash) { hashval_t index = htab_mod (hash, htab); size_t size = htab_size (htab); @@ -506,8 +472,7 @@ find_empty_slot_for_expand (htab, hash) expanded. If all goes well, it will return a non-zero value. */ static int -htab_expand (htab) - htab_t htab; +htab_expand (htab_t htab) { PTR *oentries; PTR *olimit; @@ -575,10 +540,7 @@ htab_expand (htab) element. It cannot be used to insert or delete an element. */ PTR -htab_find_with_hash (htab, element, hash) - htab_t htab; - const PTR element; - hashval_t hash; +htab_find_with_hash (htab_t htab, const PTR element, hashval_t hash) { hashval_t index, hash2; size_t size; @@ -612,9 +574,7 @@ htab_find_with_hash (htab, element, hash) element. */ PTR -htab_find (htab, element) - htab_t htab; - const PTR element; +htab_find (htab_t htab, const PTR element) { return htab_find_with_hash (htab, element, (*htab->hash_f) (element)); } @@ -628,11 +588,8 @@ htab_find (htab, element) allocation fails. */ PTR * -htab_find_slot_with_hash (htab, element, hash, insert) - htab_t htab; - const PTR element; - hashval_t hash; - enum insert_option insert; +htab_find_slot_with_hash (htab_t htab, const PTR element, + hashval_t hash, enum insert_option insert) { PTR *first_deleted_slot; hashval_t index, hash2; @@ -699,10 +656,7 @@ htab_find_slot_with_hash (htab, element, hash, insert) element. */ PTR * -htab_find_slot (htab, element, insert) - htab_t htab; - const PTR element; - enum insert_option insert; +htab_find_slot (htab_t htab, const PTR element, enum insert_option insert) { return htab_find_slot_with_hash (htab, element, (*htab->hash_f) (element), insert); @@ -713,9 +667,7 @@ htab_find_slot (htab, element, insert) element in the hash table, this function does nothing. */ void -htab_remove_elt (htab, element) - htab_t htab; - PTR element; +htab_remove_elt (htab_t htab, PTR element) { htab_remove_elt_with_hash (htab, element, (*htab->hash_f) (element)); } @@ -726,10 +678,7 @@ htab_remove_elt (htab, element) function does nothing. */ void -htab_remove_elt_with_hash (htab, element, hash) - htab_t htab; - PTR element; - hashval_t hash; +htab_remove_elt_with_hash (htab_t htab, PTR element, hashval_t hash) { PTR *slot; @@ -749,9 +698,7 @@ htab_remove_elt_with_hash (htab, element, hash) again. */ void -htab_clear_slot (htab, slot) - htab_t htab; - PTR *slot; +htab_clear_slot (htab_t htab, PTR *slot) { if (slot < htab->entries || slot >= htab->entries + htab_size (htab) || *slot == EMPTY_ENTRY || *slot == DELETED_ENTRY) @@ -770,10 +717,7 @@ htab_clear_slot (htab, slot) argument. */ void -htab_traverse_noresize (htab, callback, info) - htab_t htab; - htab_trav callback; - PTR info; +htab_traverse_noresize (htab_t htab, htab_trav callback, PTR info) { PTR *slot; PTR *limit; @@ -796,10 +740,7 @@ htab_traverse_noresize (htab, callback, info) too empty to improve effectivity of subsequent calls. */ void -htab_traverse (htab, callback, info) - htab_t htab; - htab_trav callback; - PTR info; +htab_traverse (htab_t htab, htab_trav callback, PTR info) { if (htab_elements (htab) * 8 < htab_size (htab)) htab_expand (htab); @@ -811,8 +752,7 @@ htab_traverse (htab, callback, info) hash table. */ double -htab_collisions (htab) - htab_t htab; +htab_collisions (htab_t htab) { if (htab->searches == 0) return 0.0; @@ -846,8 +786,7 @@ htab_collisions (htab) function they just started using for Perl's hashes. */ hashval_t -htab_hash_string (p) - const PTR p; +htab_hash_string (const PTR p) { const unsigned char *str = (const unsigned char *) p; hashval_t r = 0; @@ -936,10 +875,11 @@ acceptable. Do NOT use for cryptographic purposes. -------------------------------------------------------------------- */ -hashval_t iterative_hash (k_in, length, initval) - const PTR k_in; /* the key */ - register size_t length; /* the length of the key */ - register hashval_t initval; /* the previous hash, or an arbitrary value */ +hashval_t +iterative_hash (const PTR k_in /* the key */, + register size_t length /* the length of the key */, + register hashval_t initval /* the previous hash, or + an arbitrary value */) { register const unsigned char *k = (const unsigned char *)k_in; register hashval_t a,b,c,len; diff --git a/libiberty/hex.c b/libiberty/hex.c index d30f199224e..9e4e306a7d4 100644 --- a/libiberty/hex.c +++ b/libiberty/hex.c @@ -153,7 +153,7 @@ unsigned char _hex_value[_hex_array_size]; #endif /* not ASCII */ void -hex_init () +hex_init (void) { #ifndef HEX_TABLE_INITIALIZED int i; diff --git a/libiberty/index.c b/libiberty/index.c index a2e272783b9..c37edca024e 100644 --- a/libiberty/index.c +++ b/libiberty/index.c @@ -12,12 +12,10 @@ deprecated in new programs in favor of @code{strchr}. */ -extern char * strchr(); +extern char * strchr(const char *, int); char * -index (s, c) - char *s; - int c; +index (char *s, int c) { return strchr (s, c); } diff --git a/libiberty/insque.c b/libiberty/insque.c index c0c1180d421..3473bb92b31 100644 --- a/libiberty/insque.c +++ b/libiberty/insque.c @@ -33,9 +33,7 @@ struct qelem { void -insque (elem, pred) - struct qelem *elem; - struct qelem *pred; +insque (struct qelem *elem, struct qelem *pred) { elem -> q_forw = pred -> q_forw; pred -> q_forw -> q_back = elem; @@ -45,8 +43,7 @@ insque (elem, pred) void -remque (elem) - struct qelem *elem; +remque (struct qelem *elem) { elem -> q_forw -> q_back = elem -> q_back; elem -> q_back -> q_forw = elem -> q_forw; diff --git a/libiberty/lbasename.c b/libiberty/lbasename.c index 200a87f2387..4afe890013e 100644 --- a/libiberty/lbasename.c +++ b/libiberty/lbasename.c @@ -43,8 +43,7 @@ and a path ending in @code{/} returns the empty string after it. #include "filenames.h" const char * -lbasename (name) - const char *name; +lbasename (const char *name) { const char *base; diff --git a/libiberty/lrealpath.c b/libiberty/lrealpath.c index 4877753cd66..24795fa99e7 100644 --- a/libiberty/lrealpath.c +++ b/libiberty/lrealpath.c @@ -73,8 +73,7 @@ extern char *canonicalize_file_name (const char *); #endif char * -lrealpath (filename) - const char *filename; +lrealpath (const char *filename) { /* Method 1: The system has a compile time upper bound on a filename path. Use that and realpath() to canonicalize the name. This is diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c index dc4f8d5259d..3d40c5f2220 100644 --- a/libiberty/make-relative-prefix.c +++ b/libiberty/make-relative-prefix.c @@ -95,14 +95,12 @@ relative prefix can be found, return @code{NULL}. #define DIR_UP ".." -static char *save_string PARAMS ((const char *, int)); -static char **split_directories PARAMS ((const char *, int *)); -static void free_split_directories PARAMS ((char **)); +static char *save_string (const char *, int); +static char **split_directories (const char *, int *); +static void free_split_directories (char **); static char * -save_string (s, len) - const char *s; - int len; +save_string (const char *s, int len) { char *result = malloc (len + 1); @@ -114,9 +112,7 @@ save_string (s, len) /* Split a filename into component directories. */ static char ** -split_directories (name, ptr_num_dirs) - const char *name; - int *ptr_num_dirs; +split_directories (const char *name, int *ptr_num_dirs) { int num_dirs = 0; char **dirs; @@ -201,8 +197,7 @@ split_directories (name, ptr_num_dirs) /* Release storage held by split directories. */ static void -free_split_directories (dirs) - char **dirs; +free_split_directories (char **dirs) { int i = 0; @@ -223,10 +218,8 @@ free_split_directories (dirs) If no relative prefix can be found, return NULL. */ char * -make_relative_prefix (progname, bin_prefix, prefix) - const char *progname; - const char *bin_prefix; - const char *prefix; +make_relative_prefix (const char *progname, + const char *bin_prefix, const char *prefix) { char **prog_dirs, **bin_dirs, **prefix_dirs; int prog_num, bin_num, prefix_num; diff --git a/libiberty/make-temp-file.c b/libiberty/make-temp-file.c index 883350479fc..71fb7037f46 100644 --- a/libiberty/make-temp-file.c +++ b/libiberty/make-temp-file.c @@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */ #endif #include "libiberty.h" -extern int mkstemps PARAMS ((char *, int)); +extern int mkstemps (char *, int); /* '/' works just fine on MS-DOS based systems. */ #ifndef DIR_SEPARATOR @@ -61,11 +61,10 @@ extern int mkstemps PARAMS ((char *, int)); If success, DIR is returned. Otherwise NULL is returned. */ -static inline const char *try PARAMS ((const char *, const char *)); +static inline const char *try (const char *, const char *); static inline const char * -try (dir, base) - const char *dir, *base; +try (const char *dir, const char *base) { if (base != 0) return base; @@ -95,7 +94,7 @@ files in. */ char * -choose_tmpdir () +choose_tmpdir (void) { const char *base = 0; char *tmpdir; @@ -146,8 +145,7 @@ string is @code{malloc}ed, and the temporary file has been created. */ char * -make_temp_file (suffix) - const char *suffix; +make_temp_file (const char *suffix) { const char *base = choose_tmpdir (); char *temp_filename; diff --git a/libiberty/md5.c b/libiberty/md5.c index e458f2a6a64..4468c7742c1 100644 --- a/libiberty/md5.c +++ b/libiberty/md5.c @@ -62,8 +62,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ void -md5_init_ctx (ctx) - struct md5_ctx *ctx; +md5_init_ctx (struct md5_ctx *ctx) { ctx->A = (md5_uint32) 0x67452301; ctx->B = (md5_uint32) 0xefcdab89; @@ -80,9 +79,7 @@ md5_init_ctx (ctx) IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * -md5_read_ctx (ctx, resbuf) - const struct md5_ctx *ctx; - void *resbuf; +md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) { ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); @@ -98,9 +95,7 @@ md5_read_ctx (ctx, resbuf) IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * -md5_finish_ctx (ctx, resbuf) - struct md5_ctx *ctx; - void *resbuf; +md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) { /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; @@ -129,9 +124,7 @@ md5_finish_ctx (ctx, resbuf) resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ int -md5_stream (stream, resblock) - FILE *stream; - void *resblock; +md5_stream (FILE *stream, void *resblock) { /* Important: BLOCKSIZE must be a multiple of 64. */ #define BLOCKSIZE 4096 @@ -186,10 +179,7 @@ md5_stream (stream, resblock) output yields to the wanted ASCII representation of the message digest. */ void * -md5_buffer (buffer, len, resblock) - const char *buffer; - size_t len; - void *resblock; +md5_buffer (const char *buffer, size_t len, void *resblock) { struct md5_ctx ctx; @@ -205,10 +195,7 @@ md5_buffer (buffer, len, resblock) void -md5_process_bytes (buffer, len, ctx) - const void *buffer; - size_t len; - struct md5_ctx *ctx; +md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) { /* When we already have some bits in our internal buffer concatenate both inputs first. */ @@ -263,10 +250,7 @@ md5_process_bytes (buffer, len, ctx) It is assumed that LEN % 64 == 0. */ void -md5_process_block (buffer, len, ctx) - const void *buffer; - size_t len; - struct md5_ctx *ctx; +md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) { md5_uint32 correct_words[16]; const md5_uint32 *words = (const md5_uint32 *) buffer; diff --git a/libiberty/memchr.c b/libiberty/memchr.c index 3948125963d..451f817d320 100644 --- a/libiberty/memchr.c +++ b/libiberty/memchr.c @@ -15,17 +15,10 @@ returned. */ #include -#ifdef ANSI_PROTOTYPES #include -#else -#define size_t unsigned long -#endif PTR -memchr (src_void, c, length) - register const PTR src_void; - int c; - size_t length; +memchr (register const PTR src_void, int c, size_t length) { const unsigned char *src = (const unsigned char *)src_void; diff --git a/libiberty/memcmp.c b/libiberty/memcmp.c index 92f2b6e6425..39edfca98a6 100644 --- a/libiberty/memcmp.c +++ b/libiberty/memcmp.c @@ -16,17 +16,10 @@ as if comparing unsigned char arrays. */ #include -#ifdef ANSI_PROTOTYPES #include -#else -#define size_t unsigned long -#endif int -memcmp (str1, str2, count) - const PTR str1; - const PTR str2; - size_t count; +memcmp (const PTR str1, const PTR str2, size_t count) { register const unsigned char *s1 = (const unsigned char*)str1; register const unsigned char *s2 = (const unsigned char*)str2; diff --git a/libiberty/memcpy.c b/libiberty/memcpy.c index 5eece7a0a00..8a97b85b06a 100644 --- a/libiberty/memcpy.c +++ b/libiberty/memcpy.c @@ -19,13 +19,10 @@ Copies @var{length} bytes from memory region @var{in} to region #define size_t unsigned long #endif -void bcopy PARAMS((const void*, void*, size_t)); +void bcopy (const void*, void*, size_t); PTR -memcpy (out, in, length) - PTR out; - const PTR in; - size_t length; +memcpy (PTR out, const PTR in, size_t length) { bcopy(in, out, length); return out; diff --git a/libiberty/memmove.c b/libiberty/memmove.c index 00ac053401b..30801f2d1c4 100644 --- a/libiberty/memmove.c +++ b/libiberty/memmove.c @@ -19,13 +19,10 @@ Copies @var{count} bytes from memory area @var{from} to memory area #define size_t unsigned long #endif -void bcopy PARAMS ((const void*, void*, size_t)); +void bcopy (const void*, void*, size_t); PTR -memmove (s1, s2, n) - PTR s1; - const PTR s2; - size_t n; +memmove (PTR s1, const PTR s2, size_t n) { bcopy (s2, s1, n); return s1; diff --git a/libiberty/strerror.c b/libiberty/strerror.c index c0edb47e0c8..0efadc3d65e 100644 --- a/libiberty/strerror.c +++ b/libiberty/strerror.c @@ -43,7 +43,7 @@ extern PTR memset (); # define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif -static void init_error_tables PARAMS ((void)); +static void init_error_tables (void); /* Translation table for errno values. See intro(2) in most UNIX systems Programmers Reference Manuals. @@ -503,7 +503,7 @@ BUGS */ static void -init_error_tables () +init_error_tables (void) { const struct error_info *eip; int nbytes; @@ -584,7 +584,7 @@ symbolic name or message. */ int -errno_max () +errno_max (void) { int maxsize; @@ -623,8 +623,7 @@ next call to @code{strerror}. */ char * -strerror (errnoval) - int errnoval; +strerror (int errnoval) { const char *msg; static char buf[32]; @@ -690,8 +689,7 @@ valid until the next call to @code{strerrno}. */ const char * -strerrno (errnoval) - int errnoval; +strerrno (int errnoval) { const char *name; static char buf[32]; @@ -738,8 +736,7 @@ to an errno value. If no translation is found, returns 0. */ int -strtoerrno (name) - const char *name; +strtoerrno (const char *name) { int errnoval = 0; @@ -779,7 +776,7 @@ strtoerrno (name) #include int -main () +main (void) { int errn; int errnmax; diff --git a/libiberty/strncasecmp.c b/libiberty/strncasecmp.c index 10feee82198..47700dde518 100644 --- a/libiberty/strncasecmp.c +++ b/libiberty/strncasecmp.c @@ -25,11 +25,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; #endif /* LIBC_SCCS and not lint */ #include -#ifdef ANSI_PROTOTYPES #include -#else -#define size_t unsigned long -#endif /* * This array is designed for mapping upper and lower case letter @@ -72,9 +68,7 @@ static const unsigned char charmap[] = { }; int -strncasecmp(s1, s2, n) - const char *s1, *s2; - register size_t n; +strncasecmp(const char *s1, const char *s2, register size_t n) { register unsigned char u1, u2; diff --git a/libiberty/strncmp.c b/libiberty/strncmp.c index ad87e1fde8b..916c2f07a8a 100644 --- a/libiberty/strncmp.c +++ b/libiberty/strncmp.c @@ -13,16 +13,10 @@ Compares the first @var{n} bytes of two strings, returning a value as */ #include -#ifdef ANSI_PROTOTYPES #include -#else -#define size_t unsigned long -#endif int -strncmp(s1, s2, n) - const char *s1, *s2; - register size_t n; +strncmp(const char *s1, const char *s2, register size_t n) { register unsigned char u1, u2; diff --git a/libiberty/strndup.c b/libiberty/strndup.c index 3d6b93d3143..b7647777bc5 100644 --- a/libiberty/strndup.c +++ b/libiberty/strndup.c @@ -31,20 +31,14 @@ memory was available. The result is always NUL terminated. */ #include "ansidecl.h" -#ifdef ANSI_PROTOTYPES #include -#else -#define size_t unsigned long -#endif -extern size_t strlen PARAMS ((const char*)); -extern PTR malloc PARAMS ((size_t)); -extern PTR memcpy PARAMS ((PTR, const PTR, size_t)); +extern size_t strlen (const char*); +extern PTR malloc (size_t); +extern PTR memcpy (PTR, const PTR, size_t); char * -strndup(s, n) - const char *s; - size_t n; +strndup (const char *s, size_t n) { char *result; size_t len = strlen (s); diff --git a/libiberty/strrchr.c b/libiberty/strrchr.c index bc380c4c5d3..5cf7c14d8b7 100644 --- a/libiberty/strrchr.c +++ b/libiberty/strrchr.c @@ -16,9 +16,7 @@ null character, the results are undefined. #include char * -strrchr (s, c) - register const char *s; - int c; +strrchr (register const char *s, int c) { char *rtnval = 0; diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c index 1ff984debc3..c3a16ab9bdc 100644 --- a/libiberty/strsignal.c +++ b/libiberty/strsignal.c @@ -41,18 +41,14 @@ extern PTR memset (); #undef sys_nsig #ifndef NULL -# ifdef ANSI_PROTOTYPES -# define NULL (void *) 0 -# else -# define NULL 0 -# endif +# define NULL (void *) 0 #endif #ifndef MAX # define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif -static void init_signal_tables PARAMS ((void)); +static void init_signal_tables (void); /* Translation table for signal values. @@ -288,7 +284,7 @@ BUGS */ static void -init_signal_tables () +init_signal_tables (void) { const struct signal_info *eip; int nbytes; @@ -369,7 +365,7 @@ symbolic name or message. */ int -signo_max () +signo_max (void) { int maxsize; @@ -409,8 +405,7 @@ call to @code{strsignal}. #ifndef HAVE_STRSIGNAL const char * -strsignal (signo) - int signo; +strsignal (int signo) { const char *msg; static char buf[32]; @@ -469,8 +464,7 @@ valid until the next call to @code{strsigno}. */ const char * -strsigno (signo) - int signo; +strsigno (int signo) { const char *name; static char buf[32]; @@ -513,8 +507,7 @@ translation is found, returns 0. */ int -strtosigno (name) - const char *name; +strtosigno (const char *name) { int signo = 0; @@ -556,9 +549,7 @@ followed by a newline. #ifndef HAVE_PSIGNAL void -psignal (signo, message) - unsigned signo; - char *message; +psignal (unsigned signo, char *message) { if (signal_names == NULL) { @@ -585,7 +576,7 @@ psignal (signo, message) #include int -main () +main (void) { int signo; int maxsigno; diff --git a/libiberty/strstr.c b/libiberty/strstr.c index a059c7f5dcb..ff8abd20f78 100644 --- a/libiberty/strstr.c +++ b/libiberty/strstr.c @@ -21,8 +21,7 @@ length, the function returns @var{string}. been validated to comply with it. -fnf */ char * -strstr (s1, s2) - char *s1, *s2; +strstr (char *s1, char *s2) { register char *p = s1; extern char *strchr (); diff --git a/libiberty/strtod.c b/libiberty/strtod.c index 97fc9339344..4f119c46114 100644 --- a/libiberty/strtod.c +++ b/libiberty/strtod.c @@ -40,16 +40,14 @@ the location referenced by @var{endptr}. #include "ansidecl.h" #include "safe-ctype.h" -extern double atof (); +extern double atof (const char *); /* Disclaimer: this is currently just used by CHILL in GDB and therefore has not been tested well. It may have been tested for nothing except that it compiles. */ double -strtod (str, ptr) - char *str; - char **ptr; +strtod (char *str, char **ptr) { char *p; diff --git a/libiberty/strtol.c b/libiberty/strtol.c index d9f54cc8f7a..5f2a1cebb20 100644 --- a/libiberty/strtol.c +++ b/libiberty/strtol.c @@ -85,10 +85,7 @@ extern int errno; * alphabets and digits are each contiguous. */ long -strtol(nptr, endptr, base) - const char *nptr; - char **endptr; - register int base; +strtol(const char *nptr, char **endptr, register int base) { register const char *s = nptr; register unsigned long acc; diff --git a/libiberty/strtoul.c b/libiberty/strtoul.c index 66420f268b2..ba80063531e 100644 --- a/libiberty/strtoul.c +++ b/libiberty/strtoul.c @@ -58,10 +58,7 @@ extern int errno; * alphabets and digits are each contiguous. */ unsigned long -strtoul(nptr, endptr, base) - const char *nptr; - char **endptr; - register int base; +strtoul(const char *nptr, char **endptr, register int base) { register const char *s = nptr; register unsigned long acc; diff --git a/libiberty/ternary.c b/libiberty/ternary.c index 056d2cee11e..29cf646934d 100644 --- a/libiberty/ternary.c +++ b/libiberty/ternary.c @@ -34,11 +34,7 @@ insertions. */ PTR -ternary_insert (root, s, data, replace) - ternary_tree *root; - const char *s; - PTR data; - int replace; +ternary_insert (ternary_tree *root, const char *s, PTR data, int replace) { int diff; ternary_tree curr, *pcurr; @@ -98,8 +94,7 @@ ternary_insert (root, s, data, replace) /* Free the ternary search tree rooted at p. */ void -ternary_cleanup (p) - ternary_tree p; +ternary_cleanup (ternary_tree p) { if (p) { @@ -113,9 +108,7 @@ ternary_cleanup (p) /* Non-recursive find of a string in the ternary tree */ PTR -ternary_search (p, s) - const ternary_node *p; - const char *s; +ternary_search (const ternary_node *p, const char *s) { const ternary_node *curr; int diff, spchar; @@ -147,9 +140,7 @@ ternary_search (p, s) /* For those who care, the recursive version of the search. Useful if you want a starting point for pmsearch or nearsearch. */ static PTR -ternary_recursivesearch (p, s) - const ternary_node *p; - const char *s; +ternary_recursivesearch (const ternary_node *p, const char *s) { if (!p) return 0; diff --git a/libiberty/tmpnam.c b/libiberty/tmpnam.c index 406878c49a3..cc343336642 100644 --- a/libiberty/tmpnam.c +++ b/libiberty/tmpnam.c @@ -24,11 +24,10 @@ not be used in new projects. Use @code{mkstemp} instead. static char tmpnam_buffer[L_tmpnam]; static int tmpnam_counter; -extern int getpid (); +extern int getpid (void); char * -tmpnam (s) - char *s; +tmpnam (char *s) { int pid = getpid (); diff --git a/libiberty/unlink-if-ordinary.c b/libiberty/unlink-if-ordinary.c index 297b14bbc7d..a389ad4e3dc 100644 --- a/libiberty/unlink-if-ordinary.c +++ b/libiberty/unlink-if-ordinary.c @@ -58,8 +58,7 @@ was made to unlink the file because it is special. #endif int -unlink_if_ordinary (name) - const char *name; +unlink_if_ordinary (const char *name) { struct stat st; diff --git a/libiberty/vasprintf.c b/libiberty/vasprintf.c index 7eaf2b18d6f..ff4b5315199 100644 --- a/libiberty/vasprintf.c +++ b/libiberty/vasprintf.c @@ -22,11 +22,7 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #endif #include -#ifdef ANSI_PROTOTYPES #include -#else -#include -#endif #if !defined (va_copy) && defined (__va_copy) # define va_copy(d,s) __va_copy((d),(s)) #endif @@ -62,13 +58,10 @@ not be allocated, minus one is returned and @code{NULL} is stored in */ -static int int_vasprintf PARAMS ((char **, const char *, va_list)); +static int int_vasprintf (char **, const char *, va_list); static int -int_vasprintf (result, format, args) - char **result; - const char *format; - va_list args; +int_vasprintf (char **result, const char *format, va_list args) { const char *p = format; /* Add one to make sure that it is never zero, which might cause malloc @@ -156,13 +149,11 @@ int_vasprintf (result, format, args) } int -vasprintf (result, format, args) - char **result; - const char *format; +vasprintf (char **result, const char *format, #if defined (_BSD_VA_LIST_) && defined (__FreeBSD__) - _BSD_VA_LIST_ args; + _BSD_VA_LIST_ args) #else - va_list args; + va_list args) #endif { return int_vasprintf (result, format, args); @@ -170,7 +161,7 @@ vasprintf (result, format, args) #ifdef TEST static void ATTRIBUTE_PRINTF_1 -checkit VPARAMS ((const char *format, ...)) +checkit (const char *format, ...) { char *result; VA_OPEN (args, format); @@ -187,10 +178,10 @@ checkit VPARAMS ((const char *format, ...)) free (result); } -extern int main PARAMS ((void)); +extern int main (void); int -main () +main (void) { checkit ("%d", 0x12345678); checkit ("%200d", 5); diff --git a/libiberty/vfork.c b/libiberty/vfork.c index 4aa5c21d427..eb4ff622b44 100644 --- a/libiberty/vfork.c +++ b/libiberty/vfork.c @@ -13,10 +13,10 @@ Emulates @code{vfork} by calling @code{fork} and returning its value. #include "ansidecl.h" -extern int fork PARAMS ((void)); +extern int fork (void); int -vfork () +vfork (void) { return (fork ()); } diff --git a/libiberty/vfprintf.c b/libiberty/vfprintf.c index 18f09d47d32..9bd3ed555d0 100644 --- a/libiberty/vfprintf.c +++ b/libiberty/vfprintf.c @@ -4,19 +4,12 @@ */ #include "ansidecl.h" -#ifdef ANSI_PROTOTYPES #include -#else -#include -#endif #include #undef vfprintf int -vfprintf (stream, format, ap) - FILE * stream; - const char * format; - va_list ap; +vfprintf (FILE *stream, const char *format, va_list ap) { return _doprnt (format, ap, stream); } diff --git a/libiberty/vprintf.c b/libiberty/vprintf.c index 9487896ea5e..c2553167bab 100644 --- a/libiberty/vprintf.c +++ b/libiberty/vprintf.c @@ -16,17 +16,11 @@ nonstandard but common function @code{_doprnt}. */ #include -#ifdef ANSI_PROTOTYPES #include -#else -#include -#endif #include #undef vprintf int -vprintf (format, ap) - const char *format; - va_list ap; +vprintf (const char *format, va_list ap) { return vfprintf (stdout, format, ap); } diff --git a/libiberty/vsnprintf.c b/libiberty/vsnprintf.c index fd3dd18a91c..8d4a1e218b4 100644 --- a/libiberty/vsnprintf.c +++ b/libiberty/vsnprintf.c @@ -1,5 +1,5 @@ /* Implement the vsnprintf function. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Written by Kaveh R. Ghazi . This file is part of the libiberty library. This library is free @@ -42,11 +42,7 @@ system version of this function is used. #include "config.h" #include "ansidecl.h" -#ifdef ANSI_PROTOTYPES #include -#else -#include -#endif #ifdef HAVE_STRING_H #include #endif @@ -58,11 +54,7 @@ system version of this function is used. /* This implementation relies on a working vasprintf. */ int -vsnprintf (s, n, format, ap) - char * s; - size_t n; - const char *format; - va_list ap; +vsnprintf (char *s, size_t n, const char *format, va_list ap) { char *buf = 0; int result = vasprintf (&buf, format, ap); @@ -97,7 +89,7 @@ vsnprintf (s, n, format, ap) #define VERIFY(P) do { if (!(P)) abort(); } while (0) static int ATTRIBUTE_PRINTF_3 -checkit VPARAMS ((char *s, size_t n, const char *format, ...)) +checkit (char *s, size_t n, const char *format, ...) { int result; VA_OPEN (ap, format); @@ -109,9 +101,9 @@ checkit VPARAMS ((char *s, size_t n, const char *format, ...)) return result; } -extern int main PARAMS ((void)); +extern int main (void); int -main () +main (void) { char buf[128]; int status; diff --git a/libiberty/vsprintf.c b/libiberty/vsprintf.c index 9f09d7e2758..4132ff9098a 100644 --- a/libiberty/vsprintf.c +++ b/libiberty/vsprintf.c @@ -27,21 +27,14 @@ This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ #include -#ifdef ANSI_PROTOTYPES #include -#else -#include -#endif #include #undef vsprintf #if defined _IOSTRG && defined _IOWRT int -vsprintf (buf, format, ap) - char *buf; - const char *format; - va_list ap; +vsprintf (char *buf, const char *format, va_list ap) { FILE b; int ret; diff --git a/libiberty/waitpid.c b/libiberty/waitpid.c index 6e31f25e305..33f2f8e38cc 100644 --- a/libiberty/waitpid.c +++ b/libiberty/waitpid.c @@ -23,9 +23,7 @@ does the return value. The third argument is unused in @libib{}. #endif pid_t -waitpid (pid, stat_loc, options) - pid_t pid; - int *stat_loc, options; +waitpid (pid_t pid, int *stat_loc, int options) { for (;;) { diff --git a/libiberty/xatexit.c b/libiberty/xatexit.c index 075599c61f9..f29338a9f2a 100644 --- a/libiberty/xatexit.c +++ b/libiberty/xatexit.c @@ -27,31 +27,27 @@ failure. If you use @code{xatexit} to register functions, you must use #include -#ifdef ANSI_PROTOTYPES #include -#else -#define size_t unsigned long -#endif #if VMS #include #include #else /* For systems with larger pointers than ints, this must be declared. */ -PTR malloc PARAMS ((size_t)); +PTR malloc (size_t); #endif -static void xatexit_cleanup PARAMS ((void)); +static void xatexit_cleanup (void); /* Pointer to function run by xexit. */ -extern void (*_xexit_cleanup) PARAMS ((void)); +extern void (*_xexit_cleanup) (void); #define XATEXIT_SIZE 32 struct xatexit { struct xatexit *next; /* next in list */ int ind; /* next index in this table */ - void (*fns[XATEXIT_SIZE]) PARAMS ((void)); /* the table itself */ + void (*fns[XATEXIT_SIZE]) (void); /* the table itself */ }; /* Allocate one struct statically to guarantee that we can register @@ -65,8 +61,7 @@ static struct xatexit *xatexit_head = &xatexit_first; Return 0 if successful, -1 if not. */ int -xatexit (fn) - void (*fn) PARAMS ((void)); +xatexit (void (*fn) (void)) { register struct xatexit *p; @@ -90,7 +85,7 @@ xatexit (fn) /* Call any cleanup functions. */ static void -xatexit_cleanup () +xatexit_cleanup (void) { register struct xatexit *p; register int n; diff --git a/libiberty/xexit.c b/libiberty/xexit.c index a65690f09c3..552db65df6d 100644 --- a/libiberty/xexit.c +++ b/libiberty/xexit.c @@ -41,11 +41,10 @@ Termination is handled via the system's normal @code{exit} call. /* This variable is set by xatexit if it is called. This way, xmalloc doesn't drag xatexit into the link. */ -void (*_xexit_cleanup) PARAMS ((void)); +void (*_xexit_cleanup) (void); void -xexit (code) - int code; +xexit (int code) { if (_xexit_cleanup != NULL) (*_xexit_cleanup) (); diff --git a/libiberty/xmalloc.c b/libiberty/xmalloc.c index c3fe1a84f4d..ac1f6cb9432 100644 --- a/libiberty/xmalloc.c +++ b/libiberty/xmalloc.c @@ -68,22 +68,17 @@ function will be called to print an error message and terminate execution. #include -#ifdef ANSI_PROTOTYPES #include -#else -#define size_t unsigned long -#define ptrdiff_t long -#endif #if VMS #include #include #else /* For systems with larger pointers than ints, these must be declared. */ -PTR malloc PARAMS ((size_t)); -PTR realloc PARAMS ((PTR, size_t)); -PTR calloc PARAMS ((size_t, size_t)); -PTR sbrk PARAMS ((ptrdiff_t)); +PTR malloc (size_t); +PTR realloc (PTR, size_t); +PTR calloc (size_t, size_t); +PTR sbrk (ptrdiff_t); #endif /* The program name if set. */ @@ -96,8 +91,7 @@ static char *first_break = NULL; #endif /* HAVE_SBRK */ void -xmalloc_set_program_name (s) - const char *s; +xmalloc_set_program_name (const char *s) { name = s; #ifdef HAVE_SBRK @@ -108,8 +102,7 @@ xmalloc_set_program_name (s) } void -xmalloc_failed (size) - size_t size; +xmalloc_failed (size_t size) { #ifdef HAVE_SBRK extern char **environ; @@ -133,8 +126,7 @@ xmalloc_failed (size) } PTR -xmalloc (size) - size_t size; +xmalloc (size_t size) { PTR newmem; @@ -148,8 +140,7 @@ xmalloc (size) } PTR -xcalloc (nelem, elsize) - size_t nelem, elsize; +xcalloc (size_t nelem, size_t elsize) { PTR newmem; @@ -164,9 +155,7 @@ xcalloc (nelem, elsize) } PTR -xrealloc (oldmem, size) - PTR oldmem; - size_t size; +xrealloc (PTR oldmem, size_t size) { PTR newmem; diff --git a/libiberty/xmemdup.c b/libiberty/xmemdup.c index 0dae37d8923..d4831163a20 100644 --- a/libiberty/xmemdup.c +++ b/libiberty/xmemdup.c @@ -31,10 +31,7 @@ allocated, the remaining memory is zeroed. #endif PTR -xmemdup (input, copy_size, alloc_size) - const PTR input; - size_t copy_size; - size_t alloc_size; +xmemdup (const PTR input, size_t copy_size, size_t alloc_size) { PTR output = xcalloc (1, alloc_size); return (PTR) memcpy (output, input, copy_size); diff --git a/libiberty/xstrdup.c b/libiberty/xstrdup.c index 5ddd2e98a93..c04623d98ec 100644 --- a/libiberty/xstrdup.c +++ b/libiberty/xstrdup.c @@ -28,8 +28,7 @@ obtain memory. #include "libiberty.h" char * -xstrdup (s) - const char *s; +xstrdup (const char *s) { register size_t len = strlen (s) + 1; register char *ret = xmalloc (len); diff --git a/libiberty/xstrerror.c b/libiberty/xstrerror.c index e3f1ca04a26..01f3a7b961a 100644 --- a/libiberty/xstrerror.c +++ b/libiberty/xstrerror.c @@ -21,13 +21,13 @@ will never return a @code{NULL} pointer. #ifdef VMS #include #if !defined (__STRICT_ANSI__) && !defined (__HIDE_FORBIDDEN_NAMES) -extern char *strerror PARAMS ((int,...)); +extern char *strerror (int,...); #define DONT_DECLARE_STRERROR #endif #endif /* VMS */ #ifndef DONT_DECLARE_STRERROR -extern char *strerror PARAMS ((int)); +extern char *strerror (int); #endif /* If strerror returns NULL, we'll format the number into a static buffer. */ @@ -38,15 +38,14 @@ static char xstrerror_buf[sizeof ERRSTR_FMT + 20]; /* Like strerror, but result is never a null pointer. */ char * -xstrerror (errnum) - int errnum; +xstrerror (int errnum) { char *errstr; #ifdef VMS - char *(*vmslib_strerror) PARAMS ((int,...)); + char *(*vmslib_strerror) (int,...); /* Override any possibly-conflicting declaration from system header. */ - vmslib_strerror = (char *(*) PARAMS ((int,...))) strerror; + vmslib_strerror = (char *(*) (int,...)) strerror; /* Second argument matters iff first is EVMSERR, but it's simpler to pass it unconditionally. `vaxc$errno' is declared in and maintained by the run-time library in parallel to `errno'. diff --git a/libiberty/xstrndup.c b/libiberty/xstrndup.c index b481e4ad712..8dfaa9b43e6 100644 --- a/libiberty/xstrndup.c +++ b/libiberty/xstrndup.c @@ -45,9 +45,7 @@ always NUL terminated. #include "libiberty.h" char * -xstrndup (s, n) - const char *s; - size_t n; +xstrndup (const char *s, size_t n) { char *result; size_t len = strlen (s); -- 2.30.2