diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-09-28 10:39:32 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-09-28 10:39:32 +0300 |
commit | 6933158a95542a9aa1fb3862d3bd93cc71440ca3 (patch) | |
tree | 86bc82b6c2010ab5eecd10fc87f04906b187cf0d | |
parent | 4153c1cd4c234226f5075e4115606d8fc4549ad4 (diff) | |
download | libmicrohttpd-6933158a95542a9aa1fb3862d3bd93cc71440ca3.tar.gz libmicrohttpd-6933158a95542a9aa1fb3862d3bd93cc71440ca3.zip |
muted some compiler warnings for clang
-rw-r--r-- | src/examples/http_chunked_compression.c | 7 | ||||
-rw-r--r-- | 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, | |||
88 | { | 88 | { |
89 | strm->avail_out = CHUNK; | 89 | strm->avail_out = CHUNK; |
90 | strm->next_out = tmp; | 90 | strm->next_out = tmp; |
91 | ret = deflate (strm, flush); | 91 | ret = (Z_OK == deflate (strm, flush)) ? MHD_YES : MHD_NO; |
92 | have = CHUNK - strm->avail_out; | 92 | have = CHUNK - strm->avail_out; |
93 | *dest_size += have; | 93 | *dest_size += have; |
94 | tmp_dest = realloc (*dest, *dest_size); | 94 | 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, | |||
104 | while (0 == strm->avail_out); | 104 | while (0 == strm->avail_out); |
105 | } | 105 | } |
106 | while (flush != Z_SYNC_FLUSH); | 106 | while (flush != Z_SYNC_FLUSH); |
107 | return (Z_OK == ret) ? MHD_YES : MHD_NO; | 107 | return ret; |
108 | } | 108 | } |
109 | 109 | ||
110 | 110 | ||
@@ -183,8 +183,7 @@ ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const | |||
183 | holder->file = fopen (__FILE__, "rb"); | 183 | holder->file = fopen (__FILE__, "rb"); |
184 | if (NULL == holder->file) | 184 | if (NULL == holder->file) |
185 | goto file_error; | 185 | goto file_error; |
186 | ret = deflateInit (&holder->stream, Z_BEST_COMPRESSION); | 186 | if (Z_OK != deflateInit (&holder->stream, Z_BEST_COMPRESSION)) |
187 | if (ret != Z_OK) | ||
188 | goto stream_error; | 187 | goto stream_error; |
189 | holder->buf = malloc (CHUNK); | 188 | holder->buf = malloc (CHUNK); |
190 | if (NULL == holder->buf) | 189 | 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, | |||
1428 | const int l = toxdigitvalue (hex[r++]); | 1428 | const int l = toxdigitvalue (hex[r++]); |
1429 | if ((0 > h) || (0 > l)) | 1429 | if ((0 > h) || (0 > l)) |
1430 | return 0; | 1430 | return 0; |
1431 | out[w++] = ( (((uint8_t) ((unsigned int) h)) << 4) | 1431 | out[w++] = ( ((uint8_t) (((uint8_t) ((unsigned int) h)) << 4)) |
1432 | | ((uint8_t) ((unsigned int) l)) ); | 1432 | | ((uint8_t) ((unsigned int) l)) ); |
1433 | } | 1433 | } |
1434 | mhd_assert (len == r); | 1434 | mhd_assert (len == r); |