merge from gcc

This commit is contained in:
DJ Delorie 2005-03-28 02:08:50 +00:00
parent a4ec6363ca
commit 25c47304a3
7 changed files with 100 additions and 101 deletions

View File

@ -1,3 +1,15 @@
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.

View File

@ -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);

View File

@ -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_ */

View File

@ -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) */

View File

@ -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 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 PARAMS ((htab_t, htab_hash,
htab_eq, htab_del,
PTR, htab_alloc_with_arg,
htab_free_with_arg));
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 PARAMS ((htab_t));
extern void htab_empty PARAMS ((htab_t));
extern void htab_delete (htab_t);
extern void htab_empty (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 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 PARAMS ((htab_t, htab_trav, void *));
extern void htab_traverse_noresize PARAMS ((htab_t, htab_trav, void *));
extern void htab_traverse (htab_t, htab_trav, void *);
extern void htab_traverse_noresize (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 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)

View File

@ -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

View File

@ -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