]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Mon, 29 May 2000 04:15:42 +0000 (04:15 +0000)
committerwessels <>
Mon, 29 May 2000 04:15:42 +0000 (04:15 +0000)
 - 'max_objsize' was type size_t, which is not always signed.  Use
   ssize_t instead since -1 is a legal value.

src/cache_cf.cc
src/store_dir.cc
src/structs.h

index 6caa482ceeb0a85f830d8502b1a88e64d93ab2f6..9828773eabe940d32b481a5495635be322530fad 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.345 2000/05/16 07:06:03 wessels Exp $
+ * $Id: cache_cf.cc,v 1.346 2000/05/28 22:15:42 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -197,7 +197,7 @@ static void
 update_maxobjsize(void)
 {
     int i;
-    size_t ms = -1;
+    ssize_t ms = -1;
 
     for (i = 0; i < Config.cacheSwap.n_configured; i++) {
        if (Config.cacheSwap.swapDirs[i].max_objsize > ms)
@@ -892,12 +892,12 @@ parse_cachedir(cacheSwap * swap)
     SwapDir *sd;
     int i;
     int fs;
-    size_t maxobjsize;
+    ssize_t maxobjsize;
 
     if ((type_str = strtok(NULL, w_space)) == NULL)
        self_destruct();
 
-    maxobjsize = (size_t) GetInteger();
+    maxobjsize = (ssize_t) GetInteger();
 
     if ((path_str = strtok(NULL, w_space)) == NULL)
        self_destruct();
index f66343bbc76a680af443f4e78f921d2eef564eeb..976e74f11a6d97449512965da370cee2269ddbba 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.109 2000/05/16 07:06:07 wessels Exp $
+ * $Id: store_dir.cc,v 1.110 2000/05/28 22:15:42 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -35,7 +35,7 @@
 
 #include "squid.h"
 
-static int storeDirValidSwapDirSize(int, size_t);
+static int storeDirValidSwapDirSize(int, ssize_t);
 static void storeDirLRUWalkInitHead(SwapDir * sd);
 static void *storeDirLRUWalkNext(SwapDir * sd);
 
@@ -82,7 +82,7 @@ storeCreateSwapDirectories(void)
  * ie any-sized-object swapdirs. This is a good thing.
  */
 static int
-storeDirValidSwapDirSize(int swapdir, size_t objsize)
+storeDirValidSwapDirSize(int swapdir, ssize_t objsize)
 {
     /*
      * If the swapdir's max_obj_size is -1, then it definitely can
@@ -181,9 +181,9 @@ storeDirSelectSwapDir(void)
 int
 storeDirSelectSwapDir(const StoreEntry * e)
 {
-    size_t objsize;
-    size_t least_size;
-    size_t least_objsize;
+    ssize_t objsize;
+    ssize_t least_size;
+    ssize_t least_objsize;
     int least_load = 1000;
     int load;
     int dirn = -1;
@@ -191,7 +191,7 @@ storeDirSelectSwapDir(const StoreEntry * e)
     SwapDir *SD;
 
     /* Calculate the object size */
-    objsize = objectLen(e);
+    objsize = (ssize_t) objectLen(e);
     if (objsize != -1)
        objsize += e->mem_obj->swap_hdr_sz;
     /* Initial defaults */
index c9188cee1324e836348b4c6d5ee25ccc5c36d302..7b40696844662169e47527d26ec275b921fe6ee2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.334 2000/05/16 07:06:07 wessels Exp $
+ * $Id: structs.h,v 1.335 2000/05/28 22:15:42 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -1346,7 +1346,7 @@ struct _SwapDir {
     char *path;
     int index;                 /* This entry's index into the swapDirs array */
     int suggest;
-    size_t max_objsize;
+    ssize_t max_objsize;
     union {
 #ifdef HEAP_REPLACEMENT
        struct {