mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-02-06 02:52:07 +08:00
Compiler warning fixes
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user