gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 03/04: test_postprocessor{, _large}: additional fixes fo


From: gnunet
Subject: [libmicrohttpd] 03/04: test_postprocessor{, _large}: additional fixes for compiler warnings
Date: Tue, 14 Jun 2022 13:30:41 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

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

    test_postprocessor{,_large}: additional fixes for compiler warnings
---
 src/microhttpd/test_postprocessor.c       | 26 +++++++++++++-------------
 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)
     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
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,
 }
 
 
-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],

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]