summaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-10-05 21:16:07 -0400
committerJeffrey Walton <noloader@gmail.com>2019-10-05 21:16:07 -0400
commitf6ff499035b910f6e8cce32b81b13958123ff41d (patch)
tree155143c6e8c8ded565f5088b38dfb5d448a42f56 /misc.h
parent1da81ae4545d3966e9faa38de2cefff145ac0fc4 (diff)
downloadcryptopp-git-f6ff499035b910f6e8cce32b81b13958123ff41d.tar.gz
Clear signed/unsigned warnings under Clang
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/misc.h b/misc.h
index bda85099..695d75c0 100644
--- a/misc.h
+++ b/misc.h
@@ -1531,9 +1531,9 @@ template <unsigned int R, class T> inline T rotlConstant(T x)
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157,
// http://software.intel.com/en-us/forums/topic/580884
// and http://llvm.org/bugs/show_bug.cgi?id=24226
- CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8) ;
- CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1) ;
- CRYPTOPP_ASSERT(R < THIS_SIZE);
+ CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8);
+ CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1);
+ CRYPTOPP_ASSERT(static_cast<int>(R) < THIS_SIZE);
return T((x<<R)|(x>>(-R&MASK)));
}
@@ -1557,9 +1557,9 @@ template <unsigned int R, class T> inline T rotrConstant(T x)
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157,
// http://software.intel.com/en-us/forums/topic/580884
// and http://llvm.org/bugs/show_bug.cgi?id=24226
- CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8) ;
- CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1) ;
- CRYPTOPP_ASSERT(R < THIS_SIZE);
+ CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8);
+ CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1);
+ CRYPTOPP_ASSERT(static_cast<int>(R) < THIS_SIZE);
return T((x >> R)|(x<<(-R&MASK)));
}
@@ -1582,9 +1582,9 @@ template <class T> inline T rotlFixed(T x, unsigned int y)
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157,
// http://software.intel.com/en-us/forums/topic/580884
// and http://llvm.org/bugs/show_bug.cgi?id=24226
- CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8) ;
- CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1) ;
- CRYPTOPP_ASSERT(y < THIS_SIZE);
+ CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8);
+ CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1);
+ CRYPTOPP_ASSERT(static_cast<int>(y) < THIS_SIZE);
return T((x<<y)|(x>>(-y&MASK)));
}
@@ -1607,9 +1607,9 @@ template <class T> inline T rotrFixed(T x, unsigned int y)
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157,
// http://software.intel.com/en-us/forums/topic/580884
// and http://llvm.org/bugs/show_bug.cgi?id=24226
- CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8) ;
- CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1) ;
- CRYPTOPP_ASSERT(y < THIS_SIZE);
+ CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8);
+ CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1);
+ CRYPTOPP_ASSERT(static_cast<int>(y) < THIS_SIZE);
return T((x >> y)|(x<<(-y&MASK)));
}
@@ -1627,9 +1627,9 @@ template <class T> inline T rotrFixed(T x, unsigned int y)
/// \since Crypto++ 3.0
template <class T> inline T rotlVariable(T x, unsigned int y)
{
- CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8) ;
- CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1) ;
- CRYPTOPP_ASSERT(y < THIS_SIZE);
+ CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8);
+ CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1);
+ CRYPTOPP_ASSERT(static_cast<int>(y) < THIS_SIZE);
return T((x<<y)|(x>>(-y&MASK)));
}
@@ -1647,9 +1647,9 @@ template <class T> inline T rotlVariable(T x, unsigned int y)
/// \since Crypto++ 3.0
template <class T> inline T rotrVariable(T x, unsigned int y)
{
- CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8) ;
- CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1) ;
- CRYPTOPP_ASSERT(y < THIS_SIZE);
+ CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8);
+ CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1);
+ CRYPTOPP_ASSERT(static_cast<int>(y) < THIS_SIZE);
return T((x>>y)|(x<<(-y&MASK)));
}
@@ -1664,8 +1664,8 @@ template <class T> inline T rotrVariable(T x, unsigned int y)
/// \since Crypto++ 3.0
template <class T> inline T rotlMod(T x, unsigned int y)
{
- CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8) ;
- CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1) ;
+ CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8);
+ CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1);
return T((x<<(y&MASK))|(x>>(-y&MASK)));
}
@@ -1680,8 +1680,8 @@ template <class T> inline T rotlMod(T x, unsigned int y)
/// \since Crypto++ 3.0
template <class T> inline T rotrMod(T x, unsigned int y)
{
- CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8) ;
- CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1) ;
+ CRYPTOPP_CONSTANT(THIS_SIZE = sizeof(T)*8);
+ CRYPTOPP_CONSTANT(MASK = THIS_SIZE-1);
return T((x>>(y&MASK))|(x<<(-y&MASK)));
}