]> code.delx.au - gnu-emacs/blobdiff - src/cm.c
* dispextern.h (struct face.stipple):
[gnu-emacs] / src / cm.c
index dac6ece7b2d80f350643c342fed81ab6d08fe0d3..42f855f1694df74d837fed202de6adeec1b0fbb8 100644 (file)
--- a/src/cm.c
+++ b/src/cm.c
@@ -1,6 +1,5 @@
 /* Cursor motion subroutines for GNU Emacs.
 /* Cursor motion subroutines for GNU Emacs.
-   Copyright (C) 1985, 1995, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+   Copyright (C) 1985, 1995, 2001-2011  Free Software Foundation, Inc.
     based primarily on public domain code written by Chris Torek
 
 This file is part of GNU Emacs.
     based primarily on public domain code written by Chris Torek
 
 This file is part of GNU Emacs.
@@ -28,19 +27,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "cm.h"
 #include "termhooks.h"
 #include "termchar.h"
 #include "cm.h"
 #include "termhooks.h"
 #include "termchar.h"
-
-
-/* For now, don't try to include termcap.h.  On some systems,
-   configure finds a non-standard termcap.h that the main build
-   won't find.  */
-extern void tputs (const char *, int, int (*)(int));
-extern char *tgoto (const char *, int, int);
+#include "tparam.h"
 
 #define        BIG     9999            /* 9999 good on VAXen.  For 16 bit machines
                                   use about 2000.... */
 
 
 #define        BIG     9999            /* 9999 good on VAXen.  For 16 bit machines
                                   use about 2000.... */
 
-extern char *BC, *UP;
-
 int cost;              /* sums up costs */
 
 /* ARGSUSED */
 int cost;              /* sums up costs */
 
 /* ARGSUSED */
@@ -200,7 +191,7 @@ calccost (struct tty_display_info *tty,
             tabx,
             tab2x,
             tabcost;
             tabx,
             tab2x,
             tabcost;
-    register char  *p;
+    register const char *p;
 
     /* If have just wrapped on a terminal with xn,
        don't believe the cursor position: give up here
 
     /* If have just wrapped on a terminal with xn,
        don't believe the cursor position: give up here
@@ -223,8 +214,9 @@ calccost (struct tty_display_info *tty,
     }
     totalcost = c * deltay;
     if (doit)
     }
     totalcost = c * deltay;
     if (doit)
-       while (--deltay >= 0)
+      do
           emacs_tputs (tty, p, 1, cmputc);
           emacs_tputs (tty, p, 1, cmputc);
+      while (0 < --deltay);
 x:
     if ((deltax = dstx - srcx) == 0)
        goto done;
 x:
     if ((deltax = dstx - srcx) == 0)
        goto done;
@@ -305,8 +297,9 @@ fail:
     }
     totalcost += c * deltax;
     if (doit)
     }
     totalcost += c * deltax;
     if (doit)
-       while (--deltax >= 0)
+      do
           emacs_tputs (tty, p, 1, cmputc);
           emacs_tputs (tty, p, 1, cmputc);
+      while (0 < --deltax);
 done:
     return totalcost;
 }
 done:
     return totalcost;
 }
@@ -331,9 +324,9 @@ cmgoto (struct tty_display_info *tty, int row, int col)
             llcost,
             relcost,
             directcost;
             llcost,
             relcost,
             directcost;
-    int     use;
-    char   *p,
-           *dcm;
+    int     use IF_LINT (= 0);
+    char *p;
+    const char *dcm;
 
   /* First the degenerate case */
     if (row == curY (tty) && col == curX (tty)) /* already there */
 
   /* First the degenerate case */
     if (row == curY (tty) && col == curX (tty)) /* already there */
@@ -461,6 +454,3 @@ Wcm_init (struct tty_display_info *tty)
     return - 2;
   return 0;
 }
     return - 2;
   return 0;
 }
-
-/* arch-tag: bcf64c02-00f6-44ef-94b6-c56eab5b3dc4
-   (do not change this comment) */