libmicrohttpd

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

commit 7c06bcaef662c39633cbc2dacb5061c6fc9bfbdf
parent d66afa2c816c796397483303845d03d16d42adf7
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Tue, 14 Jun 2022 14:28:52 +0300

test_postprocessor{,_large}: additional fixes for compiler warnings

Diffstat:
Msrc/microhttpd/test_postprocessor.c | 26+++++++++++++-------------
Msrc/microhttpd/test_postprocessor_large.c | 4++--
2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/microhttpd/test_postprocessor.c b/src/microhttpd/test_postprocessor.c @@ -416,19 +416,19 @@ test_multipart_garbage (void) if (MHD_YES != MHD_post_process (pp, &xdata[splitpoint], size - splitpoint)) { fprintf (stderr, - "Test failed in line %u at point %d\n", + "Test failed in line %u at point %u\n", (unsigned int) __LINE__, - (int) splitpoint); + (unsigned int) splitpoint); exit (49); } MHD_destroy_post_processor (pp); if (want_off != FORM_END) { fprintf (stderr, - "Test failed in line %u at point %d\n", + "Test failed in line %u at point %u\n", (unsigned int) __LINE__, - (int) splitpoint); - return (int) splitpoint; + (unsigned int) splitpoint); + return (unsigned int) splitpoint; } } return 0; @@ -478,19 +478,19 @@ test_multipart_splits (void) size - splitpoint)) { fprintf (stderr, - "Test failed in line %u at point %d\n", + "Test failed in line %u at point %u\n", (unsigned int) __LINE__, - (int) splitpoint); + (unsigned int) splitpoint); exit (49); } MHD_destroy_post_processor (pp); if (want_off != FORM_END) { fprintf (stderr, - "Test failed in line %u at point %d\n", + "Test failed in line %u at point %u\n", (unsigned int) __LINE__, - (int) splitpoint); - return (int) splitpoint; + (unsigned int) splitpoint); + return (unsigned int) splitpoint; } } return 0; @@ -529,7 +529,7 @@ test_multipart (void) size = strlen (FORM_DATA); while (i < size) { - delta = 1 + MHD_random_ () % (size - i); + delta = 1 + ((size_t) MHD_random_ ()) % (size - i); if (MHD_YES != MHD_post_process (pp, &FORM_DATA[i], delta)) @@ -586,7 +586,7 @@ test_nested_multipart (void) size = strlen (FORM_NESTED_DATA); while (i < size) { - delta = 1 + MHD_random_ () % (size - i); + delta = 1 + ((size_t) MHD_random_ ()) % (size - i); if (MHD_YES != MHD_post_process (pp, &FORM_NESTED_DATA[i], delta)) @@ -665,7 +665,7 @@ test_overflow (void) return 1; memset (buf, 'A', i); buf[i / 2] = '='; - delta = 1 + (MHD_random_ () % (i - 1)); + delta = 1 + (((size_t) MHD_random_ ()) % (i - 1)); j = 0; while (j < i) { diff --git a/src/microhttpd/test_postprocessor_large.c b/src/microhttpd/test_postprocessor_large.c @@ -59,7 +59,7 @@ value_checker (void *cls, } -static int +static unsigned int test_simple_large (void) { struct MHD_Connection connection; @@ -88,7 +88,7 @@ test_simple_large (void) size = strlen (data); while (i < size) { - delta = 1 + MHD_random_ () % (size - i); + delta = 1 + ((size_t) MHD_random_ ()) % (size - i); if (MHD_YES != MHD_post_process (pp, &data[i],