* color.c [USE_NCURSES]: Eliminate division by COLOR, it's 0 in

black and white mode.
This commit is contained in:
Pavel Roskin 2002-07-14 22:18:12 +00:00
parent 75666df0fe
commit 82e481b78d
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,8 @@
2002-07-14 Pavel Roskin <proski@gnu.org> 2002-07-14 Pavel Roskin <proski@gnu.org>
* color.c [USE_NCURSES]: Eliminate division by COLOR, it's 0 in
black and white mode.
* slint.c: Move functions for allocating color pairs ... * slint.c: Move functions for allocating color pairs ...
* color.c: ... here. Implement ncurses equivalents. Rename * color.c: ... here. Implement ncurses equivalents. Rename
init_pair() to mc_init_pair() and keep tack of max_index with init_pair() to mc_init_pair() and keep tack of max_index with

View File

@ -42,8 +42,8 @@ int dialog_colors [4];
# define color_map_fg(n) color_map[n].fg # define color_map_fg(n) color_map[n].fg
# define color_map_bg(n) color_map[n].bg # define color_map_bg(n) color_map[n].bg
#else #else
# define color_map_fg(n) (color_map[n].fg % COLORS) # define color_map_fg(n) (color_map[n].fg & COLOR_WHITE)
# define color_map_bg(n) (color_map[n].bg % COLORS) # define color_map_bg(n) (color_map[n].bg & COLOR_WHITE)
#endif #endif
struct colorpair { struct colorpair {
@ -397,8 +397,8 @@ try_alloc_color_pair (char *fg, char *bg)
get_color (bg, &bg_index); get_color (bg, &bg_index);
bold_attr = fg_index & A_BOLD; bold_attr = fg_index & A_BOLD;
fg_index = fg_index % COLORS; fg_index = fg_index & COLOR_WHITE;
bg_index = bg_index % COLORS; bg_index = bg_index & COLOR_WHITE;
p->index = alloc_color_pair (fg_index, bg_index); p->index = alloc_color_pair (fg_index, bg_index);
attr_pairs [p->index] = bold_attr; attr_pairs [p->index] = bold_attr;