From 6f3bdc5dca8e8b6982ae2667a8b558ab5fdfc65c Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Mon, 7 Nov 2022 15:23:47 -0300 Subject: [PATCH] Remove some warnings --- examples/device-dashboard/net.c | 6 ++++-- examples/mip-tap/main.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/device-dashboard/net.c b/examples/device-dashboard/net.c index 07e77ddb..3416fdf7 100644 --- a/examples/device-dashboard/net.c +++ b/examples/device-dashboard/net.c @@ -128,7 +128,8 @@ static void mqtt_fn(struct mg_connection *c, int ev, void *ev_data, void *fnd) { static void timer_mqtt_fn(void *param) { struct mg_mgr *mgr = (struct mg_mgr *) param; if (s_mqtt == NULL) { - struct mg_mqtt_opts opts = {0}; + struct mg_mqtt_opts opts; + memset(&opts, 0, sizeof(opts)); s_mqtt = mg_mqtt_connect(mgr, s_config.url, &opts, mqtt_fn, NULL); } } @@ -207,7 +208,8 @@ void device_dashboard_fn(struct mg_connection *c, int ev, void *ev_data, mg_http_reply(c, 200, NULL, "{%Q:%Q,%Q:%Q}\n", "user", u->name, "token", u->token); } else { - struct mg_http_serve_opts opts = {0}; + struct mg_http_serve_opts opts; + memset(&opts, 0, sizeof(opts)); #if 1 opts.root_dir = "/web_root"; opts.fs = &mg_fs_packed; diff --git a/examples/mip-tap/main.c b/examples/mip-tap/main.c index ff4799a5..b2fbeee6 100644 --- a/examples/mip-tap/main.c +++ b/examples/mip-tap/main.c @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) { &c.mac[3], &c.mac[4], &c.mac[5]); struct mip_driver driver = {.tx = tap_tx, .up = tap_up, .rx = tap_rx}; - mip_init(&mgr, &c, &driver, (void *) fd); + mip_init(&mgr, &c, &driver, (void *) (size_t) fd); MG_INFO(("Init done, starting main loop")); extern void device_dashboard_fn(struct mg_connection *, int, void *, void *);