diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-07-06 04:14:45 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-07-06 11:15:18 +0000 |
commit | 2a740bd4d510a4eee983db05ec9566867d48a906 (patch) | |
tree | 17201a84fd80a210a3456f4bd9de6d7f6416f5f7 /wsutil/sober128.c | |
parent | afa8f21f56f1e65bb2ec37cffdf3422d15b45347 (diff) | |
download | wireshark-2a740bd4d510a4eee983db05ec9566867d48a906.tar.gz |
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 <guy@alum.mit.edu>
Diffstat (limited to 'wsutil/sober128.c')
-rw-r--r-- | wsutil/sober128.c | 6 |
1 files 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)); |