From 2f5e893400eef8442c1ebaf8091a413d76b68fb2 Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Sat, 14 Sep 2013 02:02:09 -0700 Subject: [PATCH] remove -Wshadow warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "warning: declaration of ‘index’ shadows a global declaration" Change-Id: I65f079aa4cd300cd1b3887a040b75c6b0f36ca1d --- examples/gif2webp_util.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/gif2webp_util.c b/examples/gif2webp_util.c index 07a0ae5f..393721e4 100644 --- a/examples/gif2webp_util.c +++ b/examples/gif2webp_util.c @@ -107,11 +107,11 @@ static int EncodeFrame(const WebPConfig* const config, WebPPicture* const pic, return 1; } -// Returns cached frame at given 'index'. +// Returns cached frame at given 'position' index. static EncodedFrame* CacheGetFrame(const WebPFrameCache* const cache, - size_t index) { - assert(cache->start + index < cache->size); - return &cache->encoded_frames[cache->start + index]; + size_t position) { + assert(cache->start + position < cache->size); + return &cache->encoded_frames[cache->start + position]; } // Calculate the penalty incurred if we encode given frame as a key frame @@ -137,9 +137,9 @@ int WebPFrameCacheAddFrame(WebPFrameCache* const cache, WebPPicture* const sub_frame_pic, const WebPMuxFrameInfo* const key_frame_info, WebPPicture* const key_frame_pic) { - const size_t index = cache->count; - EncodedFrame* const encoded_frame = CacheGetFrame(cache, index); - assert(index < cache->size); + const size_t position = cache->count; + EncodedFrame* const encoded_frame = CacheGetFrame(cache, position); + assert(position < cache->size); assert(sub_frame_pic != NULL || key_frame_pic != NULL); if (sub_frame_pic != NULL && !SetFrame(config, sub_frame_info, sub_frame_pic, &encoded_frame->sub_frame)) { @@ -153,7 +153,7 @@ int WebPFrameCacheAddFrame(WebPFrameCache* const cache, ++cache->count; if (sub_frame_pic == NULL && key_frame_pic != NULL) { // Keyframe. - cache->keyframe = index; + cache->keyframe = position; cache->flush_count = cache->count; cache->count_since_key_frame = 0; } else { @@ -164,7 +164,7 @@ int WebPFrameCacheAddFrame(WebPFrameCache* const cache, } else { // Analyze size difference of the two variants. const int64_t curr_delta = KeyFramePenalty(encoded_frame); if (curr_delta <= cache->best_delta) { // Pick this as keyframe. - cache->keyframe = index; + cache->keyframe = position; cache->best_delta = curr_delta; cache->flush_count = cache->count - 1; // We can flush previous frames. }