Clear signed/unsigned warnings under Clang

This commit is contained in:
Jeffrey Walton 2019-10-05 21:16:07 -04:00
parent 1da81ae454
commit f6ff499035
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

44
misc.h
View File

@ -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)));
}