[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 19/26: md5.c: muted compiler alignment warnings
From: |
gnunet |
Subject: |
[libmicrohttpd] 19/26: md5.c: muted compiler alignment warnings |
Date: |
Mon, 25 Apr 2022 15:08:43 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit c4c111d4d4a9da3b8197e1be365d58fc9bb1f1b7
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat Apr 23 20:14:33 2022 +0300
md5.c: muted compiler alignment warnings
---
src/microhttpd/md5.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/microhttpd/md5.c b/src/microhttpd/md5.c
index 8ac56793..a467ccac 100644
--- a/src/microhttpd/md5.c
+++ b/src/microhttpd/md5.c
@@ -113,10 +113,12 @@ MHD_MD5Final (void *ctx_,
if (1)
#endif /* _MHD_PUT_32BIT_LE_UNALIGNED */
{
- _MHD_PUT_32BIT_LE (digest, ctx->state[0]);
- _MHD_PUT_32BIT_LE (digest + 4, ctx->state[1]);
- _MHD_PUT_32BIT_LE (digest + 8, ctx->state[2]);
- _MHD_PUT_32BIT_LE (digest + 12, ctx->state[3]);
+ /* Use cast to (void*) here to mute compiler alignment warnings.
+ * Compilers are not smart enough to see that alignment has been checked.
*/
+ _MHD_PUT_32BIT_LE ((void *) (digest + 0), ctx->state[0]);
+ _MHD_PUT_32BIT_LE ((void *) (digest + 4), ctx->state[1]);
+ _MHD_PUT_32BIT_LE ((void *) (digest + 8), ctx->state[2]);
+ _MHD_PUT_32BIT_LE ((void *) (digest + 12), ctx->state[3]);
}
/* Erase buffer */
@@ -158,7 +160,7 @@ MD5Transform (uint32_t state[4],
in = data_buf;
}
else
- in = (const uint32_t *) block;
+ in = (const uint32_t *) ((const void *) block);
#endif /* _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN) || \
! _MHD_GET_32BIT_LE_UNALIGNED */
#if _MHD_BYTE_ORDER != _MHD_LITTLE_ENDIAN
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (a3ce7049 -> 0179be6c), gnunet, 2022/04/25
- [libmicrohttpd] 03/26: autoinit_funcs.h: added functions prototypes, gnunet, 2022/04/25
- [libmicrohttpd] 02/26: daemon.c: added prototypes for non-static functions, gnunet, 2022/04/25
- [libmicrohttpd] 04/26: autoinit_funcs.h: improved formatting, gnunet, 2022/04/25
- [libmicrohttpd] 01/26: MHD_start_daemon: simplified logic for AUTO flags, gnunet, 2022/04/25
- [libmicrohttpd] 06/26: websocket_threaded_example: mark function as static, gnunet, 2022/04/25
- [libmicrohttpd] 07/26: basicauth: very minor optimisaion, gnunet, 2022/04/25
- [libmicrohttpd] 05/26: Fixed old-style functions definitions, gnunet, 2022/04/25
- [libmicrohttpd] 13/26: doc/examples: do not use non-literals for printf(), gnunet, 2022/04/25
- [libmicrohttpd] 19/26: md5.c: muted compiler alignment warnings,
gnunet <=
- [libmicrohttpd] 10/26: microhttpd2.h: fixed code style, gnunet, 2022/04/25
- [libmicrohttpd] 11/26: test_shutdown_select: fixed code style, gnunet, 2022/04/25
- [libmicrohttpd] 08/26: configure: changed warning compiler flags, gnunet, 2022/04/25
- [libmicrohttpd] 14/26: doc/examples: improved formatting, gnunet, 2022/04/25
- [libmicrohttpd] 12/26: src/examples: fixed printf format specifiers, gnunet, 2022/04/25
- [libmicrohttpd] 15/26: doc/examples: avoid usage of unportable functions, gnunet, 2022/04/25
- [libmicrohttpd] 09/26: Fixed many macros, gnunet, 2022/04/25
- [libmicrohttpd] 20/26: sha256.c: fixed coding style, gnunet, 2022/04/25
- [libmicrohttpd] 26/26: test_postprocessor: fixed typo, gnunet, 2022/04/25
- [libmicrohttpd] 22/26: sha1.c: fixed coding style, gnunet, 2022/04/25