From 2e5785b23313999eab6125c52452030fe7140043 Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Thu, 23 Nov 2017 00:22:01 -0800 Subject: [PATCH] anim_utils.c: remove warning when !defined(WEBP_HAVE_GIF) BUG=webp:355 Change-Id: I57d77672260771bb0c2ab3c802388f2d62b1f187 --- examples/anim_util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/anim_util.c b/examples/anim_util.c index d1a48887..6cd2c818 100644 --- a/examples/anim_util.c +++ b/examples/anim_util.c @@ -16,7 +16,7 @@ #include #include -#ifdef WEBP_HAVE_GIF +#if defined(WEBP_HAVE_GIF) #include #endif #include "webp/format_constants.h" @@ -33,11 +33,13 @@ static const int kNumChannels = 4; // ----------------------------------------------------------------------------- // Common utilities. +#if defined(WEBP_HAVE_GIF) // Returns true if the frame covers the full canvas. static int IsFullFrame(int width, int height, int canvas_width, int canvas_height) { return (width == canvas_width && height == canvas_height); } +#endif // WEBP_HAVE_GIF static int CheckSizeForOverflow(uint64_t size) { return (size == (size_t)size); @@ -85,6 +87,7 @@ void ClearAnimatedImage(AnimatedImage* const image) { } } +#if defined(WEBP_HAVE_GIF) // Clear the canvas to transparent. static void ZeroFillCanvas(uint8_t* rgba, uint32_t canvas_width, uint32_t canvas_height) { @@ -126,6 +129,7 @@ static void CopyFrameRectangle(const uint8_t* src, uint8_t* dst, int stride, dst += stride; } } +#endif // WEBP_HAVE_GIF // Canonicalize all transparent pixels to transparent black to aid comparison. static void CleanupTransparentPixels(uint32_t* rgba, @@ -280,7 +284,7 @@ static int ReadAnimatedWebP(const char filename[], // ----------------------------------------------------------------------------- // GIF Decoding. -#ifdef WEBP_HAVE_GIF +#if defined(WEBP_HAVE_GIF) // Returns true if this is a valid GIF bitstream. static int IsGIF(const WebPData* const data) {