diff --git a/examples/dwebp.c b/examples/dwebp.c index 5c16fb1d..239114ce 100644 --- a/examples/dwebp.c +++ b/examples/dwebp.c @@ -235,33 +235,33 @@ int main(int argc, const char* argv[]) { format = RAW_YUV; } else if (!strcmp(argv[c], "-pixel_format") && c < argc - 1) { const char* const fmt = argv[++c]; - if (!strcmp(fmt, "RGB")) + if (!strcmp(fmt, "RGB")) { format = RGB; - else if (!strcmp(fmt, "RGBA")) + } else if (!strcmp(fmt, "RGBA")) { format = RGBA; - else if (!strcmp(fmt, "BGR")) + } else if (!strcmp(fmt, "BGR")) { format = BGR; - else if (!strcmp(fmt, "BGRA")) + } else if (!strcmp(fmt, "BGRA")) { format = BGRA; - else if (!strcmp(fmt, "ARGB")) + } else if (!strcmp(fmt, "ARGB")) { format = ARGB; - else if (!strcmp(fmt, "RGBA_4444")) + } else if (!strcmp(fmt, "RGBA_4444")) { format = RGBA_4444; - else if (!strcmp(fmt, "RGB_565")) + } else if (!strcmp(fmt, "RGB_565")) { format = RGB_565; - else if (!strcmp(fmt, "rgbA")) + } else if (!strcmp(fmt, "rgbA")) { format = rgbA; - else if (!strcmp(fmt, "bgrA")) + } else if (!strcmp(fmt, "bgrA")) { format = bgrA; - else if (!strcmp(fmt, "Argb")) + } else if (!strcmp(fmt, "Argb")) { format = Argb; - else if (!strcmp(fmt, "rgbA_4444")) + } else if (!strcmp(fmt, "rgbA_4444")) { format = rgbA_4444; - else if (!strcmp(fmt, "YUV")) + } else if (!strcmp(fmt, "YUV")) { format = YUV; - else if (!strcmp(fmt, "YUVA")) + } else if (!strcmp(fmt, "YUVA")) { format = YUVA; - else { + } else { fprintf(stderr, "Can't parse pixel_format %s\n", fmt); parse_error = 1; } diff --git a/sharpyuv/sharpyuv_gamma.c b/sharpyuv/sharpyuv_gamma.c index e69c89fd..06edfd51 100644 --- a/sharpyuv/sharpyuv_gamma.c +++ b/sharpyuv/sharpyuv_gamma.c @@ -121,10 +121,11 @@ static uint16_t FromLinearSrgb(uint32_t value, int bit_depth) { #define MAX(a, b) (((a) > (b)) ? (a) : (b)) static WEBP_INLINE float Roundf(float x) { - if (x < 0) + if (x < 0) { return (float)ceil((double)(x - 0.5f)); - else + } else { return (float)floor((double)(x + 0.5f)); + } } static WEBP_INLINE float Powf(float base, float exp) { diff --git a/src/dsp/alpha_processing.c b/src/dsp/alpha_processing.c index 1d1ceea6..9b9a45fa 100644 --- a/src/dsp/alpha_processing.c +++ b/src/dsp/alpha_processing.c @@ -355,22 +355,25 @@ static void ExtractGreen_C(const uint32_t* WEBP_RESTRICT argb, //------------------------------------------------------------------------------ static int HasAlpha8b_C(const uint8_t* src, int length) { - while (length-- > 0) + while (length-- > 0) { if (*src++ != 0xff) return 1; + } return 0; } static int HasAlpha32b_C(const uint8_t* src, int length) { int x; - for (x = 0; length-- > 0; x += 4) + for (x = 0; length-- > 0; x += 4) { if (src[x] != 0xff) return 1; + } return 0; } static void AlphaReplace_C(uint32_t* src, int length, uint32_t color) { int x; - for (x = 0; x < length; ++x) + for (x = 0; x < length; ++x) { if ((src[x] >> 24) == 0) src[x] = color; + } } //------------------------------------------------------------------------------ diff --git a/src/dsp/alpha_processing_sse2.c b/src/dsp/alpha_processing_sse2.c index b4bafc52..d4c16c26 100644 --- a/src/dsp/alpha_processing_sse2.c +++ b/src/dsp/alpha_processing_sse2.c @@ -274,8 +274,9 @@ static int HasAlpha8b_SSE2(const uint8_t* src, int length) { const int mask = _mm_movemask_epi8(bits); if (mask != 0xffff) return 1; } - for (; i < length; ++i) + for (; i < length; ++i) { if (src[i] != 0xff) return 1; + } return 0; } @@ -314,8 +315,9 @@ static int HasAlpha32b_SSE2(const uint8_t* src, int length) { const int mask = _mm_movemask_epi8(bits); if (mask != 0xffff) return 1; } - for (; i <= length; i += 4) + for (; i <= length; i += 4) { if (src[i] != 0xff) return 1; + } return 0; } @@ -337,8 +339,9 @@ static void AlphaReplace_SSE2(uint32_t* src, int length, uint32_t color) { _mm_storeu_si128((__m128i*)(src + i + 0), _mm_or_si128(d0, e0)); _mm_storeu_si128((__m128i*)(src + i + 4), _mm_or_si128(d1, e1)); } - for (; i < length; ++i) + for (; i < length; ++i) { if ((src[i] >> 24) == 0) src[i] = color; + } } // ----------------------------------------------------------------------------- diff --git a/src/mux/muxread.c b/src/mux/muxread.c index d9434c0a..fa7a806e 100644 --- a/src/mux/muxread.c +++ b/src/mux/muxread.c @@ -278,9 +278,10 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data, ChunkRelease(&chunk); goto PushImage; default: // A non-image chunk. - if (wpi->is_partial) + if (wpi->is_partial) { goto Err; // Encountered a non-image chunk before // getting all chunks of an image. + } if (chunk_list_ends[id] == NULL) { chunk_list_ends[id] = MuxGetChunkListFromId(mux, id); // List to add this chunk.