mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Sun Mar 17 07:19:33 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* db/Makefile (CFLAGS-hash_func.c): New variable; pass -Wno-unused. (CFLAGS): Append -Wno-unitialized. * sysdeps/alpha/memchr.S: New file. * sysdeps/alpha/memchr.c: Obsolete file removed. * string/tester.c: Soup up memchr tests.
This commit is contained in:
10
ChangeLog
10
ChangeLog
@ -1,3 +1,8 @@
|
|||||||
|
Sun Mar 17 07:19:33 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* db/Makefile (CFLAGS-hash_func.c): New variable; pass -Wno-unused.
|
||||||
|
(CFLAGS): Append -Wno-unitialized.
|
||||||
|
|
||||||
Sat Mar 16 20:58:43 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
Sat Mar 16 20:58:43 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||||
|
|
||||||
* stdlib/erand48_r.c: Use FP division by powers of two to distribute
|
* stdlib/erand48_r.c: Use FP division by powers of two to distribute
|
||||||
@ -5,8 +10,9 @@ Sat Mar 16 20:58:43 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
|||||||
|
|
||||||
Sat Mar 16 20:08:22 1996 David Mosberger-Tang <davidm@azstarnet.com>
|
Sat Mar 16 20:08:22 1996 David Mosberger-Tang <davidm@azstarnet.com>
|
||||||
|
|
||||||
* sysdeps/alpha/memchr.S: new file.
|
* sysdeps/alpha/memchr.S: New file.
|
||||||
* sysdeps/alpha/memchr.c: obsolete file removed.
|
* sysdeps/alpha/memchr.c: Obsolete file removed.
|
||||||
|
* string/tester.c: Soup up memchr tests.
|
||||||
|
|
||||||
Sat Mar 16 16:26:09 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
Sat Mar 16 16:26:09 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
@ -26,3 +26,10 @@ distribute := compat.h \
|
|||||||
include ../Rules
|
include ../Rules
|
||||||
|
|
||||||
CPPFLAGS += -D__DBINTERFACE_PRIVATE
|
CPPFLAGS += -D__DBINTERFACE_PRIVATE
|
||||||
|
|
||||||
|
# This file defines some static functions for alternative hash algorithms
|
||||||
|
# that are not actually used.
|
||||||
|
CFLAGS-hash_func.c := -Wno-unused
|
||||||
|
|
||||||
|
# The db code outsmarts the compiler frequently.
|
||||||
|
override CFLAGS += -Wno-uninitialized
|
||||||
|
@ -375,6 +375,7 @@ DEFUN(main, (argc, argv), int argc AND char **argv)
|
|||||||
check(memchr("abcd", 'z', 4) == NULL, 1); /* Not found. */
|
check(memchr("abcd", 'z', 4) == NULL, 1); /* Not found. */
|
||||||
(void) strcpy(one, "abcd");
|
(void) strcpy(one, "abcd");
|
||||||
check(memchr(one, 'c', 4) == one+2, 2); /* Basic test. */
|
check(memchr(one, 'c', 4) == one+2, 2); /* Basic test. */
|
||||||
|
check(memchr(one, ~0xff|'c', 4) == one+2, 2); /* ignore highorder bits. */
|
||||||
check(memchr(one, 'd', 4) == one+3, 3); /* End of string. */
|
check(memchr(one, 'd', 4) == one+3, 3); /* End of string. */
|
||||||
check(memchr(one, 'a', 4) == one, 4); /* Beginning. */
|
check(memchr(one, 'a', 4) == one, 4); /* Beginning. */
|
||||||
check(memchr(one, '\0', 5) == one+4, 5); /* Finding NUL. */
|
check(memchr(one, '\0', 5) == one+4, 5); /* Finding NUL. */
|
||||||
@ -385,6 +386,30 @@ DEFUN(main, (argc, argv), int argc AND char **argv)
|
|||||||
(void) strcpy(one, "a\203b");
|
(void) strcpy(one, "a\203b");
|
||||||
check(memchr(one, 0203, 3) == one+1, 9); /* Unsignedness. */
|
check(memchr(one, 0203, 3) == one+1, 9); /* Unsignedness. */
|
||||||
|
|
||||||
|
/* now test all possible alignment and length combinations to catch
|
||||||
|
bugs due to unrolled loops (assuming unrolling is limited to no
|
||||||
|
more than 128 byte chunks: */
|
||||||
|
{
|
||||||
|
char buf[128 + sizeof(long)];
|
||||||
|
long align, len, i, pos;
|
||||||
|
|
||||||
|
for (align = 0; align < sizeof(long); ++align) {
|
||||||
|
for (len = 0; len < sizeof(buf) - align; ++len) {
|
||||||
|
for (i = 0; i < len; ++i) {
|
||||||
|
buf[align + i] = 'x'; /* don't depend on memset... */
|
||||||
|
}
|
||||||
|
for (pos = 0; pos < len; ++pos) {
|
||||||
|
#if 0
|
||||||
|
printf("align %d, len %d, pos %d\n", align, len, pos);
|
||||||
|
#endif
|
||||||
|
check(memchr(buf + align, 'x', len) == buf + align + pos, 10);
|
||||||
|
check(memchr(buf + align, 'x', pos) == NULL, 11);
|
||||||
|
buf[align + pos] = '-';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* memcpy - need not work for overlap. */
|
/* memcpy - need not work for overlap. */
|
||||||
it = "memcpy";
|
it = "memcpy";
|
||||||
check(memcpy(one, "abc", 4) == one, 1); /* Returned value. */
|
check(memcpy(one, "abc", 4) == one, 1); /* Returned value. */
|
||||||
|
Reference in New Issue
Block a user