]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/lib_mvcur.c
ncurses 5.9 - patch 20120225
[ncurses.git] / ncurses / tty / lib_mvcur.c
index 5e29c62ff175ef0924c11fec0e00525398404603..8de26c4f6a80800937e550f83f8f34acc78b5b5d 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 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.124 2010/12/19 01:22:58 tom Exp $")
+MODULE_ID("$Id: lib_mvcur.c,v 1.127 2011/10/22 16:09:52 tom Exp $")
 
 #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x]    /* desired state */
 
@@ -242,8 +242,9 @@ NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcn
                if (!GetNoPadding(SP_PARM))
 #endif
                    cum_cost += number * 10;
-           } else
+           } else if (SP_PARM) {
                cum_cost += (float) SP_PARM->_char_padding;
+           }
        }
 
        return ((int) cum_cost);
@@ -469,7 +470,7 @@ NCURSES_SP_NAME(_nc_mvcur_wrap) (NCURSES_SP_DCL0)
     /* leave cursor at screen bottom */
     TINFO_MVCUR(NCURSES_SP_ARGx -1, -1, screen_lines(SP_PARM) - 1, 0);
 
-    if (SP_PARM && !IsTermInfo(SP_PARM))
+    if (!SP_PARM || !IsTermInfo(SP_PARM))
        return;
 
     /* set cursor to normal mode */
@@ -548,7 +549,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;
@@ -769,7 +770,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;