lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev minor `defloatization' (patch)


From: Leonid Pauzner
Subject: lynx-dev minor `defloatization' (patch)
Date: Tue, 25 May 1999 15:42:53 +0400 (MSD)

* remove unneeded float from integer calculations.


diff -u old/htalert.c ./htalert.c
--- old/htalert.c       Thu May 20 10:45:52 1999
+++ ./htalert.c Mon May 24 00:38:20 1999
@@ -521,10 +521,10 @@
        **  the whole cookie.  Reduce them both by a percentage.
        **  This should be smarter.
        */
-       float percentage;
-       percentage = (float)space_free/(float)(namelen + valuelen);
-       namelen = (int)(percentage*(float)namelen);
-       valuelen = (int)(percentage*(float)valuelen);
+       int percentage;  /* no float */
+       percentage = 100*space_free/(namelen + valuelen);
+       namelen = percentage*namelen/100;
+       valuelen = percentage*valuelen/100;
     }
     if(!LYAcceptAllCookies) {
        char *message = 0;
diff -u old/lyoption.c ./lyoption.c
--- old/lyoption.c      Tue May 18 09:46:26 1999
+++ ./lyoption.c        Mon May 24 00:40:08 1999
@@ -1927,7 +1927,7 @@

     if (LYlines < (MBM_V_MAXFILES + MULTI_OFFSET)) {
        for (a = ((MBM_V_MAXFILES/2 + 1) * (MBM_current - 1));
-                     a <= ((float)MBM_V_MAXFILES/2 * MBM_current); a++) {
+                     a <= (MBM_current * MBM_V_MAXFILES/2 ); a++) {
            move((3 + a) - ((MBM_V_MAXFILES/2 + 1)*(MBM_current - 1)), 5);
            addch((unsigned char)(a + 'A'));
            addstr(" : ");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]