1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-06-05 00:22:17 +03:00

Remove all traces of reg_char.

* sysdeps/generic/memcopy.h (reg_char): Delete.
	* debug/strcat_chk.c: Use char, not reg_char.
	* debug/strcpy_chk.c: Likewise.
	* debug/strncat_chk.c: Likewise.
	* debug/strncpy_chk.c: Likewise.
	* string/memchr.c: Likewise.
	* string/memrchr.c: Likewise.
	* string/rawmemchr.c: Likewise.
	* string/strcat.c: Likewise.
	* string/strchr.c: Likewise.
	* string/strchrnul.c: Likewise.
	* string/strcmp.c: Likewise.
	* string/strcpy.c: Likewise.
	* string/strncat.c: Likewise.
	* string/strncmp.c: Likewise.
	* string/strncpy.c: Likewise.
This commit is contained in:
David S. Miller 2012-04-18 16:19:10 -07:00
parent 8ff41c4601
commit 50f81fd74b
17 changed files with 35 additions and 27 deletions

View File

@ -1,3 +1,22 @@
2012-04-18 David S. Miller <davem@davemloft.net>
* sysdeps/generic/memcopy.h (reg_char): Delete.
* debug/strcat_chk.c: Use char, not reg_char.
* debug/strcpy_chk.c: Likewise.
* debug/strncat_chk.c: Likewise.
* debug/strncpy_chk.c: Likewise.
* string/memchr.c: Likewise.
* string/memrchr.c: Likewise.
* string/rawmemchr.c: Likewise.
* string/strcat.c: Likewise.
* string/strchr.c: Likewise.
* string/strchrnul.c: Likewise.
* string/strcmp.c: Likewise.
* string/strcpy.c: Likewise.
* string/strncat.c: Likewise.
* string/strncmp.c: Likewise.
* string/strncpy.c: Likewise.
2012-04-18 Will Schmidt <will_schmidt@vnet.ibm.com> 2012-04-18 Will Schmidt <will_schmidt@vnet.ibm.com>
* sysdeps/powerpc/memmove.c: New file based on string/memmove.c where * sysdeps/powerpc/memmove.c: New file based on string/memmove.c where

View File

