summaryrefslogtreecommitdiff
path: root/lib/libcurses/tty/lib_vidattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcurses/tty/lib_vidattr.c')
-rw-r--r--lib/libcurses/tty/lib_vidattr.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/libcurses/tty/lib_vidattr.c b/lib/libcurses/tty/lib_vidattr.c
index e9639a730c6..4a5c9354b72 100644
--- a/lib/libcurses/tty/lib_vidattr.c
+++ b/lib/libcurses/tty/lib_vidattr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_vidattr.c,v 1.7 2000/10/22 18:27:24 millert Exp $ */
+/* $OpenBSD: lib_vidattr.c,v 1.8 2001/01/22 18:02:00 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -66,7 +66,7 @@
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$From: lib_vidattr.c,v 1.33 2000/10/09 22:45:29 tom Exp $")
+MODULE_ID("$From: lib_vidattr.c,v 1.36 2000/12/10 03:05:48 tom Exp $")
#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
@@ -88,8 +88,9 @@ MODULE_ID("$From: 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;
@@ -136,11 +137,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;
}
@@ -250,7 +253,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)));
@@ -258,7 +261,7 @@ vidattr(attr_t newmode)
returnCode(vidputs(newmode, _nc_outch));
}
-chtype
+NCURSES_EXPORT(chtype)
termattrs(void)
{
chtype attrs = A_NORMAL;