Skip to content

Commit

Permalink
Fix some conversion warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Apr 19, 2021
1 parent d3dd89d commit 0446bba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/mosquitto_ctrl/dynsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static void dynsec__payload_callback(struct mosq_ctrl *ctrl, long payloadlen, co
UNUSED(payloadlen);
tree = cJSON_Parse(payload);
#else
tree = cJSON_ParseWithLength(payload, payloadlen);
tree = cJSON_ParseWithLength(payload, (size_t)payloadlen);
#endif
if(tree == NULL){
fprintf(stderr, "Error: Payload not JSON.\n");
Expand Down
6 changes: 3 additions & 3 deletions src/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ bool db__ready_for_flight(struct mosquitto_msg_data *msgs, int qos)
return valid_count;
}
}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;

if(msgs->inflight_maximum == 0){
Expand Down Expand Up @@ -102,7 +102,7 @@ bool db__ready_for_queue(struct mosquitto *context, int qos, struct mosquitto_ms
if(qos == 0){
return false; /* This case is handled in db__ready_for_flight() */
}else{
source_bytes = msg_data->msg_bytes12;
source_bytes = (ssize_t)msg_data->msg_bytes12;
source_count = msg_data->msg_count12;
}
adjust_count = msg_data->inflight_maximum;
Expand All @@ -113,7 +113,7 @@ bool db__ready_for_queue(struct mosquitto *context, int qos, struct mosquitto_ms
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;

if(db.config->max_queued_bytes == 0){
Expand Down

0 comments on commit 0446bba

Please sign in to comment.