forked from pool/paho-mqtt-c
94 lines
3.0 KiB
Diff
94 lines
3.0 KiB
Diff
|
From de9b43580aa1bb8703f256f994aa16e12d4b1d56 Mon Sep 17 00:00:00 2001
|
||
|
From: fpagliughi <fpagliughi@mindspring.com>
|
||
|
Date: Wed, 14 May 2025 17:56:02 -0400
|
||
|
Subject: [PATCH] #1576 Changed 'bool' typedef to 'bit'
|
||
|
|
||
|
---
|
||
|
src/MQTTPacket.h | 34 +++++++++++++++++-----------------
|
||
|
1 file changed, 17 insertions(+), 17 deletions(-)
|
||
|
|
||
|
diff --git a/src/MQTTPacket.h b/src/MQTTPacket.h
|
||
|
index fd384ae9b..04c217ef8 100644
|
||
|
--- a/src/MQTTPacket.h
|
||
|
+++ b/src/MQTTPacket.h
|
||
|
@@ -28,7 +28,7 @@
|
||
|
#include "LinkedList.h"
|
||
|
#include "Clients.h"
|
||
|
|
||
|
-typedef unsigned int bool;
|
||
|
+typedef unsigned int bit;
|
||
|
typedef void* (*pf)(int, unsigned char, char*, size_t);
|
||
|
|
||
|
#include "MQTTProperties.h"
|
||
|
@@ -67,16 +67,16 @@ typedef union
|
||
|
struct
|
||
|
{
|
||
|
unsigned int type : 4; /**< message type nibble */
|
||
|
- bool dup : 1; /**< DUP flag bit */
|
||
|
+ bit dup : 1; /**< DUP flag bit */
|
||
|
unsigned int qos : 2; /**< QoS value, 0, 1 or 2 */
|
||
|
- bool retain : 1; /**< retained flag bit */
|
||
|
+ bit retain : 1; /**< retained flag bit */
|
||
|
} bits;
|
||
|
#else
|
||
|
struct
|
||
|
{
|
||
|
- bool retain : 1; /**< retained flag bit */
|
||
|
+ bit retain : 1; /**< retained flag bit */
|
||
|
unsigned int qos : 2; /**< QoS value, 0, 1 or 2 */
|
||
|
- bool dup : 1; /**< DUP flag bit */
|
||
|
+ bit dup : 1; /**< DUP flag bit */
|
||
|
unsigned int type : 4; /**< message type nibble */
|
||
|
} bits;
|
||
|
#endif
|
||
|
@@ -95,24 +95,24 @@ typedef struct
|
||
|
#if defined(REVERSED)
|
||
|
struct
|
||
|
{
|
||
|
- bool username : 1; /**< 3.1 user name */
|
||
|
- bool password : 1; /**< 3.1 password */
|
||
|
- bool willRetain : 1; /**< will retain setting */
|
||
|
+ bit username : 1; /**< 3.1 user name */
|
||
|
+ bit password : 1; /**< 3.1 password */
|
||
|
+ bit willRetain : 1; /**< will retain setting */
|
||
|
unsigned int willQoS : 2; /**< will QoS value */
|
||
|
- bool will : 1; /**< will flag */
|
||
|
- bool cleanstart : 1; /**< cleansession flag */
|
||
|
+ bit will : 1; /**< will flag */
|
||
|
+ bit cleanstart : 1; /**< cleansession flag */
|
||
|
int : 1; /**< unused */
|
||
|
} bits;
|
||
|
#else
|
||
|
struct
|
||
|
{
|
||
|
int : 1; /**< unused */
|
||
|
- bool cleanstart : 1; /**< cleansession flag */
|
||
|
- bool will : 1; /**< will flag */
|
||
|
+ bit cleanstart : 1; /**< cleansession flag */
|
||
|
+ bit will : 1; /**< will flag */
|
||
|
unsigned int willQoS : 2; /**< will QoS value */
|
||
|
- bool willRetain : 1; /**< will retain setting */
|
||
|
- bool password : 1; /**< 3.1 password */
|
||
|
- bool username : 1; /**< 3.1 user name */
|
||
|
+ bit willRetain : 1; /**< will retain setting */
|
||
|
+ bit password : 1; /**< 3.1 password */
|
||
|
+ bit username : 1; /**< 3.1 user name */
|
||
|
} bits;
|
||
|
#endif
|
||
|
} flags; /**< connect flags byte */
|
||
|
@@ -140,12 +140,12 @@ typedef struct
|
||
|
struct
|
||
|
{
|
||
|
unsigned int reserved : 7; /**< message type nibble */
|
||
|
- bool sessionPresent : 1; /**< was a session found on the server? */
|
||
|
+ bit sessionPresent : 1; /**< was a session found on the server? */
|
||
|
} bits;
|
||
|
#else
|
||
|
struct
|
||
|
{
|
||
|
- bool sessionPresent : 1; /**< was a session found on the server? */
|
||
|
+ bit sessionPresent : 1; /**< was a session found on the server? */
|
||
|
unsigned int reserved : 7; /**< message type nibble */
|
||
|
} bits;
|
||
|
#endif
|