diff options
Diffstat (limited to 'contrib/ncurses/ncurses/tty/lib_vidattr.c')
-rw-r--r-- | contrib/ncurses/ncurses/tty/lib_vidattr.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/contrib/ncurses/ncurses/tty/lib_vidattr.c b/contrib/ncurses/ncurses/tty/lib_vidattr.c index 5022cbd..464973d 100644 --- a/contrib/ncurses/ncurses/tty/lib_vidattr.c +++ b/contrib/ncurses/ncurses/tty/lib_vidattr.c @@ -64,7 +64,7 @@ #include <curses.priv.h> #include <term.h> -MODULE_ID("$Id: lib_vidattr.c,v 1.33 2000/10/09 22:45:29 tom Exp $") +MODULE_ID("$Id: lib_vidattr.c,v 1.36 2000/12/10 03:05:48 tom Exp $") #define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) @@ -86,8 +86,9 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.33 2000/10/09 22:45:29 tom Exp $") } \ } -int -vidputs(attr_t newmode, int (*outc) (int)) +NCURSES_EXPORT(int) +vidputs +(attr_t newmode, int (*outc) (int)) { static attr_t previous_attr = A_NORMAL; attr_t turn_on, turn_off; @@ -134,11 +135,13 @@ vidputs(attr_t newmode, int (*outc) (int)) * A_ALTCHARSET (256) down 2 to line up. We use the NCURSES_BITS * macro so this will work properly for the wide-character layout. */ - attr_t mask = NCURSES_BITS((no_color_video & 63) - | ((no_color_video & 192) << 1) - | ((no_color_video & 256) >> 2), 8); + unsigned value = no_color_video; + attr_t mask = NCURSES_BITS((value & 63) + | ((value & 192) << 1) + | ((value & 256) >> 2), 8); - if (mask & A_REVERSE && newmode & A_REVERSE) { + if ((mask & A_REVERSE) != 0 + && (newmode & A_REVERSE) != 0) { reverse = TRUE; mask &= ~A_REVERSE; } @@ -248,7 +251,7 @@ vidputs(attr_t newmode, int (*outc) (int)) returnCode(OK); } -int +NCURSES_EXPORT(int) vidattr(attr_t newmode) { T((T_CALLED("vidattr(%s)"), _traceattr(newmode))); @@ -256,7 +259,7 @@ vidattr(attr_t newmode) returnCode(vidputs(newmode, _nc_outch)); } -chtype +NCURSES_EXPORT(chtype) termattrs(void) { chtype attrs = A_NORMAL; |