]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3676: Fix Shadowed variables
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 22 Jan 2013 11:33:57 +0000 (00:33 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 22 Jan 2013 11:33:57 +0000 (00:33 +1300)
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.

src/adaptation/Iterator.cc
src/client_side_request.cc
src/repl/heap/store_repl_heap.cc
src/ssl/context_storage.cc

index bbd70f82eefad26650e90c3119d6f07391a3f41a..71a0c404b882353cca2dc8640a1ae1d15d90961e 100644 (file)
@@ -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;
 }
index 414017771c97f509c370e500e19516cc177fa66d..fb793f910ec833a69d2d767851679c43977f6741 100644 (file)
@@ -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;
 }
 
index 855395cfd1d1eb1cf624b37337f1e6832d75728f..66dabaf72aff86622502d0173f431182f0e3518b 100644 (file)
@@ -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;
 }
index a5944f85071d549817e5b10202028c470f2e3c0e..c1746849077d444a4209a3313d99e413cdb3a01f 100644 (file)
 #include <openssl/ssl.h>
 #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)