summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2023-03-23 21:29:12 +0000
committerAndrew Clayton <a.clayton@nginx.com>2023-03-28 23:15:28 +0100
commit3c3d59833aaade452ab00df29d13ecc67130433d (patch)
treeebf30b914ca35d8d3a82f4f571117b1e92e13d9a
parentf6da981b218e9e817121a9087fb2e0cccae4e549 (diff)
downloadunit-bool.tar.gz
unit-bool.tar.bz2
Use nxt_bool_t in the configuration type system.bool
This replaces the use of uint8_t to represent booleans in the configuration type system with the nxt_bool_t type (which happens to be a uint8_t). This is part of the work to use nxt_bool_t in structures to represent booleans rather than uint8_t's which is more intuitive. Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r--src/nxt_conf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nxt_conf.c b/src/nxt_conf.c
index 97764d42..d239b644 100644
--- a/src/nxt_conf.c
+++ b/src/nxt_conf.c
@@ -45,7 +45,7 @@ typedef struct nxt_conf_object_s nxt_conf_object_t;
struct nxt_conf_value_s {
union {
- uint8_t boolean; /* 1 bit. */
+ nxt_bool_t boolean;
u_char number[NXT_CONF_MAX_NUMBER_LEN + 1];
struct {
@@ -582,7 +582,7 @@ nxt_conf_map_object(nxt_mp_t *mp, nxt_conf_value_t *value, nxt_conf_map_t *map,
nxt_conf_value_t *v;
union {
- uint8_t ui8;
+ nxt_bool_t b;
int32_t i32;
int64_t i64;
int i;
@@ -610,7 +610,7 @@ nxt_conf_map_object(nxt_mp_t *mp, nxt_conf_value_t *value, nxt_conf_map_t *map,
case NXT_CONF_MAP_BOOL:
if (v->type == NXT_CONF_VALUE_BOOLEAN) {
- ptr->ui8 = v->u.boolean;
+ ptr->b = v->u.boolean;
}
break;