merge from gcc
This commit is contained in:
parent
39511478d0
commit
5484689472
@ -1,3 +1,10 @@
|
||||
2005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* hashtab.h, libiberty.h, objalloc.h, splay-tree.h, ternary.h:
|
||||
Don't use the PTR macro.
|
||||
|
||||
* sort.h: Don't use the PARAMS macro.
|
||||
|
||||
2005-04-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* libiberty.h (unlock_stream): New.
|
||||
|
@ -71,14 +71,14 @@ typedef int (*htab_trav) (void **, void *);
|
||||
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) (size_t, size_t);
|
||||
typedef void *(*htab_alloc) (size_t, size_t);
|
||||
|
||||
/* We also need a free() routine. */
|
||||
typedef void (*htab_free) (PTR);
|
||||
typedef void (*htab_free) (void *);
|
||||
|
||||
/* Memory allocation and deallocation; variants which take an extra
|
||||
argument. */
|
||||
typedef PTR (*htab_alloc_with_arg) (void *, size_t, size_t);
|
||||
typedef void *(*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
|
||||
@ -99,7 +99,7 @@ struct htab GTY(())
|
||||
htab_del del_f;
|
||||
|
||||
/* Table itself. */
|
||||
PTR * GTY ((use_param, length ("%h.size"))) entries;
|
||||
void ** GTY ((use_param, length ("%h.size"))) entries;
|
||||
|
||||
/* Current size (in entries) of the hash table. */
|
||||
size_t size;
|
||||
@ -123,7 +123,7 @@ struct htab GTY(())
|
||||
htab_free free_f;
|
||||
|
||||
/* Alternate allocate/free functions, which take an extra argument. */
|
||||
PTR GTY((skip)) alloc_arg;
|
||||
void * GTY((skip)) alloc_arg;
|
||||
htab_alloc_with_arg alloc_with_arg_f;
|
||||
htab_free_with_arg free_with_arg_f;
|
||||
|
||||
@ -145,7 +145,7 @@ extern htab_t htab_create_alloc (size_t, htab_hash,
|
||||
|
||||
extern htab_t htab_create_alloc_ex (size_t, htab_hash,
|
||||
htab_eq, htab_del,
|
||||
PTR, htab_alloc_with_arg,
|
||||
void *, htab_alloc_with_arg,
|
||||
htab_free_with_arg);
|
||||
|
||||
/* Backward-compatibility functions. */
|
||||
@ -154,18 +154,17 @@ 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,
|
||||
void *, 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_find (htab_t, const void *);
|
||||
extern void ** htab_find_slot (htab_t, const void *, enum insert_option);
|
||||
extern void * htab_find_with_hash (htab_t, const void *, hashval_t);
|
||||
extern void ** 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);
|
||||
@ -184,10 +183,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 (const PTR);
|
||||
extern hashval_t htab_hash_string (const void *);
|
||||
|
||||
/* An iterative hash function for arbitrary data. */
|
||||
extern hashval_t iterative_hash (const PTR, size_t, hashval_t);
|
||||
extern hashval_t iterative_hash (const void *, size_t, hashval_t);
|
||||
/* Shorthand for hashing something with an intrinsic size. */
|
||||
#define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT)
|
||||
|
||||
|
@ -259,18 +259,18 @@ extern void xmalloc_failed (size_t) ATTRIBUTE_NORETURN;
|
||||
message to stderr (using the name set by xmalloc_set_program_name,
|
||||
if any) and then call xexit. */
|
||||
|
||||
extern PTR xmalloc (size_t) ATTRIBUTE_MALLOC;
|
||||
extern void *xmalloc (size_t) ATTRIBUTE_MALLOC;
|
||||
|
||||
/* Reallocate memory without fail. This works like xmalloc. Note,
|
||||
realloc type functions are not suitable for attribute malloc since
|
||||
they may return the same address across multiple calls. */
|
||||
|
||||
extern PTR xrealloc (PTR, size_t);
|
||||
extern void *xrealloc (void *, size_t);
|
||||
|
||||
/* Allocate memory without fail and set it to zero. This works like
|
||||
xmalloc. */
|
||||
|
||||
extern PTR xcalloc (size_t, size_t) ATTRIBUTE_MALLOC;
|
||||
extern void *xcalloc (size_t, size_t) ATTRIBUTE_MALLOC;
|
||||
|
||||
/* Copy a string into a memory buffer without fail. */
|
||||
|
||||
@ -282,7 +282,7 @@ extern char *xstrndup (const char *, size_t) ATTRIBUTE_MALLOC;
|
||||
|
||||
/* Copy an existing memory buffer to a new memory buffer without fail. */
|
||||
|
||||
extern PTR xmemdup (const PTR, size_t, size_t) ATTRIBUTE_MALLOC;
|
||||
extern void *xmemdup (const void *, size_t, size_t) ATTRIBUTE_MALLOC;
|
||||
|
||||
/* Physical memory routines. Return values are in BYTES. */
|
||||
extern double physmem_total (void);
|
||||
@ -530,7 +530,7 @@ extern int vasprintf (char **, const char *, va_list)
|
||||
USE_C_ALLOCA yourself. The canonical autoconf macro C_ALLOCA is
|
||||
also set/unset as it is often used to indicate whether code needs
|
||||
to call alloca(0). */
|
||||
extern PTR C_alloca (size_t) ATTRIBUTE_MALLOC;
|
||||
extern void *C_alloca (size_t) ATTRIBUTE_MALLOC;
|
||||
#undef alloca
|
||||
#if GCC_VERSION >= 2000 && !defined USE_C_ALLOCA
|
||||
# define alloca(x) __builtin_alloca(x)
|
||||
|
@ -45,7 +45,7 @@ struct objalloc
|
||||
{
|
||||
char *current_ptr;
|
||||
unsigned int current_space;
|
||||
PTR chunks;
|
||||
void *chunks;
|
||||
};
|
||||
|
||||
/* Work out the required alignment. */
|
||||
@ -69,7 +69,7 @@ extern struct objalloc *objalloc_create (void);
|
||||
/* Allocate space from an objalloc structure. Returns NULL if malloc
|
||||
fails. */
|
||||
|
||||
extern PTR _objalloc_alloc (struct objalloc *, unsigned long);
|
||||
extern void *_objalloc_alloc (struct objalloc *, unsigned long);
|
||||
|
||||
/* The macro version of objalloc_alloc. We only define this if using
|
||||
gcc, because otherwise we would have to evaluate the arguments
|
||||
@ -94,7 +94,7 @@ extern PTR _objalloc_alloc (struct objalloc *, unsigned long);
|
||||
(__len <= __o->current_space \
|
||||
? (__o->current_ptr += __len, \
|
||||
__o->current_space -= __len, \
|
||||
(PTR) (__o->current_ptr - __len)) \
|
||||
(void *) (__o->current_ptr - __len)) \
|
||||
: _objalloc_alloc (__o, __len)); })
|
||||
|
||||
#else /* ! __GNUC__ */
|
||||
@ -110,6 +110,6 @@ extern void objalloc_free (struct objalloc *);
|
||||
/* Free a block allocated by objalloc_alloc. This also frees all more
|
||||
recently allocated blocks. */
|
||||
|
||||
extern void objalloc_free_block (struct objalloc *, PTR);
|
||||
extern void objalloc_free_block (struct objalloc *, void *);
|
||||
|
||||
#endif /* OBJALLOC_H */
|
||||
|
@ -35,7 +35,7 @@ extern "C" {
|
||||
|
||||
/* Sort an array of pointers. */
|
||||
|
||||
extern void sort_pointers PARAMS ((size_t, void **, void **));
|
||||
extern void sort_pointers (size_t, void **, void **);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ typedef int (*splay_tree_foreach_fn) (splay_tree_node, void*);
|
||||
node structures. The first argument is the number of bytes needed;
|
||||
the second is a data pointer the splay tree functions pass through
|
||||
to the allocator. This function must never return zero. */
|
||||
typedef PTR (*splay_tree_allocate_fn) (int, void *);
|
||||
typedef void *(*splay_tree_allocate_fn) (int, void *);
|
||||
|
||||
/* The type of a function used to free memory allocated using the
|
||||
corresponding splay_tree_allocate_fn. The first argument is the
|
||||
@ -109,7 +109,7 @@ struct splay_tree_s GTY(())
|
||||
/* Allocate/free functions, and a data pointer to pass to them. */
|
||||
splay_tree_allocate_fn allocate;
|
||||
splay_tree_deallocate_fn deallocate;
|
||||
PTR GTY((skip)) allocate_data;
|
||||
void * GTY((skip)) allocate_data;
|
||||
|
||||
};
|
||||
typedef struct splay_tree_s *splay_tree;
|
||||
|
@ -38,8 +38,8 @@ 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 (ternary_tree *p, const char *s,
|
||||
PTR data, int replace);
|
||||
void *ternary_insert (ternary_tree *p, const char *s,
|
||||
void *data, int replace);
|
||||
|
||||
/* Delete the ternary search tree rooted at P.
|
||||
Does NOT delete the data you associated with the strings. */
|
||||
@ -47,5 +47,5 @@ void ternary_cleanup (ternary_tree p);
|
||||
|
||||
/* Search the ternary tree for string S, returning the data associated
|
||||
with it if found. */
|
||||
PTR ternary_search (const ternary_node *p, const char *s);
|
||||
void *ternary_search (const ternary_node *p, const char *s);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user