Fix some conversion warnings.

This commit is contained in:
Roger A. Light 2021-04-19 09:37:20 +01:00
parent d3dd89da82
commit 0446bba7df
2 changed files with 4 additions and 4 deletions

View File

@ -391,7 +391,7 @@ static void dynsec__payload_callback(struct mosq_ctrl *ctrl, long payloadlen, co
UNUSED(payloadlen); UNUSED(payloadlen);
tree = cJSON_Parse(payload); tree = cJSON_Parse(payload);
#else #else
tree = cJSON_ParseWithLength(payload, payloadlen); tree = cJSON_ParseWithLength(payload, (size_t)payloadlen);
#endif #endif
if(tree == NULL){ if(tree == NULL){
fprintf(stderr, "Error: Payload not JSON.\n"); fprintf(stderr, "Error: Payload not JSON.\n");

View File

@ -63,7 +63,7 @@ bool db__ready_for_flight(struct mosquitto_msg_data *msgs, int qos)
return valid_count; return valid_count;
} }
}else{ }else{
valid_bytes = msgs->msg_bytes12 < db.config->max_inflight_bytes; valid_bytes = (ssize_t)msgs->msg_bytes12 < (ssize_t)db.config->max_inflight_bytes;
valid_count = msgs->inflight_quota > 0; valid_count = msgs->inflight_quota > 0;
if(msgs->inflight_maximum == 0){ if(msgs->inflight_maximum == 0){
@ -102,7 +102,7 @@ bool db__ready_for_queue(struct mosquitto *context, int qos, struct mosquitto_ms
if(qos == 0){ if(qos == 0){
return false; /* This case is handled in db__ready_for_flight() */ return false; /* This case is handled in db__ready_for_flight() */
}else{ }else{
source_bytes = msg_data->msg_bytes12; source_bytes = (ssize_t)msg_data->msg_bytes12;
source_count = msg_data->msg_count12; source_count = msg_data->msg_count12;
} }
adjust_count = msg_data->inflight_maximum; adjust_count = msg_data->inflight_maximum;
@ -113,7 +113,7 @@ bool db__ready_for_queue(struct mosquitto *context, int qos, struct mosquitto_ms
adjust_count = 0; adjust_count = 0;
} }
valid_bytes = source_bytes - adjust_bytes < db.config->max_queued_bytes; valid_bytes = (source_bytes - (ssize_t)adjust_bytes) < (ssize_t)db.config->max_queued_bytes;
valid_count = source_count - adjust_count < db.config->max_queued_messages; valid_count = source_count - adjust_count < db.config->max_queued_messages;
if(db.config->max_queued_bytes == 0){ if(db.config->max_queued_bytes == 0){