[clang-tidy] fix small loop variable

Found with bugprone-too-small-loop-variable

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-02-20 22:56:29 -08:00 committed by Fabian Homborg
parent 925c7a998a
commit 8b76fe93bf

View File

@ -96,7 +96,7 @@ static unsigned char convert_color(const unsigned char rgb[3], const uint32_t *c
long r = rgb[0], g = rgb[1], b = rgb[2];
unsigned long best_distance = static_cast<unsigned long>(-1);
unsigned char best_index = static_cast<unsigned char>(-1);
for (unsigned char idx = 0; idx < color_count; idx++) {
for (size_t idx = 0; idx < color_count; idx++) {
uint32_t color = colors[idx];
long test_r = (color >> 16) & 0xFF, test_g = (color >> 8) & 0xFF,
test_b = (color >> 0) & 0xFF;