diff options
| author | Paul Eggert | 2011-03-23 01:06:21 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-03-23 01:06:21 -0700 |
| commit | 12ea59a297551086de418573f6ee201fc3ef2768 (patch) | |
| tree | 61f9745913698efb9cc12b956e27f09e2f69b261 /src | |
| parent | 6ad6792b390fd7d45773a5c14e29d44a54c17f1e (diff) | |
| download | emacs-12ea59a297551086de418573f6ee201fc3ef2768.tar.gz emacs-12ea59a297551086de418573f6ee201fc3ef2768.zip | |
* cm.c (calccost): Turn while-do into do-while, for clarity.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/cm.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4994aaa9fa8..1d3d4d65174 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2011-03-23 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-03-23 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * cm.c (calccost): Turn while-do into do-while, for clarity. | ||
| 4 | |||
| 3 | Fix more problems found by GCC 4.5.2's static checks. | 5 | Fix more problems found by GCC 4.5.2's static checks. |
| 4 | 6 | ||
| 5 | * coding.c (encode_coding_raw_text): Avoid unnecessary test | 7 | * coding.c (encode_coding_raw_text): Avoid unnecessary test |
| @@ -214,8 +214,9 @@ calccost (struct tty_display_info *tty, | |||
| 214 | } | 214 | } |
| 215 | totalcost = c * deltay; | 215 | totalcost = c * deltay; |
| 216 | if (doit) | 216 | if (doit) |
| 217 | while (--deltay >= 0) | 217 | do |
| 218 | emacs_tputs (tty, p, 1, cmputc); | 218 | emacs_tputs (tty, p, 1, cmputc); |
| 219 | while (0 < --deltay); | ||
| 219 | x: | 220 | x: |
| 220 | if ((deltax = dstx - srcx) == 0) | 221 | if ((deltax = dstx - srcx) == 0) |
| 221 | goto done; | 222 | goto done; |
| @@ -296,8 +297,9 @@ fail: | |||
| 296 | } | 297 | } |
| 297 | totalcost += c * deltax; | 298 | totalcost += c * deltax; |
| 298 | if (doit) | 299 | if (doit) |
| 299 | while (--deltax >= 0) | 300 | do |
| 300 | emacs_tputs (tty, p, 1, cmputc); | 301 | emacs_tputs (tty, p, 1, cmputc); |
| 302 | while (0 < --deltax); | ||
| 301 | done: | 303 | done: |
| 302 | return totalcost; | 304 | return totalcost; |
| 303 | } | 305 | } |