From: Amos Jeffries Date: Tue, 22 Jan 2013 11:33:57 +0000 (+1300) Subject: Bug 3676: Fix Shadowed variables X-Git-Tag: SQUID_3_4_0_1~357 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb898410b2b91301a3bd16ad1e835eb3fc748805;p=thirdparty%2Fsquid.git Bug 3676: Fix Shadowed variables This resolves a number more shadowed variables found by the more strict compilers in the layer-02-maximus optional components. There should be no logic changes in this patch. --- diff --git a/src/adaptation/Iterator.cc b/src/adaptation/Iterator.cc index bbd70f82ee..71a0c404b8 100644 --- a/src/adaptation/Iterator.cc +++ b/src/adaptation/Iterator.cc @@ -215,9 +215,9 @@ bool Adaptation::Iterator::updatePlan(bool adopt) debugs(85,3, HERE << "retiring old plan: " << thePlan); - Adaptation::ServiceFilter filter = this->filter(); + Adaptation::ServiceFilter f = this->filter(); DynamicGroupCfg current, future; - DynamicServiceChain::Split(filter, services, current, future); + DynamicServiceChain::Split(f, services, current, future); if (!future.empty()) { ah->setFutureServices(future); @@ -225,8 +225,8 @@ bool Adaptation::Iterator::updatePlan(bool adopt) } // use the current config even if it is empty; we must replace the old plan - theGroup = new DynamicServiceChain(current, filter); // refcounted - thePlan = ServicePlan(theGroup, filter); + theGroup = new DynamicServiceChain(current, f); // refcounted + thePlan = ServicePlan(theGroup, f); debugs(85,3, HERE << "adopted service-proposed plan: " << thePlan); return true; } diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 414017771c..fb793f910e 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1382,8 +1382,8 @@ ClientRequestContext::sslBumpAccessCheck() debugs(85, 5, HERE << "SslBump possible, checking ACL"); - ACLFilledChecklist *acl_checklist = clientAclChecklistCreate(Config.accessList.ssl_bump, http); - acl_checklist->nonBlockingCheck(sslBumpAccessCheckDoneWrapper, this); + ACLFilledChecklist *aclChecklist = clientAclChecklistCreate(Config.accessList.ssl_bump, http); + aclChecklist->nonBlockingCheck(sslBumpAccessCheckDoneWrapper, this); return true; } diff --git a/src/repl/heap/store_repl_heap.cc b/src/repl/heap/store_repl_heap.cc index 855395cfd1..66dabaf72a 100644 --- a/src/repl/heap/store_repl_heap.cc +++ b/src/repl/heap/store_repl_heap.cc @@ -101,51 +101,51 @@ HeapPolicyData::setPolicyNode (StoreEntry *entry, void *value) const static void heap_add(RemovalPolicy * policy, StoreEntry * entry, RemovalPolicyNode * node) { - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; assert(!node->data); if (EBIT_TEST(entry->flags, ENTRY_SPECIAL)) return; /* We won't manage these.. they messes things up */ - node->data = heap_insert(heap->theHeap, entry); + node->data = heap_insert(h->theHeap, entry); - heap->count += 1; + h->count += 1; - if (!heap->type) - heap->type = heap_guessType(entry, node); + if (!h->type) + h->type = heap_guessType(entry, node); /* Add a little more variance to the aging factor */ - heap->theHeap->age += heap->theHeap->age / 100000000; + h->theHeap->age += h->theHeap->age / 100000000; } static void heap_remove(RemovalPolicy * policy, StoreEntry * entry, RemovalPolicyNode * node) { - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; heap_node *hnode = (heap_node *)node->data; if (!hnode) return; - heap_delete(heap->theHeap, hnode); + heap_delete(h->theHeap, hnode); node->data = NULL; - heap->count -= 1; + h->count -= 1; } static void heap_referenced(RemovalPolicy * policy, const StoreEntry * entry, RemovalPolicyNode * node) { - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; heap_node *hnode = (heap_node *)node->data; if (!hnode) return; - heap_update(heap->theHeap, hnode, (StoreEntry *) entry); + heap_update(h->theHeap, hnode, (StoreEntry *) entry); } /** RemovalPolicyWalker **/ @@ -161,13 +161,13 @@ heap_walkNext(RemovalPolicyWalker * walker) { HeapWalkData *heap_walk = (HeapWalkData *)walker->_data; RemovalPolicy *policy = walker->_policy; - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; StoreEntry *entry; - if (heap_walk->current >= heap_nodes(heap->theHeap)) + if (heap_walk->current >= heap_nodes(h->theHeap)) return NULL; /* done */ - entry = (StoreEntry *) heap_peep(heap->theHeap, heap_walk->current++); + entry = (StoreEntry *) heap_peep(h->theHeap, heap_walk->current++); return entry; } @@ -176,10 +176,10 @@ static void heap_walkDone(RemovalPolicyWalker * walker) { RemovalPolicy *policy = walker->_policy; - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; assert(strcmp(policy->_type, "heap") == 0); - assert(heap->nwalkers > 0); - heap->nwalkers -= 1; + assert(h->nwalkers > 0); + h->nwalkers -= 1; safe_free(walker->_data); delete walker; } @@ -187,10 +187,10 @@ heap_walkDone(RemovalPolicyWalker * walker) static RemovalPolicyWalker * heap_walkInit(RemovalPolicy * policy) { - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; RemovalPolicyWalker *walker; HeapWalkData *heap_walk; - heap->nwalkers += 1; + h->nwalkers += 1; walker = new RemovalPolicyWalker; heap_walk = (HeapWalkData *)xcalloc(1, sizeof(*heap_walk)); heap_walk->current = 0; @@ -215,18 +215,18 @@ heap_purgeNext(RemovalPurgeWalker * walker) { HeapPurgeData *heap_walker = (HeapPurgeData *)walker->_data; RemovalPolicy *policy = walker->_policy; - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; StoreEntry *entry; heap_key age; try_again: - if (!heap_nodes(heap->theHeap) > 0) + if (!heap_nodes(h->theHeap) > 0) return NULL; /* done */ - age = heap_peepminkey(heap->theHeap); + age = heap_peepminkey(h->theHeap); - entry = (StoreEntry *)heap_extractmin(heap->theHeap); + entry = (StoreEntry *)heap_extractmin(h->theHeap); if (entry->locked()) { @@ -237,7 +237,7 @@ try_again: } heap_walker->min_age = age; - heap->setPolicyNode(entry, NULL); + h->setPolicyNode(entry, NULL); return entry; } @@ -246,23 +246,23 @@ heap_purgeDone(RemovalPurgeWalker * walker) { HeapPurgeData *heap_walker = (HeapPurgeData *)walker->_data; RemovalPolicy *policy = walker->_policy; - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; StoreEntry *entry; assert(strcmp(policy->_type, "heap") == 0); - assert(heap->nwalkers > 0); - heap->nwalkers -= 1; + assert(h->nwalkers > 0); + h->nwalkers -= 1; if (heap_walker->min_age > 0) { - heap->theHeap->age = heap_walker->min_age; - debugs(81, 3, "heap_purgeDone: Heap age set to " << heap->theHeap->age ); + h->theHeap->age = heap_walker->min_age; + debugs(81, 3, "Heap age set to " << h->theHeap->age); } /* * Reinsert the locked entries */ while ((entry = (StoreEntry *)linklistShift(&heap_walker->locked_entries))) { - heap_node *node = heap_insert(heap->theHeap, entry); - heap->setPolicyNode(entry, node); + heap_node *node = heap_insert(h->theHeap, entry); + h->setPolicyNode(entry, node); entry->unlock(); } @@ -273,10 +273,10 @@ heap_purgeDone(RemovalPurgeWalker * walker) static RemovalPurgeWalker * heap_purgeInit(RemovalPolicy * policy, int max_scan) { - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; RemovalPurgeWalker *walker; HeapPurgeData *heap_walk; - heap->nwalkers += 1; + h->nwalkers += 1; walker = new RemovalPurgeWalker; heap_walk = (HeapPurgeData *)xcalloc(1, sizeof(*heap_walk)); heap_walk->min_age = 0.0; @@ -292,13 +292,13 @@ heap_purgeInit(RemovalPolicy * policy, int max_scan) static void heap_free(RemovalPolicy * policy) { - HeapPolicyData *heap = (HeapPolicyData *)policy->_data; + HeapPolicyData *h = (HeapPolicyData *)policy->_data; /* Make some verification of the policy state */ assert(strcmp(policy->_type, "heap") == 0); - assert(heap->nwalkers); - assert(heap->count); + assert(h->nwalkers); + assert(h->count); /* Ok, time to destroy this policy */ - safe_free(heap); + safe_free(h); memset(policy, 0, sizeof(*policy)); delete policy; } diff --git a/src/ssl/context_storage.cc b/src/ssl/context_storage.cc index a5944f8507..c174684907 100644 --- a/src/ssl/context_storage.cc +++ b/src/ssl/context_storage.cc @@ -10,14 +10,14 @@ #include #endif -Ssl::CertificateStorageAction::CertificateStorageAction(const Mgr::Command::Pointer &cmd) - : Mgr::Action(cmd) +Ssl::CertificateStorageAction::CertificateStorageAction(const Mgr::Command::Pointer &aCmd) + : Mgr::Action(aCmd) {} Ssl::CertificateStorageAction::Pointer -Ssl::CertificateStorageAction::Create(const Mgr::Command::Pointer &cmd) +Ssl::CertificateStorageAction::Create(const Mgr::Command::Pointer &aCmd) { - return new CertificateStorageAction(cmd); + return new CertificateStorageAction(aCmd); } void Ssl::CertificateStorageAction::dump (StoreEntry *sentry)