Skip to content

Commit abb6f58

Browse files
Nikita Nerkarhedeshianaws
authored andcommitted
Fixed compilation warnings
fixes #78
1 parent 2567e5c commit abb6f58

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/aws_iot_mqtt_client_connect.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,9 @@ IoT_Error_t aws_iot_mqtt_connect(AWS_IoT_Client *pClient, IoT_Client_Connect_Par
478478
if(SUCCESS != rc) {
479479
pClient->networkStack.disconnect(&(pClient->networkStack));
480480
disconRc = pClient->networkStack.destroy(&(pClient->networkStack));
481+
if (SUCCESS != disconRc) {
482+
FUNC_EXIT_RC(NETWORK_DISCONNECTED_ERROR);
483+
}
481484
aws_iot_mqtt_set_client_state(pClient, CLIENT_STATE_CONNECTING, CLIENT_STATE_DISCONNECTED_ERROR);
482485
} else {
483486
aws_iot_mqtt_set_client_state(pClient, CLIENT_STATE_CONNECTING, CLIENT_STATE_CONNECTED_IDLE);

src/aws_iot_shadow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const ShadowInitParameters_t ShadowInitParametersDefault = {(char *) AWS_IOT_MQT
3636
NULL, false, NULL};
3737

3838
const ShadowConnectParameters_t ShadowConnectParametersDefault = {(char *) AWS_IOT_MY_THING_NAME,
39-
(char *) AWS_IOT_MQTT_CLIENT_ID, 0};
39+
(char *) AWS_IOT_MQTT_CLIENT_ID, 0, NULL};
4040

4141
void aws_iot_shadow_reset_last_received_version(void) {
4242
shadowJsonVersionNum = 0;

src/aws_iot_shadow_json.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ IoT_Error_t aws_iot_shadow_add_reported(char *pJsonDocument, size_t maxSizeOfJso
217217
int32_t FillWithClientTokenSize(char *pBufferToBeUpdatedWithClientToken, size_t maxSizeOfJsonDocument) {
218218
int32_t snPrintfReturn;
219219
snPrintfReturn = snprintf(pBufferToBeUpdatedWithClientToken, maxSizeOfJsonDocument, "%s-%d", mqttClientID,
220-
clientTokenNum++);
220+
(int) clientTokenNum++);
221221

222222
return snPrintfReturn;
223223
}
@@ -282,7 +282,7 @@ IoT_Error_t aws_iot_finalize_json_document(char *pJsonDocument, size_t maxSizeOf
282282
}
283283

284284
void FillWithClientToken(char *pBufferToBeUpdatedWithClientToken) {
285-
sprintf(pBufferToBeUpdatedWithClientToken, "%s-%d", mqttClientID, clientTokenNum++);
285+
sprintf(pBufferToBeUpdatedWithClientToken, "%s-%d", mqttClientID, (int) clientTokenNum++);
286286
}
287287

288288
static IoT_Error_t convertDataToString(char *pStringBuffer, size_t maxSizoStringBuffer, JsonPrimitiveType type,
@@ -330,6 +330,8 @@ static jsmntok_t jsonTokenStruct[MAX_JSON_TOKEN_EXPECTED];
330330
bool isJsonValidAndParse(const char *pJsonDocument, void *pJsonHandler, int32_t *pTokenCount) {
331331
int32_t tokenCount;
332332

333+
IOT_UNUSED(pJsonHandler);
334+
333335
jsmn_init(&shadowJsonParser);
334336

335337
tokenCount = jsmn_parse(&shadowJsonParser, pJsonDocument, strlen(pJsonDocument), jsonTokenStruct,
@@ -383,10 +385,10 @@ bool isJsonKeyMatchingAndUpdateValue(const char *pJsonDocument, void *pJsonHandl
383385
jsonStruct_t *pDataStruct, uint32_t *pDataLength, int32_t *pDataPosition) {
384386
int32_t i;
385387
uint32_t dataLength;
386-
jsmntok_t *pJsonTokenStruct;
387388
jsmntok_t dataToken;
388389

389-
pJsonTokenStruct = (jsmntok_t *) pJsonHandler;
390+
IOT_UNUSED(pJsonHandler);
391+
390392
for(i = 1; i < tokenCount; i++) {
391393
if(jsoneq(pJsonDocument, &(jsonTokenStruct[i]), pDataStruct->pKey) == 0) {
392394
dataToken = jsonTokenStruct[i + 1];

src/aws_iot_shadow_records.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static void AckStatusCallback(AWS_IoT_Client *pClient, char *topicName, uint16_t
214214
for(i = 0; i < MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME; i++) {
215215
if(!AckWaitList[i].isFree) {
216216
if(strcmp(AckWaitList[i].clientTokenID, temporaryClientToken) == 0) {
217-
Shadow_Ack_Status_t status = SHADOW_ACK_TIMEOUT;
217+
Shadow_Ack_Status_t status = SHADOW_ACK_REJECTED;
218218
if(strstr(topicName, "accepted") != NULL) {
219219
status = SHADOW_ACK_ACCEPTED;
220220
} else if(strstr(topicName, "rejected") != NULL) {

0 commit comments

Comments
 (0)