From f20172e5959d2029fdc7f084a332a748563dd50e Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Thu, 23 Mar 2023 16:44:26 +0000 Subject: Change nxt_bool_t from a nxt_uint_t to a uint8_t. We have a 'bool' type, nxt_bool_t which is defined as a nxt_uint_t, that is used as local variables, and function return types and arguments. However in structs we use a uint8_t, due to not wanting to waste memory in structures, but the use of uint8_t in structs is confusing and unintuitive. We could just switch to using the C99 _Bool type, however there are concerns about this possibly not always being 1-byte on platforms on which Unit runs and might mess with structure layouts. (Switching to _Bool as the underlying type is still an eventual goal) The alternative is to just make our nxt_bool_t be a uint8_t. Reviewed-by: Alejandro Colomar Signed-off-by: Andrew Clayton --- src/nxt_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nxt_types.h b/src/nxt_types.h index 03e9c187..235d5733 100644 --- a/src/nxt_types.h +++ b/src/nxt_types.h @@ -31,7 +31,7 @@ typedef uintptr_t nxt_uint_t; #endif -typedef nxt_uint_t nxt_bool_t; +typedef uint8_t nxt_bool_t; /* -- cgit