diff options
| author | Stefan Monnier | 2011-03-31 00:24:03 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-03-31 00:24:03 -0400 |
| commit | 40d83b412f584cc02e68d4eac8fd5e6eb769e2fe (patch) | |
| tree | b56f27a7e6d75a8c1fd27b00179a27b5efea0a32 /src/cm.c | |
| parent | f488fb6528738131ef41859e1f04125f2e50efce (diff) | |
| parent | 44f230aa043ebb222aa0876b44d70484d5dd38db (diff) | |
| download | emacs-40d83b412f584cc02e68d4eac8fd5e6eb769e2fe.tar.gz emacs-40d83b412f584cc02e68d4eac8fd5e6eb769e2fe.zip | |
Merge from trunk
Diffstat (limited to 'src/cm.c')
| -rw-r--r-- | src/cm.c | 16 |
1 files changed, 5 insertions, 11 deletions
| @@ -27,19 +27,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 27 | #include "cm.h" | 27 | #include "cm.h" |
| 28 | #include "termhooks.h" | 28 | #include "termhooks.h" |
| 29 | #include "termchar.h" | 29 | #include "termchar.h" |
| 30 | 30 | #include "tparam.h" | |
| 31 | |||
| 32 | /* For now, don't try to include termcap.h. On some systems, | ||
| 33 | configure finds a non-standard termcap.h that the main build | ||
| 34 | won't find. */ | ||
| 35 | extern void tputs (const char *, int, int (*)(int)); | ||
| 36 | extern char *tgoto (const char *, int, int); | ||
| 37 | 31 | ||
| 38 | #define BIG 9999 /* 9999 good on VAXen. For 16 bit machines | 32 | #define BIG 9999 /* 9999 good on VAXen. For 16 bit machines |
| 39 | use about 2000.... */ | 33 | use about 2000.... */ |
| 40 | 34 | ||
| 41 | extern char *BC, *UP; | ||
| 42 | |||
| 43 | int cost; /* sums up costs */ | 35 | int cost; /* sums up costs */ |
| 44 | 36 | ||
| 45 | /* ARGSUSED */ | 37 | /* ARGSUSED */ |
| @@ -222,8 +214,9 @@ calccost (struct tty_display_info *tty, | |||
| 222 | } | 214 | } |
| 223 | totalcost = c * deltay; | 215 | totalcost = c * deltay; |
| 224 | if (doit) | 216 | if (doit) |
| 225 | while (--deltay >= 0) | 217 | do |
| 226 | emacs_tputs (tty, p, 1, cmputc); | 218 | emacs_tputs (tty, p, 1, cmputc); |
| 219 | while (0 < --deltay); | ||
| 227 | x: | 220 | x: |
| 228 | if ((deltax = dstx - srcx) == 0) | 221 | if ((deltax = dstx - srcx) == 0) |
| 229 | goto done; | 222 | goto done; |
| @@ -304,8 +297,9 @@ fail: | |||
| 304 | } | 297 | } |
| 305 | totalcost += c * deltax; | 298 | totalcost += c * deltax; |
| 306 | if (doit) | 299 | if (doit) |
| 307 | while (--deltax >= 0) | 300 | do |
| 308 | emacs_tputs (tty, p, 1, cmputc); | 301 | emacs_tputs (tty, p, 1, cmputc); |
| 302 | while (0 < --deltax); | ||
| 309 | done: | 303 | done: |
| 310 | return totalcost; | 304 | return totalcost; |
| 311 | } | 305 | } |