summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libncurses/lib_addch.c2
-rw-r--r--lib/libncurses/lib_bkgd.c2
-rw-r--r--lib/libncurses/lib_clrbot.c2
-rw-r--r--lib/libncurses/lib_clreol.c2
-rw-r--r--lib/libncurses/lib_doupdate.c2
-rw-r--r--usr.bin/tn3270/sys_curses/termout.c25
6 files changed, 13 insertions, 22 deletions
diff --git a/lib/libncurses/lib_addch.c b/lib/libncurses/lib_addch.c
index 00684ed..15ecf59 100644
--- a/lib/libncurses/lib_addch.c
+++ b/lib/libncurses/lib_addch.c
@@ -56,7 +56,7 @@ chtype ch = c;
T(("win attr = %x", win->_attrs));
ch |= win->_attrs;
- if (win->_line[y][x]&A_CHARTEXT == ' ')
+ if ((win->_line[y][x]&A_CHARTEXT) == ' ')
ch |= win->_bkgd;
else
ch |= (win->_bkgd&A_ATTRIBUTES);
diff --git a/lib/libncurses/lib_bkgd.c b/lib/libncurses/lib_bkgd.c
index a74c56e..0628935 100644
--- a/lib/libncurses/lib_bkgd.c
+++ b/lib/libncurses/lib_bkgd.c
@@ -27,7 +27,7 @@ int x, y;
T(("wbkgd(%x, %x) called", win, ch));
for (y = 0; y < win->_maxy; y++)
for (x = 0; x < win->_maxx; x++)
- if (win->_line[y][x]&A_CHARTEXT == ' ')
+ if ((win->_line[y][x]&A_CHARTEXT) == ' ')
win->_line[y][x] |= ch;
else
win->_line[y][x] |= (ch&A_ATTRIBUTES);
diff --git a/lib/libncurses/lib_clrbot.c b/lib/libncurses/lib_clrbot.c
index fa48db8..22f8726 100644
--- a/lib/libncurses/lib_clrbot.c
+++ b/lib/libncurses/lib_clrbot.c
@@ -12,7 +12,7 @@
#include "curses.priv.h"
-#define BLANK ' '|A_NORMAL
+#define BLANK (' '|A_NORMAL)
int wclrtobot(WINDOW *win)
{
diff --git a/lib/libncurses/lib_clreol.c b/lib/libncurses/lib_clreol.c
index a22d6b2..12b78fe 100644
--- a/lib/libncurses/lib_clreol.c
+++ b/lib/libncurses/lib_clreol.c
@@ -12,7 +12,7 @@
#include "curses.priv.h"
-#define BLANK ' '|A_NORMAL
+#define BLANK (' '|A_NORMAL)
int wclrtoeol(WINDOW *win)
{
diff --git a/lib/libncurses/lib_doupdate.c b/lib/libncurses/lib_doupdate.c
index 2dba944..9f56386 100644
--- a/lib/libncurses/lib_doupdate.c
+++ b/lib/libncurses/lib_doupdate.c
@@ -195,7 +195,7 @@ static int countc(int c)
**
*/
-#define BLANK ' '|A_NORMAL
+#define BLANK (' '|A_NORMAL)
static void ClrUpdate(WINDOW *scr)
{
diff --git a/usr.bin/tn3270/sys_curses/termout.c b/usr.bin/tn3270/sys_curses/termout.c
index bf5284c..128d7e5 100644
--- a/usr.bin/tn3270/sys_curses/termout.c
+++ b/usr.bin/tn3270/sys_curses/termout.c
@@ -37,18 +37,10 @@ static char sccsid[] = "@(#)termout.c 8.1 (Berkeley) 6/6/93";
#if defined(unix)
#include <signal.h>
-#include <sgtty.h>
+#include <termios.h>
#endif
#include <stdio.h>
#include <curses.h>
-#if defined(ultrix)
-/* Some version of this OS has a bad definition for nonl() */
-#undef nl
-#undef nonl
-
-#define nl() (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty))
-#define nonl() (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty))
-#endif /* defined(ultrix) */
#include "../general/general.h"
@@ -628,9 +620,8 @@ void
InitTerminal()
{
#if defined(unix)
- struct sgttyb ourttyb;
- static int speeds[] = { 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800,
- 2400, 4800, 9600 };
+ struct termios termios_info;
+ speed_t speed;
#endif
extern void InitMapping();
@@ -657,14 +648,14 @@ InitTerminal()
TryToSend = FastScreen;
#if defined(unix)
- ioctl(1, TIOCGETP, (char *) &ourttyb);
- if ((ourttyb.sg_ospeed < 0) || (ourttyb.sg_ospeed > B9600)) {
+ (void) tcgetattr(1, &termios_info);
+ speed = cfgetospeed(&termios_info);
+ if (speed > 19200) {
max_changes_before_poll = 1920;
} else {
- max_changes_before_poll = speeds[ourttyb.sg_ospeed]/10;
- if (max_changes_before_poll < 40) {
+ max_changes_before_poll = speed/10;
+ if (max_changes_before_poll < 40)
max_changes_before_poll = 40;
- }
TryToSend = SlowScreen;
HaveInput = 1; /* get signals going */
}
OpenPOWER on IntegriCloud