commit f31cb129e8433dc52ab400fe93eb734508db8475
parent 979f320e01dc8d37b44bba941d7b2532fb2c84d2
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Wed, 23 Apr 2025 12:49:53 +0200
Muted some compiler warnings
Diffstat:
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/mhd2/auth_digest.c b/src/mhd2/auth_digest.c
@@ -225,7 +225,7 @@ simple_hash (size_t data_size,
memcpy (&a, data, data_size);
a ^= c[(i++) % mhd_ARR_NUM_ELEMS (c)];
a = (uint_fast64_t) mhd_ROTR64 ((uint64_t) a, \
- (int) (res >> 58u));
+ (unsigned int) (res >> 58u));
res ^= a;
if (8 > data_size)
break;
@@ -1356,9 +1356,12 @@ digest_get_hash_size (enum MHD_DigestAuthAlgo algo)
#endif /* MHD_SUPPORT_SHA512_256 */
/* Only one algorithm must be specified */
mhd_assert (1 == \
- (((0 != (algo & MHD_DIGEST_BASE_ALGO_MD5)) ? 1 : 0) \
- + ((0 != (algo & MHD_DIGEST_BASE_ALGO_SHA256)) ? 1 : 0) \
- + ((0 != (algo & MHD_DIGEST_BASE_ALGO_SHA512_256)) ? 1 : 0)));
+ (((0 != (((unsigned int) algo) \
+ & MHD_DIGEST_BASE_ALGO_MD5)) ? 1 : 0) \
+ + ((0 != (((unsigned int) algo) \
+ & MHD_DIGEST_BASE_ALGO_SHA256)) ? 1 : 0) \
+ + ((0 != (((unsigned int) algo) \
+ & MHD_DIGEST_BASE_ALGO_SHA512_256)) ? 1 : 0)));
#ifdef MHD_SUPPORT_MD5
if (0 != (((unsigned int) algo)
& ((unsigned int) MHD_DIGEST_BASE_ALGO_MD5)))
@@ -3267,9 +3270,12 @@ MHD_digest_auth_check_digest (struct MHD_Request *MHD_RESTRICT request,
enum MHD_DigestAuthMultiQOP mqop,
enum MHD_DigestAuthMultiAlgo malgo)
{
- if (1 != (((0 != (malgo & MHD_DIGEST_BASE_ALGO_MD5)) ? 1 : 0)
- + ((0 != (malgo & MHD_DIGEST_BASE_ALGO_SHA256)) ? 1 : 0)
- + ((0 != (malgo & MHD_DIGEST_BASE_ALGO_SHA512_256)) ? 1 : 0)))
+ if (1 != (((0 != (((unsigned int) malgo) \
+ & MHD_DIGEST_BASE_ALGO_MD5)) ? 1 : 0)
+ + ((0 != (((unsigned int) malgo) \
+ & MHD_DIGEST_BASE_ALGO_SHA256)) ? 1 : 0)
+ + ((0 != (((unsigned int) malgo) \
+ & MHD_DIGEST_BASE_ALGO_SHA512_256)) ? 1 : 0)))
return MHD_DAUTH_UNSUPPORTED_ALGO;
#ifndef MHD_SUPPORT_MD5
diff --git a/src/mhd2/daemon_start.c b/src/mhd2/daemon_start.c
@@ -1608,7 +1608,7 @@ daemon_init_auth_digest (struct MHD_Daemon *restrict d,
free (d->auth_dg.nonces);
mhd_assert (MHD_SC_OK != ret);
- return ret; /* Failure exit point */
+ return (enum MHD_StatusCode) ret; /* Failure exit point */
}