From a1d57563973d04fb560e183c696595de16df0cb7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 7 Nov 2023 15:30:32 +0100 Subject: [PATCH] rawmemchr: Port to CHERI. * lib/rawmemchr.c (rawmemchr): Use 'unsigned long' instead of uintptr_t. --- ChangeLog | 5 +++++ lib/rawmemchr.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f6e4e5f97..c206ebccc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-11-07 Bruno Haible + + rawmemchr: Port to CHERI. + * lib/rawmemchr.c (rawmemchr): Use 'unsigned long' instead of uintptr_t. + 2023-11-06 Paul Eggert stdint: port intptr_t to CHERI diff --git a/lib/rawmemchr.c b/lib/rawmemchr.c index 45c6cd3527..6f2809071b 100644 --- a/lib/rawmemchr.c +++ b/lib/rawmemchr.c @@ -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; -- 2.39.5