[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 02/10: Avoid dropping 'const' qualifier in
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 02/10: Avoid dropping 'const' qualifier in macros |
Date: |
Tue, 21 May 2019 21:29:06 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit c011158fe674cff7f989a3eb5bf105b0cd319719
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Tue May 21 20:47:39 2019 +0300
Avoid dropping 'const' qualifier in macros
---
src/microhttpd/mhd_bithelpers.h | 24 ++++++++++++------------
src/microhttpd/sha256.c | 2 +-
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/microhttpd/mhd_bithelpers.h b/src/microhttpd/mhd_bithelpers.h
index caa24846..ac2a13ce 100644
--- a/src/microhttpd/mhd_bithelpers.h
+++ b/src/microhttpd/mhd_bithelpers.h
@@ -136,17 +136,17 @@
*/
#if _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
#define _MHD_GET_32BIT_LE(addr) \
- (*(uint32_t*)(addr))
+ (*(const uint32_t*)(addr))
#elif _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
#define _MHD_GET_32BIT_LE(addr) \
- _MHD_BYTES_SWAP32(*(uint32_t*)(addr))
+ _MHD_BYTES_SWAP32(*(const uint32_t*)(addr))
#else /* _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN */
/* Endianess was not detected or non-standard like PDP-endian */
#define _MHD_GET_32BIT_LE(addr) \
- ( ( (uint32_t)(((uint8_t*)addr)[0])) | \
- (((uint32_t)(((uint8_t*)addr)[1])) << 8) | \
- (((uint32_t)(((uint8_t*)addr)[2])) << 16) | \
- (((uint32_t)(((uint8_t*)addr)[3])) << 24) )
+ ( ( (uint32_t)(((const uint8_t*)addr)[0])) | \
+ (((uint32_t)(((const uint8_t*)addr)[1])) << 8) | \
+ (((uint32_t)(((const uint8_t*)addr)[2])) << 16) | \
+ (((uint32_t)(((const uint8_t*)addr)[3])) << 24) )
#endif /* _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN */
@@ -200,17 +200,17 @@
*/
#if _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
#define _MHD_GET_32BIT_BE(addr) \
- (*(uint32_t*)(addr))
+ (*(const uint32_t*)(addr))
#elif _MHD_BYTE_ORDER == _MHD_LITTLE_ENDIAN
#define _MHD_GET_32BIT_BE(addr) \
- _MHD_BYTES_SWAP32(*(uint32_t*)(addr))
+ _MHD_BYTES_SWAP32(*(const uint32_t*)(addr))
#else /* _MHD_BYTE_ORDER != _MHD_LITTLE_ENDIAN */
/* Endianess was not detected or non-standard like PDP-endian */
#define _MHD_GET_32BIT_BE(addr) \
- ( (((uint32_t)(((uint8_t*)addr)[0])) << 24) | \
- (((uint32_t)(((uint8_t*)addr)[1])) << 16) | \
- (((uint32_t)(((uint8_t*)addr)[2])) << 8) | \
- ((uint32_t) (((uint8_t*)addr)[3])) )
+ ( (((uint32_t)(((const uint8_t*)addr)[0])) << 24) | \
+ (((uint32_t)(((const uint8_t*)addr)[1])) << 16) | \
+ (((uint32_t)(((const uint8_t*)addr)[2])) << 8) | \
+ ((uint32_t) (((const uint8_t*)addr)[3])) )
#endif /* _MHD_BYTE_ORDER != _MHD_LITTLE_ENDIAN */
diff --git a/src/microhttpd/sha256.c b/src/microhttpd/sha256.c
index 6336c986..6463532e 100644
--- a/src/microhttpd/sha256.c
+++ b/src/microhttpd/sha256.c
@@ -135,7 +135,7 @@ sha256_transform (uint32_t H[_SHA256_DIGEST_LENGTH],
Input data must be read in big-endian bytes order,
see FIPS PUB 180-4 paragraph 3.1.2. */
#define GET_W_FROM_DATA(buf,t) \
- _MHD_GET_32BIT_BE(((uint8_t*)(buf)) + (t) * SHA256_BYTES_IN_WORD)
+ _MHD_GET_32BIT_BE(((const uint8_t*)(buf)) + (t) * SHA256_BYTES_IN_WORD)
/* During first 16 steps, before making any calculations on each step,
the W element is read from input data buffer as big-endian value and
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [libmicrohttpd] branch master updated (d5d03f11 -> 9da5831c), gnunet, 2019/05/21
- [GNUnet-SVN] [libmicrohttpd] 03/10: Removed unused macro, gnunet, 2019/05/21
- [GNUnet-SVN] [libmicrohttpd] 04/10: Fixed compiler warning, gnunet, 2019/05/21
- [GNUnet-SVN] [libmicrohttpd] 02/10: Avoid dropping 'const' qualifier in macros,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 06/10: Check TLS strings lengths, gnunet, 2019/05/21
- [GNUnet-SVN] [libmicrohttpd] 05/10: MHD_start_daemon(): fixed port detection on some platforms, avoid re-use variable names., gnunet, 2019/05/21
- [GNUnet-SVN] [libmicrohttpd] 01/10: Fixed doxygen comments, Fixed spelling in comments, gnunet, 2019/05/21
- [GNUnet-SVN] [libmicrohttpd] 07/10: Removed extra ';', gnunet, 2019/05/21
- [GNUnet-SVN] [libmicrohttpd] 08/10: MHD_set_connection_value_n_nocheck_() mark as static function, gnunet, 2019/05/21
- [GNUnet-SVN] [libmicrohttpd] 09/10: MHD_start_daemon(): report if TCP_FASTOPEN is used on supported platform, gnunet, 2019/05/21
- [GNUnet-SVN] [libmicrohttpd] 10/10: ChangeLog updated, gnunet, 2019/05/21