diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2016-10-21 11:49:26 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-10-21 11:49:26 +0200 |
commit | 8368a551382bfa3a50b393873be341cd3c17f6df (patch) | |
tree | a23f02a7f33850f6e001af4cb3ebeee816f8a867 | |
parent | 7e7bfc9f66066771804af28ae293dca3d9b7f4bb (diff) |
csum: Don't drop const qualifier during cast
Don't drop const qualifier during cast to void *
Found by compiling with -Wcast-qual.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | csum.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -73,12 +73,12 @@ static inline uint16_t __in_cksum(const struct cksum_vec *vec, int veclen) if (vec->len == 0) continue; - w = (const uint16_t *) (void *) vec->ptr; + w = (const uint16_t *) (const void *) vec->ptr; if (mlen == -1) { s_util.c[1] = *(const uint8_t *) w; sum += s_util.s; - w = (const uint16_t *) (void *) ((const uint8_t *) w + 1); + w = (const uint16_t *) (const void *) ((const uint8_t *) w + 1); mlen = vec->len - 1; } else mlen = vec->len; @@ -87,7 +87,7 @@ static inline uint16_t __in_cksum(const struct cksum_vec *vec, int veclen) REDUCE; sum <<= 8; s_util.c[0] = *(const uint8_t *) w; - w = (const uint16_t *) (void *) ((const uint8_t *) w + 1); + w = (const uint16_t *) (const void *) ((const uint8_t *) w + 1); mlen--; byte_swapped = 1; } |