Clear signed/unsigned warnings with GCC and -Wall -Wextra

pull/552/head
Jeffrey Walton 2017-12-26 11:48:11 -05:00
parent 66da740ad3
commit ae445c0b0f
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 16 additions and 16 deletions

View File

@ -657,7 +657,7 @@ inline void SIMON128_Enc_Block(__m128i &block0, __m128i &block1, const word64 *s
x1 = _mm_shuffle_epi8(x1, mask);
y1 = _mm_shuffle_epi8(y1, mask);
for (size_t i = 0; static_cast<int>(i) < (rounds & ~1)-1; i += 2)
for (int i = 0; i < static_cast<int>(rounds & ~1)-1; i += 2)
{
const __m128i rk1 = _mm_castpd_si128(
_mm_loaddup_pd(reinterpret_cast<const double*>(subkeys+i)));
@ -707,7 +707,7 @@ inline void SIMON128_Enc_6_Blocks(__m128i &block0, __m128i &block1,
x3 = _mm_shuffle_epi8(x3, mask);
y3 = _mm_shuffle_epi8(y3, mask);
for (size_t i = 0; static_cast<int>(i) < (rounds & ~1) - 1; i += 2)
for (int i = 0; i < static_cast<int>(rounds & ~1) - 1; i += 2)
{
const __m128i rk1 = _mm_castpd_si128(
_mm_loaddup_pd(reinterpret_cast<const double*>(subkeys + i)));
@ -771,7 +771,7 @@ inline void SIMON128_Dec_Block(__m128i &block0, __m128i &block1, const word64 *s
rounds--;
}
for (size_t i = rounds-2; static_cast<int>(i) >= 0; i -= 2)
for (int i = static_cast<int>(rounds-2); i >= 0; i -= 2)
{
const __m128i rk1 = _mm_castpd_si128(
_mm_loaddup_pd(reinterpret_cast<const double*>(subkeys+i+1)));
@ -824,7 +824,7 @@ inline void SIMON128_Dec_6_Blocks(__m128i &block0, __m128i &block1,
rounds--;
}
for (size_t i = rounds - 2; static_cast<int>(i) >= 0; i -= 2)
for (int i = static_cast<int>(rounds-2); i >= 0; i -= 2)
{
const __m128i rk1 = _mm_castpd_si128(
_mm_loaddup_pd(reinterpret_cast<const double*>(subkeys + i + 1)));
@ -912,7 +912,7 @@ inline void SIMON64_Enc_Block(__m128i &block0, __m128i &block1,
x1 = _mm_shuffle_epi8(x1, mask);
y1 = _mm_shuffle_epi8(y1, mask);
for (size_t i = 0; static_cast<int>(i) < (rounds & ~1)-1; i += 2)
for (int i = 0; i < static_cast<int>(rounds & ~1)-1; i += 2)
{
const __m128i rk1 = _mm_set1_epi32(subkeys[i]);
y1 = _mm_xor_si128(_mm_xor_si128(y1, SIMON64_f(x1)), rk1);
@ -962,7 +962,7 @@ inline void SIMON64_Dec_Block(__m128i &block0, __m128i &block1,
rounds--;
}
for (size_t i = rounds-2; static_cast<int>(i) >= 0; i -= 2)
for (int i = static_cast<int>(rounds-2); i >= 0; i -= 2)
{
const __m128i rk1 = _mm_set1_epi32(subkeys[i+1]);
x1 = _mm_xor_si128(_mm_xor_si128(x1, SIMON64_f(y1)), rk1);
@ -1012,7 +1012,7 @@ inline void SIMON64_Enc_6_Blocks(__m128i &block0, __m128i &block1,
x3 = _mm_shuffle_epi8(x3, mask);
y3 = _mm_shuffle_epi8(y3, mask);
for (size_t i = 0; static_cast<int>(i) < (rounds & ~1)-1; i += 2)
for (int i = 0; i < static_cast<int>(rounds & ~1)-1; i += 2)
{
const __m128i rk1 = _mm_set1_epi32(subkeys[i]);
y1 = _mm_xor_si128(_mm_xor_si128(y1, SIMON64_f(x1)), rk1);
@ -1093,7 +1093,7 @@ inline void SIMON64_Dec_6_Blocks(__m128i &block0, __m128i &block1,
rounds--;
}
for (size_t i = rounds-2; static_cast<int>(i) >= 0; i -= 2)
for (int i = static_cast<int>(rounds-2); i >= 0; i -= 2)
{
const __m128i rk1 = _mm_set1_epi32(subkeys[i+1]);
x1 = _mm_xor_si128(_mm_xor_si128(x1, SIMON64_f(y1)), rk1);

View File

@ -602,7 +602,7 @@ inline void SPECK128_Enc_Block(__m128i &block0, __m128i &block1,
x1 = _mm_shuffle_epi8(x1, mask);
y1 = _mm_shuffle_epi8(y1, mask);
for (size_t i=0; static_cast<int>(i)<rounds; ++i)
for (int i=0; i < static_cast<int>(rounds); ++i)
{
const __m128i rk = _mm_castpd_si128(
_mm_loaddup_pd(reinterpret_cast<const double*>(subkeys+i)));
@ -645,7 +645,7 @@ inline void SPECK128_Enc_6_Blocks(__m128i &block0, __m128i &block1,
x3 = _mm_shuffle_epi8(x3, mask);
y3 = _mm_shuffle_epi8(y3, mask);
for (size_t i=0; static_cast<int>(i)<rounds; ++i)
for (int i=0; i < static_cast<int>(rounds); ++i)
{
const __m128i rk = _mm_castpd_si128(
_mm_loaddup_pd(reinterpret_cast<const double*>(subkeys+i)));
@ -697,7 +697,7 @@ inline void SPECK128_Dec_Block(__m128i &block0, __m128i &block1,
x1 = _mm_shuffle_epi8(x1, mask);
y1 = _mm_shuffle_epi8(y1, mask);
for (size_t i=rounds-1; static_cast<int>(i)>=0; --i)
for (int i = static_cast<int>(rounds-1); i >=0 ; --i)
{
const __m128i rk = _mm_castpd_si128(
_mm_loaddup_pd(reinterpret_cast<const double*>(subkeys+i)));
@ -740,7 +740,7 @@ inline void SPECK128_Dec_6_Blocks(__m128i &block0, __m128i &block1,
x3 = _mm_shuffle_epi8(x3, mask);
y3 = _mm_shuffle_epi8(y3, mask);
for (size_t i=rounds-1; static_cast<int>(i)>=0; --i)
for (int i = static_cast<int>(rounds-1); i >= 0; --i)
{
const __m128i rk = _mm_castpd_si128(
_mm_loaddup_pd(reinterpret_cast<const double*>(subkeys+i)));
@ -829,7 +829,7 @@ inline void SPECK64_Enc_Block(__m128i &block0, __m128i &block1,
x1 = _mm_shuffle_epi8(x1, mask);
y1 = _mm_shuffle_epi8(y1, mask);
for (size_t i=0; static_cast<int>(i)<rounds; ++i)
for (int i=0; i < static_cast<int>(rounds); ++i)
{
const __m128i rk = _mm_set1_epi32(subkeys[i]);
@ -866,7 +866,7 @@ inline void SPECK64_Dec_Block(__m128i &block0, __m128i &block1,
x1 = _mm_shuffle_epi8(x1, mask);
y1 = _mm_shuffle_epi8(y1, mask);
for (size_t i=rounds-1; static_cast<int>(i)>=0; --i)
for (int i = static_cast<int>(rounds-1); i >= 0; --i)
{
const __m128i rk = _mm_set1_epi32(subkeys[i]);
@ -918,7 +918,7 @@ inline void SPECK64_Enc_6_Blocks(__m128i &block0, __m128i &block1,
x3 = _mm_shuffle_epi8(x3, mask);
y3 = _mm_shuffle_epi8(y3, mask);
for (size_t i=0; static_cast<int>(i)<rounds; ++i)
for (int i=0; i < static_cast<int>(rounds); ++i)
{
const __m128i rk = _mm_set1_epi32(subkeys[i]);
@ -988,7 +988,7 @@ inline void SPECK64_Dec_6_Blocks(__m128i &block0, __m128i &block1,
x3 = _mm_shuffle_epi8(x3, mask);
y3 = _mm_shuffle_epi8(y3, mask);
for (size_t i=rounds-1; static_cast<int>(i)>=0; --i)
for (int i = static_cast<int>(rounds-1); i >= 0; --i)
{
const __m128i rk = _mm_set1_epi32(subkeys[i]);