1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Fix bugs I introduced in last change.

This commit is contained in:
Ulrich Drepper
1999-04-30 15:43:09 +00:00
parent 1fafbbda1a
commit 6c8f9de31c

View File

@ -97,59 +97,61 @@ __STRING2_COPY_TYPE (8);
(__extension__ (__builtin_constant_p (n) && (n) <= 16 \ (__extension__ (__builtin_constant_p (n) && (n) <= 16 \
? ((n) == 1 \ ? ((n) == 1 \
? __memset_1 (s, c) \ ? __memset_1 (s, c) \
: __memset_gc (s, (((__uint8_t) c) * 0x1010101), n)) \ : __memset_gc (s, c, n)) \
: (__builtin_constant_p (c) && (c) == '\0' \ : (__builtin_constant_p (c) && (c) == '\0' \
? ({ void *__s = (s); __bzero (__s, n); __s; }) \ ? ({ void *__s = (s); __bzero (__s, n); __s; }) \
: memset (s, c, n)))) : memset (s, c, n))))
#define __memset_1(s, c) ({ void *__s = (s); *((__uint8_t *) __s) = c; __s; }) #define __memset_1(s, c) ({ void *__s = (s); \
*((__uint8_t *) __s) = (__uint8_t) c; __s; })
#define __memset_gc(s, c, n) \ #define __memset_gc(s, c, n) \
({ void *__s = (s); \ ({ void *__s = (s); \
__uint32_t *__ts = (__uint32_t *) __s; \ __uint32_t *__ts = (__uint32_t *) __s; \
__uint8_t __c = (__uint8_t) (c); \
\ \
/* This `switch' statement will be removed at compile-time. */ \ /* This `switch' statement will be removed at compile-time. */ \
switch (n) \ switch (n) \
{ \ { \
case 15: \ case 15: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 11: \ case 11: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 7: \ case 7: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 3: \ case 3: \
*((__uint16_t *) __ts)++ = c; \ *((__uint16_t *) __ts)++ = __c * 0x0101; \
*((__uint8_t *) __ts) = c; \ *((__uint8_t *) __ts) = __c; \
break; \ break; \
\ \
case 14: \ case 14: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 10: \ case 10: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 6: \ case 6: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 2: \ case 2: \
*((__uint16_t *) __ts) = c; \ *((__uint16_t *) __ts) = __c * 0x0101; \
break; \ break; \
\ \
case 13: \ case 13: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 9: \ case 9: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 5: \ case 5: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 1: \ case 1: \
*((__uint8_t *) __ts) = c; \ *((__uint8_t *) __ts) = __c; \
break; \ break; \
\ \
case 16: \ case 16: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 12: \ case 12: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 8: \ case 8: \
*__ts++ = c; \ *__ts++ = __c * 0x01010101; \
case 4: \ case 4: \
*__ts = c; \ *__ts = __c * 0x01010101; \
case 0: \ case 0: \
break; \ break; \
} \ } \