Skip to content

Commit

Permalink
MQTTPacket: use int32_t instead of int where necessary
Browse files Browse the repository at this point in the history
Followup commit to 1f3e757.
  • Loading branch information
OlegHahm committed Jan 15, 2025
1 parent f44e537 commit b217029
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MQTTClient-C/src/MQTTClient.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ int cycle(MQTTClient* c, Timer* timer)
unsigned char intQoS;
msg.payloadlen = 0; /* this is a size_t, but deserialize publish sets this as int */
if (MQTTDeserialize_publish(&msg.dup, &intQoS, &msg.retained, &msg.id, &topicName,
(unsigned char**)&msg.payload, (int*)&msg.payloadlen, c->readbuf, c->readbuf_size) != 1)
(unsigned char**)&msg.payload, (int32_t*)&msg.payloadlen, c->readbuf, c->readbuf_size) != 1)
goto exit;
msg.qos = (enum MQTTQoS)intQoS;
deliverMessage(c, &topicName, &msg);
Expand Down
2 changes: 1 addition & 1 deletion MQTTPacket/src/MQTTDeserializePublish.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int32_t MQTTDeserialize_publish(unsigned char* dup, unsigned char* qos, unsigned
unsigned char* curdata = buf;
unsigned char* enddata = NULL;
int32_t rc = 0;
int mylen = 0;
int32_t mylen = 0;

FUNC_ENTRY;
header.byte = readChar(&curdata);
Expand Down
2 changes: 1 addition & 1 deletion MQTTPacket/src/MQTTPacket.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ int MQTTPacket_read(unsigned char* buf, int32_t buflen, int (*getfn)(unsigned ch
int rc = -1;
MQTTHeader header = {0};
int32_t len = 0;
int rem_len = 0;
int32_t rem_len = 0;

/* 1. read the header byte. This has the packet type in it */
if ((*getfn)(buf, 1) != 1)
Expand Down
2 changes: 1 addition & 1 deletion MQTTPacket/src/MQTTSubscribeServer.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int32_t MQTTSerialize_suback(unsigned char* buf, int32_t buflen, unsigned short
int32_t MQTTV5Serialize_suback(unsigned char* buf, int32_t buflen, unsigned short packetid,
MQTTProperties* properties, int count, unsigned char* reasonCodes)
#else
int32_t MQTTSerialize_suback(unsigned char* buf, int buflen, unsigned short packetid, int count, unsigned char* grantedQoSs)
int32_t MQTTSerialize_suback(unsigned char* buf, int32_t buflen, unsigned short packetid, int count, unsigned char* grantedQoSs)
#endif
{
MQTTHeader header = {0};
Expand Down

0 comments on commit b217029

Please sign in to comment.