1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

* cm.c (calccost): Turn while-do into do-while, for clarity.

This commit is contained in:
Paul Eggert 2011-03-23 01:06:21 -07:00
parent 6ad6792b39
commit 12ea59a297
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,7 @@
2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
* cm.c (calccost): Turn while-do into do-while, for clarity.
Fix more problems found by GCC 4.5.2's static checks.
* coding.c (encode_coding_raw_text): Avoid unnecessary test

View File

@ -214,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;
@ -296,8 +297,9 @@ calccost (struct tty_display_info *tty,
}
totalcost += c * deltax;
if (doit)
while (--deltax >= 0)
do
emacs_tputs (tty, p, 1, cmputc);
while (0 < --deltax);
done:
return totalcost;
}