httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject bogus change to proxy_cache.c
Date Sat, 06 Sep 1997 04:28:03 GMT
The below (at the end of this message) patch that Ben applied is bogus. 
curbytes needs to be signed: 

            if (curbytes < 0)
            {
                curbytes += 1024;
                curblocks--;
            }

This probably breaks things in reality.  You can't just make things
unsigned.

Not sure about the other changes.

I'm not sure what to think about a compiler that gives such verbose
warnings that having them signed causes it to whine (I'm assuming it is
because the code does something like assign an unsigned value to the
signed value) yet testing to see if an unsigned value is <0 doesn't set
off alarms.


--- proxy_cache.c       1997/08/23 22:59:11     1.24
+++ proxy_cache.c       1997/09/05 19:38:34     1.25
@@ -87,8 +87,9 @@
     else return 0;
 }
 
-static int curbytes, cachesize, every;
-static unsigned long int curblocks;
+static int every;
+static unsigned curbytes, cachesize;
+static unsigned long curblocks;
 static time_t now, expire;
 static char *filename;
 static mutex *garbage_mutex = NULL;
@@ -873,7 +874,7 @@
 proxy_cache_tidy(struct cache_req *c)
 {
     server_rec *s=c->req->server;
-    long int bc;
+    unsigned long bc;
 
     if (c->fp == NULL) return;



Mime
View raw message