Remove intprops dependency.
authorEric Blake <ebb9@byu.net>
Mon, 28 Apr 2008 16:24:14 +0000 (10:24 -0600)
committerEric Blake <ebb9@byu.net>
Mon, 28 Apr 2008 21:04:49 +0000 (15:04 -0600)
* 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 <ebb9@byu.net>
ChangeLog
lib/memchr.c
lib/memchr2.c
lib/memrchr.c
modules/memchr
modules/memchr2
modules/memrchr

index 36e8ab5..74522bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-04-28  Eric Blake  <ebb9@byu.net>
+
+       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  <simon@josefsson.org>
 
        * m4/sys_socket_h.m4: Move AC_REQUIRE([AC_C_INLINE]) to top.
        * tests/test-memchr.c; New file, based on tests/test-memchr2.c.
 
 2008-04-26  Eric Blake  <ebb9@byu.net>
-            Bruno Haible  <bruno@clisp.org>
+           Bruno Haible  <bruno@clisp.org>
 
        * lib/memchr.c: Include intprops.h.
        (__memchr): Optimize parallel detection of matching bytes. Rename local
index 2398dc3..2253d2d 100644 (file)
@@ -45,8 +45,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 # define BP_SYM(sym) sym
 #endif
 
-#include "intprops.h"
-
 #undef __memchr
 #ifdef _LIBC
 # undef memchr
@@ -65,7 +63,7 @@ __memchr (void const *s, int c_in, size_t n)
      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 @@ __memchr (void const *s, int c_in, size_t n)
   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;
index 850d380..ad78195 100644 (file)
@@ -29,8 +29,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <stdint.h>
 #include <string.h>
 
-#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 @@ memchr2 (void const *s, int c1_in, int c2_in, size_t n)
      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 @@ memchr2 (void const *s, int c1_in, int c2_in, size_t n)
   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;
index 2796dea..da93ca0 100644 (file)
@@ -32,8 +32,6 @@
 #include <string.h>
 #include <limits.h>
 
-#include "intprops.h"
-
 #undef __memrchr
 #ifdef _LIBC
 # undef memrchr
@@ -52,7 +50,7 @@ __memrchr (void const *s, int c_in, size_t n)
      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 @@ __memrchr (void const *s, int c_in, size_t n)
   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;
index 718a3fc..5e908d2 100644 (file)
@@ -6,7 +6,6 @@ lib/memchr.c
 m4/memchr.m4
 
 Depends-on:
-intprops
 
 configure.ac:
 gl_FUNC_MEMCHR
index da5671d..7e83415 100644 (file)
@@ -6,7 +6,6 @@ lib/memchr2.h
 lib/memchr2.c
 
 Depends-on:
-intprops
 stdint
 memchr
 
index 36a119d..3a6e982 100644 (file)
@@ -7,7 +7,6 @@ m4/memrchr.m4
 
 Depends-on:
 extensions
-intprops
 string
 
 configure.ac: