From 1c6f6ba212c442fa3154e110abf6f1be7cc02b77 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 3 Dec 2021 12:16:53 +0100 Subject: [PATCH] tweaks: rename three parameters, away from single letters Also, reshuffle two lines, to have the code after the declaration. --- src/rcfile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rcfile.c b/src/rcfile.c index 0d967155..63d76f55 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -992,15 +992,15 @@ void parse_includes(char *ptr) /* Return the index of the color that is closest to the given RGB levels, * assuming that the terminal uses the 6x6x6 color cube of xterm-256color. */ -short closest_index_color(short r, short g, short b) +short closest_index_color(short red, short green, short blue) { - if (COLORS != 256) - return THE_DEFAULT; - /* Translation table, from 16 intended levels to 6 available levels. */ static const short level[] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 }; - return (36 * level[r] + 6 * level[g] + level[b] + 16); + if (COLORS == 256) + return (36 * level[red] + 6 * level[green] + level[blue] + 16); + else + return THE_DEFAULT; } #define COLORCOUNT 20