Squash warnings under linux

This commit is contained in:
cpq 2020-12-14 14:05:01 +00:00
parent 0c142f20d7
commit fa8f62fb5d
3 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ static const char *s_topic = "mg/test";
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_ERROR) {
// On error, log error message
LOG(LL_ERROR, ("%p %s", c->fd, ev_data));
LOG(LL_ERROR, ("%p %s", c->fd, (char *) ev_data));
} else if (ev == MG_EV_CONNECT) {
// If target URL is SSL/TLS, command client connection to use TLS
if (mg_url_is_ssl(s_url)) {

View File

@ -82,7 +82,7 @@ static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
}
} else if (ev == MG_EV_POLL && c->fn_data != NULL) {
// On each poll iteration, try to receive response data
int sock = (int) c->fn_data;
int sock = (int) (long) c->fn_data;
struct response response = {NULL, 0};
if (recv(sock, (void *) &response, sizeof(response), 0) ==
sizeof(response)) {

View File

@ -13,7 +13,7 @@ static const char *s_url = "ws://localhost:8000/websocket";
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
if (ev == MG_EV_ERROR) {
// On error, log error message
LOG(LL_ERROR, ("%p %s", c->fd, ev_data));
LOG(LL_ERROR, ("%p %s", c->fd, (char *) ev_data));
} else if (ev == MG_EV_WS_OPEN) {
// When websocket handshake is successful, send message
mg_ws_send(c, "hello", 5, WEBSOCKET_OP_TEXT);