From 3f6c35c6f38e6bc2c6f1ea52ac4d3aad8d0f37e6 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 27 Nov 2013 20:10:45 -0800 Subject: [PATCH] EstimateBestFilter: use an int to iterate WEBP_FILTER_TYPE this change allows the code to be built with a C++ compiler without the addition of an operator++ Change-Id: I2f2fae720b9772abfc3c540bb2e3bf9107d96cc9 --- src/utils/filters.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/filters.c b/src/utils/filters.c index 511457ec..be7da8c0 100644 --- a/src/utils/filters.c +++ b/src/utils/filters.c @@ -228,7 +228,8 @@ WEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data, } } { - WEBP_FILTER_TYPE filter, best_filter = WEBP_FILTER_NONE; + int filter; + WEBP_FILTER_TYPE best_filter = WEBP_FILTER_NONE; int best_score = 0x7fffffff; for (filter = WEBP_FILTER_NONE; filter < WEBP_FILTER_LAST; ++filter) { int score = 0; @@ -239,7 +240,7 @@ WEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data, } if (score < best_score) { best_score = score; - best_filter = filter; + best_filter = (WEBP_FILTER_TYPE)filter; } } return best_filter;