From: Kevin Day Date: Mon, 1 Dec 2025 01:42:27 +0000 (-0600) Subject: Update: Avoid the use of bool, keeping it to a bare minimum. X-Git-Tag: 0.7.4~20 X-Git-Url: https://www.git.kevux.org/?a=commitdiff_plain;h=9a56cd68a25ff2baf0cdd7cbfa2a0e2a254dda8d;p=control Update: Avoid the use of bool, keeping it to a bare minimum. Use `uint8_t` to both enforce a specific byte size as well as provide the ability for it to be converted into a set of bits if need be, without breaking API or ABI. --- diff --git a/sources/c/program/control/main/packet.c b/sources/c/program/control/main/packet.c index b17ed92..9cbae7a 100644 --- a/sources/c/program/control/main/packet.c +++ b/sources/c/program/control/main/packet.c @@ -135,7 +135,7 @@ extern "C" { #endif // _di_control_packet_header_flag_ #ifndef _di_control_packet_header_length_ - uint32_t control_packet_header_length(const bool is_big, const uint8_t buffer[]) { + uint32_t control_packet_header_length(const uint8_t is_big, const uint8_t buffer[]) { #ifdef _is_F_endian_big if (is_big) return (buffer[1] << 24u) | (buffer[2] << 16u) | (buffer[3] << 8u) | buffer[4]; diff --git a/sources/c/program/control/main/packet.h b/sources/c/program/control/main/packet.h index f5fdefb..9ccafe7 100644 --- a/sources/c/program/control/main/packet.h +++ b/sources/c/program/control/main/packet.h @@ -69,7 +69,7 @@ extern "C" { * The 32-bit number representing the length. */ #ifndef _di_control_packet_header_length_ - extern uint32_t control_packet_header_length(const bool is_big, const uint8_t buffer[]); + extern uint32_t control_packet_header_length(const uint8_t is_big, const uint8_t buffer[]); #endif // _di_control_packet_header_length_ /**