commit 6933158a95542a9aa1fb3862d3bd93cc71440ca3
parent 4153c1cd4c234226f5075e4115606d8fc4549ad4
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Wed, 28 Sep 2022 10:39:32 +0300
muted some compiler warnings for clang
Diffstat:
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git 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
@@ -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);