Static analysis showed the unsigned int y is truncated to an unsigned char via _rotr16. It does not appear to be a problem with the library, but it may be a problem for users. The assert will alert in Debug builds (but not Release builds)

pull/1/merge
Jeffrey Walton 2015-06-29 08:38:38 -04:00
parent e67480dd9e
commit 457eaeaf23
1 changed files with 1 additions and 0 deletions

1
misc.h
View File

@ -708,6 +708,7 @@ template<> inline word16 rotlFixed<word16>(word16 x, unsigned int y)
template<> inline word16 rotrFixed<word16>(word16 x, unsigned int y)
{
assert(y < 8*sizeof(x));
assert(y <= 255);
return y ? _rotr16(x, y) : x;
}