gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 01/09: muted some compiler warnings for clang


From: gnunet
Subject: [libmicrohttpd] 01/09: muted some compiler warnings for clang
Date: Sat, 01 Oct 2022 14:16:01 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 6933158a95542a9aa1fb3862d3bd93cc71440ca3
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Sep 28 10:39:32 2022 +0300

    muted some compiler warnings for clang
---
 src/examples/http_chunked_compression.c | 7 +++----
 src/microhttpd/mhd_str.c                | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/examples/http_chunked_compression.c 
b/src/examples/http_chunked_compression.c
index aa7bd2e5..6c52f60a 100644
--- a/src/examples/http_chunked_compression.c
+++ b/src/examples/http_chunked_compression.c
@@ -88,7 +88,7 @@ compress_buf (z_stream *strm, const void *src, size_t 
src_size, size_t *offset,
     {
       strm->avail_out = CHUNK;
       strm->next_out = tmp;
-      ret = deflate (strm, flush);
+      ret = (Z_OK == deflate (strm, flush)) ? MHD_YES : MHD_NO;
       have = CHUNK - strm->avail_out;
       *dest_size += have;
       tmp_dest = realloc (*dest, *dest_size);
@@ -104,7 +104,7 @@ compress_buf (z_stream *strm, const void *src, size_t 
src_size, size_t *offset,
     while (0 == strm->avail_out);
   }
   while (flush != Z_SYNC_FLUSH);
-  return (Z_OK == ret) ? MHD_YES : MHD_NO;
+  return ret;
 }
 
 
@@ -183,8 +183,7 @@ ahc_echo (void *cls, struct MHD_Connection *con, const char 
*url, const
   holder->file = fopen (__FILE__, "rb");
   if (NULL == holder->file)
     goto file_error;
-  ret = deflateInit (&holder->stream, Z_BEST_COMPRESSION);
-  if (ret != Z_OK)
+  if (Z_OK != deflateInit (&holder->stream, Z_BEST_COMPRESSION))
     goto stream_error;
   holder->buf = malloc (CHUNK);
   if (NULL == holder->buf)
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index 9c1c5172..22ae36a9 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -1428,7 +1428,7 @@ MHD_hex_to_bin (const char *hex,
     const int l = toxdigitvalue (hex[r++]);
     if ((0 > h) || (0 > l))
       return 0;
-    out[w++] = ( (((uint8_t) ((unsigned int) h)) << 4)
+    out[w++] = ( ((uint8_t) (((uint8_t) ((unsigned int) h)) << 4))
                  | ((uint8_t) ((unsigned int) l)) );
   }
   mhd_assert (len == r);

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