diff options
author | des <des@FreeBSD.org> | 2014-05-16 15:32:16 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2014-05-16 15:32:16 +0000 |
commit | 524a3d01438aaf2b8be8b02e0da9876ba56f5129 (patch) | |
tree | b7d8c1f7d99056d6cb8f4983177e3592e9b8d2ab /contrib/ldns | |
parent | af9fb17a16f82b4b8fb3d41be0bca4b3c60eb83d (diff) | |
download | FreeBSD-src-524a3d01438aaf2b8be8b02e0da9876ba56f5129.zip FreeBSD-src-524a3d01438aaf2b8be8b02e0da9876ba56f5129.tar.gz |
Don't cast away the const qualifier. Fixes gcc build.
Diffstat (limited to 'contrib/ldns')
-rw-r--r-- | contrib/ldns/ldns/util.h | 8 | ||||
-rw-r--r-- | contrib/ldns/ldns/util.h.in | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/contrib/ldns/ldns/util.h b/contrib/ldns/ldns/util.h index a8b3df3..cb3806a 100644 --- a/contrib/ldns/ldns/util.h +++ b/contrib/ldns/ldns/util.h @@ -70,9 +70,9 @@ INLINE uint16_t ldns_read_uint16(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES - return ntohs(*(uint16_t *) src); + return ntohs(*(const uint16_t *) src); #else - uint8_t *p = (uint8_t *) src; + const uint8_t *p = (const uint8_t *) src; return ((uint16_t) p[0] << 8) | (uint16_t) p[1]; #endif } @@ -81,9 +81,9 @@ INLINE uint32_t ldns_read_uint32(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES - return ntohl(*(uint32_t *) src); + return ntohl(*(const uint32_t *) src); #else - uint8_t *p = (uint8_t *) src; + const uint8_t *p = (const uint8_t *) src; return ( ((uint32_t) p[0] << 24) | ((uint32_t) p[1] << 16) | ((uint32_t) p[2] << 8) diff --git a/contrib/ldns/ldns/util.h.in b/contrib/ldns/ldns/util.h.in index b6c9abe..0fbc4e6 100644 --- a/contrib/ldns/ldns/util.h.in +++ b/contrib/ldns/ldns/util.h.in @@ -70,9 +70,9 @@ INLINE uint16_t ldns_read_uint16(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES - return ntohs(*(uint16_t *) src); + return ntohs(*(const uint16_t *) src); #else - uint8_t *p = (uint8_t *) src; + const uint8_t *p = (const uint8_t *) src; return ((uint16_t) p[0] << 8) | (uint16_t) p[1]; #endif } @@ -81,9 +81,9 @@ INLINE uint32_t ldns_read_uint32(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES - return ntohl(*(uint32_t *) src); + return ntohl(*(const uint32_t *) src); #else - uint8_t *p = (uint8_t *) src; + const uint8_t *p = (const uint8_t *) src; return ( ((uint32_t) p[0] << 24) | ((uint32_t) p[1] << 16) | ((uint32_t) p[2] << 8) |