]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Explicit casting crack which seems to actually work.
authoradrian <>
Wed, 3 Mar 2004 16:34:58 +0000 (16:34 +0000)
committeradrian <>
Wed, 3 Mar 2004 16:34:58 +0000 (16:34 +0000)
Without this, it keeps using -1 as a maxsize during the calculation.

src/fs/coss/store_dir_coss.cc

index b4084669241f8e301a64b98f7075ee0ffcac7de2..9d1f590ffa04006f4b5d31b2b1370bd9e2e7c419 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.cc,v 1.51 2003/09/01 03:49:42 robertc Exp $
+ * $Id: store_dir_coss.cc,v 1.52 2004/03/03 09:34:58 adrian Exp $
  *
  * DEBUG: section 47    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -827,7 +827,7 @@ CossSwapDir::parse(int anIndex, char *aPath)
 {
     unsigned int i;
     unsigned int size;
-    off_t max_offset;
+    unsigned long max_offset;
 
     i = GetInteger();
     size = i << 10;            /* Mbytes to Kbytes */
@@ -856,9 +856,9 @@ CossSwapDir::parse(int anIndex, char *aPath)
      * largest possible sfileno, assuming sfileno is a 25-bit
      * signed integer, as defined in structs.h.
      */
-    max_offset = (off_t) 0xFFFFFF << blksz_bits;
+    max_offset = (unsigned long) 0xFFFFFF << blksz_bits;
 
-    if (max_size > (max_offset>>10)) {
+    if ((unsigned long)max_size > (unsigned long)(max_offset>>10)) {
         debug(47,0)("COSS block-size = %d bytes\n", 1<<blksz_bits);
         debugs(47,0, "COSS largest file offset = " << (max_offset >> 10) << " KB");
         debug(47,0)("COSS cache_dir size = %d KB\n", max_size);