gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 01/03: Muted extra compiler warnings


From: gnunet
Subject: [libmicrohttpd] 01/03: Muted extra compiler warnings
Date: Tue, 30 Jan 2024 17:33:29 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit d63cb66783776ce528681beb08b4e76c40c1fc9f
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Jan 30 17:08:52 2024 +0100

    Muted extra compiler warnings
---
 src/examples/websocket_threaded_example.c |  2 +-
 src/microhttpd/mhd_str.c                  | 18 ++++++++++--------
 src/microhttpd/test_client_put_stop.c     | 12 ++++++------
 3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/examples/websocket_threaded_example.c 
b/src/examples/websocket_threaded_example.c
index 3047fc7d..1c98b428 100644
--- a/src/examples/websocket_threaded_example.c
+++ b/src/examples/websocket_threaded_example.c
@@ -675,7 +675,7 @@ ws_receive_frame (unsigned char *frame, ssize_t *length, 
int *type)
     {
       idx_first_mask = 10;
     }
-    idx_first_data = idx_first_mask + 4;
+    idx_first_data = (unsigned char) (idx_first_mask + 4);
     data_length = (size_t) *length - idx_first_data;
     masks[0] = frame[idx_first_mask + 0];
     masks[1] = frame[idx_first_mask + 1];
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index 8943b46e..d01086ac 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -1073,7 +1073,7 @@ MHD_str_remove_tokens_caseless_ (char *str,
       while (pt < tokens_len && (' ' == t[pt] || '\t' == t[pt]))
         pt++;
       /* Found end of the token string or non-whitespace char */
-    } while(pt < tokens_len && ',' != t[pt]);
+    } while (pt < tokens_len && ',' != t[pt]);
 
     /* 'tkn' is the input token with 'tkn_len' chars */
     mhd_assert (0 != tkn_len);
@@ -1531,8 +1531,10 @@ MHD_uint32_to_strx (uint32_t val,
 
   while (o_pos < buf_size)
   {
-    buf[o_pos++] = (digit <= 9) ? ('0' + (char) digit) :
-                   ('A' + (char) digit - 10);
+    buf[o_pos++] =
+      (char) ((digit <= 9) ?
+              ('0' + (char) digit) :
+              ('A' + (char) digit - 10));
     if (0 == digit_pos)
       return o_pos;
     digit_pos--;
@@ -1568,7 +1570,7 @@ MHD_uint16_to_str (uint16_t val,
 
   while (0 != buf_size)
   {
-    *chr = (char) digit + '0';
+    *chr = (char) ((char) digit + '0');
     chr++;
     buf_size--;
     if (1 == divisor)
@@ -1609,7 +1611,7 @@ MHD_uint64_to_str (uint64_t val,
 
   while (0 != buf_size)
   {
-    *chr = (char) digit + '0';
+    *chr = (char) ((char) digit + '0');
     chr++;
     buf_size--;
     if (1 == divisor)
@@ -1644,7 +1646,7 @@ MHD_uint8_to_str_pad (uint8_t val,
   }
   else
   {
-    buf[pos++] = '0' + (char) digit;
+    buf[pos++] = (char) ('0' + (char) digit);
     val %= 100;
     min_digits = 2;
   }
@@ -1659,13 +1661,13 @@ MHD_uint8_to_str_pad (uint8_t val,
   }
   else
   {
-    buf[pos++] = '0' + (char) digit;
+    buf[pos++] = (char) ('0' + (char) digit);
     val %= 10;
   }
 
   if (buf_size <= pos)
     return 0;
-  buf[pos++] = '0' + (char) val;
+  buf[pos++] = (char) ('0' + (char) val);
   return pos;
 }
 
diff --git a/src/microhttpd/test_client_put_stop.c 
b/src/microhttpd/test_client_put_stop.c
index aaf5c829..3a6c1865 100644
--- a/src/microhttpd/test_client_put_stop.c
+++ b/src/microhttpd/test_client_put_stop.c
@@ -1964,17 +1964,17 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
   {
     *pport = 4170;
     if (use_shutdown)
-      *pport += 0;
+      *pport = (uint16_t) (*pport + 0);
     if (use_close)
-      *pport += 1;
+      *pport = (uint16_t) (*pport + 1);
     if (use_hard_close)
-      *pport += 1;
+      *pport = (uint16_t) (*pport + 1);
     if (by_step)
-      *pport += 1 << 2;
+      *pport = (uint16_t) (*pport + (1 << 2));
     if (upl_chunked)
-      *pport += 1 << 3;
+      *pport = (uint16_t) (*pport + (1 << 3));
     if (! oneone)
-      *pport += 1 << 4;
+      *pport = (uint16_t) (*pport + (1 << 4));
   }
 
   if (testMhdThreadExternal == thrType)

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