]> Savannah Git Hosting - gnulib.git/commitdiff
rawmemchr: Port to CHERI.
authorBruno Haible <bruno@clisp.org>
Tue, 7 Nov 2023 14:30:32 +0000 (15:30 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 7 Nov 2023 14:30:32 +0000 (15:30 +0100)
* lib/rawmemchr.c (rawmemchr): Use 'unsigned long' instead of uintptr_t.

ChangeLog
lib/rawmemchr.c

index 8f6e4e5f97ba4277c0c5ba2a9e31820f9f300703..c206ebccc9fbfb77311c089bbed1b46423738d8e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-11-07  Bruno Haible  <bruno@clisp.org>
+
+       rawmemchr: Port to CHERI.
+       * lib/rawmemchr.c (rawmemchr): Use 'unsigned long' instead of uintptr_t.
+
 2023-11-06  Paul Eggert  <eggert@cs.ucla.edu>
 
        stdint: port intptr_t to CHERI
index 45c6cd3527689765fa1e7d792c3d3f6508d069aa..6f2809071b33ba594c2b289c214370a28882777e 100644 (file)
@@ -31,10 +31,10 @@ void *
 rawmemchr (const void *s, int c_in)
 {
   /* Change this typedef to experiment with performance.  */
-  typedef uintptr_t longword;
-  /* If you change the "uintptr_t", you should change UINTPTR_WIDTH to match.
+  typedef unsigned long longword;
+  /* If you change the "unsigned long", you should change ULONG_WIDTH to match.
      This verifies that the type does not have padding bits.  */
-  static_assert (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
+  static_assert (ULONG_WIDTH == UCHAR_WIDTH * sizeof (longword));
 
   const unsigned char *char_ptr;
   unsigned char c = c_in;