summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libiberty/src
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2004-12-24 22:03:56 +0000
committerespie <espie@openbsd.org>2004-12-24 22:03:56 +0000
commit25e200da7abb1e899c6b29276c1d104f90573a1f (patch)
tree158c293047a20dae1f7ce43eb2d60d9c64d5581a /gnu/lib/libiberty/src
parentupdate to gcc 3.3.5 (diff)
downloadwireguard-openbsd-25e200da7abb1e899c6b29276c1d104f90573a1f.tar.xz
wireguard-openbsd-25e200da7abb1e899c6b29276c1d104f90573a1f.zip
fix up conflicts
Diffstat (limited to 'gnu/lib/libiberty/src')
-rw-r--r--gnu/lib/libiberty/src/ChangeLog12
-rw-r--r--gnu/lib/libiberty/src/calloc.c3
-rw-r--r--gnu/lib/libiberty/src/copysign.c8
-rw-r--r--gnu/lib/libiberty/src/functions.texi101
-rw-r--r--gnu/lib/libiberty/src/maint-tool8
-rw-r--r--gnu/lib/libiberty/src/memchr.c2
-rw-r--r--gnu/lib/libiberty/src/memcpy.c9
-rw-r--r--gnu/lib/libiberty/src/memmove.c4
-rw-r--r--gnu/lib/libiberty/src/memset.c8
-rw-r--r--gnu/lib/libiberty/src/physmem.c2
-rw-r--r--gnu/lib/libiberty/src/strcasecmp.c2
-rw-r--r--gnu/lib/libiberty/src/strdup.c21
-rw-r--r--gnu/lib/libiberty/src/strncasecmp.c2
-rw-r--r--gnu/lib/libiberty/src/strncmp.c2
-rw-r--r--gnu/lib/libiberty/src/strstr.c4
-rw-r--r--gnu/lib/libiberty/src/testsuite/test-demangle.c2
-rw-r--r--gnu/lib/libiberty/src/vfprintf.c3
-rw-r--r--gnu/lib/libiberty/src/vprintf.c4
-rw-r--r--gnu/lib/libiberty/src/xatexit.c2
19 files changed, 141 insertions, 58 deletions
diff --git a/gnu/lib/libiberty/src/ChangeLog b/gnu/lib/libiberty/src/ChangeLog
index 0539a5aa1ca..607bb148cc8 100644
--- a/gnu/lib/libiberty/src/ChangeLog
+++ b/gnu/lib/libiberty/src/ChangeLog
@@ -1,3 +1,15 @@
+2004-09-30 Release Manager
+
+ * GCC 3.3.5 Released.
+
+2004-05-31 Release Manager
+
+ * GCC 3.3.4 Released.
+
+2004-02-14 Release Manager
+
+ * GCC 3.3.3 Released.
+
2003-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* vsnprintf.c (vsnprintf): Don't pad string with extra nulls.
diff --git a/gnu/lib/libiberty/src/calloc.c b/gnu/lib/libiberty/src/calloc.c
index b342f6c1b3b..50736823077 100644
--- a/gnu/lib/libiberty/src/calloc.c
+++ b/gnu/lib/libiberty/src/calloc.c
@@ -13,8 +13,6 @@ Uses @code{malloc} to allocate storage for @var{nelem} objects of
*/
#include "ansidecl.h"
-#include "libiberty.h"
-
#ifdef ANSI_PROTOTYPES
#include <stddef.h>
#else
@@ -23,6 +21,7 @@ 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 5c48a5422eb..d288be239eb 100644
--- a/gnu/lib/libiberty/src/copysign.c
+++ b/gnu/lib/libiberty/src/copysign.c
@@ -131,7 +131,9 @@ typedef union
#if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN)
-double DEFUN(copysign, (x, y), double x AND double y)
+double
+copysign (x, y)
+ double x, y;
{
__ieee_double_shape_type a,b;
b.value = y;
@@ -142,7 +144,9 @@ double DEFUN(copysign, (x, y), double x AND double y)
#else
-double DEFUN(copysign, (x, y), double x AND double y)
+double
+copysign (x, y)
+ double x, 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 841151ce5a2..4261d864676 100644
--- a/gnu/lib/libiberty/src/functions.texi
+++ b/gnu/lib/libiberty/src/functions.texi
@@ -392,22 +392,6 @@ 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})
@@ -492,6 +476,14 @@ 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})
@@ -518,7 +510,7 @@ reading and writing.
@end deftypefn
-@c pexecute.c:67
+@c pexecute.txh:1
@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.
@@ -533,14 +525,15 @@ 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
@@ -575,21 +568,23 @@ name is unset/removed.
@end deftypefn
-@c pexecute.c:104
+@c pexecute.txh:39
@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
@@ -678,6 +673,19 @@ 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})
@@ -687,6 +695,24 @@ 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})
@@ -916,6 +942,19 @@ 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 ceeb48dbf39..6b9bf7f2cdb 100644
--- a/gnu/lib/libiberty/src/maint-tool
+++ b/gnu/lib/libiberty/src/maint-tool
@@ -223,6 +223,14 @@ 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 f94bea018f5..3948125963d 100644
--- a/gnu/lib/libiberty/src/memchr.c
+++ b/gnu/lib/libiberty/src/memchr.c
@@ -15,7 +15,7 @@ returned.
*/
#include <ansidecl.h>
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
#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 0f2bac7ac2c..5eece7a0a00 100644
--- a/gnu/lib/libiberty/src/memcpy.c
+++ b/gnu/lib/libiberty/src/memcpy.c
@@ -13,14 +13,19 @@ Copies @var{length} bytes from memory region @var{in} to region
*/
#include <ansidecl.h>
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
#include <stddef.h>
#else
#define size_t unsigned long
#endif
+void bcopy PARAMS((const void*, void*, size_t));
+
PTR
-DEFUN(memcpy, (out, in, length), PTR out AND const PTR in AND size_t length)
+memcpy (out, in, length)
+ PTR out;
+ const PTR in;
+ 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 3ec73208ca7..00ac053401b 100644
--- a/gnu/lib/libiberty/src/memmove.c
+++ b/gnu/lib/libiberty/src/memmove.c
@@ -13,12 +13,14 @@ Copies @var{count} bytes from memory area @var{from} to memory area
*/
#include <ansidecl.h>
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
#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 489ca174815..5119f858ad0 100644
--- a/gnu/lib/libiberty/src/memset.c
+++ b/gnu/lib/libiberty/src/memset.c
@@ -13,15 +13,17 @@ Sets the first @var{count} bytes of @var{s} to the constant byte
*/
#include <ansidecl.h>
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
#include <stddef.h>
#else
#define size_t unsigned long
#endif
PTR
-DEFUN(memset, (dest, val, len),
- PTR dest AND register int val AND register size_t len)
+memset (dest, val, len)
+ PTR dest;
+ register int val;
+ 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 f64e07c74d4..9185c1224e8 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 4.3.3+. */
+ /* This works on AIX. */
return _system_configuration.physmem;
#endif
diff --git a/gnu/lib/libiberty/src/strcasecmp.c b/gnu/lib/libiberty/src/strcasecmp.c
index 4bfe6507712..d2608dc0b87 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 __STDC__
+#ifdef ANSI_PROTOTYPES
#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 49233ba7aac..071a4a401af 100644
--- a/gnu/lib/libiberty/src/strdup.c
+++ b/gnu/lib/libiberty/src/strdup.c
@@ -9,13 +9,24 @@ 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;
{
- char *result = (char*)malloc(strlen(s) + 1);
- if (result == (char*)0)
- return (char*)0;
- strcpy(result, s);
- return result;
+ size_t len = strlen (s) + 1;
+ char *result = (char*) malloc (len);
+ if (result == (char*) 0)
+ return (char*) 0;
+ return (char*) memcpy (result, s, len);
}
diff --git a/gnu/lib/libiberty/src/strncasecmp.c b/gnu/lib/libiberty/src/strncasecmp.c
index 77cb4217701..10feee82198 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 __STDC__
+#ifdef ANSI_PROTOTYPES
#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 819cea6cb58..ad87e1fde8b 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 __STDC__
+#ifdef ANSI_PROTOTYPES
#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 470e04b1a76..a059c7f5dcb 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 ();
+#if __GNUC__ >= 2
+ extern __SIZE_TYPE__ strlen (const char *);
#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 6e5d0b4b973..82f263e88af 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 + 1 >= alloc)
+ if (count >= alloc)
{
alloc *= 2;
data = xrealloc (data, alloc);
diff --git a/gnu/lib/libiberty/src/vfprintf.c b/gnu/lib/libiberty/src/vfprintf.c
index db7b2ff4c19..18f09d47d32 100644
--- a/gnu/lib/libiberty/src/vfprintf.c
+++ b/gnu/lib/libiberty/src/vfprintf.c
@@ -3,7 +3,8 @@
Copyright (C) 1998 Free Software Foundation, Inc.
*/
-#ifdef __STDC__
+#include "ansidecl.h"
+#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
diff --git a/gnu/lib/libiberty/src/vprintf.c b/gnu/lib/libiberty/src/vprintf.c
index c57c3e4f318..9487896ea5e 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}.
*/
-#ifdef __STDC__
+#include <ansidecl.h>
+#ifdef ANSI_PROTOTYPES
#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 abf340737e4..075599c61f9 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 __STDC__
+#ifdef ANSI_PROTOTYPES
#include <stddef.h>
#else
#define size_t unsigned long