Remove some warnings

This commit is contained in:
Sergio R. Caprile 2022-11-07 15:23:47 -03:00
parent 095cdcd69e
commit 6f3bdc5dca
2 changed files with 5 additions and 3 deletions

View File

@ -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;

View File

@ -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 *);