aboutsummaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /string
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'string')
-rw-r--r--string/Makefile10
-rw-r--r--string/_strerror.c68
-rw-r--r--string/argz-replace.c5
-rw-r--r--string/bcopy.c29
-rw-r--r--string/bits/string3.h87
-rw-r--r--string/bug-envz1.c76
-rw-r--r--string/bug-strtok1.c45
-rw-r--r--string/bzero.c83
-rw-r--r--string/envz.c4
-rw-r--r--string/ffs.c55
-rw-r--r--string/ffsll.c42
-rw-r--r--string/memccpy.c46
-rw-r--r--string/memchr.c215
-rw-r--r--string/memcmp.c381
-rw-r--r--string/memcpy.c65
-rw-r--r--string/memmem.c58
-rw-r--r--string/memmove.c112
-rw-r--r--string/mempcpy.c69
-rw-r--r--string/memrchr.c210
-rw-r--r--string/memset.c91
-rw-r--r--string/rawmemchr.c189
-rw-r--r--string/stpcpy.c55
-rw-r--r--string/stpncpy.c100
-rw-r--r--string/strcasecmp.c74
-rw-r--r--string/strcasecmp_l.c23
-rw-r--r--string/strcasestr.c142
-rw-r--r--string/strcat.c52
-rw-r--r--string/strchr.c191
-rw-r--r--string/strchrnul.c170
-rw-r--r--string/strcmp.c47
-rw-r--r--string/strcoll.c6
-rw-r--r--string/strcpy.c50
-rw-r--r--string/strcspn.c51
-rw-r--r--string/string-inlines.c35
-rw-r--r--string/strlen.c153
-rw-r--r--string/strncase.c76
-rw-r--r--string/strncase_l.c25
-rw-r--r--string/strncat.c85
-rw-r--r--string/strncmp.c73
-rw-r--r--string/strncpy.c87
-rw-r--r--string/strnlen.c161
-rw-r--r--string/strpbrk.c46
-rw-r--r--string/strrchr.c50
-rw-r--r--string/strsep.c70
-rw-r--r--string/strsignal.c6
-rw-r--r--string/strspn.c47
-rw-r--r--string/strstr.c123
-rw-r--r--string/strtok.c66
-rw-r--r--string/strtok_r.c79
-rw-r--r--string/strxfrm_l.c17
-rw-r--r--string/test-memccpy.c6
-rw-r--r--string/test-memchr.c13
-rw-r--r--string/test-memcmp.c8
-rw-r--r--string/test-memcpy.c10
-rw-r--r--string/test-memmove.c10
-rw-r--r--string/test-memset.c16
-rw-r--r--string/test-strcat.c9
-rw-r--r--string/test-strchr.c14
-rw-r--r--string/test-strcmp.c8
-rw-r--r--string/test-strcpy.c9
-rw-r--r--string/test-strlen.c9
-rw-r--r--string/test-strncmp.c85
-rw-r--r--string/test-strncpy.c10
-rw-r--r--string/test-strpbrk.c19
-rw-r--r--string/test-strrchr.c16
-rw-r--r--string/test-strspn.c14
-rw-r--r--string/tester.c37
-rw-r--r--string/tst-strfry.c15
-rw-r--r--string/tst-strxfrm2.c83
-rw-r--r--string/wordcopy.c413
-rw-r--r--string/xpg-strerror.c57
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 *_