mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-24 02:03:35 +08:00
Update.
2003-01-13 Ulrich Drepper <drepper@redhat.com> * string/tester.c (test_strcpy): Use the previously #if 0'ed code to test void* parameters. * sysdeps/i386/i486/bits/string.h (__STRING_SMALLL_GET16): Cast source pointer before dereferencing. (__STRING_SMALLL_GET32): Likewise. (__memset_gc): Add missing parenthesis around macro arguments. Patch by Denis Zaitsev<zzz@cd-club.ru>. * sysdeps/i386/i486/bits/string.h (__strspn_cg): Tell the compiler that %eax is modified. Reported by Denis Zaitsev<zzz@cd-club.ru>.
This commit is contained in:
parent
47805511c4
commit
642eb2a2ed
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
2003-01-13 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* string/tester.c (test_strcpy): Use the previously #if 0'ed code
|
||||||
|
to test void* parameters.
|
||||||
|
|
||||||
|
* sysdeps/i386/i486/bits/string.h (__STRING_SMALLL_GET16): Cast
|
||||||
|
source pointer before dereferencing.
|
||||||
|
(__STRING_SMALLL_GET32): Likewise.
|
||||||
|
(__memset_gc): Add missing parenthesis around macro arguments.
|
||||||
|
Patch by Denis Zaitsev<zzz@cd-club.ru>.
|
||||||
|
|
||||||
|
* sysdeps/i386/i486/bits/string.h (__strspn_cg): Tell the compiler
|
||||||
|
that %eax is modified. Reported by Denis Zaitsev<zzz@cd-club.ru>.
|
||||||
|
|
||||||
2003-01-14 Jakub Jelinek <jakub@redhat.com>
|
2003-01-14 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* sysdeps/unix/alpha/sysdep.h (INLINE_SYSCALL): Undefined before
|
* sysdeps/unix/alpha/sysdep.h (INLINE_SYSCALL): Undefined before
|
||||||
|
@ -174,13 +174,11 @@ test_strcpy (void)
|
|||||||
SIMPLE_COPY(strcpy, 15, "555555555555555", 56);
|
SIMPLE_COPY(strcpy, 15, "555555555555555", 56);
|
||||||
SIMPLE_COPY(strcpy, 16, "6666666666666666", 57);
|
SIMPLE_COPY(strcpy, 16, "6666666666666666", 57);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* Simple test using implicitly coerced `void *' arguments. */
|
/* Simple test using implicitly coerced `void *' arguments. */
|
||||||
const void *src = "frobozz";
|
const void *src = "frobozz";
|
||||||
void *dst = one;
|
void *dst = one;
|
||||||
check (strcpy (dst, src) == dst, 1);
|
check (strcpy (dst, src) == dst, 1);
|
||||||
equal (dst, "frobozz", 2);
|
equal (dst, "frobozz", 2);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -41,10 +41,13 @@
|
|||||||
|
|
||||||
/* The macros are used in some of the optimized implementations below. */
|
/* The macros are used in some of the optimized implementations below. */
|
||||||
#define __STRING_SMALL_GET16(src, idx) \
|
#define __STRING_SMALL_GET16(src, idx) \
|
||||||
(((src)[idx + 1] << 8) | (src)[idx])
|
((((__const unsigned char *) (src))[idx + 1] << 8) \
|
||||||
|
| ((__const unsigned char *) (src))[idx])
|
||||||
#define __STRING_SMALL_GET32(src, idx) \
|
#define __STRING_SMALL_GET32(src, idx) \
|
||||||
((((src)[idx + 3] << 8 | (src)[idx + 2]) << 8 \
|
(((((__const unsigned char *) (src))[idx + 3] << 8 \
|
||||||
| (src)[idx + 1]) << 8 | (src)[idx])
|
| ((__const unsigned char *) (src))[idx + 2]) << 8 \
|
||||||
|
| ((__const unsigned char *) (src))[idx + 1]) << 8 \
|
||||||
|
| ((__const unsigned char *) (src))[idx])
|
||||||
|
|
||||||
|
|
||||||
/* Copy N bytes of SRC to DEST. */
|
/* Copy N bytes of SRC to DEST. */
|
||||||
@ -230,7 +233,7 @@ memcmp (__const void *__s1, __const void *__s2, size_t __n)
|
|||||||
assignments using immediate operands. But this uses to much \
|
assignments using immediate operands. But this uses to much \
|
||||||
memory (7, instead of 4 bytes). So we force the value in a \
|
memory (7, instead of 4 bytes). So we force the value in a \
|
||||||
registers. */ \
|
registers. */ \
|
||||||
if (n == 3 || n >= 5) \
|
if ((n) == 3 || (n) >= 5) \
|
||||||
__asm__ __volatile__ ("" : "=r" (__c) : "0" (__c)); \
|
__asm__ __volatile__ ("" : "=r" (__c) : "0" (__c)); \
|
||||||
\
|
\
|
||||||
/* This `switch' statement will be removed at compile-time. */ \
|
/* This `switch' statement will be removed at compile-time. */ \
|
||||||
@ -1650,14 +1653,15 @@ __strspn_cg (__const char *__s, __const char __accept[], size_t __accept_len)
|
|||||||
"lodsb\n\t"
|
"lodsb\n\t"
|
||||||
"testb %%al,%%al\n\t"
|
"testb %%al,%%al\n\t"
|
||||||
"je 2f\n\t"
|
"je 2f\n\t"
|
||||||
"movl %1,%%edi\n\t"
|
"movl %5,%%edi\n\t"
|
||||||
"movl %6,%%ecx\n\t"
|
"movl %6,%%ecx\n\t"
|
||||||
"repne; scasb\n\t"
|
"repne; scasb\n\t"
|
||||||
"je 1b\n"
|
"je 1b\n"
|
||||||
"2:"
|
"2:"
|
||||||
: "=S" (__res), "=&d" (__d0), "=&c" (__d1), "=&D" (__d2)
|
: "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
|
||||||
: "0" (__s), "1" (__accept), "g" (__accept_len),
|
: "0" (__s), "g" (__accept), "g" (__accept_len),
|
||||||
/* Since we do not know how large the memory we access it, use a really large amount. */
|
/* Since we do not know how large the memory we access it, use a
|
||||||
|
really large amount. */
|
||||||
"m" ( *(struct { char __x[0xfffffff]; } *)__s),
|
"m" ( *(struct { char __x[0xfffffff]; } *)__s),
|
||||||
"m" ( *(struct { __extension__ char __x[__accept_len]; } *)__accept)
|
"m" ( *(struct { __extension__ char __x[__accept_len]; } *)__accept)
|
||||||
: "cc");
|
: "cc");
|
||||||
|
Loading…
Reference in New Issue
Block a user