summaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2011-10-12 06:13:37 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2011-10-12 06:13:37 +0000
commit69de3b14426c96725bbf19d4c828b193f0f175b2 (patch)
treec863e7c992fa355e45d1fe7258f56664bfdda4d5 /misc.h
parentd8257ec3e567f0f7509cd6dba11faea9c67c9cb5 (diff)
downloadcryptopp-69de3b14426c96725bbf19d4c828b193f0f175b2.tar.gz
fix compile with clang 2.9 (Jeff Walton)
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@532 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc.h b/misc.h
index 8425c53..7f32b86 100644
--- a/misc.h
+++ b/misc.h
@@ -580,13 +580,13 @@ CRYPTOPP_DLL void CRYPTOPP_API UnalignedDeallocate(void *p);
template <class T> inline T rotlFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
- return T((x<<y) | (x>>(sizeof(T)*8-y)));
+ return y ? T((x<<y) | (x>>(sizeof(T)*8-y))) : x;
}
template <class T> inline T rotrFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
- return T((x>>y) | (x<<(sizeof(T)*8-y)));
+ return y ? T((x>>y) | (x<<(sizeof(T)*8-y))) : x;
}
template <class T> inline T rotlVariable(T x, unsigned int y)