]> Kevux Git Server - control/commitdiff
Update: Avoid the use of bool, keeping it to a bare minimum.
authorKevin Day <Kevin@kevux.org>
Mon, 1 Dec 2025 01:42:27 +0000 (19:42 -0600)
committerKevin Day <Kevin@kevux.org>
Mon, 1 Dec 2025 01:42:27 +0000 (19:42 -0600)
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.

sources/c/program/control/main/packet.c
sources/c/program/control/main/packet.h

index b17ed92f06153fcf53abec50f0dfd7014aeaa17c..9cbae7aa7b04e14108279261cc5fc8faf072c30f 100644 (file)
@@ -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];
index f5fdefb23e94dae63bb8ac88fe64591b51180f7f..9ccafe7496c5025e7e3bab702aa1f8f77b67b02b 100644 (file)
@@ -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_
 
 /**