diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-14 14:28:52 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-14 14:28:52 +0300 |
commit | 7c06bcaef662c39633cbc2dacb5061c6fc9bfbdf (patch) | |
tree | 7381bc683a66492ec856ffccb35ab149dc038817 /src | |
parent | d66afa2c816c796397483303845d03d16d42adf7 (diff) | |
download | libmicrohttpd-7c06bcaef662c39633cbc2dacb5061c6fc9bfbdf.tar.gz libmicrohttpd-7c06bcaef662c39633cbc2dacb5061c6fc9bfbdf.zip |
test_postprocessor{,_large}: additional fixes for compiler warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/microhttpd/test_postprocessor.c | 26 | ||||
-rw-r--r-- | src/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 index ab68541b..50dfd534 100644 --- a/src/microhttpd/test_postprocessor.c +++ b/src/microhttpd/test_postprocessor.c | |||
@@ -416,19 +416,19 @@ test_multipart_garbage (void) | |||
416 | if (MHD_YES != MHD_post_process (pp, &xdata[splitpoint], size - splitpoint)) | 416 | if (MHD_YES != MHD_post_process (pp, &xdata[splitpoint], size - splitpoint)) |
417 | { | 417 | { |
418 | fprintf (stderr, | 418 | fprintf (stderr, |
419 | "Test failed in line %u at point %d\n", | 419 | "Test failed in line %u at point %u\n", |
420 | (unsigned int) __LINE__, | 420 | (unsigned int) __LINE__, |
421 | (int) splitpoint); | 421 | (unsigned int) splitpoint); |
422 | exit (49); | 422 | exit (49); |
423 | } | 423 | } |
424 | MHD_destroy_post_processor (pp); | 424 | MHD_destroy_post_processor (pp); |
425 | if (want_off != FORM_END) | 425 | if (want_off != FORM_END) |
426 | { | 426 | { |
427 | fprintf (stderr, | 427 | fprintf (stderr, |
428 | "Test failed in line %u at point %d\n", | 428 | "Test failed in line %u at point %u\n", |
429 | (unsigned int) __LINE__, | 429 | (unsigned int) __LINE__, |
430 | (int) splitpoint); | 430 | (unsigned int) splitpoint); |
431 | return (int) splitpoint; | 431 | return (unsigned int) splitpoint; |
432 | } | 432 | } |
433 | } | 433 | } |
434 | return 0; | 434 | return 0; |
@@ -478,19 +478,19 @@ test_multipart_splits (void) | |||
478 | size - splitpoint)) | 478 | size - splitpoint)) |
479 | { | 479 | { |
480 | fprintf (stderr, | 480 | fprintf (stderr, |
481 | "Test failed in line %u at point %d\n", | 481 | "Test failed in line %u at point %u\n", |
482 | (unsigned int) __LINE__, | 482 | (unsigned int) __LINE__, |
483 | (int) splitpoint); | 483 | (unsigned int) splitpoint); |
484 | exit (49); | 484 | exit (49); |
485 | } | 485 | } |
486 | MHD_destroy_post_processor (pp); | 486 | MHD_destroy_post_processor (pp); |
487 | if (want_off != FORM_END) | 487 | if (want_off != FORM_END) |
488 | { | 488 | { |
489 | fprintf (stderr, | 489 | fprintf (stderr, |
490 | "Test failed in line %u at point %d\n", | 490 | "Test failed in line %u at point %u\n", |
491 | (unsigned int) __LINE__, | 491 | (unsigned int) __LINE__, |
492 | (int) splitpoint); | 492 | (unsigned int) splitpoint); |
493 | return (int) splitpoint; | 493 | return (unsigned int) splitpoint; |
494 | } | 494 | } |
495 | } | 495 | } |
496 | return 0; | 496 | return 0; |
@@ -529,7 +529,7 @@ test_multipart (void) | |||
529 | size = strlen (FORM_DATA); | 529 | size = strlen (FORM_DATA); |
530 | while (i < size) | 530 | while (i < size) |
531 | { | 531 | { |
532 | delta = 1 + MHD_random_ () % (size - i); | 532 | delta = 1 + ((size_t) MHD_random_ ()) % (size - i); |
533 | if (MHD_YES != MHD_post_process (pp, | 533 | if (MHD_YES != MHD_post_process (pp, |
534 | &FORM_DATA[i], | 534 | &FORM_DATA[i], |
535 | delta)) | 535 | delta)) |
@@ -586,7 +586,7 @@ test_nested_multipart (void) | |||
586 | size = strlen (FORM_NESTED_DATA); | 586 | size = strlen (FORM_NESTED_DATA); |
587 | while (i < size) | 587 | while (i < size) |
588 | { | 588 | { |
589 | delta = 1 + MHD_random_ () % (size - i); | 589 | delta = 1 + ((size_t) MHD_random_ ()) % (size - i); |
590 | if (MHD_YES != MHD_post_process (pp, | 590 | if (MHD_YES != MHD_post_process (pp, |
591 | &FORM_NESTED_DATA[i], | 591 | &FORM_NESTED_DATA[i], |
592 | delta)) | 592 | delta)) |
@@ -665,7 +665,7 @@ test_overflow (void) | |||
665 | return 1; | 665 | return 1; |
666 | memset (buf, 'A', i); | 666 | memset (buf, 'A', i); |
667 | buf[i / 2] = '='; | 667 | buf[i / 2] = '='; |
668 | delta = 1 + (MHD_random_ () % (i - 1)); | 668 | delta = 1 + (((size_t) MHD_random_ ()) % (i - 1)); |
669 | j = 0; | 669 | j = 0; |
670 | while (j < i) | 670 | while (j < i) |
671 | { | 671 | { |
diff --git a/src/microhttpd/test_postprocessor_large.c b/src/microhttpd/test_postprocessor_large.c index 9f7096fa..5e500ed3 100644 --- a/src/microhttpd/test_postprocessor_large.c +++ b/src/microhttpd/test_postprocessor_large.c | |||
@@ -59,7 +59,7 @@ value_checker (void *cls, | |||
59 | } | 59 | } |
60 | 60 | ||
61 | 61 | ||
62 | static int | 62 | static unsigned int |
63 | test_simple_large (void) | 63 | test_simple_large (void) |
64 | { | 64 | { |
65 | struct MHD_Connection connection; | 65 | struct MHD_Connection connection; |
@@ -88,7 +88,7 @@ test_simple_large (void) | |||
88 | size = strlen (data); | 88 | size = strlen (data); |
89 | while (i < size) | 89 | while (i < size) |
90 | { | 90 | { |
91 | delta = 1 + MHD_random_ () % (size - i); | 91 | delta = 1 + ((size_t) MHD_random_ ()) % (size - i); |
92 | if (MHD_YES != | 92 | if (MHD_YES != |
93 | MHD_post_process (pp, | 93 | MHD_post_process (pp, |
94 | &data[i], | 94 | &data[i], |