From 514878dd29b52fcbdc3ec63833d528070d502880 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 7 Dec 2018 04:35:19 +0300 Subject: Fix code style. --- src/resources/dye/dye.cpp | 4 ++-- src/resources/dye/dyepalette_replacescolor.cpp | 16 ++++++++-------- src/resources/dye/dyepalette_replacesoglcolor.cpp | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/resources/dye') diff --git a/src/resources/dye/dye.cpp b/src/resources/dye/dye.cpp index df4d165cc..d9c766af3 100644 --- a/src/resources/dye/dye.cpp +++ b/src/resources/dye/dye.cpp @@ -232,10 +232,10 @@ void Dye::normalOGLDye(uint32_t *restrict pixels, { const uint32_t p = *pixels; #if SDL_BYTEORDER == SDL_BIG_ENDIAN - const int alpha = p & 255; + const uint32_t alpha = p & 255U; #else // SDL_BYTEORDER == SDL_BIG_ENDIAN - const int alpha = p & 0xff000000; + const uint32_t alpha = p & 0xff000000U; #endif // SDL_BYTEORDER == SDL_BIG_ENDIAN if (alpha == 0) diff --git a/src/resources/dye/dyepalette_replacescolor.cpp b/src/resources/dye/dyepalette_replacescolor.cpp index 4c987aa9d..6f0cb7d30 100644 --- a/src/resources/dye/dyepalette_replacescolor.cpp +++ b/src/resources/dye/dyepalette_replacescolor.cpp @@ -52,10 +52,10 @@ void DyePalette::replaceSColorDefault(uint32_t *restrict pixels, { uint8_t *const p = reinterpret_cast(pixels); #if SDL_BYTEORDER == SDL_BIG_ENDIAN - const unsigned int data = (*pixels) & 0x00ffffff; + const unsigned int data = (*pixels) & 0x00ffffffU; #else // SDL_BYTEORDER == SDL_BIG_ENDIAN - const unsigned int data = (*pixels) & 0xffffff00; + const unsigned int data = (*pixels) & 0xffffff00U; #endif // SDL_BYTEORDER == SDL_BIG_ENDIAN STD_VECTOR::const_iterator it = mColors.begin(); @@ -111,7 +111,7 @@ void DyePalette::replaceSColorSse2(uint32_t *restrict pixels, for (int ptr = 0; ptr < bufEnd; ptr += 4) { - __m128i mask = _mm_set1_epi32(0xffffff00); + __m128i mask = _mm_set1_epi32(0xffffff00U); // __m128i base = _mm_load_si128(reinterpret_cast<__m128i*>(pixels)); __m128i base = _mm_loadu_si128(reinterpret_cast<__m128i*>( &pixels[ptr])); @@ -142,10 +142,10 @@ void DyePalette::replaceSColorSse2(uint32_t *restrict pixels, { uint8_t *const p = reinterpret_cast(&pixels[ptr]); #if SDL_BYTEORDER == SDL_BIG_ENDIAN - const unsigned int data = pixels[ptr] & 0x00ffffff; + const unsigned int data = pixels[ptr] & 0x00ffffffU; #else // SDL_BYTEORDER == SDL_BIG_ENDIAN - const unsigned int data = pixels[ptr] & 0xffffff00; + const unsigned int data = pixels[ptr] & 0xffffff00U; #endif // SDL_BYTEORDER == SDL_BIG_ENDIAN STD_VECTOR::const_iterator it = mColors.begin(); @@ -192,7 +192,7 @@ void DyePalette::replaceSColorAvx2(uint32_t *restrict pixels, for (int ptr = 0; ptr < bufEnd; ptr += 8) { - __m256i mask = _mm256_set1_epi32(0xffffff00); + __m256i mask = _mm256_set1_epi32(0xffffff00U); // __m256i base = _mm256_load_si256(reinterpret_cast<__m256i*>(pixels)); __m256i base = _mm256_loadu_si256(reinterpret_cast<__m256i*>( &pixels[ptr])); @@ -223,10 +223,10 @@ void DyePalette::replaceSColorAvx2(uint32_t *restrict pixels, { uint8_t *const p = reinterpret_cast(&pixels[ptr]); #if SDL_BYTEORDER == SDL_BIG_ENDIAN - const unsigned int data = pixels[ptr] & 0x00ffffff; + const unsigned int data = pixels[ptr] & 0x00ffffffU; #else // SDL_BYTEORDER == SDL_BIG_ENDIAN - const unsigned int data = pixels[ptr] & 0xffffff00; + const unsigned int data = pixels[ptr] & 0xffffff00U; #endif // SDL_BYTEORDER == SDL_BIG_ENDIAN STD_VECTOR::const_iterator it = mColors.begin(); diff --git a/src/resources/dye/dyepalette_replacesoglcolor.cpp b/src/resources/dye/dyepalette_replacesoglcolor.cpp index a23c64f1f..f4bd31dd0 100644 --- a/src/resources/dye/dyepalette_replacesoglcolor.cpp +++ b/src/resources/dye/dyepalette_replacesoglcolor.cpp @@ -238,7 +238,7 @@ void DyePalette::replaceSOGLColorAvx2(uint32_t *restrict pixels, STD_VECTOR::const_iterator it = mColors.begin(); while (it != it_end) { - const DyeColor &col = *it; + const DyeColor &col = *it; ++ it; const DyeColor &col2 = *it; -- cgit v1.2.3-60-g2f50