Compiler warning fixes

This commit is contained in:
Roger A. Light
2026-01-22 23:42:16 +00:00
parent 567d1bbf91
commit 7de6cb42ef
13 changed files with 15 additions and 15 deletions

View File

@@ -3003,7 +3003,7 @@ static int config__check(struct mosquitto__config *config)
id_prefix_len = config->security_options.auto_id_prefix_len;
}else{
id_prefix = "auto-";
id_prefix_len = strlen("auto-");
id_prefix_len = (int)strlen("auto-");
}
/* Default to auto_id_prefix = 'auto-' if none set. */

View File

@@ -59,7 +59,7 @@ static int scmp_p(const void *p1, const void *p2)
while(s1[0] && s2[0]){
/* Sort by case insensitive part first */
result = toupper(s1[0]) - toupper(s2[0]);
result = toupper((unsigned char)s1[0]) - toupper((unsigned char)s2[0]);
if(result == 0){
/* Case insensitive part matched, now distinguish between case */
result = s1[0] - s2[0];

View File

@@ -41,7 +41,7 @@ static void control__negative_reply(const char *clientid, const char *request_to
}
snprintf(response_topic, response_topic_len, "%s/response", request_topic);
mosquitto_broker_publish_copy(clientid, response_topic, strlen(payload), payload, 0, false, NULL);
mosquitto_broker_publish_copy(clientid, response_topic, (int)strlen(payload), payload, 0, false, NULL);
mosquitto_FREE(response_topic);
}

View File

@@ -172,7 +172,7 @@ static int listeners__add_local(const char *host, uint16_t port)
mosquitto_FREE(listeners[db.config->listener_count].security_options);
return MOSQ_ERR_NOMEM;
}
listeners[db.config->listener_count].security_options->auto_id_prefix_len = strlen("auto-");
listeners[db.config->listener_count].security_options->auto_id_prefix_len = (int)strlen("auto-");
listeners[db.config->listener_count].port = port;
listeners[db.config->listener_count].host = mosquitto_strdup(host);
if(listeners[db.config->listener_count].host == NULL){