nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 1c6f6ba212c442fa3154e110abf6f1be7cc02b77
parent 58cba6a7c68272555e1477433a86bd8a2ed8cb01
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri,  3 Dec 2021 12:16:53 +0100

tweaks: rename three parameters, away from single letters

Also, reshuffle two lines, to have the code after the declaration.

Diffstat:
Msrc/rcfile.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 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