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
This commit is contained in:
James Zern 2013-11-27 20:10:45 -08:00
parent cc55790e37
commit 3f6c35c6f3

View File

@ -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; int best_score = 0x7fffffff;
for (filter = WEBP_FILTER_NONE; filter < WEBP_FILTER_LAST; ++filter) { for (filter = WEBP_FILTER_NONE; filter < WEBP_FILTER_LAST; ++filter) {
int score = 0; int score = 0;
@ -239,7 +240,7 @@ WEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data,
} }
if (score < best_score) { if (score < best_score) {
best_score = score; best_score = score;
best_filter = filter; best_filter = (WEBP_FILTER_TYPE)filter;
} }
} }
return best_filter; return best_filter;