]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
More SunPRO cc warnings and errors..
authorhno <>
Wed, 17 Oct 2001 19:43:06 +0000 (19:43 +0000)
committerhno <>
Wed, 17 Oct 2001 19:43:06 +0000 (19:43 +0000)
* Some signed/unsigned char conflicts
* Errored out on a // comment.. this is C not C++.
* cleanup of sfileno usage in "ufs".. not good to have variables named the
  same as a type.. and even worse when the type differs.

src/cache_cf.cc
src/fs/ufs/store_dir_ufs.cc

index 63999f7d209363cf8ccec48851382fdecfdf02b9..e2390538923afaa4f3fe7ea3f99c552a4574b789 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.391 2001/10/10 15:17:39 adrian Exp $
+ * $Id: cache_cf.cc,v 1.392 2001/10/17 13:43:06 hno Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -1919,7 +1919,7 @@ free_string(char **var)
 void
 parse_eol(char *volatile *var)
 {
-    unsigned char *token = strtok(NULL, null_string);
+    unsigned char *token = (unsigned char *) strtok(NULL, null_string);
     safe_free(*var);
     if (token == NULL)
        self_destruct();
@@ -1927,7 +1927,7 @@ parse_eol(char *volatile *var)
        token++;
     if (!*token)
        self_destruct();
-    *var = xstrdup(token);
+    *var = xstrdup((char *) token);
 }
 
 static void
@@ -2018,8 +2018,8 @@ dump_body_size_t(StoreEntry * entry, const char *name, dlink_list bodylist)
 }
 
 static void
-free_body_size_t(dlink_list * bodylist)                //acl_access ** head)
- {
+free_body_size_t(dlink_list * bodylist)
+{
     body_size *bs, *tempnode;
     bs = (body_size *) bodylist->head;
     while (bs) {
index d8b3424aef55ff19d751a94a9dd42da9b32f609c..f8cd0fafdde62bedc33aed3cc0d5891f137ce05c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_ufs.cc,v 1.35 2001/07/11 22:29:51 hno Exp $
+ * $Id: store_dir_ufs.cc,v 1.36 2001/10/17 13:43:06 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -77,7 +77,7 @@ static void storeUfsDirCreateSwapSubDirs(SwapDir *);
 static char *storeUfsDirSwapLogFile(SwapDir *, const char *);
 static EVH storeUfsDirRebuildFromDirectory;
 static EVH storeUfsDirRebuildFromSwapLog;
-static int storeUfsDirGetNextFile(RebuildState *, int *sfileno, int *size);
+static int storeUfsDirGetNextFile(RebuildState *, sfileno *, int *size);
 static StoreEntry *storeUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key,
     int file_number,
     size_t swap_file_sz,
@@ -126,9 +126,8 @@ STSETUP storeFsSetup_ufs;
  */
 
 static int
-storeUfsDirMapBitTest(SwapDir * SD, int fn)
+storeUfsDirMapBitTest(SwapDir * SD, sfileno filn)
 {
-    sfileno filn = fn;
     ufsinfo_t *ufsinfo;
     ufsinfo = (ufsinfo_t *) SD->fsdata;
     return file_map_bit_test(ufsinfo->map, filn);
@@ -378,7 +377,7 @@ storeUfsDirRebuildFromDirectory(void *data)
     StoreEntry *e = NULL;
     StoreEntry tmpe;
     cache_key key[MD5_DIGEST_CHARS];
-    int sfileno = 0;
+    sfileno filn = 0;
     int count;
     int size;
     struct stat sb;
@@ -390,7 +389,7 @@ storeUfsDirRebuildFromDirectory(void *data)
     debug(20, 3) ("storeUfsDirRebuildFromDirectory: DIR #%d\n", rb->sd->index);
     for (count = 0; count < rb->speed; count++) {
        assert(fd == -1);
-       fd = storeUfsDirGetNextFile(rb, &sfileno, &size);
+       fd = storeUfsDirGetNextFile(rb, &filn, &size);
        if (fd == -2) {
            debug(20, 1) ("Done scanning %s swaplog (%d entries)\n",
                rb->sd->path, rb->n_read);
@@ -415,7 +414,7 @@ storeUfsDirRebuildFromDirectory(void *data)
        if ((++rb->counts.scancount & 0xFFFF) == 0)
            debug(20, 3) ("  %s %7d files opened so far.\n",
                rb->sd->path, rb->counts.scancount);
-       debug(20, 9) ("file_in: fd=%d %08X\n", fd, sfileno);
+       debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn);
        statCounter.syscalls.disk.reads++;
        if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
            debug(20, 1) ("storeUfsDirRebuildFromDirectory: read(FD %d): %s\n",
@@ -437,7 +436,7 @@ storeUfsDirRebuildFromDirectory(void *data)
        if (tlv_list == NULL) {
            debug(20, 1) ("storeUfsDirRebuildFromDirectory: failed to get meta data\n");
            /* XXX shouldn't this be a call to storeUfsUnlink ? */
-           storeUfsDirUnlinkFile(SD, sfileno);
+           storeUfsDirUnlinkFile(SD, filn);
            continue;
        }
        debug(20, 3) ("storeUfsDirRebuildFromDirectory: successful swap meta unpacking\n");
@@ -461,7 +460,7 @@ storeUfsDirRebuildFromDirectory(void *data)
        tlv_list = NULL;
        if (storeKeyNull(key)) {
            debug(20, 1) ("storeUfsDirRebuildFromDirectory: NULL key\n");
-           storeUfsDirUnlinkFile(SD, sfileno);
+           storeUfsDirUnlinkFile(SD, filn);
            continue;
        }
        tmpe.hash.key = key;
@@ -473,11 +472,11 @@ storeUfsDirRebuildFromDirectory(void *data)
        } else if (tmpe.swap_file_sz != sb.st_size) {
            debug(20, 1) ("storeUfsDirRebuildFromDirectory: SIZE MISMATCH %d!=%d\n",
                tmpe.swap_file_sz, (int) sb.st_size);
-           storeUfsDirUnlinkFile(SD, sfileno);
+           storeUfsDirUnlinkFile(SD, filn);
            continue;
        }
        if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) {
-           storeUfsDirUnlinkFile(SD, sfileno);
+           storeUfsDirUnlinkFile(SD, filn);
            rb->counts.badflags++;
            continue;
        }
@@ -496,7 +495,7 @@ storeUfsDirRebuildFromDirectory(void *data)
        rb->counts.objcount++;
        storeEntryDump(&tmpe, 5);
        e = storeUfsDirAddDiskRestore(SD, key,
-           sfileno,
+           filn,
            tmpe.swap_file_sz,
            tmpe.expires,
            tmpe.timestamp,
@@ -687,7 +686,7 @@ storeUfsDirRebuildFromSwapLog(void *data)
 }
 
 static int
-storeUfsDirGetNextFile(RebuildState * rb, int *sfileno, int *size)
+storeUfsDirGetNextFile(RebuildState * rb, sfileno *filn_p, int *size)
 {
     SwapDir *SD = rb->sd;
     ufsinfo_t *ufsinfo = (ufsinfo_t *) SD->fsdata;
@@ -769,7 +768,7 @@ storeUfsDirGetNextFile(RebuildState * rb, int *sfileno, int *size)
        rb->curlvl1 = 0;
        rb->done = 1;
     }
-    *sfileno = rb->fn;
+    *filn_p = rb->fn;
     return fd;
 }