gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated: Fixed compiler warnings


From: gnunet
Subject: [libmicrohttpd] branch master updated: Fixed compiler warnings
Date: Sun, 11 Oct 2020 16:34:28 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new f0d4dde9 Fixed compiler warnings
f0d4dde9 is described below

commit f0d4dde902692968ef34f93796d05b1417d92dae
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Oct 11 15:59:05 2020 +0300

    Fixed compiler warnings
---
 src/microhttpd/connection.c | 5 ++++-
 src/microhttpd/daemon.c     | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 7fd52739..eda98f71 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2958,6 +2958,8 @@ MHD_connection_handle_write (struct MHD_Connection 
*connection)
     {
       const size_t wb_ready = connection->write_buffer_append_offset
                               - connection->write_buffer_send_offset;
+      mhd_assert (connection->write_buffer_append_offset > \
+                  connection->write_buffer_send_offset);
 
       /* if the response body is not available, we use 
MHD_send_on_connection_() */
       if (NULL != connection->response->crc)
@@ -2987,7 +2989,8 @@ MHD_connection_handle_write (struct MHD_Connection 
*connection)
                                   "Connection was closed while sending 
response headers.\n"));
         return;
       }
-      if (ret > wb_ready)
+      /* 'ret' is not negative, it's safe to cast it to 'size_t'. */
+      if (((size_t) ret) > wb_ready)
       {
         mhd_assert (NULL == connection->response->crc);
         /* We sent not just header data but also some response data,
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 480c37cd..5a7c0caa 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -5163,8 +5163,9 @@ parse_options_va (struct MHD_Daemon *daemon,
 #endif
         daemon->worker_pool_size = 0;
       }
+#if (0 == (UINT_MAX + 0)) || (UINT_MAX >= (SIZE_MAX / (64 * 1024)))
       /* Next comparison could be always false on some platforms and whole 
branch will
-       * be optimized out on those platforms. On others it will be compiled 
into real
+       * be optimized out on these platforms. On others it will be compiled 
into real
        * check. */
       else if (daemon->worker_pool_size >= (SIZE_MAX / sizeof (struct
                                                                MHD_Daemon)))   
         /* Compiler may warn on some platforms, ignore warning. */
@@ -5176,6 +5177,7 @@ parse_options_va (struct MHD_Daemon *daemon,
 #endif
         return MHD_NO;
       }
+#endif /* (UINT_MAX >= (SIZE_MAX/(64*1024))) */
       else
       {
         if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))

-- 
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]