From 05458eb35d76f96dff73a948bdb0519b4939cb70 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 6 Feb 2019 13:42:49 +0000 Subject: [PATCH] Fix some unused variable warnings. --- client/client_shared.c | 4 ++++ src/conf.c | 4 ++++ src/context.c | 2 ++ src/loop.c | 4 ++-- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/client/client_shared.c b/client/client_shared.c index 8f993dc9..981eea3a 100644 --- a/client/client_shared.c +++ b/client/client_shared.c @@ -34,7 +34,9 @@ Contributors: #include #include "client_shared.h" +#ifdef WITH_SOCKS static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url); +#endif static int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[]); @@ -884,7 +886,9 @@ unknown_option: int client_opts_set(struct mosquitto *mosq, struct mosq_config *cfg) { +#ifdef WITH_SOCKS int rc; +#endif if(cfg->will_topic && mosquitto_will_set(mosq, cfg->will_topic, cfg->will_payloadlen, cfg->will_payload, cfg->will_qos, diff --git a/src/conf.c b/src/conf.c index 8479fd25..14d35284 100644 --- a/src/conf.c +++ b/src/conf.c @@ -269,7 +269,9 @@ void config__init(struct mosquitto_db *db, struct mosquitto__config *config) void config__cleanup(struct mosquitto__config *config) { int i; +#ifdef WITH_BRIDGE int j; +#endif mosquitto__free(config->clientid_prefixes); mosquitto__free(config->persistence_location); @@ -583,7 +585,9 @@ int config__read(struct mosquitto_db *db, struct mosquitto__config *config, bool int rc = MOSQ_ERR_SUCCESS; struct config_recurse cr; int lineno = 0; +#ifdef WITH_PERSISTENCE int len; +#endif struct mosquitto__config config_reload; int i; diff --git a/src/context.c b/src/context.c index b7e47565..0a9ac175 100644 --- a/src/context.c +++ b/src/context.c @@ -99,7 +99,9 @@ void context__cleanup(struct mosquitto_db *db, struct mosquitto *context, bool d { struct mosquitto__packet *packet; struct mosquitto_client_msg *msg, *next; +#ifdef WITH_BRIDGE int i; +#endif if(!context) return; diff --git a/src/loop.c b/src/loop.c index 980de518..7535b6d0 100644 --- a/src/loop.c +++ b/src/loop.c @@ -128,11 +128,11 @@ int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int li #endif #ifdef WITH_BRIDGE int rc; + int err; + socklen_t len; #endif time_t expiration_check_time = 0; char *id; - int err; - socklen_t len; #ifndef WIN32 sigemptyset(&sigblock);