tweaks: rename two variables, to match others

This commit is contained in:
Benno Schulenberg 2016-07-25 10:53:49 +02:00
parent a472f480a7
commit c38ffdc741

View File

@ -38,7 +38,7 @@
* for the colors in each syntax. */ * for the colors in each syntax. */
void set_colorpairs(void) void set_colorpairs(void)
{ {
const syntaxtype *this_syntax = syntaxes; const syntaxtype *sint;
bool using_defaults = FALSE; bool using_defaults = FALSE;
short foreground, background; short foreground, background;
size_t i; size_t i;
@ -78,28 +78,27 @@ void set_colorpairs(void)
/* For each syntax, go through its list of colors and assign each /* For each syntax, go through its list of colors and assign each
* its pair number, giving identical color pairs the same number. */ * its pair number, giving identical color pairs the same number. */
for (; this_syntax != NULL; this_syntax = this_syntax->next) { for (sint = syntaxes; sint != NULL; sint = sint->next) {
colortype *this_color = this_syntax->color; colortype *ink;
int clr_pair = NUMBER_OF_ELEMENTS + 1; int clr_pair = NUMBER_OF_ELEMENTS + 1;
for (; this_color != NULL; this_color = this_color->next) { for (ink = sint->color; ink != NULL; ink = ink->next) {
const colortype *beforenow = this_syntax->color; const colortype *beforenow = sint->color;
while (beforenow != this_color && while (beforenow != ink && (beforenow->fg != ink->fg ||
(beforenow->fg != this_color->fg || beforenow->bg != ink->bg ||
beforenow->bg != this_color->bg || beforenow->bright != ink->bright))
beforenow->bright != this_color->bright))
beforenow = beforenow->next; beforenow = beforenow->next;
if (beforenow != this_color) if (beforenow != ink)
this_color->pairnum = beforenow->pairnum; ink->pairnum = beforenow->pairnum;
else { else {
this_color->pairnum = clr_pair; ink->pairnum = clr_pair;
clr_pair++; clr_pair++;
} }
this_color->attributes = COLOR_PAIR(this_color->pairnum) | ink->attributes = COLOR_PAIR(ink->pairnum) |
(this_color->bright ? A_BOLD : A_NORMAL); (ink->bright ? A_BOLD : A_NORMAL);
} }
} }
} }