COLOR_PAIR() should & with A_COLOR, not A_ATTRIBUTES.

This commit is contained in:
William McBrine
2006-02-21 17:20:17 +00:00
parent 31033f3c09
commit 91b2d2124f
2 changed files with 4 additions and 5 deletions

View File

@@ -15,7 +15,7 @@
* See the file maintain.er for details of the current maintainer.
**************************************************************************/
/* $Id: curses.h,v 1.129 2006/02/21 07:05:43 wmcbrine Exp $ */
/* $Id: curses.h,v 1.130 2006/02/21 17:20:17 wmcbrine Exp $ */
/* ----------------------------------------------------------------------
PDCurses
@@ -1557,8 +1557,7 @@ int PDC_set_line_color(short);
#if !defined(NOMACROS) && !defined(PDCDEBUG)
#define COLOR_PAIR(n) (((chtype)(n) << PDC_COLOR_SHIFT) &\
A_ATTRIBUTES)
#define COLOR_PAIR(n) (((chtype)(n) << PDC_COLOR_SHIFT) & A_COLOR)
#define PAIR_NUMBER(n) (((n) & A_COLOR) >> PDC_COLOR_SHIFT)
# define addch(c) waddch(stdscr, c)

View File

@@ -35,7 +35,7 @@ static void PDC_init_pair(short, short, short);
#ifdef PDCDEBUG
const char *rcsid_color =
"$Id: color.c,v 1.39 2006/02/21 07:05:43 wmcbrine Exp $";
"$Id: color.c,v 1.40 2006/02/21 17:20:17 wmcbrine Exp $";
#endif
/*man-start*********************************************************************
@@ -133,7 +133,7 @@ unsigned char colorset[PDC_COLOR_PAIRS];
chtype COLOR_PAIR(int n)
{
return ((chtype)n << PDC_COLOR_SHIFT) & A_ATTRIBUTES;
return ((chtype)n << PDC_COLOR_SHIFT) & A_COLOR;
}
int PAIR_NUMBER(chtype value)