fix more warnings

This commit is contained in:
Christian Grothoff
2020-04-11 11:28:36 +02:00
parent f4be5e0154
commit 912181afd3
3 changed files with 10 additions and 9 deletions
+5 -4
View File
@@ -46,6 +46,7 @@ ahc_echo (void *cls,
char *username;
const char *password = "testpass";
const char *realm = "test@example.com";
int res;
enum MHD_Result ret;
(void) cls; /* Unused. Silent compiler warning. */
(void) url; /* Unused. Silent compiler warning. */
@@ -68,13 +69,13 @@ ahc_echo (void *cls,
MHD_destroy_response (response);
return ret;
}
ret = MHD_digest_auth_check (connection, realm,
res = MHD_digest_auth_check (connection, realm,
username,
password,
300);
MHD_free (username);
if ( (ret == MHD_INVALID_NONCE) ||
(ret == MHD_NO) )
if ( (res == MHD_INVALID_NONCE) ||
(res == MHD_NO) )
{
response = MHD_create_response_from_buffer (strlen (DENIED),
DENIED,
@@ -84,7 +85,7 @@ ahc_echo (void *cls,
ret = MHD_queue_auth_fail_response (connection, realm,
MY_OPAQUE_STR,
response,
(ret == MHD_INVALID_NONCE) ? MHD_YES :
(res == MHD_INVALID_NONCE) ? MHD_YES :
MHD_NO);
MHD_destroy_response (response);
return ret;
+4 -4
View File
@@ -357,7 +357,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
else if (buffer_size > (size_t) ret)
connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
#endif /* EPOLL_SUPPORT */
if (ret == buffer_size)
if (buffer_size == (size_t) ret)
post_cork_setsockopt (connection, want_cork);
}
@@ -398,7 +398,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
header,
header_size,
MHD_SSO_HDR_CORK);
if ( (ret == header_size) &&
if ( (header_size == (size_t) ret) &&
(0 == buffer_size) &&
connection->sk_cork_on)
{
@@ -443,7 +443,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
/* Only if we succeeded sending the full buffer, we need to make sure that
the OS flushes at the end */
if (ret == header_size + buffer_size)
if (header_size + buffer_size == (size_t) ret)
post_cork_setsockopt (connection, false);
return ret;
@@ -665,7 +665,7 @@ MHD_send_sendfile_ (struct MHD_Connection *connection)
/* Make sure we send the data without delay ONLY if we
provided the complete response (not on partial write) */
if (ret == left)
if (left == (uint64_t) ret)
post_cork_setsockopt (connection, false);
return ret;
+1 -1
View File
@@ -391,7 +391,7 @@ process_value (struct MHD_PostProcessor *pp,
pp->xbuf_pos = 0;
if (NULL != last_escape)
{
if (value_end - last_escape < sizeof (pp->xbuf))
if (((size_t) (value_end - last_escape)) < sizeof (pp->xbuf))
{
pp->xbuf_pos = value_end - last_escape;
memcpy (pp->xbuf,