aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/tty/lib_vidattr.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
commit7a69bbfb278952228c9aa1eca241e65fcdef425e (patch)
treee83b2ef47811e687a6c54035c9af6d4a2b7f14e1 /contrib/ncurses/ncurses/tty/lib_vidattr.c
parent18259542b2f8fa7e3f76f4bb0dd37995dfd424aa (diff)
downloadsrc-7a69bbfb278952228c9aa1eca241e65fcdef425e.tar.gz
src-7a69bbfb278952228c9aa1eca241e65fcdef425e.zip
Import ncurses-5.2-20010512 onto the vendor branch
Obtained from: ftp://dickey.his.com/ncurses/
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=76726
Diffstat (limited to 'contrib/ncurses/ncurses/tty/lib_vidattr.c')
-rw-r--r--contrib/ncurses/ncurses/tty/lib_vidattr.c21
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 5022cbdde78a..464973de32c3 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;