From 38294ebfaebde35618d04c860c69c1c12db538ae Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Fri, 14 May 1999 15:23:19 +0000 Subject: [PATCH] (swap_u_int32_t): only define when used git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6246 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/md4.c | 6 ++---- lib/des/md5.c | 6 ++---- lib/des/sha.c | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/des/md4.c b/lib/des/md4.c index 1b032149d..04468868d 100644 --- a/lib/des/md4.c +++ b/lib/des/md4.c @@ -159,10 +159,10 @@ calc (struct md4 *m, u_int32_t *data) * From `Performance analysis of MD5' by Joseph D. Touch */ +#if defined(WORDS_BIGENDIAN) static inline u_int32_t swap_u_int32_t (u_int32_t t) { -#if defined(WORDS_BIGENDIAN) u_int32_t temp1, temp2; temp1 = cshift(t, 16); @@ -171,10 +171,8 @@ swap_u_int32_t (u_int32_t t) temp2 &= 0x00ff00ff; temp1 <<= 8; return temp1 | temp2; -#else - return t; -#endif } +#endif struct x32{ unsigned int a:32; diff --git a/lib/des/md5.c b/lib/des/md5.c index 39c5428d0..bfada0ae4 100644 --- a/lib/des/md5.c +++ b/lib/des/md5.c @@ -183,10 +183,10 @@ calc (struct md5 *m, u_int32_t *data) * From `Performance analysis of MD5' by Joseph D. Touch */ +#if defined(WORDS_BIGENDIAN) static inline u_int32_t swap_u_int32_t (u_int32_t t) { -#if defined(WORDS_BIGENDIAN) u_int32_t temp1, temp2; temp1 = cshift(t, 16); @@ -195,10 +195,8 @@ swap_u_int32_t (u_int32_t t) temp2 &= 0x00ff00ff; temp1 <<= 8; return temp1 | temp2; -#else - return t; -#endif } +#endif struct x32{ unsigned int a:32; diff --git a/lib/des/sha.c b/lib/des/sha.c index 9085e770c..16fd7c8d5 100644 --- a/lib/des/sha.c +++ b/lib/des/sha.c @@ -208,10 +208,10 @@ calc (struct sha *m, u_int32_t *in) * From `Performance analysis of MD5' by Joseph D. Touch */ +#if !defined(WORDS_BIGENDIAN) static inline u_int32_t swap_u_int32_t (u_int32_t t) { -#if !defined(WORDS_BIGENDIAN) #define ROL(x,n) ((x)<<(n))|((x)>>(32-(n))) u_int32_t temp1, temp2; @@ -221,10 +221,8 @@ swap_u_int32_t (u_int32_t t) temp2 &= 0x00ff00ff; temp1 <<= 8; return temp1 | temp2; -#else - return t; -#endif } +#endif struct x32{ unsigned int a:32;