aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-03-23 01:06:21 -0700
committerPaul Eggert2011-03-23 01:06:21 -0700
commit12ea59a297551086de418573f6ee201fc3ef2768 (patch)
tree61f9745913698efb9cc12b956e27f09e2f69b261 /src
parent6ad6792b390fd7d45773a5c14e29d44a54c17f1e (diff)
downloademacs-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/ChangeLog2
-rw-r--r--src/cm.c6
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 @@
12011-03-23 Paul Eggert <eggert@cs.ucla.edu> 12011-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
diff --git a/src/cm.c b/src/cm.c
index 6379955b48c..42f855f1694 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -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);
219x: 220x:
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);
301done: 303done:
302 return totalcost; 304 return totalcost;
303} 305}