mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-02-05 10:40:05 +08:00
Minor compiler warning fixes
This commit is contained in:
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
int pid = -2;
|
int pid = -2;
|
||||||
int msig = 0;
|
enum mosq_signal msig = 0;
|
||||||
|
|
||||||
if(argc == 1){
|
if(argc == 1){
|
||||||
print_usage();
|
print_usage();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ enum mosq_signal {
|
|||||||
MSIG_XTREPORT,
|
MSIG_XTREPORT,
|
||||||
};
|
};
|
||||||
|
|
||||||
void signal_all(enum mosq_signal msig);
|
void signal_all(int sig);
|
||||||
void send_signal(int pid, enum mosq_signal msig);
|
void send_signal(int pid, enum mosq_signal msig);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Contributors:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void signal_all(enum mosq_signal sig)
|
void signal_all(int sig)
|
||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
struct dirent *d;
|
struct dirent *d;
|
||||||
|
|||||||
2
deps/picohttpparser/picohttpparser.c
vendored
2
deps/picohttpparser/picohttpparser.c
vendored
@@ -639,7 +639,7 @@ ssize_t phr_decode_chunked(struct phr_chunked_decoder *decoder, char *buf, size_
|
|||||||
decoder->_state = CHUNKED_IN_TRAILERS_LINE_HEAD;
|
decoder->_state = CHUNKED_IN_TRAILERS_LINE_HEAD;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(!"decoder is corrupt");
|
assert(0 /*"decoder is corrupt"*/);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ enum mosquitto_msg_direction {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum mosquitto_msg_state {
|
enum mosquitto_msg_state {
|
||||||
mosq_ms_any = -1,
|
|
||||||
mosq_ms_invalid = 0,
|
mosq_ms_invalid = 0,
|
||||||
mosq_ms_publish_qos0 = 1,
|
mosq_ms_publish_qos0 = 1,
|
||||||
mosq_ms_publish_qos1 = 2,
|
mosq_ms_publish_qos1 = 2,
|
||||||
@@ -113,6 +112,9 @@ enum mosquitto_msg_state {
|
|||||||
mosq_ms_wait_for_pubcomp = 9,
|
mosq_ms_wait_for_pubcomp = 9,
|
||||||
mosq_ms_send_pubrec = 10,
|
mosq_ms_send_pubrec = 10,
|
||||||
mosq_ms_queued = 11,
|
mosq_ms_queued = 11,
|
||||||
|
|
||||||
|
mosq_ms_any = 255,
|
||||||
|
/* max value allowed is 255 */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum mosquitto_client_state {
|
enum mosquitto_client_state {
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ int db__message_insert_incoming(struct mosquitto *context, uint64_t cmsg_id, str
|
|||||||
db__msg_store_ref_inc(client_msg->base_msg);
|
db__msg_store_ref_inc(client_msg->base_msg);
|
||||||
client_msg->data.mid = base_msg->data.source_mid;
|
client_msg->data.mid = base_msg->data.source_mid;
|
||||||
client_msg->data.direction = mosq_md_in;
|
client_msg->data.direction = mosq_md_in;
|
||||||
client_msg->data.state = (enum mosquitto_msg_state)state;
|
client_msg->data.state = (uint8_t)state;
|
||||||
client_msg->data.dup = false;
|
client_msg->data.dup = false;
|
||||||
if(base_msg->data.qos > context->max_qos){
|
if(base_msg->data.qos > context->max_qos){
|
||||||
client_msg->data.qos = context->max_qos;
|
client_msg->data.qos = context->max_qos;
|
||||||
@@ -674,7 +674,7 @@ int db__message_insert_outgoing(struct mosquitto *context, uint64_t cmsg_id, uin
|
|||||||
db__msg_store_ref_inc(client_msg->base_msg);
|
db__msg_store_ref_inc(client_msg->base_msg);
|
||||||
client_msg->data.mid = mid;
|
client_msg->data.mid = mid;
|
||||||
client_msg->data.direction = mosq_md_out;
|
client_msg->data.direction = mosq_md_out;
|
||||||
client_msg->data.state = (enum mosquitto_msg_state)state;
|
client_msg->data.state = (uint8_t)state;
|
||||||
client_msg->data.dup = false;
|
client_msg->data.dup = false;
|
||||||
if(qos > context->max_qos){
|
if(qos > context->max_qos){
|
||||||
client_msg->data.qos = context->max_qos;
|
client_msg->data.qos = context->max_qos;
|
||||||
@@ -757,7 +757,7 @@ static inline int db__message_update_outgoing_state(struct mosquitto *context, s
|
|||||||
context->id, client_msg->data.qos, qos);
|
context->id, client_msg->data.qos, qos);
|
||||||
return MOSQ_ERR_PROTOCOL;
|
return MOSQ_ERR_PROTOCOL;
|
||||||
}
|
}
|
||||||
client_msg->data.state = (enum mosquitto_msg_state)state;
|
client_msg->data.state = (uint8_t)state;
|
||||||
if(persist){
|
if(persist){
|
||||||
plugin_persist__handle_client_msg_update(context, client_msg);
|
plugin_persist__handle_client_msg_update(context, client_msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,20 +224,20 @@ BROKER_EXPORT int mosquitto_callback_register(
|
|||||||
if(own_callback == NULL){
|
if(own_callback == NULL){
|
||||||
return MOSQ_ERR_NOMEM;
|
return MOSQ_ERR_NOMEM;
|
||||||
}
|
}
|
||||||
own_callback->event = event;
|
own_callback->event = (enum mosquitto_plugin_event)event;
|
||||||
own_callback->cb_func = cb_func;
|
own_callback->cb_func = cb_func;
|
||||||
DL_APPEND(identifier->own_callbacks, own_callback);
|
DL_APPEND(identifier->own_callbacks, own_callback);
|
||||||
|
|
||||||
if(identifier->config.security_option_count == 0){
|
if(identifier->config.security_option_count == 0){
|
||||||
log__printf(NULL, MOSQ_LOG_WARNING, "Plugin could not register callback '%s'",
|
log__printf(NULL, MOSQ_LOG_WARNING, "Plugin could not register callback '%s'",
|
||||||
get_event_name(event));
|
get_event_name((enum mosquitto_plugin_event)event));
|
||||||
return MOSQ_ERR_INVAL;
|
return MOSQ_ERR_INVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0; i<identifier->config.security_option_count; i++){
|
for(int i=0; i<identifier->config.security_option_count; i++){
|
||||||
security_options = identifier->config.security_options[i];
|
security_options = identifier->config.security_options[i];
|
||||||
|
|
||||||
cb_base = plugin__get_callback_base(security_options, event);
|
cb_base = plugin__get_callback_base(security_options, (enum mosquitto_plugin_event)event);
|
||||||
if(cb_base == NULL){
|
if(cb_base == NULL){
|
||||||
return MOSQ_ERR_NOT_SUPPORTED;
|
return MOSQ_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
@@ -261,10 +261,10 @@ BROKER_EXPORT int mosquitto_callback_register(
|
|||||||
|
|
||||||
if(identifier->plugin_name){
|
if(identifier->plugin_name){
|
||||||
log__printf(NULL, MOSQ_LOG_INFO, "Plugin %s has registered to receive '%s' events.",
|
log__printf(NULL, MOSQ_LOG_INFO, "Plugin %s has registered to receive '%s' events.",
|
||||||
identifier->plugin_name, get_event_name(event));
|
identifier->plugin_name, get_event_name((enum mosquitto_plugin_event)event));
|
||||||
}else{
|
}else{
|
||||||
log__printf(NULL, MOSQ_LOG_INFO, "Plugin has registered to receive '%s' events.",
|
log__printf(NULL, MOSQ_LOG_INFO, "Plugin has registered to receive '%s' events.",
|
||||||
get_event_name(event));
|
get_event_name((enum mosquitto_plugin_event)event));
|
||||||
}
|
}
|
||||||
|
|
||||||
return MOSQ_ERR_SUCCESS;
|
return MOSQ_ERR_SUCCESS;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ static int plugin__handle_message_single(struct mosquitto__callback *callbacks,
|
|||||||
event_data.properties = stored->properties;
|
event_data.properties = stored->properties;
|
||||||
|
|
||||||
DL_FOREACH_SAFE(callbacks, cb_base, cb_next){
|
DL_FOREACH_SAFE(callbacks, cb_base, cb_next){
|
||||||
rc = cb_base->cb(ev_type, &event_data, cb_base->userdata);
|
rc = cb_base->cb((int)ev_type, &event_data, cb_base->userdata);
|
||||||
if(rc != MOSQ_ERR_SUCCESS){
|
if(rc != MOSQ_ERR_SUCCESS){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ TEST_F(CtrlShellDynsecTest, NoDynsec)
|
|||||||
data.response_received = true;
|
data.response_received = true;
|
||||||
return 0;
|
return 0;
|
||||||
}))
|
}))
|
||||||
.WillOnce(t::Invoke([this, &mosq](pthread_cond_t *, pthread_mutex_t *, const struct timespec *){
|
.WillOnce(t::Invoke([](pthread_cond_t *, pthread_mutex_t *, const struct timespec *){
|
||||||
// Subscribe
|
// Subscribe
|
||||||
data.response_received = true;
|
data.response_received = true;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user