From b999efd6e260ee2d12f1a16eab404dd2fdb75035 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 29 Sep 2024 16:20:14 +0200 Subject: [PATCH] -fix misc warnings --- src/include/microhttpd2.h | 2 +- src/tests/client_server/libtest.h | 24 +++++++++---------- src/tests/client_server/libtest_convenience.c | 2 +- .../libtest_convenience_client_request.c | 19 ++++++++------- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h index 246ec1a5..05e1486b 100644 --- a/src/include/microhttpd2.h +++ b/src/include/microhttpd2.h @@ -6749,7 +6749,7 @@ MHD_FN_PAR_IN_SIZE_ (6,5); * @param urh the HTTP-Upgraded handle * @param recv_buf_size the size of the @a recv_buf * @param recv_buf the buffer to receive the data - * @param[out] received_size the pointer to variable to get amount of received data + * @param received_size the pointer to variable to get amount of received data * @param max_wait_millisec the maximum wait time for the data, * non-blocking operation if set to zero, * wait indefinitely if larger or equal to diff --git a/src/tests/client_server/libtest.h b/src/tests/client_server/libtest.h index 13a9f32c..f1ac5e8c 100644 --- a/src/tests/client_server/libtest.h +++ b/src/tests/client_server/libtest.h @@ -61,7 +61,7 @@ struct MHDT_PhaseContext * @return error message, NULL on success */ typedef const char * -(*MHDT_ClientLogic)(void *cls, +(*MHDT_ClientLogic)(const void *cls, const struct MHDT_PhaseContext *pc); @@ -74,7 +74,7 @@ typedef const char * * @return error message, NULL on success */ const char * -MHDT_client_get_root (void *cls, +MHDT_client_get_root (const void *cls, const struct MHDT_PhaseContext *pc); @@ -89,7 +89,7 @@ MHDT_client_get_root (void *cls, * @return error message, NULL on success */ const char * -MHDT_client_get_with_query (void *cls, +MHDT_client_get_with_query (const void *cls, const struct MHDT_PhaseContext *pc); @@ -103,7 +103,7 @@ MHDT_client_get_with_query (void *cls, * @return error message, NULL on success */ const char * -MHDT_client_set_header (void *cls, +MHDT_client_set_header (const void *cls, const struct MHDT_PhaseContext *pc); @@ -118,7 +118,7 @@ MHDT_client_set_header (void *cls, * @return error message, NULL on success */ const char * -MHDT_client_expect_header (void *cls, +MHDT_client_expect_header (const void *cls, const struct MHDT_PhaseContext *pc); @@ -131,7 +131,7 @@ MHDT_client_expect_header (void *cls, * @return error message, NULL on success */ const char * -MHDT_client_put_data (void *cls, +MHDT_client_put_data (const void *cls, const struct MHDT_PhaseContext *pc); @@ -144,7 +144,7 @@ MHDT_client_put_data (void *cls, * @return error message, NULL on success */ const char * -MHDT_client_chunk_data (void *cls, +MHDT_client_chunk_data (const void *cls, const struct MHDT_PhaseContext *pc); @@ -256,7 +256,7 @@ struct MHDT_PostInstructions */ const char * MHDT_client_do_post ( - void *cls, + const void *cls, const struct MHDT_PhaseContext *pc); @@ -280,7 +280,7 @@ struct MHDT_Phase /** * Closure for @e server_cb. */ - void *server_cb_cls; + const void *server_cb_cls; /** * Logic for the CURL client for this phase. @@ -290,7 +290,7 @@ struct MHDT_Phase /** * Closure for @e client_cb. */ - void *client_cb_cls; + const void *client_cb_cls; /** * How long is the phase allowed to run at most before @@ -541,7 +541,7 @@ MHDT_server_reply_check_post ( * @return error message, NULL on success */ typedef const char * -(*MHDT_ServerSetup)(void *cls, +(*MHDT_ServerSetup)(const void *cls, struct MHD_Daemon *d); @@ -554,7 +554,7 @@ typedef const char * * @return error message, NULL on success */ const char * -MHDT_server_setup_minimal (void *cls, +MHDT_server_setup_minimal (const void *cls, struct MHD_Daemon *d); diff --git a/src/tests/client_server/libtest_convenience.c b/src/tests/client_server/libtest_convenience.c index b046f52f..27d2e23f 100644 --- a/src/tests/client_server/libtest_convenience.c +++ b/src/tests/client_server/libtest_convenience.c @@ -33,7 +33,7 @@ const char * -MHDT_server_setup_minimal (void *cls, +MHDT_server_setup_minimal (const void *cls, struct MHD_Daemon *d) { const struct MHD_DaemonOptionAndValue *options = cls; diff --git a/src/tests/client_server/libtest_convenience_client_request.c b/src/tests/client_server/libtest_convenience_client_request.c index c8a02bbd..716e15ad 100644 --- a/src/tests/client_server/libtest_convenience_client_request.c +++ b/src/tests/client_server/libtest_convenience_client_request.c @@ -228,7 +228,7 @@ check_status (CURL *c, const char * MHDT_client_get_root ( - void *cls, + const void *cls, const struct MHDT_PhaseContext *pc) { const char *text = cls; @@ -257,7 +257,7 @@ MHDT_client_get_root ( const char * MHDT_client_get_with_query ( - void *cls, + const void *cls, const struct MHDT_PhaseContext *pc) { const char *args = cls; @@ -294,8 +294,9 @@ MHDT_client_get_with_query ( const char * -MHDT_client_set_header (void *cls, - const struct MHDT_PhaseContext *pc) +MHDT_client_set_header ( + const void *cls, + const struct MHDT_PhaseContext *pc) { const char *hdr = cls; CURL *c; @@ -339,7 +340,7 @@ MHDT_client_set_header (void *cls, const char * -MHDT_client_expect_header (void *cls, +MHDT_client_expect_header (const void *cls, const struct MHDT_PhaseContext *pc) { #ifdef HAVE_LIBCRUL_NEW_HDR_API @@ -469,7 +470,7 @@ read_cb (void *ptr, const char * MHDT_client_put_data ( - void *cls, + const void *cls, const struct MHDT_PhaseContext *pc) { const char *text = cls; @@ -532,7 +533,7 @@ MHDT_client_put_data ( const char * MHDT_client_chunk_data ( - void *cls, + const void *cls, const struct MHDT_PhaseContext *pc) { const char *text = cls; @@ -588,10 +589,10 @@ MHDT_client_chunk_data ( const char * MHDT_client_do_post ( - void *cls, + const void *cls, const struct MHDT_PhaseContext *pc) { - struct MHDT_PostInstructions *pi = cls; + const struct MHDT_PostInstructions *pi = cls; CURL *c; struct curl_slist *request_hdr = NULL;