]> code.delx.au - gnu-emacs/blobdiff - src/cm.c
image.c, indent.c: Use bool for booleans.
[gnu-emacs] / src / cm.c
index 108ee5720f31b908356edfbc14f4614d8afd8316..eda6430bafa349b7bed2b4b03d0fbc26e3ca6bbe 100644 (file)
--- a/src/cm.c
+++ b/src/cm.c
@@ -1,5 +1,5 @@
 /* Cursor motion subroutines for GNU Emacs.
 /* Cursor motion subroutines for GNU Emacs.
-   Copyright (C) 1985, 1995, 2001-2011  Free Software Foundation, Inc.
+   Copyright (C) 1985, 1995, 2001-2012  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.
@@ -20,26 +20,17 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include <stdio.h>
 
 #include <config.h>
 #include <stdio.h>
-#include <setjmp.h>
 
 #include "lisp.h"
 #include "frame.h"
 #include "cm.h"
 #include "termhooks.h"
 #include "termchar.h"
 
 #include "lisp.h"
 #include "frame.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 */
@@ -127,7 +118,7 @@ cmcheckmagic (struct tty_display_info *tty)
   if (curX (tty) == FrameCols (tty))
     {
       if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1)
   if (curX (tty) == FrameCols (tty))
     {
       if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1)
-       abort ();
+       emacs_abort ();
       if (tty->termscript)
        putc ('\r', tty->termscript);
       putc ('\r', tty->output);
       if (tty->termscript)
        putc ('\r', tty->termscript);
       putc ('\r', tty->output);
@@ -222,8 +213,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;
@@ -304,14 +296,16 @@ 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;
 }
 
 #if 0
 done:
     return totalcost;
 }
 
 #if 0
-losecursor ()
+void
+losecursor (void)
 {
   curY = -1;
 }
 {
   curY = -1;
 }