]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - tack/sysdep.c
ncurses 5.6 - patch 20070128
[ncurses.git] / tack / sysdep.c
index 25376578fbcd92c0a76914faa0aaf6d205509290..78ae095e3bcb50e50c24b180fe79b0cd0c665ee0 100644 (file)
@@ -15,8 +15,8 @@
 ** 
 ** You should have received a copy of the GNU General Public License
 ** along with TACK; see the file COPYING.  If not, write to
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-** Boston, MA 02111-1307, USA.
+** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+** Boston, MA 02110-1301, USA
 */
 /*
  * Operating system dependent functions.  We assume the POSIX API.
  * global has no effect.
  */
 
-#if defined(__BEOS__)
-#include <OS.h>
+#ifdef HAVE_CONFIG_H
+#include <ncurses_cfg.h>
 #endif
+#include <signal.h>    /* include before curses.h to work around glibc bug */
 
 #include <tack.h>
 
-#include <signal.h>
 #include <term.h>
 #include <errno.h>
 
+#if defined(__BEOS__)
+#undef false
+#undef true
+#include <OS.h>
+#endif
+
 #if HAVE_SELECT
 #if HAVE_SYS_TIME_H && HAVE_SYS_TIME_SELECT
 #include <sys/time.h>
@@ -43,7 +49,7 @@
 #endif
 #endif
 
-MODULE_ID("$Id: sysdep.c,v 1.9 2000/09/02 19:17:39 tom Exp $")
+MODULE_ID("$Id: sysdep.c,v 1.15 2005/09/17 19:49:16 tom Exp $")
 
 #if DECL_ERRNO
 extern int errno;
@@ -57,7 +63,7 @@ extern int errno;
 
 /* globals */
 int tty_frame_size;            /* asynch frame size times 2 */
-unsigned long tty_baud_rate;   /* baud rate - bits per second */
+unsigned tty_baud_rate;                /* baud rate - bits per second */
 int not_a_tty;                 /* TRUE if output is not a tty (i.e. pipe) */
 int nodelay_read;              /* TRUE if NDELAY is set */
 
@@ -176,8 +182,8 @@ tty_set(void)
 #endif /* NL1 */
                break;
        }
-       if (!(new_modes.c_oflag & ~OPOST))
-               new_modes.c_oflag &= ~OPOST;
+       if (!(new_modes.c_oflag & (unsigned long) ~OPOST))
+               new_modes.c_oflag &= (unsigned long) ~OPOST;
 #else
        new_modes.sg_flags |= RAW;
        if (not_a_tty)
@@ -393,7 +399,7 @@ read_key(char *buf, int max)
                if (ask > max) {
                        ask = max;
                }
-               if ((got = read(fileno(stdin), s, ask))) {
+               if ((got = read(fileno(stdin), s, (unsigned) ask))) {
                        s += got;
                } else {
                        break;
@@ -494,5 +500,5 @@ set_alarm_clock(
 {
        signal(SIGALRM, alarm_event);
        no_alarm_event = 1;
-       (void) alarm(seconds);
+       (void) alarm((unsigned) seconds);
 }