changeset 9995:901b50b38fae

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 <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Mon, 28 Apr 2008 10:24:14 -0600
parents d45f5069548a
children dd3a38e7cf66
files ChangeLog lib/memchr.c lib/memchr2.c lib/memrchr.c modules/memchr modules/memchr2 modules/memrchr
diffstat 7 files changed, 18 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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.
@@ -167,7 +178,7 @@
 	* 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
--- 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;
--- a/lib/memchr2.c
+++ b/lib/memchr2.c
@@ -29,8 +29,6 @@
 #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 @@
      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;
--- a/lib/memrchr.c
+++ b/lib/memrchr.c
@@ -32,8 +32,6 @@
 #include <string.h>
 #include <limits.h>
 
-#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;
--- a/modules/memchr
+++ b/modules/memchr
@@ -6,7 +6,6 @@
 m4/memchr.m4
 
 Depends-on:
-intprops
 
 configure.ac:
 gl_FUNC_MEMCHR
--- a/modules/memchr2
+++ b/modules/memchr2
@@ -6,7 +6,6 @@
 lib/memchr2.c
 
 Depends-on:
-intprops
 stdint
 memchr
 
--- a/modules/memrchr
+++ b/modules/memrchr
@@ -7,7 +7,6 @@
 
 Depends-on:
 extensions
-intprops
 string
 
 configure.ac: