From 04bd4759a8a72afbc8dc1dc1a270fc15a007f231 Mon Sep 17 00:00:00 2001 From: Paul Traina Date: Sun, 22 Sep 1996 01:05:21 +0000 Subject: [PATCH] Fix some compilation warnings --- lib/libncurses/lib_addch.c | 2 +- lib/libncurses/lib_bkgd.c | 2 +- lib/libncurses/lib_clrbot.c | 2 +- lib/libncurses/lib_clreol.c | 2 +- lib/libncurses/lib_doupdate.c | 2 +- usr.bin/tn3270/sys_curses/termout.c | 25 ++++++++----------------- 6 files changed, 13 insertions(+), 22 deletions(-) diff --git a/lib/libncurses/lib_addch.c b/lib/libncurses/lib_addch.c index 00684eddd1d1..15ecf598880f 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 a74c56e73bbb..06289351e7d9 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 fa48db8a8ebd..22f87267f836 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 a22d6b2f9cc2..12b78feafa78 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 2dba9442e51e..9f56386c3f4d 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 bf5284ce49b3..128d7e5d1a2a 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 -#include +#include #endif #include #include -#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 */ }