summaryrefslogtreecommitdiff
path: root/umac.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2008-06-13 12:40:55 +1000
committerDarren Tucker <dtucker@zip.com.au>2008-06-13 12:40:55 +1000
commit2c91b28a6da35f2e499414f8f6585f4f11410935 (patch)
tree48ee25aa008f35a641983ef62098845d970bbe6e /umac.c
parent2c1eb82695ff4628ad61bc5a9e70fb9d7826446f (diff)
- (dtucker) [umac.c] STORE_UINT32_REVERSED and endian_convert are never used
on big endian machines, so ifdef them for little endian only to prevent unused function warnings.
Diffstat (limited to 'umac.c')
-rw-r--r--umac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/umac.c b/umac.c
index 6b5a00585..1eba663c0 100644
--- a/umac.c
+++ b/umac.c
@@ -136,12 +136,14 @@ static UINT32 LOAD_UINT32_REVERSED(void *ptr)
136 return (UINT32)temp; 136 return (UINT32)temp;
137} 137}
138 138
139# if (__LITTLE_ENDIAN__)
139static void STORE_UINT32_REVERSED(void *ptr, UINT32 x) 140static void STORE_UINT32_REVERSED(void *ptr, UINT32 x)
140{ 141{
141 UINT32 i = (UINT32)x; 142 UINT32 i = (UINT32)x;
142 *(UINT32 *)ptr = (i >> 24) | ((i & 0x00FF0000) >> 8 ) 143 *(UINT32 *)ptr = (i >> 24) | ((i & 0x00FF0000) >> 8 )
143 | ((i & 0x0000FF00) << 8 ) | (i << 24); 144 | ((i & 0x0000FF00) << 8 ) | (i << 24);
144} 145}
146# endif /* __LITTLE_ENDIAN */
145#endif /* HAVE_SWAP32 */ 147#endif /* HAVE_SWAP32 */
146 148
147/* The following definitions use the above reversal-primitives to do the right 149/* The following definitions use the above reversal-primitives to do the right
@@ -544,6 +546,7 @@ static void nh_transform(nh_ctx *hc, UINT8 *buf, UINT32 nbytes)
544 546
545/* ---------------------------------------------------------------------- */ 547/* ---------------------------------------------------------------------- */
546 548
549#if (__LITTLE_ENDIAN__)
547static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes) 550static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes)
548/* We endian convert the keys on little-endian computers to */ 551/* We endian convert the keys on little-endian computers to */
549/* compensate for the lack of big-endian memory reads during hashing. */ 552/* compensate for the lack of big-endian memory reads during hashing. */
@@ -566,7 +569,6 @@ static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes)
566 } while (--iters); 569 } while (--iters);
567 } 570 }
568} 571}
569#if (__LITTLE_ENDIAN__)
570#define endian_convert_if_le(x,y,z) endian_convert((x),(y),(z)) 572#define endian_convert_if_le(x,y,z) endian_convert((x),(y),(z))
571#else 573#else
572#define endian_convert_if_le(x,y,z) do{}while(0) /* Do nothing */ 574#define endian_convert_if_le(x,y,z) do{}while(0) /* Do nothing */