From: Amos Jeffries Date: Mon, 21 Jan 2013 08:15:06 +0000 (+1300) Subject: Bug 3676: Fix Shadowed variables X-Git-Tag: SQUID_3_4_0_1~363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3254023f3b0b920c4ede6e5f1657cf800bdec52f;p=thirdparty%2Fsquid.git Bug 3676: Fix Shadowed variables This resolves some more shadowed variables by renaming. Allowing Squid to build clean with -Wshadow. There should be no logic changes in this patch. --- diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index a601b06e6c..c9cec3747f 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -294,8 +294,7 @@ struct InitStoreEntry : public unary_function { }; bool -storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, - StoreRebuildData &counts) +storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &) { if (fd < 0) return false; @@ -317,7 +316,7 @@ storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, bool storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key, - StoreRebuildData &counts, + StoreRebuildData &stats, uint64_t expectedSize) { int swap_hdr_len = 0; @@ -374,7 +373,7 @@ storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key, } if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) { - ++ counts.badflags; + ++ stats.badflags; return false; } @@ -382,8 +381,7 @@ storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key, } bool -storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, - StoreRebuildData &counts) +storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, StoreRebuildData &stats) { /* this needs to become * 1) unpack url @@ -408,7 +406,7 @@ storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, if (e->lastref >= tmpe.lastref) { /* key already exists, old entry is newer */ /* keep old, ignore new */ - ++counts.dupcount; + ++stats.dupcount; // For some stores, get() creates/unpacks a store entry. Signal // such stores that we will no longer use the get() result: @@ -420,7 +418,7 @@ storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, /* URL already exists, this swapfile not being used */ /* junk old, load new */ e->release(); /* release old entry */ - ++counts.dupcount; + ++stats.dupcount; } }