diff options
| author | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
| commit | a334319f6530564d22e775935d9c91663623a1b4 (patch) | |
| tree | b5877475619e4c938e98757d518bb1e9cbead751 /string | |
| parent | 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff) | |
| download | glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz glibc-a334319f6530564d22e775935d9c91663623a1b4.zip | |
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'string')
71 files changed, 143 insertions, 4818 deletions
diff --git a/string/Makefile b/string/Makefile index f087022b3c..66469f586e 100644 --- a/string/Makefile +++ b/string/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991-2002, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 1991-1999,2000,2001,2002 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -52,9 +52,8 @@ strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \ tests := tester inl-tester noinl-tester testcopy test-ffs \ tst-strlen stratcliff tst-svc tst-inlcall \ bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \ - tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \ - bug-strtok1 $(addprefix test-,$(strop-tests)) \ - bug-envz1 tst-strxfrm2 + tst-strtok tst-strxfrm bug-strcoll1 \ + $(addprefix test-,$(strop-tests)) distribute := memcopy.h pagecopy.h tst-svc.expect test-string.h @@ -64,14 +63,11 @@ tester-ENV = LANGUAGE=C inl-tester-ENV = LANGUAGE=C noinl-tester-ENV = LANGUAGE=C tst-strxfrm-ENV = LOCPATH=$(common-objpfx)localedata -tst-strxfrm2-ENV = LOCPATH=$(common-objpfx)localedata bug-strcoll1-ENV = LOCPATH=$(common-objpfx)localedata -CFLAGS-inl-tester.c = -fno-builtin CFLAGS-noinl-tester.c = -fno-builtin CFLAGS-tst-strlen.c = -fno-builtin CFLAGS-stratcliff.c = -fno-builtin CFLAGS-test-ffs.c = -fno-builtin -CFLAGS-tst-inlcall.c = -fno-builtin ifeq ($(cross-compiling),no) tests: $(objpfx)tst-svc.out diff --git a/string/_strerror.c b/string/_strerror.c deleted file mode 100644 index cb5d9e3609..0000000000 --- a/string/_strerror.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (C) 1991,93,95,96,97,98,2000,2002,2006 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <libintl.h> -#include <stdio.h> -#include <string.h> -#include <sys/param.h> -#include <stdio-common/_itoa.h> - -/* It is critical here that we always use the `dcgettext' function for - the message translation. Since <libintl.h> only defines the macro - `dgettext' to use `dcgettext' for optimizing programs this is not - always guaranteed. */ -#ifndef dgettext -# include <locale.h> /* We need LC_MESSAGES. */ -# define dgettext(domainname, msgid) dcgettext (domainname, msgid, LC_MESSAGES) -#endif - -/* Return a string describing the errno code in ERRNUM. */ -char * -__strerror_r (int errnum, char *buf, size_t buflen) -{ - if (__builtin_expect (errnum < 0 || errnum >= _sys_nerr_internal - || _sys_errlist_internal[errnum] == NULL, 0)) - { - /* Buffer we use to print the number in. For a maximum size for - `int' of 8 bytes we never need more than 20 digits. */ - char numbuf[21]; - const char *unk = _("Unknown error "); - const size_t unklen = strlen (unk); - char *p, *q; - - numbuf[20] = '\0'; - p = _itoa_word (errnum, &numbuf[20], 10, 0); - - /* Now construct the result while taking care for the destination - buffer size. */ - q = __mempcpy (buf, unk, MIN (unklen, buflen)); - if (unklen < buflen) - memcpy (q, p, MIN ((size_t) (&numbuf[21] - p), buflen - unklen)); - - /* Terminate the string in any case. */ - if (buflen > 0) - buf[buflen - 1] = '\0'; - - return buf; - } - - return (char *) _(_sys_errlist_internal[errnum]); -} -weak_alias (__strerror_r, strerror_r) -libc_hidden_def (__strerror_r) diff --git a/string/argz-replace.c b/string/argz-replace.c index 1b0eb15fd7..3c4062488e 100644 --- a/string/argz-replace.c +++ b/string/argz-replace.c @@ -1,5 +1,5 @@ /* String replacement in an argz vector - Copyright (C) 1997, 1998, 2006 Free Software Foundation, Inc. + Copyright (C) 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader <miles@gnu.ai.mit.edu> @@ -121,7 +121,8 @@ __argz_replace (char **argz, size_t *argz_len, const char *str, const char *with if (! delayed_copy) /* We never found any instances of str. */ { - free (src); + if (src) + free (src); *argz = dst; *argz_len = dst_len; } diff --git a/string/bcopy.c b/string/bcopy.c deleted file mode 100644 index 3f16b884ac..0000000000 --- a/string/bcopy.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <string.h> - -#define memmove bcopy -#define rettype void -#define RETURN(s) return -#define a1 src -#define a1const const -#define a2 dest -#define a2const - -#include <memmove.c> diff --git a/string/bits/string3.h b/string/bits/string3.h index 041ac11259..87cbe35bb1 100644 --- a/string/bits/string3.h +++ b/string/bits/string3.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -44,9 +44,10 @@ ((__bos0 (dest) != (size_t) -1) \ ? __builtin___memcpy_chk (dest, src, len, __bos0 (dest)) \ : __memcpy_ichk (dest, src, len)) -static __always_inline void * -__NTH (__memcpy_ichk (void *_ |
