libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit c01b043ff9585cf201bae0b7f732d3972cb1945f
parent 32d37eb7705e0a206358cccccdfd2afb767d0058
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Mon, 29 Jan 2024 23:16:14 +0100

Fixed and/or muted compiler warnings

Diffstat:
Msrc/microhttpd/daemon.c | 7++++++-
Msrc/microhttpd/test_upgrade.c | 5+++--
Msrc/testcurl/https/test_https_multi_daemon.c | 4++--
Msrc/testcurl/https/test_https_sni.c | 2+-
Msrc/testcurl/https/tls_test_common.h | 4++--
Msrc/testcurl/mhd_has_in_name.h | 4++--
Msrc/testcurl/perf_get_concurrent.c | 4+---
Msrc/testcurl/test_get_close_keep_alive.c | 4++--
8 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -2780,7 +2780,8 @@ new_connection_prepare_ (struct MHD_Daemon *daemon, (int) (client_socket)); #else /* GnuTLS before 3.1.9 or Win x64 */ gnutls_transport_set_ptr (connection->tls_session, - (gnutls_transport_ptr_t) (intptr_t) (client_socket)); + (gnutls_transport_ptr_t) \ + (intptr_t) client_socket); #endif /* GnuTLS before 3.1.9 or Win x64 */ #ifdef MHD_TLSLIB_NEED_PUSH_FUNC gnutls_transport_set_push_function (connection->tls_session, @@ -6358,6 +6359,8 @@ daemon_tls_priorities_init_default (struct MHD_Daemon *daemon) mhd_assert (MHD_TLS_PRIO_BASE_NORMAL + 1 == \ sizeof(MHD_TlsBasePriotities) / sizeof(MHD_TlsBasePriotities[0])); + res = GNUTLS_E_SUCCESS; /* Mute compiler warning */ + for (p = 0; p < sizeof(MHD_TlsBasePriotities) / sizeof(MHD_TlsBasePriotities[0]); ++p) @@ -6436,6 +6439,8 @@ daemon_tls_priorities_init_append_inner_ (struct MHD_Daemon *daemon, mhd_assert (MHD_TLS_PRIO_BASE_NORMAL + 1 == \ sizeof(MHD_TlsBasePriotities) / sizeof(MHD_TlsBasePriotities[0])); + res = GNUTLS_E_SUCCESS; /* Mute compiler warning */ + for (p = 0; p < sizeof(MHD_TlsBasePriotities) / sizeof(MHD_TlsBasePriotities[0]); ++p) diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c @@ -512,7 +512,8 @@ wr_create_tls_sckt (void) gnutls_transport_set_int (s->tls_s, (int) (s->fd)); #else /* GnuTLS before 3.1.9 or Win x64 */ gnutls_transport_set_ptr (s->tls_s, - (gnutls_transport_ptr_t) (intptr_t) (s->fd)); + (gnutls_transport_ptr_t) \ + (intptr_t) (s->fd)); #endif /* GnuTLS before 3.1.9 or Win x64 */ return s; } @@ -2120,7 +2121,7 @@ global_test_init (void) rclient_msg_size = MHD_STATICSTR_LEN_ ("Hello"); rclient_msg = "Hello"; - app_msg_size = MHD_STATICSTR_LEN_ ("World");; + app_msg_size = MHD_STATICSTR_LEN_ ("World"); app_msg = "World"; } return true; diff --git a/src/testcurl/https/test_https_multi_daemon.c b/src/testcurl/https/test_https_multi_daemon.c @@ -84,7 +84,7 @@ test_concurent_daemon_pair (void *cls, MHD_stop_daemon (d1); return 1; } - port1 = (int) dinfo->port; + port1 = dinfo->port; } d2 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION @@ -112,7 +112,7 @@ test_concurent_daemon_pair (void *cls, MHD_stop_daemon (d2); return 1; } - port2 = (int) dinfo->port; + port2 = dinfo->port; } res = diff --git a/src/testcurl/https/test_https_sni.c b/src/testcurl/https/test_https_sni.c @@ -235,7 +235,7 @@ do_get (const char *url, uint16_t port) curl_easy_cleanup (c); free (cbc.buf); curl_slist_free_all (dns_info); - return errornum; + return -1; } curl_easy_cleanup (c); diff --git a/src/testcurl/https/tls_test_common.h b/src/testcurl/https/tls_test_common.h @@ -232,8 +232,8 @@ int testsuite_curl_global_init (void); * @param prog_name program name, may include path * @param marker marker to look for. * @return zero if any parameter is NULL or empty string or - * @prog_name ends with slash or @marker is not found in - * program name, non-zero if @maker is found in program + * @a prog_name ends with slash or @a marker is not found in + * program name, non-zero if @a maker is found in program * name. */ int diff --git a/src/testcurl/mhd_has_in_name.h b/src/testcurl/mhd_has_in_name.h @@ -34,8 +34,8 @@ * @param prog_name program name, may include path * @param marker marker to look for. * @return zero if any parameter is NULL or empty string or - * @prog_name ends with slash or @marker is not found in - * program name, non-zero if @maker is found in program + * @a prog_name ends with slash or @a marker is not found in + * program name, non-zero if @a maker is found in program * name. */ static int diff --git a/src/testcurl/perf_get_concurrent.c b/src/testcurl/perf_get_concurrent.c @@ -412,7 +412,6 @@ testExternalGet (uint16_t port) MHD_socket max; struct timeval tv; uint64_t tt64; - int tret; char *ret_val; int ret = 0; @@ -455,8 +454,7 @@ testExternalGet (uint16_t port) MHD_stop_daemon (d); return 4096; } - tret = MHD_get_timeout64 (d, &tt64); - if (MHD_YES != tret) + if (MHD_NO == MHD_get_timeout64 (d, &tt64)) tt64 = 1; #if ! defined(_WIN32) || defined(__CYGWIN__) tv.tv_sec = (time_t) (tt64 / 1000); diff --git a/src/testcurl/test_get_close_keep_alive.c b/src/testcurl/test_get_close_keep_alive.c @@ -108,7 +108,7 @@ #endif -static void +_MHD_NORETURN static void _externalErrorExit_func (const char *errDesc, const char *funcName, int lineNum) { if ((NULL != errDesc) && (0 != errDesc[0])) @@ -132,7 +132,7 @@ _externalErrorExit_func (const char *errDesc, const char *funcName, int lineNum) static char libcurl_errbuf[CURL_ERROR_SIZE] = ""; -static void +_MHD_NORETURN static void _libcurlErrorExit_func (const char *errDesc, const char *funcName, int lineNum) { if ((NULL != errDesc) && (0 != errDesc[0]))