# HG changeset patch # User Eric Blake # Date 1209399854 21600 # Node ID 901b50b38faeddf3a2e61fce2d9c2601cf47bead # Parent d45f5069548a5564d122c6b445d0d7b4d1add75f Remove intprops dependency. * modules/memchr (Depends-on): Remove intprops. * modules/memrchr (Depends-on): Likewise. * modules/memchr2 (Depends-on): Likewise. * lib/memchr.c (__memchr): Hand-inline the TYPE_MAXIMUM check. * lib/memrchr.c (__memrchr): Likewise. * lib/memrchr2.c (memchr2): Likewise. Reported by Simon Josefsson. Signed-off-by: Eric Blake diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-04-28 Eric Blake + + Remove intprops dependency. + * modules/memchr (Depends-on): Remove intprops. + * modules/memrchr (Depends-on): Likewise. + * modules/memchr2 (Depends-on): Likewise. + * lib/memchr.c (__memchr): Hand-inline the TYPE_MAXIMUM check. + * lib/memrchr.c (__memrchr): Likewise. + * lib/memrchr2.c (memchr2): Likewise. + Reported by Simon Josefsson. + 2008-04-28 Simon Josefsson * m4/sys_socket_h.m4: Move AC_REQUIRE([AC_C_INLINE]) to top. @@ -167,7 +178,7 @@ * tests/test-memchr.c; New file, based on tests/test-memchr2.c. 2008-04-26 Eric Blake - Bruno Haible + Bruno Haible * lib/memchr.c: Include intprops.h. (__memchr): Optimize parallel detection of matching bytes. Rename local diff --git a/lib/memchr.c b/lib/memchr.c --- a/lib/memchr.c +++ b/lib/memchr.c @@ -45,8 +45,6 @@ # define BP_SYM(sym) sym #endif -#include "intprops.h" - #undef __memchr #ifdef _LIBC # undef memchr @@ -65,7 +63,7 @@ performance. On 64-bit hardware, unsigned long is generally 64 bits already. Change this typedef to experiment with performance. */ - typedef unsigned long longword; + typedef unsigned long int longword; const unsigned char *char_ptr; const longword *longword_ptr; @@ -94,7 +92,7 @@ repeated_one = 0x01010101; repeated_c = c | (c << 8); repeated_c |= repeated_c << 16; - if (0xffffffffU < TYPE_MAXIMUM (longword)) + if (0xffffffffU < (longword) -1) { repeated_one |= repeated_one << 31 << 1; repeated_c |= repeated_c << 31 << 1; diff --git a/lib/memchr2.c b/lib/memchr2.c --- a/lib/memchr2.c +++ b/lib/memchr2.c @@ -29,8 +29,6 @@ #include #include -#include "intprops.h" - /* Return the first address of either C1 or C2 (treated as unsigned char) that occurs within N bytes of the memory region S. If neither byte appears, return NULL. */ @@ -42,7 +40,7 @@ performance. On 64-bit hardware, unsigned long is generally 64 bits already. Change this typedef to experiment with performance. */ - typedef unsigned long longword; + typedef unsigned long int longword; const unsigned char *char_ptr; const longword *longword_ptr; @@ -80,7 +78,7 @@ repeated_c2 = c2 | (c2 << 8); repeated_c1 |= repeated_c1 << 16; repeated_c2 |= repeated_c2 << 16; - if (0xffffffffU < TYPE_MAXIMUM (longword)) + if (0xffffffffU < (longword) -1) { repeated_one |= repeated_one << 31 << 1; repeated_c1 |= repeated_c1 << 31 << 1; diff --git a/lib/memrchr.c b/lib/memrchr.c --- a/lib/memrchr.c +++ b/lib/memrchr.c @@ -32,8 +32,6 @@ #include #include -#include "intprops.h" - #undef __memrchr #ifdef _LIBC # undef memrchr @@ -52,7 +50,7 @@ performance. On 64-bit hardware, unsigned long is generally 64 bits already. Change this typedef to experiment with performance. */ - typedef unsigned long longword; + typedef unsigned long int longword; const unsigned char *char_ptr; const longword *longword_ptr; @@ -81,7 +79,7 @@ repeated_one = 0x01010101; repeated_c = c | (c << 8); repeated_c |= repeated_c << 16; - if (0xffffffffU < TYPE_MAXIMUM (longword)) + if (0xffffffffU < (longword) -1) { repeated_one |= repeated_one << 31 << 1; repeated_c |= repeated_c << 31 << 1; diff --git a/modules/memchr b/modules/memchr --- a/modules/memchr +++ b/modules/memchr @@ -6,7 +6,6 @@ m4/memchr.m4 Depends-on: -intprops configure.ac: gl_FUNC_MEMCHR diff --git a/modules/memchr2 b/modules/memchr2 --- a/modules/memchr2 +++ b/modules/memchr2 @@ -6,7 +6,6 @@ lib/memchr2.c Depends-on: -intprops stdint memchr diff --git a/modules/memrchr b/modules/memrchr --- a/modules/memrchr +++ b/modules/memrchr @@ -7,7 +7,6 @@ Depends-on: extensions -intprops string configure.ac: