From ba02937ec670a97091a0fe6184f2a9b3caef4a42 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Tue, 2 Nov 2021 16:40:25 +0000 Subject: [PATCH] Squash warnings --- examples/mqtt-over-ws-client/main.c | 2 +- mongoose.c | 4 ++-- src/http.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/mqtt-over-ws-client/main.c b/examples/mqtt-over-ws-client/main.c index ee2ff535..032f285f 100644 --- a/examples/mqtt-over-ws-client/main.c +++ b/examples/mqtt-over-ws-client/main.c @@ -32,7 +32,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { .will_topic = mg_str(s_topic), .will_message = mg_str("goodbye")}; size_t len = c->send.len; - mg_mqtt_login(c, s_url, &opts); + mg_mqtt_login(c, &opts); mg_ws_wrap(c, c->send.len - len, WEBSOCKET_OP_BINARY); } else if (ev == MG_EV_WS_MSG) { struct mg_mqtt_message mm; diff --git a/mongoose.c b/mongoose.c index 3dcfe7ab..b7f0355d 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1336,7 +1336,6 @@ static void printdirentry(const char *name, void *userdata) { struct tm tm; if (flags & MG_FS_DIR) { snprintf(sz, sizeof(sz), "%s", "[DIR]"); - size = -1; } else if (size < 1024) { snprintf(sz, sizeof(sz), "%d", (int) size); } else if (size < 0x100000) { @@ -1351,7 +1350,8 @@ static void printdirentry(const char *name, void *userdata) { mg_printf(d->c, " %s%s" "%s%s\n", - n, path, slash, name, slash, (unsigned long) t, mod, size, sz); + n, path, slash, name, slash, (unsigned long) t, mod, + flags & MG_FS_DIR ? (int64_t) -1 : (int64_t) size, sz); } } diff --git a/src/http.c b/src/http.c index 4b5070a4..f65478d7 100644 --- a/src/http.c +++ b/src/http.c @@ -587,7 +587,6 @@ static void printdirentry(const char *name, void *userdata) { struct tm tm; if (flags & MG_FS_DIR) { snprintf(sz, sizeof(sz), "%s", "[DIR]"); - size = -1; } else if (size < 1024) { snprintf(sz, sizeof(sz), "%d", (int) size); } else if (size < 0x100000) { @@ -602,7 +601,8 @@ static void printdirentry(const char *name, void *userdata) { mg_printf(d->c, " %s%s" "%s%s\n", - n, path, slash, name, slash, (unsigned long) t, mod, size, sz); + n, path, slash, name, slash, (unsigned long) t, mod, + flags & MG_FS_DIR ? (int64_t) -1 : (int64_t) size, sz); } }