From 2a740bd4d510a4eee983db05ec9566867d48a906 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 6 Jul 2014 04:14:45 -0700 Subject: [PATCH] Squash casting-away-constness warnings. BYTE2WORD() doesn't modify what its argument points to, so make that argument a const unsigned char *. This lets us get rid of casts that cast away constness. Change-Id: I44a58bd3d75fc77a022b7e8f7fa9b43990bcf81c Reviewed-on: https://code.wireshark.org/review/2876 Reviewed-by: Guy Harris --- wsutil/sober128.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wsutil/sober128.c b/wsutil/sober128.c index 6c40fce5fe..5534cef3e2 100644 --- a/wsutil/sober128.c +++ b/wsutil/sober128.c @@ -631,7 +631,7 @@ static const ulong32 Sbox[256] = { #define B(x,i) ((unsigned char)(((x) >> (8*i)) & 0xFF)) -static ulong32 BYTE2WORD(unsigned char *b) +static ulong32 BYTE2WORD(const unsigned char *b) { ulong32 t; LOAD32L(t, b); @@ -789,7 +789,7 @@ int sober128_add_entropy(const unsigned char *buf, unsigned long len, sober128_p /* assert ((len & 3) == 0); */ for (i = 0; i < len; i += 4) { - k = BYTE2WORD((unsigned char *)&buf[i]); + k = BYTE2WORD(&buf[i]); ADDKEY(k); cycle(c->R); XORNL(nltap(c)); @@ -814,7 +814,7 @@ int sober128_add_entropy(const unsigned char *buf, unsigned long len, sober128_p /* assert ((len & 3) == 0); */ for (i = 0; i < len; i += 4) { - k = BYTE2WORD((unsigned char *)&buf[i]); + k = BYTE2WORD(&buf[i]); ADDKEY(k); cycle(c->R); XORNL(nltap(c)); -- 2.34.1