/* Create an objalloc structure. Returns NULL if malloc fails. */
-extern struct objalloc *objalloc_create PARAMS ((void));
+extern struct objalloc *objalloc_create (void);
/* Allocate space from an objalloc structure. Returns NULL if malloc
fails. */
-extern PTR _objalloc_alloc PARAMS ((struct objalloc *, unsigned long));
+extern PTR _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
/* Free an entire objalloc structure. */
-extern void objalloc_free PARAMS ((struct objalloc *));
+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 PARAMS ((struct objalloc *, PTR));
+extern void objalloc_free_block (struct objalloc *, PTR);
#endif /* OBJALLOC_H */
/* obstack.h - object stack macros
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
- 1999, 2000
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
#if defined _LIBC || defined HAVE_STRING_H
# include <string.h>
-# if defined __STDC__ && __STDC__
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
-# else
-# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
-# endif
+# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
#else
# ifdef memcpy
# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
char *chunk_limit; /* address of char after current chunk */
PTR_INT_TYPE temp; /* Temporary for some macros. */
int alignment_mask; /* Mask of alignment for each object. */
-#if defined __STDC__ && __STDC__
/* These prototypes vary based on `use_extra_arg', and we use
casts to the prototypeless function type in all assignments,
but having prototypes here quiets -Wstrict-prototypes. */
struct _obstack_chunk *(*chunkfun) (void *, long);
void (*freefun) (void *, struct _obstack_chunk *);
void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
-#else
- struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
- void (*freefun) (); /* User's function to free a chunk. */
- char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
-#endif
unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
unsigned maybe_empty_object:1;/* There is a possibility that the current
chunk contains a zero-length object. This
/* Declare the external functions we use; they are in obstack.c. */
-#if defined __STDC__ && __STDC__
extern void _obstack_newchunk (struct obstack *, int);
extern void _obstack_free (struct obstack *, void *);
extern int _obstack_begin (struct obstack *, int, int,
void *(*) (void *, long),
void (*) (void *, void *), void *);
extern int _obstack_memory_used (struct obstack *);
-#else
-extern void _obstack_newchunk ();
-extern void _obstack_free ();
-extern int _obstack_begin ();
-extern int _obstack_begin_1 ();
-extern int _obstack_memory_used ();
-#endif
\f
-#if defined __STDC__ && __STDC__
-
/* Do the function-declarations after the structs
but before defining the macros. */
int obstack_chunk_size (struct obstack *obstack);
int obstack_memory_used (struct obstack *obstack);
-#endif /* __STDC__ */
-
-/* Non-ANSI C cannot really support alternative functions for these macros,
- so we do not declare them. */
-
/* Error handler called when `obstack_chunk_alloc' failed to allocate
more memory. This can be set to a user defined function. The
default action is to print a message and abort. */
-#if defined __STDC__ && __STDC__
extern void (*obstack_alloc_failed_handler) (void);
-#else
-extern void (*obstack_alloc_failed_handler) ();
-#endif
/* Exit value used when `print_and_abort' is used. */
extern int obstack_exit_failure;
/* To prevent prototype warnings provide complete argument list in
standard C version. */
-#if defined __STDC__ && __STDC__
-
# define obstack_init(h) \
_obstack_begin ((h), 0, 0, \
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
# define obstack_freefun(h, newfreefun) \
((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
-#else
-
-# define obstack_init(h) \
- _obstack_begin ((h), 0, 0, \
- (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-# define obstack_begin(h, size) \
- _obstack_begin ((h), (size), 0, \
- (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
- _obstack_begin ((h), (size), (alignment), \
- (void *(*) ()) (chunkfun), (void (*) ()) (freefun))
-
-# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
- _obstack_begin_1 ((h), (size), (alignment), \
- (void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
-
-# define obstack_chunkfun(h, newchunkfun) \
- ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
-
-# define obstack_freefun(h, newfreefun) \
- ((h) -> freefun = (void (*)()) (newfreefun))
-
-#endif
-
#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar))
#define obstack_blank_fast(h,n) ((h)->next_free += (n))
(h)->object_base = (h)->next_free, \
__INT_TO_PTR ((h)->temp))
-# if defined __STDC__ && __STDC__
-# define obstack_free(h,obj) \
+# define obstack_free(h,obj) \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
? (int) ((h)->next_free = (h)->object_base \
= (h)->temp + (char *) (h)->chunk) \
: (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
-# else
-# define obstack_free(h,obj) \
-( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
- (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp + (char *) (h)->chunk) \
- : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
-# endif
#endif /* not __GNUC__ or not __STDC__ */
struct partition_elem elements[1];
} *partition;
-extern partition partition_new PARAMS((int));
-extern void partition_delete PARAMS((partition));
-extern int partition_union PARAMS((partition,
- int,
- int));
-extern void partition_print PARAMS((partition,
- FILE*));
+extern partition partition_new (int);
+extern void partition_delete (partition);
+extern int partition_union (partition, int, int);
+extern void partition_print (partition, FILE*);
/* Returns the canonical element corresponding to the class containing
ELEMENT__ in PARTITION__. */
/* The type of a function which compares two splay-tree keys. The
function should return values as for qsort. */
-typedef int (*splay_tree_compare_fn) PARAMS((splay_tree_key, splay_tree_key));
+typedef int (*splay_tree_compare_fn) (splay_tree_key, splay_tree_key);
/* The type of a function used to deallocate any resources associated
with the key. */
-typedef void (*splay_tree_delete_key_fn) PARAMS((splay_tree_key));
+typedef void (*splay_tree_delete_key_fn) (splay_tree_key);
/* The type of a function used to deallocate any resources associated
with the value. */
-typedef void (*splay_tree_delete_value_fn) PARAMS((splay_tree_value));
+typedef void (*splay_tree_delete_value_fn) (splay_tree_value);
/* The type of a function used to iterate over the tree. */
-typedef int (*splay_tree_foreach_fn) PARAMS((splay_tree_node, void*));
+typedef int (*splay_tree_foreach_fn) (splay_tree_node, void*);
/* The type of a function used to allocate memory for tree root and
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) PARAMS((int, void *));
+typedef PTR (*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
memory to be freed; the latter is a data pointer the splay tree
functions pass through to the freer. */
-typedef void (*splay_tree_deallocate_fn) PARAMS((void *, void *));
+typedef void (*splay_tree_deallocate_fn) (void *, void *);
/* The nodes in the splay tree. */
struct splay_tree_node_s GTY(())
};
typedef struct splay_tree_s *splay_tree;
-extern splay_tree splay_tree_new PARAMS((splay_tree_compare_fn,
- splay_tree_delete_key_fn,
- splay_tree_delete_value_fn));
-extern splay_tree splay_tree_new_with_allocator
- PARAMS((splay_tree_compare_fn,
- splay_tree_delete_key_fn,
+extern splay_tree splay_tree_new (splay_tree_compare_fn,
+ splay_tree_delete_key_fn,
+ splay_tree_delete_value_fn);
+extern splay_tree splay_tree_new_with_allocator (splay_tree_compare_fn,
+ splay_tree_delete_key_fn,
splay_tree_delete_value_fn,
- splay_tree_allocate_fn,
- splay_tree_deallocate_fn,
- void *));
-extern void splay_tree_delete PARAMS((splay_tree));
-extern splay_tree_node splay_tree_insert
- PARAMS((splay_tree,
- splay_tree_key,
- splay_tree_value));
-extern void splay_tree_remove PARAMS((splay_tree,
- splay_tree_key));
-extern splay_tree_node splay_tree_lookup
- PARAMS((splay_tree,
- splay_tree_key));
-extern splay_tree_node splay_tree_predecessor
- PARAMS((splay_tree,
- splay_tree_key));
-extern splay_tree_node splay_tree_successor
- PARAMS((splay_tree,
- splay_tree_key));
-extern splay_tree_node splay_tree_max
- PARAMS((splay_tree));
-extern splay_tree_node splay_tree_min
- PARAMS((splay_tree));
-extern int splay_tree_foreach PARAMS((splay_tree,
- splay_tree_foreach_fn,
- void*));
-extern int splay_tree_compare_ints PARAMS((splay_tree_key,
- splay_tree_key));
-extern int splay_tree_compare_pointers PARAMS((splay_tree_key,
- splay_tree_key));
+ splay_tree_allocate_fn,
+ splay_tree_deallocate_fn,
+ void *);
+extern void splay_tree_delete (splay_tree);
+extern splay_tree_node splay_tree_insert (splay_tree,
+ splay_tree_key,
+ splay_tree_value);
+extern void splay_tree_remove (splay_tree, splay_tree_key);
+extern splay_tree_node splay_tree_lookup (splay_tree, splay_tree_key);
+extern splay_tree_node splay_tree_predecessor (splay_tree, splay_tree_key);
+extern splay_tree_node splay_tree_successor (splay_tree, splay_tree_key);
+extern splay_tree_node splay_tree_max (splay_tree);
+extern splay_tree_node splay_tree_min (splay_tree);
+extern int splay_tree_foreach (splay_tree, splay_tree_foreach_fn, void*);
+extern int splay_tree_compare_ints (splay_tree_key, splay_tree_key);
+extern int splay_tree_compare_pointers (splay_tree_key, splay_tree_key);
#ifdef __cplusplus
}
+2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Convert libiberty to use ISO C prototype style 5/n.
+ * random.c (srandom, initstate, setstate, random): Use ISO C
+ prototypes.
+ * putenv.c (putenv): Likewise.
+ * physmem.c (physmem_available, physmem_total, main): Likewise.
+ * pex-win32.c (fix_argv, pexecute, pwait): Likewise.
+ * pex-unix.c (pexecute, pwait): Likewise.
+ * pex-msdos.c (pexecute, pwait): Likewise.
+ * pex-djgpp.c (pexecute, pwait): Likewise.
+ * partition.c (partition_new, partition_delete, partition_union)
+ (elem_compare, partition_print): Likewise.
+ * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
+ _obstack_allocated_p, _obstack_free, obstack_free,
+ _obstack_memory_used, print_and_abort, obstack_next_free,
+ obstack_object_size, obstack_base): Likewise. Remove codes
+ predicated on !defined(__STDC__).
+ * objalloc.c (objalloc_create, _objalloc_alloc, objalloc_free,
+ objalloc_free_block): Use ISO C prototypes.
+ * mkstemps.c (mkstemps): Likewise.
+ * memset.c (memset): Likewise.
+ * mempcpy.c (mempcpy): Likewise.
+ * rename.c (rename): Likewise.
+ * rindex.c (rindex): Likewise.
+ * setenv.c (setenv, unsetenv): Likewise.
+ * sigsetmask.c (sigsetmask): Likewise.
+ * snprintf.c (snprintf): Likewise.
+ * sort.c (sort_pointers, xmalloc): Likewise.
+ * spaces.c (spaces): Likewise.
+ * splay-tree.c (splay_tree_delete_helper,
+ splay_tree_splay_helper, splay_tree_splay,
+ splay_tree_foreach_helper, splay_tree_xmalloc_allocate,
+ splay_tree_new, splay_tree_xmalloc_allocate,
+ splay_tree_new_with_allocator, splay_tree_delete,
+ splay_tree_insert, splay_tree_remove, splay_tree_lookup,
+ splay_tree_max, splay_tree_min, splay_tree_predecessor,
+ splay_tree_successor, splay_tree_foreach,
+ splay_tree_compare_ints, splay_tree_compare_pointers): Likewise.
+ * stpcpy.c (stpcpy): Likewise.
+ * stpncpy.c (stpncpy): Likewise.
+ * strcasecmp.c (strcasecmp): Likewise.
+ * strchr.c (strchr): Likewise.
+ * strdup.c (strdup): Likewise.
+
2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
Convert libiberty to use ISO C prototype style 6/n.
/* Implement the mempcpy 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.
*/
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#else
-#define size_t unsigned long
-#endif
-extern PTR memcpy PARAMS ((PTR, const PTR, size_t));
+extern PTR memcpy (PTR, const PTR, size_t);
PTR
-mempcpy (dst, src, len)
- PTR dst;
- const PTR src;
- size_t len;
+mempcpy (PTR dst, const PTR src, size_t len)
{
return (char *) memcpy (dst, src, len) + len;
}
*/
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#else
-#define size_t unsigned long
-#endif
PTR
-memset (dest, val, len)
- PTR dest;
- register int val;
- register size_t len;
+memset (PTR dest, register int val, register size_t len)
{
register unsigned char *ptr = (unsigned char*)dest;
while (len-- > 0)
*/
int
-mkstemps (template, suffix_len)
- char *template;
- int suffix_len;
+mkstemps (char *template, int suffix_len)
{
static const char letters[]
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
#include <stdlib.h>
#else
/* For systems with larger pointers than ints, this must be declared. */
-extern PTR malloc PARAMS ((size_t));
-extern void free PARAMS ((PTR));
+extern PTR malloc (size_t);
+extern void free (PTR);
#endif
#endif
/* Create an objalloc structure. */
struct objalloc *
-objalloc_create ()
+objalloc_create (void)
{
struct objalloc *ret;
struct objalloc_chunk *chunk;
/* Allocate space from an objalloc structure. */
PTR
-_objalloc_alloc (o, len)
- struct objalloc *o;
- unsigned long len;
+_objalloc_alloc (struct objalloc *o, unsigned long len)
{
/* We avoid confusion from zero sized objects by always allocating
at least 1 byte. */
/* Free an entire objalloc structure. */
void
-objalloc_free (o)
- struct objalloc *o;
+objalloc_free (struct objalloc *o)
{
struct objalloc_chunk *l;
recently allocated blocks. */
void
-objalloc_free_block (o, block)
- struct objalloc *o;
- PTR block;
+objalloc_free_block (struct objalloc *o, PTR block)
{
struct objalloc_chunk *p, *small;
char *b = (char *) block;
#ifndef ELIDE_CODE
-#if defined (__STDC__) && __STDC__
#define POINTER void *
-#else
-#define POINTER char *
-#endif
/* Determine default alignment. */
struct fooalign {char x; double d;};
jump to the handler pointed to by `obstack_alloc_failed_handler'.
This variable by default points to the internal function
`print_and_abort'. */
-#if defined (__STDC__) && __STDC__
static void print_and_abort (void);
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
-#else
-static void print_and_abort ();
-void (*obstack_alloc_failed_handler) () = print_and_abort;
-#endif
/* Exit value used when `print_and_abort' is used. */
#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
free up some memory, then call this again. */
int
-_obstack_begin (h, size, alignment, chunkfun, freefun)
- struct obstack *h;
- int size;
- int alignment;
-#if defined (__STDC__) && __STDC__
- POINTER (*chunkfun) (long);
- void (*freefun) (void *);
-#else
- POINTER (*chunkfun) ();
- void (*freefun) ();
-#endif
+_obstack_begin (struct obstack *h, int size, int alignment,
+ POINTER (*chunkfun) (long), void (*freefun) (void *))
{
register struct _obstack_chunk *chunk; /* points to new chunk */
size = 4096 - extra;
}
-#if defined (__STDC__) && __STDC__
h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
-#else
- h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
- h->freefun = freefun;
-#endif
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->use_extra_arg = 0;
}
int
-_obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
- struct obstack *h;
- int size;
- int alignment;
-#if defined (__STDC__) && __STDC__
- POINTER (*chunkfun) (POINTER, long);
- void (*freefun) (POINTER, POINTER);
-#else
- POINTER (*chunkfun) ();
- void (*freefun) ();
-#endif
- POINTER arg;
+_obstack_begin_1 (struct obstack *h, int size, int alignment,
+ POINTER (*chunkfun) (POINTER, long),
+ void (*freefun) (POINTER, POINTER), POINTER arg)
{
register struct _obstack_chunk *chunk; /* points to new chunk */
size = 4096 - extra;
}
-#if defined(__STDC__) && __STDC__
h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
-#else
- h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
- h->freefun = freefun;
-#endif
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->extra_arg = arg;
to the beginning of the new one. */
void
-_obstack_newchunk (h, length)
- struct obstack *h;
- int length;
+_obstack_newchunk (struct obstack *h, int length)
{
register struct _obstack_chunk *old_chunk = h->chunk;
register struct _obstack_chunk *new_chunk;
This is here for debugging.
If you use it in a program, you are probably losing. */
-#if defined (__STDC__) && __STDC__
/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
obstack.h because it is just for debugging. */
int _obstack_allocated_p (struct obstack *h, POINTER obj);
-#endif
int
-_obstack_allocated_p (h, obj)
- struct obstack *h;
- POINTER obj;
+_obstack_allocated_p (struct obstack *h, POINTER obj)
{
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
This is the first one, called from non-ANSI code. */
void
-_obstack_free (h, obj)
- struct obstack *h;
- POINTER obj;
+_obstack_free (struct obstack *h, POINTER obj)
{
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
/* This function is used from ANSI code. */
void
-obstack_free (h, obj)
- struct obstack *h;
- POINTER obj;
+obstack_free (struct obstack *h, POINTER obj)
{
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
}
\f
int
-_obstack_memory_used (h)
- struct obstack *h;
+_obstack_memory_used (struct obstack *h)
{
register struct _obstack_chunk* lp;
register int nbytes = 0;
#endif
static void
-print_and_abort ()
+print_and_abort (void)
{
fputs (_("memory exhausted\n"), stderr);
exit (obstack_exit_failure);
/* Now define the functional versions of the obstack macros.
Define them to simply use the corresponding macros to do the job. */
-#if defined (__STDC__) && __STDC__
-/* These function definitions do not work with non-ANSI preprocessors;
- they won't pass through the macro names in parentheses. */
-
/* The function names appear in parentheses in order to prevent
the macro-definitions of the names from being expanded there. */
-POINTER (obstack_base) (obstack)
- struct obstack *obstack;
+POINTER (obstack_base) (struct obstack *obstack)
{
return obstack_base (obstack);
}
-POINTER (obstack_next_free) (obstack)
- struct obstack *obstack;
+POINTER (obstack_next_free) (struct obstack *obstack)
{
return obstack_next_free (obstack);
}
-int (obstack_object_size) (obstack)
- struct obstack *obstack;
+int (obstack_object_size) (struct obstack *obstack)
{
return obstack_object_size (obstack);
}
-int (obstack_room) (obstack)
- struct obstack *obstack;
+int (obstack_room) (struct obstack *obstack)
{
return obstack_room (obstack);
}
-int (obstack_make_room) (obstack, length)
- struct obstack *obstack;
- int length;
+int (obstack_make_room) (struct obstack *obstack, int length)
{
return obstack_make_room (obstack, length);
}
-void (obstack_grow) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
+void (obstack_grow) (struct obstack *obstack, POINTER pointer, int length)
{
obstack_grow (obstack, pointer, length);
}
-void (obstack_grow0) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
+void (obstack_grow0) (struct obstack *obstack, POINTER pointer, int length)
{
obstack_grow0 (obstack, pointer, length);
}
-void (obstack_1grow) (obstack, character)
- struct obstack *obstack;
- int character;
+void (obstack_1grow) (struct obstack *obstack, int character)
{
obstack_1grow (obstack, character);
}
-void (obstack_blank) (obstack, length)
- struct obstack *obstack;
- int length;
+void (obstack_blank) (struct obstack *obstack, int length)
{
obstack_blank (obstack, length);
}
-void (obstack_1grow_fast) (obstack, character)
- struct obstack *obstack;
- int character;
+void (obstack_1grow_fast) (struct obstack *obstack, int character)
{
obstack_1grow_fast (obstack, character);
}
-void (obstack_blank_fast) (obstack, length)
- struct obstack *obstack;
- int length;
+void (obstack_blank_fast) (struct obstack *obstack, int length)
{
obstack_blank_fast (obstack, length);
}
-POINTER (obstack_finish) (obstack)
- struct obstack *obstack;
+POINTER (obstack_finish) (struct obstack *obstack)
{
return obstack_finish (obstack);
}
-POINTER (obstack_alloc) (obstack, length)
- struct obstack *obstack;
- int length;
+POINTER (obstack_alloc) (struct obstack *obstack, int length)
{
return obstack_alloc (obstack, length);
}
-POINTER (obstack_copy) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
+POINTER (obstack_copy) (struct obstack *obstack, POINTER pointer, int length)
{
return obstack_copy (obstack, pointer, length);
}
-POINTER (obstack_copy0) (obstack, pointer, length)
- struct obstack *obstack;
- POINTER pointer;
- int length;
+POINTER (obstack_copy0) (struct obstack *obstack, POINTER pointer, int length)
{
return obstack_copy0 (obstack, pointer, length);
}
-#endif /* __STDC__ */
-
#endif /* 0 */
#endif /* !ELIDE_CODE */
element is in a class by itself. */
partition
-partition_new (num_elements)
- int num_elements;
+partition_new (int num_elements)
{
int e;
/* Freeds a partition. */
void
-partition_delete (part)
- partition part;
+partition_delete (partition part)
{
free (part);
}
resulting union class. */
int
-partition_union (part, elem1, elem2)
- partition part;
- int elem1;
- int elem2;
+partition_union (partition part, int elem1, int elem2)
{
struct partition_elem *elements = part->elements;
struct partition_elem *e1;
pointer to each. Used to qsort such an array. */
static int
-elem_compare (elem1, elem2)
- const void *elem1;
- const void *elem2;
+elem_compare (const void *elem1, const void *elem2)
{
int e1 = * (const int *) elem1;
int e2 = * (const int *) elem2;
class are sorted. */
void
-partition_print (part, fp)
- partition part;
- FILE *fp;
+partition_print (partition part, FILE *fp)
{
char *done;
int num_elements = part->num_elements;
static int last_reaped = 0;
int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
+pexecute (const char *program, char * const *argv, const char *this_pname,
+ const char *temp_base, char **errmsg_fmt,
+ char **errmsg_arg, int flags)
{
int rc;
}
int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
+pwait (int pid, int *status, int flags)
{
/* On MSDOS each pexecute must be followed by its associated pwait. */
if (pid != last_pid
static int last_reaped = 0;
int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
+pexecute (const char *program, char * const *argv, const char *this_pname,
+ const char *temp_base, char **errmsg_fmt, char **errmsg_arg,
+ int flags)
{
int rc;
char *scmd, *rf;
#endif
int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags;
+pwait (int pid, int *status, int flags)
{
/* On MSDOS each pexecute must be followed by its associated pwait. */
if (pid != last_pid
/* Utilities to execute a program in a subprocess (possibly linked by pipes
with other subprocesses), and wait for it. Generic Unix version
(also used for UWIN and VMS).
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of the libiberty library.
exactly once and is not an argument, or is marked volatile. */
int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg,
- flagsarg)
- const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base ATTRIBUTE_UNUSED;
- char **errmsg_fmt, **errmsg_arg;
- int flagsarg;
+pexecute (const char *program, char * const *argv, const char *this_pname,
+ const char *temp_base ATTRIBUTE_UNUSED,
+ char **errmsg_fmt, char **errmsg_arg, int flagsarg)
{
int pid;
int pdes[2];
}
int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags ATTRIBUTE_UNUSED;
+pwait (int pid, int *status, int flags ATTRIBUTE_UNUSED)
{
/* ??? Here's an opportunity to canonicalize the values in STATUS.
Needed? */
/* Utilities to execute a program in a subprocess (possibly linked by pipes
with other subprocesses), and wait for it. Generic Win32 specialization.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of the libiberty library.
to remove the outermost set of double quotes from all arguments. */
static const char * const *
-fix_argv (argvec)
- char **argvec;
+fix_argv (char **argvec)
{
int i;
char * command0 = argvec[0];
/* Win32 supports pipes */
int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
- const char *program;
- char * const *argv;
- const char *this_pname ATTRIBUTE_UNUSED;
- const char *temp_base ATTRIBUTE_UNUSED;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
+pexecute (const char *program, char * const *argv,
+ const char *this_pname ATTRIBUTE_UNUSED,
+ const char *temp_base ATTRIBUTE_UNUSED,
+ char **errmsg_fmt, char **errmsg_arg, int flags)
{
int pid;
int pdes[2];
macros. Note that WIFSIGNALED will never be true under CRTDLL. */
int
-pwait (pid, status, flags)
- int pid;
- int *status;
- int flags ATTRIBUTE_UNUSED;
+pwait (int pid, int *status, int flags ATTRIBUTE_UNUSED)
{
int termstat;
/* Calculate the size of physical memory.
- Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Return the total amount of physical memory. */
double
-physmem_total ()
+physmem_total (void)
{
#if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE
{ /* This works on linux-gnu, solaris2 and cygwin. */
/* Return the amount of physical memory available. */
double
-physmem_available ()
+physmem_available (void)
{
#if defined _SC_AVPHYS_PAGES && defined _SC_PAGESIZE
{ /* This works on linux-gnu, solaris2 and cygwin. */
# include <stdlib.h>
int
-main ()
+main (void)
{
printf ("%12.f %12.f\n", physmem_total (), physmem_available ());
exit (0);
/* Put STRING, which is of the form "NAME=VALUE", in the environment. */
int
-putenv (string)
- const char *string;
+putenv (const char *string)
{
const char *const name_end = strchr (string, '=');
#endif
-long int random ();
+long int random (void);
/* An improved random number generation package. In addition to the standard
rand()/srand() like interface, this package also has a special state info
introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
for default usage relies on values produced by this routine. */
void
-srandom (x)
- unsigned int x;
+srandom (unsigned int x)
{
state[0] = x;
if (rand_type != TYPE_0)
setstate so that it doesn't matter when initstate is called.
Returns a pointer to the old state. */
PTR
-initstate (seed, arg_state, n)
- unsigned int seed;
- PTR arg_state;
- unsigned long n;
+initstate (unsigned int seed, PTR arg_state, unsigned long n)
{
PTR ostate = (PTR) &state[-1];
Returns a pointer to the old state information. */
PTR
-setstate (arg_state)
- PTR arg_state;
+setstate (PTR arg_state)
{
register long int *new_state = (long int *) arg_state;
register int type = new_state[0] % MAX_TYPES;
pointer if the front one has wrapped. Returns a 31-bit random number. */
long int
-random ()
+random (void)
{
if (rand_type == TYPE_0)
{
#endif
int
-rename (zfrom, zto)
- const char *zfrom;
- const char *zto;
+rename (const char *zfrom, const char *zto)
{
if (link (zfrom, zto) < 0)
{
extern char *strrchr ();
char *
-rindex (s, c)
- char *s;
- int c;
+rindex (char *s, int c)
{
return strrchr (s, c);
}
/* <ctype.h> replacement macros.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004,
+ 2005 Free Software Foundation, Inc.
Contributed by Zack Weinberg <zackw@stanford.edu>.
This file is part of the libiberty library.
int
-setenv (name, value, replace)
- const char *name;
- const char *value;
- int replace;
+setenv (const char *name, const char *value, int replace)
{
register char **ep = 0;
register size_t size;
}
void
-unsetenv (name)
- const char *name;
+unsetenv (const char *name)
{
const size_t len = strlen (name);
char **ep;
#include <sys/types.h>
#include <signal.h>
-extern void abort PARAMS ((void)) ATTRIBUTE_NORETURN;
+extern void abort (void) ATTRIBUTE_NORETURN;
#ifdef SIG_SETMASK
int
-sigsetmask (set)
- int set;
+sigsetmask (int set)
{
sigset_t new;
sigset_t old;
#include "ansidecl.h"
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#include <stddef.h>
-#else
-#include <varargs.h>
-#define size_t unsigned long
-#endif
-int vsnprintf PARAMS ((char *, size_t, const char *, va_list));
+int vsnprintf (char *, size_t, const char *, va_list);
int
-snprintf VPARAMS ((char *s, size_t n, const char *format, ...))
+snprintf (char *s, size_t n, const char *format, ...)
{
int result;
VA_OPEN (ap, format);
/* POINTERS and WORK are both arrays of N pointers. When this
function returns POINTERS will be sorted in ascending order. */
-void sort_pointers (n, pointers, work)
- size_t n;
- void **pointers;
- void **work;
+void sort_pointers (size_t n, void **pointers, void **work)
{
/* The type of a single digit. This can be any unsigned integral
type. When changing this, DIGIT_MAX should be changed as
#include <stdio.h>
-void *xmalloc (n)
- size_t n;
+void *xmalloc (size_t n)
{
return malloc (n);
}
#include <unixlib.h>
#else
/* For systems with larger pointers than ints, these must be declared. */
-extern PTR malloc PARAMS ((size_t));
-extern void free PARAMS ((PTR));
+extern PTR malloc (size_t);
+extern void free (PTR);
#endif
const char *
-spaces (count)
- int count;
+spaces (int count)
{
register char *t;
static char *buf;
#include "libiberty.h"
#include "splay-tree.h"
-static void splay_tree_delete_helper PARAMS((splay_tree,
- splay_tree_node));
-static void splay_tree_splay PARAMS((splay_tree,
- splay_tree_key));
-static splay_tree_node splay_tree_splay_helper
- PARAMS((splay_tree,
+static void splay_tree_delete_helper (splay_tree, splay_tree_node);
+static void splay_tree_splay (splay_tree, splay_tree_key);
+static splay_tree_node splay_tree_splay_helper (splay_tree,
splay_tree_key,
splay_tree_node*,
splay_tree_node*,
- splay_tree_node*));
-static int splay_tree_foreach_helper PARAMS((splay_tree,
- splay_tree_node,
- splay_tree_foreach_fn,
- void*));
+ splay_tree_node*);
+static int splay_tree_foreach_helper (splay_tree, splay_tree_node,
+ splay_tree_foreach_fn, void*);
/* Deallocate NODE (a member of SP), and all its sub-trees. */
static void
-splay_tree_delete_helper (sp, node)
- splay_tree sp;
- splay_tree_node node;
+splay_tree_delete_helper (splay_tree sp, splay_tree_node node)
{
splay_tree_node pending = 0;
splay_tree_node active = 0;
and grandparent, respectively, of NODE. */
static splay_tree_node
-splay_tree_splay_helper (sp, key, node, parent, grandparent)
- splay_tree sp;
- splay_tree_key key;
- splay_tree_node *node;
- splay_tree_node *parent;
- splay_tree_node *grandparent;
+splay_tree_splay_helper (splay_tree sp, splay_tree_key key,
+ splay_tree_node *node, splay_tree_node *parent,
+ splay_tree_node *grandparent)
{
splay_tree_node *next;
splay_tree_node n;
/* Splay SP around KEY. */
static void
-splay_tree_splay (sp, key)
- splay_tree sp;
- splay_tree_key key;
+splay_tree_splay (splay_tree sp, splay_tree_key key)
{
if (sp->root == 0)
return;
value is returned. Otherwise, this function returns 0. */
static int
-splay_tree_foreach_helper (sp, node, fn, data)
- splay_tree sp;
- splay_tree_node node;
- splay_tree_foreach_fn fn;
- void* data;
+splay_tree_foreach_helper (splay_tree sp, splay_tree_node node,
+ splay_tree_foreach_fn fn, void *data)
{
int val;
/* An allocator and deallocator based on xmalloc. */
static void *
-splay_tree_xmalloc_allocate (size, data)
- int size;
- void *data ATTRIBUTE_UNUSED;
+splay_tree_xmalloc_allocate (int size, void *data ATTRIBUTE_UNUSED)
{
return (void *) xmalloc (size);
}
static void
-splay_tree_xmalloc_deallocate (object, data)
- void *object;
- void *data ATTRIBUTE_UNUSED;
+splay_tree_xmalloc_deallocate (void *object, void *data ATTRIBUTE_UNUSED)
{
free (object);
}
nodes added. */
splay_tree
-splay_tree_new (compare_fn, delete_key_fn, delete_value_fn)
- splay_tree_compare_fn compare_fn;
- splay_tree_delete_key_fn delete_key_fn;
- splay_tree_delete_value_fn delete_value_fn;
+splay_tree_new (splay_tree_compare_fn compare_fn,
+ splay_tree_delete_key_fn delete_key_fn,
+ splay_tree_delete_value_fn delete_value_fn)
{
return (splay_tree_new_with_allocator
(compare_fn, delete_key_fn, delete_value_fn,
values. */
splay_tree
-splay_tree_new_with_allocator (compare_fn, delete_key_fn, delete_value_fn,
- allocate_fn, deallocate_fn, allocate_data)
- splay_tree_compare_fn compare_fn;
- splay_tree_delete_key_fn delete_key_fn;
- splay_tree_delete_value_fn delete_value_fn;
- splay_tree_allocate_fn allocate_fn;
- splay_tree_deallocate_fn deallocate_fn;
- void *allocate_data;
+splay_tree_new_with_allocator (splay_tree_compare_fn compare_fn,
+ splay_tree_delete_key_fn delete_key_fn,
+ splay_tree_delete_value_fn delete_value_fn,
+ splay_tree_allocate_fn allocate_fn,
+ splay_tree_deallocate_fn deallocate_fn,
+ void *allocate_data)
{
splay_tree sp = (splay_tree) (*allocate_fn) (sizeof (struct splay_tree_s),
allocate_data);
/* Deallocate SP. */
void
-splay_tree_delete (sp)
- splay_tree sp;
+splay_tree_delete (splay_tree sp)
{
splay_tree_delete_helper (sp, sp->root);
(*sp->deallocate) ((char*) sp, sp->allocate_data);
with the new value. Returns the new node. */
splay_tree_node
-splay_tree_insert (sp, key, value)
- splay_tree sp;
- splay_tree_key key;
- splay_tree_value value;
+splay_tree_insert (splay_tree sp, splay_tree_key key, splay_tree_value value)
{
int comparison = 0;
/* Remove KEY from SP. It is not an error if it did not exist. */
void
-splay_tree_remove (sp, key)
- splay_tree sp;
- splay_tree_key key;
+splay_tree_remove (splay_tree sp, splay_tree_key key)
{
splay_tree_splay (sp, key);
otherwise. */
splay_tree_node
-splay_tree_lookup (sp, key)
- splay_tree sp;
- splay_tree_key key;
+splay_tree_lookup (splay_tree sp, splay_tree_key key)
{
splay_tree_splay (sp, key);
/* Return the node in SP with the greatest key. */
splay_tree_node
-splay_tree_max (sp)
- splay_tree sp;
+splay_tree_max (splay_tree sp)
{
splay_tree_node n = sp->root;
/* Return the node in SP with the smallest key. */
splay_tree_node
-splay_tree_min (sp)
- splay_tree sp;
+splay_tree_min (splay_tree sp)
{
splay_tree_node n = sp->root;
predecessor. KEY need not be present in the tree. */
splay_tree_node
-splay_tree_predecessor (sp, key)
- splay_tree sp;
- splay_tree_key key;
+splay_tree_predecessor (splay_tree sp, splay_tree_key key)
{
int comparison;
splay_tree_node node;
successor. KEY need not be present in the tree. */
splay_tree_node
-splay_tree_successor (sp, key)
- splay_tree sp;
- splay_tree_key key;
+splay_tree_successor (splay_tree sp, splay_tree_key key)
{
int comparison;
splay_tree_node node;
Otherwise, this function returns 0. */
int
-splay_tree_foreach (sp, fn, data)
- splay_tree sp;
- splay_tree_foreach_fn fn;
- void *data;
+splay_tree_foreach (splay_tree sp, splay_tree_foreach_fn fn, void *data)
{
return splay_tree_foreach_helper (sp, sp->root, fn, data);
}
/* Splay-tree comparison function, treating the keys as ints. */
int
-splay_tree_compare_ints (k1, k2)
- splay_tree_key k1;
- splay_tree_key k2;
+splay_tree_compare_ints (splay_tree_key k1, splay_tree_key k2)
{
if ((int) k1 < (int) k2)
return -1;
/* Splay-tree comparison function, treating the keys as pointers. */
int
-splay_tree_compare_pointers (k1, k2)
- splay_tree_key k1;
- splay_tree_key k2;
+splay_tree_compare_pointers (splay_tree_key k1, splay_tree_key k2)
{
if ((char*) k1 < (char*) k2)
return -1;
*/
#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 memcpy PARAMS ((PTR, const PTR, size_t));
+extern size_t strlen (const char *);
+extern PTR memcpy (PTR, const PTR, size_t);
char *
-stpcpy (dst, src)
- char *dst;
- const char *src;
+stpcpy (char *dst, const char *src)
{
const size_t len = strlen (src);
return (char *) memcpy (dst, src, len + 1) + len;
*/
#include <ansidecl.h>
-#ifdef ANSI_PROTOTYPES
#include <stddef.h>
-#else
-#define size_t unsigned long
-#endif
-extern size_t strlen PARAMS ((const char *));
-extern char *strncpy PARAMS ((char *, const char *, size_t));
+extern size_t strlen (const char *);
+extern char *strncpy (char *, const char *, size_t);
char *
-stpncpy (dst, src, len)
- char *dst;
- const char *src;
- size_t len;
+stpncpy (char *dst, const char *src, size_t len)
{
size_t n = strlen (src);
if (n > len)
#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
-strcasecmp(s1, s2)
- const char *s1, *s2;
+strcasecmp(const char *s1, const char *s2)
{
register unsigned char u1, u2;
#include <ansidecl.h>
char *
-strchr (s, c)
- register const char *s;
- int c;
+strchr (register const char *s, int c)
{
do {
if (*s == c)
*/
#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 *
-strdup(s)
- const char *s;
+strdup(const char *s)
{
size_t len = strlen (s) + 1;
char *result = (char*) malloc (len);