]> code.delx.au - gnu-emacs/blobdiff - src/cm.c
* lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
[gnu-emacs] / src / cm.c
index 108ee5720f31b908356edfbc14f4614d8afd8316..42f855f1694df74d837fed202de6adeec1b0fbb8 100644 (file)
--- a/src/cm.c
+++ b/src/cm.c
@@ -27,19 +27,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #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.... */
 
-extern char *BC, *UP;
-
 int cost;              /* sums up costs */
 
 /* ARGSUSED */
@@ -222,8 +214,9 @@ calccost (struct tty_display_info *tty,
     }
     totalcost = c * deltay;
     if (doit)
-       while (--deltay >= 0)
+      do
           emacs_tputs (tty, p, 1, cmputc);
+      while (0 < --deltay);
 x:
     if ((deltax = dstx - srcx) == 0)
        goto done;
@@ -304,8 +297,9 @@ fail:
     }
     totalcost += c * deltax;
     if (doit)
-       while (--deltax >= 0)
+      do
           emacs_tputs (tty, p, 1, cmputc);
+      while (0 < --deltax);
 done:
     return totalcost;
 }