From: arighi Date: Thu, 17 Feb 2011 14:15:54 +0000 (+0000) Subject: sec: silent wrong compiler warning in isaac X-Git-Tag: 2.7.0~253 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=e596a709a407e54b16e338576d4fdb639ed96b15;p=bertos.git sec: silent wrong compiler warning in isaac Silent the following compiler warning: bertos/sec/prng/isaac.c: In function 'isaac': bertos/sec/prng/isaac.c:76: warning: cast increases required alignment of target type The warning was reported the ind() macro, that casts the first argument (a uint32_t *) to a (uint8_t *) adds a value to it and re-casts back to (uint32_t *). However, the value added to the pointer is always a multiple of uint32_t, so the warning can be suppressed without potential side effects. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4713 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/sec/prng/isaac.c b/bertos/sec/prng/isaac.c index 6c0ddc1c..86c16270 100644 --- a/bertos/sec/prng/isaac.c +++ b/bertos/sec/prng/isaac.c @@ -57,7 +57,7 @@ typedef uint32_t ub4; typedef uint16_t ub2; typedef uint8_t ub1; -#define ind(mm,x) (*(ub4 *)((ub1 *)(mm) + ((x) & ((CONFIG_ISAAC_RANDSIZ-1)<<2)))) +#define ind(mm,x) (*(ub4 *)((size_t)(mm) + ((x) & ((CONFIG_ISAAC_RANDSIZ-1)<<2)))) #define rngstep(mix,a,b,mm,m,m2,r,x) \ { \ x = *m; \