diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-12-07 04:35:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-12-07 18:50:36 +0300 |
commit | 514878dd29b52fcbdc3ec63833d528070d502880 (patch) | |
tree | 8d4abe6e8a5146630f9d66908f8ccdf860f1b8d2 /src/resources/dye | |
parent | 48ea9be889ecc77ae0ee7e952f1970771a92e5c9 (diff) | |
download | mv-514878dd29b52fcbdc3ec63833d528070d502880.tar.gz mv-514878dd29b52fcbdc3ec63833d528070d502880.tar.bz2 mv-514878dd29b52fcbdc3ec63833d528070d502880.tar.xz mv-514878dd29b52fcbdc3ec63833d528070d502880.zip |
Fix code style.
Diffstat (limited to 'src/resources/dye')
-rw-r--r-- | src/resources/dye/dye.cpp | 4 | ||||
-rw-r--r-- | src/resources/dye/dyepalette_replacescolor.cpp | 16 | ||||
-rw-r--r-- | src/resources/dye/dyepalette_replacesoglcolor.cpp | 2 |
3 files changed, 11 insertions, 11 deletions
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<uint8_t *>(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<DyeColor>::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<uint8_t *>(&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<DyeColor>::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<uint8_t *>(&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<DyeColor>::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<DyeColor>::const_iterator it = mColors.begin(); while (it != it_end) { - const DyeColor &col = *it; + const DyeColor &col = *it; ++ it; const DyeColor &col2 = *it; |