]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/lib_mvcur.c
ncurses 5.9 - patch 20121215
[ncurses.git] / ncurses / tty / lib_mvcur.c
index 8e1b90bd592dbddcfbe35875034ef783e8808b55..78453e35f0db9f89811b6e5d41322cc2d5d4d005 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mvcur.c,v 1.125 2011/01/09 21:06:08 tom Exp $")
+MODULE_ID("$Id: lib_mvcur.c,v 1.128 2012/12/15 20:59:27 tom Exp $")
 
 #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x]    /* desired state */
 
@@ -285,7 +285,7 @@ NCURSES_EXPORT(void)
 NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_DCL0)
 /* what to do at initialization time and after each shellout */
 {
-    if (SP_PARM && !IsTermInfo(SP_PARM))
+    if (!SP_PARM || !IsTermInfo(SP_PARM))
        return;
 
     /* initialize screen for cursor access */
@@ -327,13 +327,14 @@ NCURSES_EXPORT(void)
 NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0)
 /* initialize the cost structure */
 {
-    if (SP_PARM->_ofp && isatty(fileno(SP_PARM->_ofp)))
+    if (SP_PARM->_ofp && isatty(fileno(SP_PARM->_ofp))) {
        SP_PARM->_char_padding = ((BAUDBYTE * 1000 * 10)
                                  / (BAUDRATE(SP_PARM) > 0
                                     ? BAUDRATE(SP_PARM)
                                     : 9600));
-    else
+    } else {
        SP_PARM->_char_padding = 1;     /* must be nonzero */
+    }
     if (SP_PARM->_char_padding <= 0)
        SP_PARM->_char_padding = 1;     /* must be nonzero */
     TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP_PARM->_char_padding));
@@ -549,7 +550,7 @@ relative_move(NCURSES_SP_DCLx
              int from_x,
              int to_y,
              int to_x,
-             bool ovw)
+             int ovw)
 /* move via local motions (cuu/cuu1/cud/cud1/cub1/cub/cuf1/cuf/vpa/hpa) */
 {
     string_desc save;
@@ -770,7 +771,7 @@ relative_move(NCURSES_SP_DCLx
  */
 
 static NCURSES_INLINE int
-onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw)
+onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, int ovw)
 /* onscreen move from (yold, xold) to (ynew, xnew) */
 {
     string_desc result;