diff options
author | 2004-12-24 21:48:27 +0000 | |
---|---|---|
committer | 2004-12-24 21:48:27 +0000 | |
commit | a2267c5a410630e195ee505533afedb37f704d85 (patch) | |
tree | b44757f67f7afdabe79d28e4027390d4be894ee0 | |
parent | Rewrite intlock/intunlock not to pass around interrupt frame directly (diff) | |
download | wireguard-openbsd-a2267c5a410630e195ee505533afedb37f704d85.tar.xz wireguard-openbsd-a2267c5a410630e195ee505533afedb37f704d85.zip |
update to gcc 3.3.5
-rw-r--r-- | gnu/lib/libiberty/src/calloc.c | 3 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/copysign.c | 8 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/functions.texi | 101 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/maint-tool | 8 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/memchr.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/memcpy.c | 9 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/memmove.c | 4 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/memset.c | 8 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/physmem.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strcasecmp.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strdup.c | 21 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strncasecmp.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strncmp.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strstr.c | 4 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/testsuite/test-demangle.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/vfprintf.c | 3 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/vprintf.c | 4 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/xatexit.c | 2 |
18 files changed, 58 insertions, 129 deletions
diff --git a/gnu/lib/libiberty/src/calloc.c b/gnu/lib/libiberty/src/calloc.c index 50736823077..b342f6c1b3b 100644 --- a/gnu/lib/libiberty/src/calloc.c +++ b/gnu/lib/libiberty/src/calloc.c @@ -13,6 +13,8 @@ Uses @code{malloc} to allocate storage for @var{nelem} objects of */ #include "ansidecl.h" +#include "libiberty.h" + #ifdef ANSI_PROTOTYPES #include <stddef.h> #else @@ -21,7 +23,6 @@ Uses @code{malloc} to allocate storage for @var{nelem} objects of /* For systems with larger pointers than ints, this must be declared. */ PTR malloc PARAMS ((size_t)); -void bzero PARAMS ((PTR, size_t)); PTR calloc (nelem, elsize) diff --git a/gnu/lib/libiberty/src/copysign.c b/gnu/lib/libiberty/src/copysign.c index d288be239eb..5c48a5422eb 100644 --- a/gnu/lib/libiberty/src/copysign.c +++ b/gnu/lib/libiberty/src/copysign.c @@ -131,9 +131,7 @@ typedef union #if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN) -double -copysign (x, y) - double x, y; +double DEFUN(copysign, (x, y), double x AND double y) { __ieee_double_shape_type a,b; b.value = y; @@ -144,9 +142,7 @@ copysign (x, y) #else -double -copysign (x, y) - double x, y; +double DEFUN(copysign, (x, y), double x AND double y) { if ((x < 0 && y > 0) || (x > 0 && y < 0)) return -x; diff --git a/gnu/lib/libiberty/src/functions.texi b/gnu/lib/libiberty/src/functions.texi index 4261d864676..841151ce5a2 100644 --- a/gnu/lib/libiberty/src/functions.texi +++ b/gnu/lib/libiberty/src/functions.texi @@ -392,6 +392,22 @@ and a path ending in @code{/} returns the empty string after it. @end deftypefn +@c make-relative-prefix.c:24 +@deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix}) + +Given three strings @var{progname}, @var{bin_prefix}, @var{prefix}, return a string +that gets to @var{prefix} starting with the directory portion of @var{progname} and +a relative pathname of the difference between @var{bin_prefix} and @var{prefix}. + +For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta}, @var{prefix} +is @code{/alpha/beta/gamma/omega/}, and @var{progname} is @code{/red/green/blue/gcc}, +then this function will return @code{/red/green/blue/../../omega/}. + +The return value is normally allocated via @code{malloc}. If no relative prefix +can be found, return @code{NULL}. + +@end deftypefn + @c lrealpath.c:25 @deftypefn Replacement {const char*} lrealpath (const char *@var{name}) @@ -476,14 +492,6 @@ Copies @var{count} bytes from memory area @var{from} to memory area @end deftypefn -@c mempcpy.c:23 -@deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, size_t @var{length}) - -Copies @var{length} bytes from memory region @var{in} to region -@var{out}. Returns a pointer to @var{out} + @var{length}. - -@end deftypefn - @c memset.c:6 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count}) @@ -510,7 +518,7 @@ reading and writing. @end deftypefn -@c pexecute.txh:1 +@c pexecute.c:67 @deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) Executes a program. @@ -525,15 +533,14 @@ use if needed. This is currently only needed for MS-DOS ports that don't use @code{go32} (do any still exist?). Ports that don't need it can pass @code{NULL}. -(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} -should be searched (??? It's not clear that GCC passes this flag -correctly). (@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the -first process in chain. (@code{@var{flags} & PEXECUTE_FIRST}) is -nonzero for the last process in chain. The first/last flags could be -simplified to only mark the last of a chain of processes but that -requires the caller to always mark the last one (and not give up -early if some error occurs). It's more robust to require the caller -to mark both ends of the chain. +(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} should be searched +(??? It's not clear that GCC passes this flag correctly). (@code{@var{flags} & +PEXECUTE_FIRST}) is nonzero for the first process in chain. +(@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the last process +in chain. The first/last flags could be simplified to only mark the +last of a chain of processes but that requires the caller to always +mark the last one (and not give up early if some error occurs). +It's more robust to require the caller to mark both ends of the chain. The result is the pid on systems like Unix where we @code{fork}/@code{exec} and on systems like WIN32 and OS/2 where we @@ -568,23 +575,21 @@ name is unset/removed. @end deftypefn -@c pexecute.txh:39 +@c pexecute.c:104 @deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags}) Waits for a program started by @code{pexecute} to finish. @var{pid} is the process id of the task to wait for. @var{status} is -the `status' argument to wait. @var{flags} is currently unused -(allows future enhancement without breaking upward compatibility). -Pass 0 for now. +the `status' argument to wait. @var{flags} is currently unused (allows +future enhancement without breaking upward compatibility). Pass 0 for now. The result is the pid of the child reaped, or -1 for failure (@code{errno} says why). -On systems that don't support waiting for a particular child, -@var{pid} is ignored. On systems like MS-DOS that don't really -multitask @code{pwait} is just a mechanism to provide a consistent -interface for the caller. +On systems that don't support waiting for a particular child, @var{pid} is +ignored. On systems like MS-DOS that don't really multitask @code{pwait} +is just a mechanism to provide a consistent interface for the caller. @end deftypefn @@ -673,19 +678,6 @@ be the value @code{1}). @end deftypefn -@c snprintf.c:28 -@deftypefn Supplemental int snprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, ...) - -This function is similar to sprintf, but it will print at most @var{n} -characters. On error the return value is -1, otherwise it returns the -number of characters that would have been printed had @var{n} been -sufficiently large, regardless of the actual value of @var{n}. Note -some pre-C99 system libraries do not implement this correctly so users -cannot generally rely on the return value if the system version of -this function is used. - -@end deftypefn - @c spaces.c:22 @deftypefn Extension char* spaces (int @var{count}) @@ -695,24 +687,6 @@ valid until at least the next call. @end deftypefn -@c stpcpy.c:23 -@deftypefn Supplemental char* stpcpy (char *@var{dst}, const char *@var{src}) - -Copies the string @var{src} into @var{dst}. Returns a pointer to -@var{dst} + strlen(@var{src}). - -@end deftypefn - -@c stpncpy.c:23 -@deftypefn Supplemental char* stpncpy (char *@var{dst}, const char *@var{src}, size_t @var{len}) - -Copies the string @var{src} into @var{dst}, copying exactly @var{len} -and padding with zeros if necessary. If @var{len} < strlen(@var{src}) -then return @var{dst} + @var{len}, otherwise returns @var{dst} + -strlen(@var{src}). - -@end deftypefn - @c strcasecmp.c:15 @deftypefn Supplemental int strcasecmp (const char *@var{s1}, const char *@var{s2}) @@ -942,19 +916,6 @@ nonstandard but common function @code{_doprnt}. @end deftypefn -@c vsnprintf.c:28 -@deftypefn Supplemental int vsnprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, va_list @var{ap}) - -This function is similar to vsprintf, but it will print at most -@var{n} characters. On error the return value is -1, otherwise it -returns the number of characters that would have been printed had -@var{n} been sufficiently large, regardless of the actual value of -@var{n}. Note some pre-C99 system libraries do not implement this -correctly so users cannot generally rely on the return value if the -system version of this function is used. - -@end deftypefn - @c waitpid.c:3 @deftypefn Supplemental int waitpid (int @var{pid}, int *@var{status}, int) diff --git a/gnu/lib/libiberty/src/maint-tool b/gnu/lib/libiberty/src/maint-tool index 6b9bf7f2cdb..ceeb48dbf39 100644 --- a/gnu/lib/libiberty/src/maint-tool +++ b/gnu/lib/libiberty/src/maint-tool @@ -223,14 +223,6 @@ sub deps { } $mine{'config.h'} = "config.h"; - opendir(INC, $srcdir); - while ($f = readdir INC) { - next unless $f =~ /\.h$/; - $mine{$f} = "\$(srcdir)/$f"; - $deps{$f} = join(' ', &deps_for("$srcdir/$f")); - } - $mine{'config.h'} = "config.h"; - open(IN, "$srcdir/Makefile.in"); open(OUT, ">$srcdir/Makefile.tmp"); while (<IN>) { diff --git a/gnu/lib/libiberty/src/memchr.c b/gnu/lib/libiberty/src/memchr.c index 3948125963d..f94bea018f5 100644 --- a/gnu/lib/libiberty/src/memchr.c +++ b/gnu/lib/libiberty/src/memchr.c @@ -15,7 +15,7 @@ returned. */ #include <ansidecl.h> -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stddef.h> #else #define size_t unsigned long diff --git a/gnu/lib/libiberty/src/memcpy.c b/gnu/lib/libiberty/src/memcpy.c index 5eece7a0a00..0f2bac7ac2c 100644 --- a/gnu/lib/libiberty/src/memcpy.c +++ b/gnu/lib/libiberty/src/memcpy.c @@ -13,19 +13,14 @@ Copies @var{length} bytes from memory region @var{in} to region */ #include <ansidecl.h> -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stddef.h> #else #define size_t unsigned long #endif -void bcopy PARAMS((const void*, void*, size_t)); - PTR -memcpy (out, in, length) - PTR out; - const PTR in; - size_t length; +DEFUN(memcpy, (out, in, length), PTR out AND const PTR in AND size_t length) { bcopy(in, out, length); return out; diff --git a/gnu/lib/libiberty/src/memmove.c b/gnu/lib/libiberty/src/memmove.c index 00ac053401b..3ec73208ca7 100644 --- a/gnu/lib/libiberty/src/memmove.c +++ b/gnu/lib/libiberty/src/memmove.c @@ -13,14 +13,12 @@ Copies @var{count} bytes from memory area @var{from} to memory area */ #include <ansidecl.h> -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stddef.h> #else #define size_t unsigned long #endif -void bcopy PARAMS ((const void*, void*, size_t)); - PTR memmove (s1, s2, n) PTR s1; diff --git a/gnu/lib/libiberty/src/memset.c b/gnu/lib/libiberty/src/memset.c index 5119f858ad0..489ca174815 100644 --- a/gnu/lib/libiberty/src/memset.c +++ b/gnu/lib/libiberty/src/memset.c @@ -13,17 +13,15 @@ Sets the first @var{count} bytes of @var{s} to the constant byte */ #include <ansidecl.h> -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stddef.h> #else #define size_t unsigned long #endif PTR -memset (dest, val, len) - PTR dest; - register int val; - register size_t len; +DEFUN(memset, (dest, val, len), + PTR dest AND register int val AND register size_t len) { register unsigned char *ptr = (unsigned char*)dest; while (len-- > 0) diff --git a/gnu/lib/libiberty/src/physmem.c b/gnu/lib/libiberty/src/physmem.c index 9185c1224e8..f64e07c74d4 100644 --- a/gnu/lib/libiberty/src/physmem.c +++ b/gnu/lib/libiberty/src/physmem.c @@ -145,7 +145,7 @@ physmem_total () #endif #if HAVE__SYSTEM_CONFIGURATION - /* This works on AIX. */ + /* This works on AIX 4.3.3+. */ return _system_configuration.physmem; #endif diff --git a/gnu/lib/libiberty/src/strcasecmp.c b/gnu/lib/libiberty/src/strcasecmp.c index d2608dc0b87..4bfe6507712 100644 --- a/gnu/lib/libiberty/src/strcasecmp.c +++ b/gnu/lib/libiberty/src/strcasecmp.c @@ -25,7 +25,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; #endif /* LIBC_SCCS and not lint */ #include <ansidecl.h> -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stddef.h> #else #define size_t unsigned long diff --git a/gnu/lib/libiberty/src/strdup.c b/gnu/lib/libiberty/src/strdup.c index 071a4a401af..49233ba7aac 100644 --- a/gnu/lib/libiberty/src/strdup.c +++ b/gnu/lib/libiberty/src/strdup.c @@ -9,24 +9,13 @@ Returns a pointer to a copy of @var{s} in memory obtained from */ -#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)); - char * strdup(s) char *s; { - size_t len = strlen (s) + 1; - char *result = (char*) malloc (len); - if (result == (char*) 0) - return (char*) 0; - return (char*) memcpy (result, s, len); + char *result = (char*)malloc(strlen(s) + 1); + if (result == (char*)0) + return (char*)0; + strcpy(result, s); + return result; } diff --git a/gnu/lib/libiberty/src/strncasecmp.c b/gnu/lib/libiberty/src/strncasecmp.c index 10feee82198..77cb4217701 100644 --- a/gnu/lib/libiberty/src/strncasecmp.c +++ b/gnu/lib/libiberty/src/strncasecmp.c @@ -25,7 +25,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; #endif /* LIBC_SCCS and not lint */ #include <ansidecl.h> -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stddef.h> #else #define size_t unsigned long diff --git a/gnu/lib/libiberty/src/strncmp.c b/gnu/lib/libiberty/src/strncmp.c index ad87e1fde8b..819cea6cb58 100644 --- a/gnu/lib/libiberty/src/strncmp.c +++ b/gnu/lib/libiberty/src/strncmp.c @@ -13,7 +13,7 @@ Compares the first @var{n} bytes of two strings, returning a value as */ #include <ansidecl.h> -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stddef.h> #else #define size_t unsigned long diff --git a/gnu/lib/libiberty/src/strstr.c b/gnu/lib/libiberty/src/strstr.c index a059c7f5dcb..470e04b1a76 100644 --- a/gnu/lib/libiberty/src/strstr.c +++ b/gnu/lib/libiberty/src/strstr.c @@ -27,8 +27,8 @@ strstr (s1, s2) register char *p = s1; extern char *strchr (); extern int strncmp (); -#if __GNUC__ >= 2 - extern __SIZE_TYPE__ strlen (const char *); +#if __GNUC__==2 + extern __SIZE_TYPE__ strlen (); #endif register int len = strlen (s2); diff --git a/gnu/lib/libiberty/src/testsuite/test-demangle.c b/gnu/lib/libiberty/src/testsuite/test-demangle.c index 82f263e88af..6e5d0b4b973 100644 --- a/gnu/lib/libiberty/src/testsuite/test-demangle.c +++ b/gnu/lib/libiberty/src/testsuite/test-demangle.c @@ -65,7 +65,7 @@ getline(buf) line: copy this line into the buffer and return. */ while (c != EOF && c != '\n') { - if (count >= alloc) + if (count + 1 >= alloc) { alloc *= 2; data = xrealloc (data, alloc); diff --git a/gnu/lib/libiberty/src/vfprintf.c b/gnu/lib/libiberty/src/vfprintf.c index 18f09d47d32..db7b2ff4c19 100644 --- a/gnu/lib/libiberty/src/vfprintf.c +++ b/gnu/lib/libiberty/src/vfprintf.c @@ -3,8 +3,7 @@ Copyright (C) 1998 Free Software Foundation, Inc. */ -#include "ansidecl.h" -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stdarg.h> #else #include <varargs.h> diff --git a/gnu/lib/libiberty/src/vprintf.c b/gnu/lib/libiberty/src/vprintf.c index 9487896ea5e..c57c3e4f318 100644 --- a/gnu/lib/libiberty/src/vprintf.c +++ b/gnu/lib/libiberty/src/vprintf.c @@ -15,13 +15,13 @@ nonstandard but common function @code{_doprnt}. */ -#include <ansidecl.h> -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stdarg.h> #else #include <varargs.h> #endif #include <stdio.h> +#include <ansidecl.h> #undef vprintf int vprintf (format, ap) diff --git a/gnu/lib/libiberty/src/xatexit.c b/gnu/lib/libiberty/src/xatexit.c index 075599c61f9..abf340737e4 100644 --- a/gnu/lib/libiberty/src/xatexit.c +++ b/gnu/lib/libiberty/src/xatexit.c @@ -27,7 +27,7 @@ failure. If you use @code{xatexit} to register functions, you must use #include <stdio.h> -#ifdef ANSI_PROTOTYPES +#ifdef __STDC__ #include <stddef.h> #else #define size_t unsigned long |