summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port.h
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2023-03-23 20:16:08 +0000
committerAndrew Clayton <a.clayton@nginx.com>2023-03-28 23:15:28 +0100
commitc1303660eda80c5e17fde06bb8f17715e7be049b (patch)
tree6604e5d93ef42ce3ced9c5cf8d4dc2ee24bd5170 /src/nxt_port.h
parentf20172e5959d2029fdc7f084a332a748563dd50e (diff)
downloadunit-c1303660eda80c5e17fde06bb8f17715e7be049b.tar.gz
unit-c1303660eda80c5e17fde06bb8f17715e7be049b.tar.bz2
Convert uint8_t struct boolean members to nxt_bool_t.
Replace the usage of uint8_t in structures to represent boolean values with our nxt_bool_t type. This will result in no change in structure layout as the nxt_bool_t is now a uint8_t, same as what it's replacing. Even though it's essentially the same type, it makes it much clearer as to what its purpose is. This was largely done with the following script from Alex, with some manual conversions $ grep -rl 'uint8_t.*1 bit' src/ \ | xargs sed -i '/uint8_t.*1 bit/{s/uint8_t /nxt_bool_t /;s/; *\/\*.*/;/}' This doesn't convert the non-uint8_t booleans, they will be handled separately. Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/nxt_port.h')
-rw-r--r--src/nxt_port.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nxt_port.h b/src/nxt_port.h
index eba8d06f..deaa8acc 100644
--- a/src/nxt_port.h
+++ b/src/nxt_port.h
@@ -172,16 +172,16 @@ typedef struct {
uint8_t type;
/* Last message for this stream. */
- uint8_t last; /* 1 bit */
+ nxt_bool_t last;
/* Message data send using mmap, next chunk is a nxt_port_mmap_msg_t. */
- uint8_t mmap; /* 1 bit */
+ nxt_bool_t mmap;
/* Non-First fragment in fragmented message sequence. */
- uint8_t nf; /* 1 bit */
+ nxt_bool_t nf;
/* More Fragments followed. */
- uint8_t mf; /* 1 bit */
+ nxt_bool_t mf;
} nxt_port_msg_t;
@@ -191,8 +191,8 @@ typedef struct {
size_t share;
nxt_fd_t fd[2];
nxt_port_msg_t port_msg;
- uint8_t close_fd; /* 1 bit */
- uint8_t allocated; /* 1 bit */
+ nxt_bool_t close_fd;
+ nxt_bool_t allocated;
} nxt_port_send_msg_t;
#if (NXT_HAVE_UCRED) || (NXT_HAVE_MSGHDR_CMSGCRED)