Skip to content

Commit 524d7af

Browse files
committed
MQTTPacket: use int32_t instead of int where necessary
Followup commit to 1f3e757.
1 parent 00e0b45 commit 524d7af

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

MQTTClient-C/src/MQTTClient.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ int cycle(MQTTClient* c, Timer* timer)
296296
unsigned char intQoS;
297297
msg.payloadlen = 0; /* this is a size_t, but deserialize publish sets this as int */
298298
if (MQTTDeserialize_publish(&msg.dup, &intQoS, &msg.retained, &msg.id, &topicName,
299-
(unsigned char**)&msg.payload, (int*)&msg.payloadlen, c->readbuf, c->readbuf_size) != 1)
299+
(unsigned char**)&msg.payload, (int32_t*)&msg.payloadlen, c->readbuf, c->readbuf_size) != 1)
300300
goto exit;
301301
msg.qos = (enum MQTTQoS)intQoS;
302302
deliverMessage(c, &topicName, &msg);

MQTTPacket/src/MQTTDeserializePublish.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int32_t MQTTDeserialize_publish(unsigned char* dup, unsigned char* qos, unsigned
5656
unsigned char* curdata = buf;
5757
unsigned char* enddata = NULL;
5858
int32_t rc = 0;
59-
int mylen = 0;
59+
int32_t mylen = 0;
6060

6161
FUNC_ENTRY;
6262
header.byte = readChar(&curdata);

MQTTPacket/src/MQTTPacket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ int MQTTPacket_read(unsigned char* buf, int32_t buflen, int (*getfn)(unsigned ch
296296
int rc = -1;
297297
MQTTHeader header = {0};
298298
int32_t len = 0;
299-
int rem_len = 0;
299+
int32_t rem_len = 0;
300300

301301
/* 1. read the header byte. This has the packet type in it */
302302
if ((*getfn)(buf, 1) != 1)

MQTTPacket/src/MQTTSubscribeServer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ int32_t MQTTSerialize_suback(unsigned char* buf, int32_t buflen, unsigned short
127127
int32_t MQTTV5Serialize_suback(unsigned char* buf, int32_t buflen, unsigned short packetid,
128128
MQTTProperties* properties, int count, unsigned char* reasonCodes)
129129
#else
130-
int32_t MQTTSerialize_suback(unsigned char* buf, int buflen, unsigned short packetid, int count, unsigned char* grantedQoSs)
130+
int32_t MQTTSerialize_suback(unsigned char* buf, int32_t buflen, unsigned short packetid, int count, unsigned char* grantedQoSs)
131131
#endif
132132
{
133133
MQTTHeader header = {0};

0 commit comments

Comments
 (0)