From 8b76fe93bf2228e5ab4dd2113e6277c3b83a742c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 20 Feb 2020 22:56:29 -0800 Subject: [PATCH] [clang-tidy] fix small loop variable Found with bugprone-too-small-loop-variable Signed-off-by: Rosen Penev --- src/color.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/color.cpp b/src/color.cpp index 0a5857f4d..990997a33 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -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(-1); unsigned char best_index = static_cast(-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;