+2005-03-27 Gabriel Dos Reis <gdr@integreable-solutions.net>
+
+ * ternary.h: Don't use PARAMS anymore.
+
+2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * 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 <gdr@integrable-solutions.net>
* demangle.h: Remove uses of PARAMS.
(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);
#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_ */
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. */
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) */
/* 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
/* 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;
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)
# 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
{
/* 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
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
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
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
+2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ 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 <aj@suse.de>
+
+ * configure.ac (ac_c_preproc_warn_flag): Remove -Wtraditional
+ flags.
+ * configure: Regenerated.
+
+2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * getopt1.c (getopt_long_only): Fix thinko.
+
+2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ 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 <gdr@integrable-solutions.net>
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 <gdr@integrable-solutions.net>
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 <gdr@integrable-solutions.net>
(_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.
(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.
* hex.c (hex_value): Group 'unsigned int' together to get correct
markup.
* functions.texi: Regenerated.
-
+
2004-12-27 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in: Undo to 2004-12-17.
* vasprintf.c: Accept __va_copy in addition to va_copy.
-2004-09-03 Paolo Bonzini <bonzini@gnu.org>
+2004-09-03 Paolo Bonzini <bonzini@gnu.org>
* configure: Regenerate.
-2004-09-02 Paolo Bonzini <bonzini@gnu.org>
+2004-09-02 Paolo Bonzini <bonzini@gnu.org>
* configure.ac: Do not enable multilibs for build-side libiberty.
-2004-06-29 Danny Smith <dannysmith@users.sourceforge.net>
+2004-06-29 Danny Smith <dannysmith@users.sourceforge.net>
* lrealpath.c (lrealpath): Add _WIN32 support.
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
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)
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)
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
/* 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);
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;
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;
/* 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';
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 ();
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. */
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);
}
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);
}
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;
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);
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;
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;
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);
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)
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;
/* 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)
#include <sys/types.h>
#include <sys/stat.h>
-int fdmatch (fd1, fd2)
- int fd1;
- int fd2;
+int fdmatch (int fd1, int fd2)
{
struct stat sbuf1;
struct stat sbuf2;
*/
int
-ffs (valu)
- register int valu;
+ffs (register int valu)
{
register int bit;
#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);
\f
/* 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;
}
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;
}
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;
/* 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;
/* 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)
/* 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)
/* 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;
/* 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;
/* 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;
/* 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);
/* 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;
/* Delete HEAP. */
void
-fibheap_delete (heap)
- fibheap_t heap;
+fibheap_delete (fibheap_t heap)
{
while (heap->min != NULL)
free (fibheap_extr_min_node (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;
/* 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. */
/* 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;
/* 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;
/* 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;
/* 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--;
}
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;
}
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)
{
}
static fibnode_t
-fibnode_remove (node)
- fibnode_t node;
+fibnode_remove (fibnode_t node)
{
fibnode_t ret;
#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;
}
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
/* 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;
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;
*to = dto;
}
\f
-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;
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;
/* 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);
}
/* 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;
}
int
-main ()
+main (void)
{
ieee_test (0.0);
ieee_test (0.5);
/* 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;
#endif
char *
-getcwd (buf, len)
- char *buf;
- size_t len;
+getcwd (char *buf, size_t len)
{
char ourbuf[MAXPATHLEN];
char *result;
#endif
static char *
-my_index (str, chr)
- const char *str;
- int chr;
+my_index (const char *str, int chr)
{
while (*str)
{
#endif
static void
-exchange (argv)
- char **argv;
+exchange (char **argv)
{
int bottom = first_nonopt;
int middle = last_nonopt;
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
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;
}
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,
the above definition of `getopt'. */
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int c;
int digit_optind = 0;
#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);
}
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);
}
#include <stdio.h>
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int c;
int digit_optind = 0;
#endif /* GNU_OUR_PAGESIZE */
int
-getpagesize ()
+getpagesize (void)
{
return (GNU_OUR_PAGESIZE);
}
#endif
extern unsigned long lib$getsyi(const unsigned short *,...);
-int getpagesize ()
+int getpagesize (void)
{
long pagsiz = 0L;
unsigned short itmcod = SYI$_PAGE_SIZE;
yield 0 and set errno. */
char *
-getpwd ()
+getpwd (void)
{
static char *pwd;
static int failure_errno;
#endif
char *
-getpwd ()
+getpwd (void)
{
static char *pwd = 0;
*/
long
-get_run_time ()
+get_run_time (void)
{
#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
struct rusage rusage;
*/
int
-gettimeofday (tp, tz)
- struct timeval *tp;
- void *tz;
+gettimeofday (struct timeval *tp, void *tz)
{
if (tz)
abort ();
#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
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]);
/* 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);
}
/* 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;
}
/* 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;
}
/* 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;
}
/* 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. */
/* 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);
/* 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);
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;
/* 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;
#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);
}
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;
/* 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;
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);
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;
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;
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));
}
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;
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);
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));
}
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;
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)
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;
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);
hash table. */
double
-htab_collisions (htab)
- htab_t htab;
+htab_collisions (htab_t htab)
{
if (htab->searches == 0)
return 0.0;
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;
--------------------------------------------------------------------
*/
-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;
#endif /* not ASCII */
void
-hex_init ()
+hex_init (void)
{
#ifndef HEX_TABLE_INITIALIZED
int i;
*/
-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);
}
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;
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;
#include "filenames.h"
const char *
-lbasename (name)
- const char *name;
+lbasename (const char *name)
{
const char *base;
#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
#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);
/* 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;
/* Release storage held by split directories. */
static void
-free_split_directories (dirs)
- char **dirs;
+free_split_directories (char **dirs)
{
int i = 0;
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;
#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
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;
*/
char *
-choose_tmpdir ()
+choose_tmpdir (void)
{
const char *base = 0;
char *tmpdir;
*/
char *
-make_temp_file (suffix)
- const char *suffix;
+make_temp_file (const char *suffix)
{
const char *base = choose_tmpdir ();
char *temp_filename;
/* 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;
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);
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;
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
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;
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. */
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;
*/
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#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;
*/
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#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;
#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;
#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;
# 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.
*/
static void
-init_error_tables ()
+init_error_tables (void)
{
const struct error_info *eip;
int nbytes;
*/
int
-errno_max ()
+errno_max (void)
{
int maxsize;
*/
char *
-strerror (errnoval)
- int errnoval;
+strerror (int errnoval)
{
const char *msg;
static char buf[32];
*/
const char *
-strerrno (errnoval)
- int errnoval;
+strerrno (int errnoval)
{
const char *name;
static char buf[32];
*/
int
-strtoerrno (name)
- const char *name;
+strtoerrno (const char *name)
{
int errnoval = 0;
#include <stdio.h>
int
-main ()
+main (void)
{
int errn;
int errnmax;
#endif /* LIBC_SCCS and not lint */
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#else
-#define size_t unsigned long
-#endif
/*
* This array is designed for mapping upper and lower case letter
};
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;
*/
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#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;
*/
#include "ansidecl.h"
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#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);
#include <ansidecl.h>
char *
-strrchr (s, c)
- register const char *s;
- int c;
+strrchr (register const char *s, int c)
{
char *rtnval = 0;
#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.
*/
static void
-init_signal_tables ()
+init_signal_tables (void)
{
const struct signal_info *eip;
int nbytes;
*/
int
-signo_max ()
+signo_max (void)
{
int maxsize;
#ifndef HAVE_STRSIGNAL
const char *
-strsignal (signo)
- int signo;
+strsignal (int signo)
{
const char *msg;
static char buf[32];
*/
const char *
-strsigno (signo)
- int signo;
+strsigno (int signo)
{
const char *name;
static char buf[32];
*/
int
-strtosigno (name)
- const char *name;
+strtosigno (const char *name)
{
int signo = 0;
#ifndef HAVE_PSIGNAL
void
-psignal (signo, message)
- unsigned signo;
- char *message;
+psignal (unsigned signo, char *message)
{
if (signal_names == NULL)
{
#include <stdio.h>
int
-main ()
+main (void)
{
int signo;
int maxsigno;
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 ();
#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;
* 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;
* 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;
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;
/* Free the ternary search tree rooted at p. */
void
-ternary_cleanup (p)
- ternary_tree p;
+ternary_cleanup (ternary_tree p)
{
if (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;
/* 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;
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 ();
#endif
int
-unlink_if_ordinary (name)
- const char *name;
+unlink_if_ordinary (const char *name)
{
struct stat st;
#include "config.h"
#endif
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#if !defined (va_copy) && defined (__va_copy)
# define va_copy(d,s) __va_copy((d),(s))
#endif
*/
-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
}
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);
#ifdef TEST
static void ATTRIBUTE_PRINTF_1
-checkit VPARAMS ((const char *format, ...))
+checkit (const char *format, ...)
{
char *result;
VA_OPEN (args, format);
free (result);
}
-extern int main PARAMS ((void));
+extern int main (void);
int
-main ()
+main (void)
{
checkit ("%d", 0x12345678);
checkit ("%200d", 5);
#include "ansidecl.h"
-extern int fork PARAMS ((void));
+extern int fork (void);
int
-vfork ()
+vfork (void)
{
return (fork ());
}
*/
#include "ansidecl.h"
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include <stdio.h>
#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);
}
*/
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include <stdio.h>
#undef vprintf
int
-vprintf (format, ap)
- const char *format;
- va_list ap;
+vprintf (const char *format, va_list ap)
{
return vfprintf (stdout, format, ap);
}
/* 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 <ghazi@caip.rutgers.edu>.
This file is part of the libiberty library. This library is free
#include "config.h"
#include "ansidecl.h"
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
/* 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);
#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);
return result;
}
-extern int main PARAMS ((void));
+extern int main (void);
int
-main ()
+main (void)
{
char buf[128];
int status;
the executable file might be covered by the GNU General Public License. */
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include <stdio.h>
#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;
#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 (;;)
{
#include <stdio.h>
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#else
-#define size_t unsigned long
-#endif
#if VMS
#include <stdlib.h>
#include <unixlib.h>
#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
Return 0 if successful, -1 if not. */
int
-xatexit (fn)
- void (*fn) PARAMS ((void));
+xatexit (void (*fn) (void))
{
register struct xatexit *p;
/* Call any cleanup functions. */
static void
-xatexit_cleanup ()
+xatexit_cleanup (void)
{
register struct xatexit *p;
register int n;
/* 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) ();
#include <stdio.h>
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#else
-#define size_t unsigned long
-#define ptrdiff_t long
-#endif
#if VMS
#include <stdlib.h>
#include <unixlib.h>
#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. */
#endif /* HAVE_SBRK */
void
-xmalloc_set_program_name (s)
- const char *s;
+xmalloc_set_program_name (const char *s)
{
name = s;
#ifdef HAVE_SBRK
}
void
-xmalloc_failed (size)
- size_t size;
+xmalloc_failed (size_t size)
{
#ifdef HAVE_SBRK
extern char **environ;
}
PTR
-xmalloc (size)
- size_t size;
+xmalloc (size_t size)
{
PTR newmem;
}
PTR
-xcalloc (nelem, elsize)
- size_t nelem, elsize;
+xcalloc (size_t nelem, size_t elsize)
{
PTR newmem;
}
PTR
-xrealloc (oldmem, size)
- PTR oldmem;
- size_t size;
+xrealloc (PTR oldmem, size_t size)
{
PTR newmem;
#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);
#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);
#ifdef VMS
#include <errno.h>
#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. */
/* 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 <errno.h>
and maintained by the run-time library in parallel to `errno'.
#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);