-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings about size_t being cast to a narrower type #1875
base: master
Are you sure you want to change the base?
Conversation
@@ -63,7 +63,7 @@ static void gpsd_client_event(struct mg_connection *nc, int ev, void *ev_data) | |||
// Success | |||
fprintf(stderr, "GPSd Connected...\n"); | |||
if (ctx->init_str && *ctx->init_str) { | |||
mg_send(nc, ctx->init_str, strlen(ctx->init_str)); | |||
mg_send(nc, ctx->init_str, (int)strlen(ctx->init_str)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should not be required if mongoose was consistent in its methods declarations: mg_send_http_chunk
, mg_send_websocket_frame
and almost all others take a size_t
, but for some reason mg_send
does not...
@@ -1090,7 +1090,7 @@ static void http_broadcast_send(struct http_server_context *ctx, char const *msg | |||
mg_set_timer(nc, mg_time() + KEEP_ALIVE); // reset keep alive timer | |||
} | |||
else if (cctx && !cctx->is_chunked) { | |||
mg_send(nc, msg, len); | |||
mg_send(nc, msg, (int)len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should not be required if mongoose was consistent in its methods declarations: mg_send_http_chunk
, mg_send_websocket_frame
and almost all others take a size_t
, but for some reason mg_send
does not...
8e31ece
to
e42ad33
Compare
30e27ae
to
7c3ef9e
Compare
I have just rebased this branch on the latest master, please let me know if this is still of interest |
7c3ef9e
to
4bb48c9
Compare
93031a1
to
ed794ec
Compare
…ables because system functions like fread/snprintf/malloc all work with size_t
… cannot be changed, make the cast explicit
4bb48c9
to
2530ae0
Compare
This fixes a few C4267 warning as reported in #1866 because the x64 target defines
size_t
as a 64 bit unsigned integer.