@ -28,7 +28,7 @@ __strcat_chk (dest, src, destlen)
{ {
char *s1 = dest; char *s1 = dest;
const char *s2 = src; const char *s2 = src;
reg_char c; char c;
/* Find the end of the string. */ /* Find the end of the string. */
do do

View File

@ -28,7 +28,7 @@ __strcpy_chk (dest, src, destlen)
const char *src; const char *src;
size_t destlen; size_t destlen;
{ {
reg_char c; char c;
char *s = (char *) src; char *s = (char *) src;
const ptrdiff_t off = dest - s; const ptrdiff_t off = dest - s;

View File

@ -27,7 +27,7 @@ __strncat_chk (s1, s2, n, s1len)
size_t n; size_t n;
size_t s1len; size_t s1len;
{ {
reg_char c; char c;
char *s = s1; char *s = s1;
/* Find the end of S1. */ /* Find the end of S1. */

View File

@ -26,7 +26,7 @@ __strncpy_chk (s1, s2, n, s1len)
size_t n; size_t n;
size_t s1len; size_t s1len;
{ {
reg_char c; char c;
char *s = s1; char *s = s1;
if (__builtin_expect (s1len < n, 0)) if (__builtin_expect (s1len < n, 0))

View File

@ -30,8 +30,6 @@
#if defined _LIBC #if defined _LIBC
# include <string.h> # include <string.h>
# include <memcopy.h> # include <memcopy.h>
#else
# define reg_char char
#endif #endif
#if HAVE_STDLIB_H || defined _LIBC #if HAVE_STDLIB_H || defined _LIBC
@ -68,7 +66,7 @@ __memchr (s, c_in, n)
const unsigned char *char_ptr; const unsigned char *char_ptr;
const unsigned long int *longword_ptr; const unsigned long int *longword_ptr;
unsigned long int longword, magic_bits, charmask; unsigned long int longword, magic_bits, charmask;
unsigned reg_char c; unsigned char c;
c = (unsigned char) c_in; c = (unsigned char) c_in;

View File

@ -33,8 +33,6 @@
#if defined _LIBC #if defined _LIBC
# include <string.h> # include <string.h>
# include <memcopy.h> # include <memcopy.h>
#else
# define reg_char char
#endif #endif
#if defined HAVE_LIMITS_H || defined _LIBC #if defined HAVE_LIMITS_H || defined _LIBC
@ -71,7 +69,7 @@ MEMRCHR
const unsigned char *char_ptr; const unsigned char *char_ptr;
const unsigned long int *longword_ptr; const unsigned long int *longword_ptr;
unsigned long int longword, magic_bits, charmask; unsigned long int longword, magic_bits, charmask;
unsigned reg_char c; unsigned char c;
c = (unsigned char) c_in; c = (unsigned char) c_in;

View File

@ -31,8 +31,6 @@
# include <string.h> # include <string.h>
# include <memcopy.h> # include <memcopy.h>
# include <stdlib.h> # include <stdlib.h>
#else
# define reg_char char
#endif #endif
#if defined (HAVE_LIMITS_H) || defined (_LIBC) #if defined (HAVE_LIMITS_H) || defined (_LIBC)
@ -59,7 +57,7 @@ __rawmemchr (s, c_in)
const unsigned char *char_ptr; const unsigned char *char_ptr;
const unsigned long int *longword_ptr; const unsigned long int *longword_ptr;
unsigned long int longword, magic_bits, charmask; unsigned long int longword, magic_bits, charmask;
unsigned reg_char c; unsigned char c;
c = (unsigned char) c_in; c = (unsigned char) c_in;

View File

@ -28,7 +28,7 @@ strcat (dest, src)
{ {
char *s1 = dest; char *s1 = dest;
const char *s2 = src; const char *s2 = src;
reg_char c; char c;
/* Find the end of the string. */ /* Find the end of the string. */
do do

View File

@ -36,7 +36,7 @@ strchr (s, c_in)
const unsigned char *char_ptr; const unsigned char *char_ptr;
const unsigned long int *longword_ptr; const unsigned long int *longword_ptr;
unsigned long int longword, magic_bits, charmask; unsigned long int longword, magic_bits, charmask;
unsigned reg_char c; unsigned char c;
c = (unsigned char) c_in; c = (unsigned char) c_in;

View File

@ -36,7 +36,7 @@ __strchrnul (s, c_in)
const unsigned char *char_ptr; const unsigned char *char_ptr;
const unsigned long int *longword_ptr; const unsigned long int *longword_ptr;
unsigned long int longword, magic_bits, charmask; unsigned long int longword, magic_bits, charmask;
unsigned reg_char c; unsigned char c;
c = (unsigned char) c_in; c = (unsigned char) c_in;

View File

@ -30,7 +30,7 @@ strcmp (p1, p2)
{ {
register const unsigned char *s1 = (const unsigned char *) p1; register const unsigned char *s1 = (const unsigned char *) p1;
register const unsigned char *s2 = (const unsigned char *) p2; register const unsigned char *s2 = (const unsigned char *) p2;
unsigned reg_char c1, c2; unsigned char c1, c2;
do do
{ {

View File

@ -28,7 +28,7 @@ strcpy (dest, src)
char *dest; char *dest;
const char *src; const char *src;
{ {
reg_char c; char c;
char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src); char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src);
const ptrdiff_t off = CHECK_BOUNDS_LOW (dest) - s - 1; const ptrdiff_t off = CHECK_BOUNDS_LOW (dest) - s - 1;
size_t n; size_t n;

View File

@ -19,8 +19,6 @@
#ifdef _LIBC #ifdef _LIBC
# include <memcopy.h> # include <memcopy.h>
#else
typedef char reg_char;
#endif #endif
#ifndef STRNCAT #ifndef STRNCAT
@ -31,7 +29,7 @@ typedef char reg_char;
char * char *
STRNCAT (char *s1, const char *s2, size_t n) STRNCAT (char *s1, const char *s2, size_t n)
{ {
reg_char c; char c;
char *s = s1; char *s = s1;
/* Find the end of S1. */ /* Find the end of S1. */

View File

@ -31,8 +31,8 @@
int int
STRNCMP (const char *s1, const char *s2, size_t n) STRNCMP (const char *s1, const char *s2, size_t n)
{ {
unsigned reg_char c1 = '\0'; unsigned char c1 = '\0';
unsigned reg_char c2 = '\0'; unsigned char c2 = '\0';
if (n >= 4) if (n >= 4)
{ {

View File

@ -27,7 +27,7 @@
char * char *
STRNCPY (char *s1, const char *s2, size_t n) STRNCPY (char *s1, const char *s2, size_t n)
{ {
reg_char c; char c;
char *s = s1; char *s = s1;
--s1; --s1;

View File

@ -61,9 +61,6 @@
/* Type to use for unaligned operations. */ /* Type to use for unaligned operations. */
typedef unsigned char byte; typedef unsigned char byte;
/* Optimal type for storing bytes in registers. */
#define reg_char char
#if __BYTE_ORDER == __LITTLE_ENDIAN #if __BYTE_ORDER == __LITTLE_ENDIAN
#define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2))) #define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2)))
#endif #endif