remove warnings

master
Eggert Jung 4 years ago
parent 62cb87ffa0
commit e775792323

@ -117,7 +117,7 @@ char* MQTTFormat_toClientString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
int32_t index = 0; int32_t index = 0;
int32_t rem_length = 0; int32_t rem_length = 0;
MQTTHeader header = {0}; MQTTHeader header = {0};
int32_t strindex = 0; //int32_t strindex = 0;
header.byte = buf[index++]; header.byte = buf[index++];
index += MQTTPacket_decodeBuf(&buf[index], &rem_length); index += MQTTPacket_decodeBuf(&buf[index], &rem_length);
@ -128,7 +128,7 @@ char* MQTTFormat_toClientString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
{ {
uint8_t sessionPresent, connack_rc; uint8_t sessionPresent, connack_rc;
if (MQTTDeserialize_connack(&sessionPresent, &connack_rc, buf, buflen) == 1) if (MQTTDeserialize_connack(&sessionPresent, &connack_rc, buf, buflen) == 1)
strindex = MQTTStringFormat_connack(strbuf, strbuflen, connack_rc, sessionPresent); /*strindex = */MQTTStringFormat_connack(strbuf, strbuflen, connack_rc, sessionPresent);
} }
break; break;
case PUBLISH: case PUBLISH:
@ -141,7 +141,7 @@ char* MQTTFormat_toClientString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
if (MQTTDeserialize_publish(&dup, &qos, &retained, &packetid, &topicName, if (MQTTDeserialize_publish(&dup, &qos, &retained, &packetid, &topicName,
&payload, &payloadlen, buf, buflen) == 1) &payload, &payloadlen, buf, buflen) == 1)
strindex = MQTTStringFormat_publish(strbuf, strbuflen, dup, qos, retained, /*strindex = */MQTTStringFormat_publish(strbuf, strbuflen, dup, qos, retained,
packetid, topicName, payload, payloadlen); packetid, topicName, payload, payloadlen);
} }
break; break;
@ -153,7 +153,7 @@ char* MQTTFormat_toClientString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
uint8_t packettype, dup; uint8_t packettype, dup;
uint16_t packetid; uint16_t packetid;
if (MQTTDeserialize_ack(&packettype, &dup, &packetid, buf, buflen) == 1) if (MQTTDeserialize_ack(&packettype, &dup, &packetid, buf, buflen) == 1)
strindex = MQTTStringFormat_ack(strbuf, strbuflen, packettype, dup, packetid); /*strindex = */MQTTStringFormat_ack(strbuf, strbuflen, packettype, dup, packetid);
} }
break; break;
case SUBACK: case SUBACK:
@ -162,20 +162,20 @@ char* MQTTFormat_toClientString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
int32_t maxcount = 1, count = 0; int32_t maxcount = 1, count = 0;
int32_t grantedQoSs[1]; int32_t grantedQoSs[1];
if (MQTTDeserialize_suback(&packetid, maxcount, &count, grantedQoSs, buf, buflen) == 1) if (MQTTDeserialize_suback(&packetid, maxcount, &count, grantedQoSs, buf, buflen) == 1)
strindex = MQTTStringFormat_suback(strbuf, strbuflen, packetid, count, grantedQoSs); /*strindex = */MQTTStringFormat_suback(strbuf, strbuflen, packetid, count, grantedQoSs);
} }
break; break;
case UNSUBACK: case UNSUBACK:
{ {
uint16_t packetid; uint16_t packetid;
if (MQTTDeserialize_unsuback(&packetid, buf, buflen) == 1) if (MQTTDeserialize_unsuback(&packetid, buf, buflen) == 1)
strindex = MQTTStringFormat_ack(strbuf, strbuflen, UNSUBACK, 0, packetid); /*strindex = */MQTTStringFormat_ack(strbuf, strbuflen, UNSUBACK, 0, packetid);
} }
break; break;
case PINGREQ: case PINGREQ:
case PINGRESP: case PINGRESP:
case DISCONNECT: case DISCONNECT:
strindex = snprintf(strbuf, strbuflen, "%s", MQTTPacket_names[header.bits.type]); /*strindex = */snprintf(strbuf, strbuflen, "%s", MQTTPacket_names[header.bits.type]);
break; break;
} }
@ -188,7 +188,7 @@ char* MQTTFormat_toServerString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
int32_t index = 0; int32_t index = 0;
int32_t rem_length = 0; int32_t rem_length = 0;
MQTTHeader header = {0}; MQTTHeader header = {0};
int32_t strindex = 0; //int32_t strindex = 0;
header.byte = buf[index++]; header.byte = buf[index++];
index += MQTTPacket_decodeBuf(&buf[index], &rem_length); index += MQTTPacket_decodeBuf(&buf[index], &rem_length);
@ -201,7 +201,7 @@ char* MQTTFormat_toServerString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
int32_t rc; int32_t rc;
if ((rc = MQTTDeserialize_connect(&data, buf, buflen)) == 1) if ((rc = MQTTDeserialize_connect(&data, buf, buflen)) == 1)
strindex = MQTTStringFormat_connect(strbuf, strbuflen, &data); /*strindex = */MQTTStringFormat_connect(strbuf, strbuflen, &data);
} }
break; break;
case PUBLISH: case PUBLISH:
@ -214,7 +214,7 @@ char* MQTTFormat_toServerString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
if (MQTTDeserialize_publish(&dup, &qos, &retained, &packetid, &topicName, if (MQTTDeserialize_publish(&dup, &qos, &retained, &packetid, &topicName,
&payload, &payloadlen, buf, buflen) == 1) &payload, &payloadlen, buf, buflen) == 1)
strindex = MQTTStringFormat_publish(strbuf, strbuflen, dup, qos, retained, /*strindex = */MQTTStringFormat_publish(strbuf, strbuflen, dup, qos, retained,
packetid, topicName, payload, payloadlen); packetid, topicName, payload, payloadlen);
} }
break; break;
@ -227,7 +227,7 @@ char* MQTTFormat_toServerString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
uint16_t packetid; uint16_t packetid;
if (MQTTDeserialize_ack(&packettype, &dup, &packetid, buf, buflen) == 1) if (MQTTDeserialize_ack(&packettype, &dup, &packetid, buf, buflen) == 1)
strindex = MQTTStringFormat_ack(strbuf, strbuflen, packettype, dup, packetid); /*strindex = */MQTTStringFormat_ack(strbuf, strbuflen, packettype, dup, packetid);
} }
break; break;
case SUBSCRIBE: case SUBSCRIBE:
@ -240,7 +240,7 @@ char* MQTTFormat_toServerString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
if (MQTTDeserialize_subscribe(&dup, &packetid, maxcount, &count, if (MQTTDeserialize_subscribe(&dup, &packetid, maxcount, &count,
topicFilters, requestedQoSs, buf, buflen) == 1) topicFilters, requestedQoSs, buf, buflen) == 1)
strindex = MQTTStringFormat_subscribe(strbuf, strbuflen, dup, packetid, count, topicFilters, requestedQoSs);; /*strindex = */MQTTStringFormat_subscribe(strbuf, strbuflen, dup, packetid, count, topicFilters, requestedQoSs);;
} }
break; break;
case UNSUBSCRIBE: case UNSUBSCRIBE:
@ -250,13 +250,13 @@ char* MQTTFormat_toServerString(char* strbuf, int32_t strbuflen, uint8_t* buf, i
int32_t maxcount = 1, count = 0; int32_t maxcount = 1, count = 0;
MQTTString topicFilters[1]; MQTTString topicFilters[1];
if (MQTTDeserialize_unsubscribe(&dup, &packetid, maxcount, &count, topicFilters, buf, buflen) == 1) if (MQTTDeserialize_unsubscribe(&dup, &packetid, maxcount, &count, topicFilters, buf, buflen) == 1)
strindex = MQTTStringFormat_unsubscribe(strbuf, strbuflen, dup, packetid, count, topicFilters); /*strindex = */MQTTStringFormat_unsubscribe(strbuf, strbuflen, dup, packetid, count, topicFilters);
} }
break; break;
case PINGREQ: case PINGREQ:
case PINGRESP: case PINGRESP:
case DISCONNECT: case DISCONNECT:
strindex = snprintf(strbuf, strbuflen, "%s", MQTTPacket_names[header.bits.type]); /*strindex = */snprintf(strbuf, strbuflen, "%s", MQTTPacket_names[header.bits.type]);
break; break;
} }