From: Francesco Chemolli Date: Wed, 25 Nov 2009 17:10:52 +0000 (+0100) Subject: Fixed some variable shadowing. X-Git-Tag: SQUID_3_2_0_1~531 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ddfeb800277dfc010ca61177551795897f9f219;p=thirdparty%2Fsquid.git Fixed some variable shadowing. --- diff --git a/src/cbdata.cc b/src/cbdata.cc index 5675a787f9..ab5ee3a6e8 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -111,11 +111,11 @@ public: cbdata_type type; #if CBDATA_DEBUG - void addHistory(char const *label, char const *file, int line) { + void addHistory(char const *label, char const *aFile, int aLine) { if (calls.size() > 1000) return; - calls.push_back(new CBDataCall(label, file, line)); + calls.push_back(new CBDataCall(label, aFile, aLine)); } dlink_node link; @@ -126,7 +126,7 @@ public: /* cookie used while debugging */ long cookie; - void check(int line) const {assert(cookie == ((long)this ^ Cookie));} + void check(int aLine) const {assert(cookie == ((long)this ^ Cookie));} static const long Cookie; #if !HASHED_CBDATA diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 3ae6af5b93..8d37cb327d 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -357,13 +357,14 @@ clientReplyContext::handleIMSReply(StoreIOBuffer result) HttpReply *old_rep = (HttpReply *) old_entry->getReply(); // origin replied 304 - + // TODO FIXME: old_rep2 was forcibly unshadowed, used to be old_rep. Are we sure + // that the right semantics were preserved? if (status == HTTP_NOT_MODIFIED) { http->logType = LOG_TCP_REFRESH_UNMODIFIED; // update headers on existing entry - HttpReply *old_rep = (HttpReply *) old_entry->getReply(); - old_rep->updateOnNotModified(http->storeEntry()->getReply()); + HttpReply *old_rep2 = (HttpReply *) old_entry->getReply(); + old_rep2->updateOnNotModified(http->storeEntry()->getReply()); old_entry->timestampsSet(); // if client sent IMS @@ -375,7 +376,7 @@ clientReplyContext::handleIMSReply(StoreIOBuffer result) } else { // send existing entry, it's still valid debugs(88, 3, "handleIMSReply: origin replied 304, revalidating existing entry and sending " << - old_rep->sline.status << " to client"); + old_rep2->sline.status << " to client"); sendClientOldEntry(); } } diff --git a/src/forward.cc b/src/forward.cc index bc3a4e58c8..009bc193ab 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -993,9 +993,9 @@ FwdState::dispatch() * prepared in the kernel by the ZPH incoming TCP TOS preserving * patch. */ - unsigned char * p = buf; - while (p-buf < len) { - struct cmsghdr *o = (struct cmsghdr*)p; + unsigned char * pbuf = buf; + while (pbuf-buf < len) { + struct cmsghdr *o = (struct cmsghdr*)pbuf; if (o->cmsg_len<=0) break; @@ -1003,7 +1003,7 @@ FwdState::dispatch() clientFde->upstreamTOS = (unsigned char)(*(int*)CMSG_DATA(o)); break; } - p += CMSG_LEN(o->cmsg_len); + pbuf += CMSG_LEN(o->cmsg_len); } } else { debugs(33, 1, "ZPH: error in getsockopt(IP_PKTOPTIONS) on FD "<