]> code.delx.au - gnu-emacs/commitdiff
* cm.c (calccost): Turn while-do into do-while, for clarity.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 23 Mar 2011 08:06:21 +0000 (01:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 23 Mar 2011 08:06:21 +0000 (01:06 -0700)
src/ChangeLog
src/cm.c

index 4994aaa9fa89a2b84d6c3aeec500b00c17851be8..1d3d4d651746d72f1fb8d85437a3ef5923ee1576 100644 (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
index 6379955b48c3cabb4e9688582dea7863890255dd..42f855f1694df74d837fed202de6adeec1b0fbb8 100644 (file)
--- a/src/cm.c
+++ b/src/cm.c
@@ -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 @@ fail:
     }
     totalcost += c * deltax;
     if (doit)
-       while (--deltax >= 0)
+      do
           emacs_tputs (tty, p, 1, cmputc);
+      while (0 < --deltax);
 done:
     return totalcost;
 }