Removed compiler warnings

Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
This commit is contained in:
Norbert Heusser
2025-07-10 00:52:33 +01:00
committed by Roger Light
parent 424df70395
commit f7a00aa19c
6 changed files with 15 additions and 12 deletions
+1
View File
@@ -194,6 +194,7 @@ void ctrl_shell__connect_blocking(const char *hostname, int port)
rc = mosquitto_loop_start(data.mosq);
/* FIXME - do something with the error */
UNUSED(rc);
response_wait(true);
}
+2
View File
@@ -909,6 +909,8 @@ static void print_default_acls(cJSON *j_data)
static void response_callback(const char *command, cJSON *j_data, const char *payload)
{
UNUSED(payload);
if(!strcmp(command, "listClients")){
completion_tree_arg_list_args_free(tree_clients);
+7 -7
View File
@@ -90,7 +90,7 @@
CHECK_EOF(); \
} \
tok = tok_start; \
toklen = buf - tok_start; \
toklen = (size_t)(buf - tok_start); \
} while (0)
static const char *token_char_map = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -181,9 +181,9 @@ FOUND_CTL:
if (likely(*buf == '\015')) {
++buf;
EXPECT_CHAR('\012');
*token_len = buf - 2 - token_start;
*token_len = (size_t)(buf - 2 - token_start);
} else if (*buf == '\012') {
*token_len = buf - token_start;
*token_len = (size_t)(buf - token_start);
++buf;
} else {
*ret = -1;
@@ -272,7 +272,7 @@ static const char *parse_token(const char *buf, const char *buf_end, const char
CHECK_EOF();
}
*token = buf_start;
*token_len = buf - buf_start;
*token_len = (size_t)(buf - buf_start);
return buf;
}
@@ -347,7 +347,7 @@ static const char *parse_headers(const char *buf, const char *buf_end, struct ph
}
}
headers[*num_headers].value = value;
headers[*num_headers].value_len = value_end - value;
headers[*num_headers].value_len = (size_t)(value_end - value);
}
return buf;
}
@@ -563,7 +563,7 @@ ssize_t phr_decode_chunked(struct phr_chunked_decoder *decoder, char *buf, size_
ret = -1;
goto Exit;
}
decoder->bytes_left_in_chunk = decoder->bytes_left_in_chunk * 16 + v;
decoder->bytes_left_in_chunk = decoder->bytes_left_in_chunk * 16 + (size_t)v;
++decoder->_hex_count;
}
decoder->_hex_count = 0;
@@ -647,7 +647,7 @@ ssize_t phr_decode_chunked(struct phr_chunked_decoder *decoder, char *buf, size_
}
Complete:
ret = bufsz - src;
ret = (ssize_t)(bufsz - src);
Exit:
if (dst != src)
memmove(buf + dst, buf + src, bufsz - src);
+3 -3
View File
@@ -496,7 +496,7 @@ int db__message_insert_incoming(struct mosquitto *context, uint64_t cmsg_id, str
db__msg_store_ref_inc(client_msg->base_msg);
client_msg->data.mid = base_msg->data.source_mid;
client_msg->data.direction = mosq_md_in;
client_msg->data.state = state;
client_msg->data.state = (enum mosquitto_msg_state)state;
client_msg->data.dup = false;
if(base_msg->data.qos > context->max_qos){
client_msg->data.qos = context->max_qos;
@@ -637,7 +637,7 @@ int db__message_insert_outgoing(struct mosquitto *context, uint64_t cmsg_id, uin
db__msg_store_ref_inc(client_msg->base_msg);
client_msg->data.mid = mid;
client_msg->data.direction = mosq_md_out;
client_msg->data.state = state;
client_msg->data.state = (enum mosquitto_msg_state)state;
client_msg->data.dup = false;
if(qos > context->max_qos){
client_msg->data.qos = context->max_qos;
@@ -712,7 +712,7 @@ int db__message_update_outgoing(struct mosquitto *context, uint16_t mid, enum mo
if(client_msg->data.qos != qos){
return MOSQ_ERR_PROTOCOL;
}
client_msg->data.state = state;
client_msg->data.state = (enum mosquitto_msg_state)state;
if(persist){
plugin_persist__handle_client_msg_update(context, client_msg);
}
+1 -1
View File
@@ -292,7 +292,7 @@ struct mosquitto__listener_sock{
struct plugin_own_callback{
struct plugin_own_callback *next, *prev;
MOSQ_FUNC_generic_callback cb_func;
int event;
enum mosquitto_plugin_event event;
};
struct mosquitto_plugin_id_t{
+1 -1
View File
@@ -302,7 +302,7 @@ BROKER_EXPORT int mosquitto_callback_unregister(
}
DL_FOREACH_SAFE(identifier->own_callbacks, own, own_tmp){
if(own->event == event && own->cb_func == cb_func){
if(own->event == (enum mosquitto_plugin_event)event && own->cb_func == cb_func){
return remove_callback(identifier, own);
}
}