]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3676: Fix Shadowed variables
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 21 Jan 2013 07:15:09 +0000 (20:15 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 21 Jan 2013 07:15:09 +0000 (20:15 +1300)
This resolves a number more shadowed variables by renaming.
There should be no logic changes in this patch.

28 files changed:
include/snmp_api_util.h
include/snmp_pdu.h
src/StatHist.cc
src/auth/basic/UserRequest.cc
src/auth/digest/auth_digest.cc
src/client_side_request.cc
src/dns_internal.cc
src/fs/rock/RockSwapDir.cc
src/ipc/Coordinator.cc
src/ipc/Kid.cc
src/ipc/TypedMsgHdr.cc
src/mgr/BasicActions.cc
src/mgr/CountersAction.cc
src/mgr/InfoAction.cc
src/mgr/IntervalAction.cc
src/mgr/IoAction.cc
src/mgr/ServiceTimesAction.cc
src/mgr/StoreIoAction.cc
src/snmp_core.cc
src/tests/stub_HttpRequest.cc
src/tests/stub_comm.cc
src/tests/stub_libcomm.cc
src/tests/stub_store.cc
src/tests/testEventLoop.cc
src/tests/testStatHist.cc
test-suite/splay.cc
tools/purge/purge.cc
tools/purge/socket.cc

index 536578a03d0ae37a93ebb8666dad646e8f126f59..5e7811229b5583e0c9ec122cd8b394482c897e75 100644 (file)
@@ -57,7 +57,7 @@ struct session_list {
 
 struct snmp_internal_session {
     int sd;                    /* socket descriptor for this connection */
-    ipaddr addr;               /* address of connected peer */
+    struct sockaddr_in addr;           /* address of connected peer */
     struct request_list *requests;     /* Info about outstanding requests */
 };
 
index be1680a2dbe4bd4edbb300385c42542e0c32af49..732aa88b6661d927598fa8c3090c43fcbfce8c04 100644 (file)
 extern "C" {
 #endif
 
-    typedef struct sockaddr_in ipaddr;
-
     /* An SNMP PDU */
     struct snmp_pdu {
         int command;           /* Type of this PDU */
-        ipaddr address;                /* Address of peer */
+        struct sockaddr_in address;            /* Address of peer */
 
         int reqid;                     /* Integer32: Request id */
         int errstat;           /* INTEGER:   Error status */
@@ -59,7 +57,7 @@ extern "C" {
         /* Trap information */
         oid *enterprise;               /* System OID */
         int enterprise_length;
-        ipaddr agent_addr;             /* address of object generating trap */
+        struct sockaddr_in agent_addr;         /* address of object generating trap */
         int trap_type;         /* generic trap type */
         int specific_type;             /* specific type */
         u_int time;                    /* Uptime */
index dfdd1325729c36467e953d7a2924527bfb229d2a..6523d393d06a958946630396efc6f167d53b7006 100644 (file)
@@ -73,11 +73,11 @@ StatHist::StatHist(const StatHist &src) :
 }
 
 void
-StatHist::count(double val)
+StatHist::count(double v)
 {
     if (bins==NULL) //do not count before initialization or after destruction
         return;
-    const unsigned int bin = findBin(val);
+    const unsigned int bin = findBin(v);
     ++bins[bin];
 }
 
index a3d9651579b4e0d0912f2b7c01fbb225bed3871d..669c8beb7cef5550fb4e33ff1f5b6bc9ff9b9aae 100644 (file)
@@ -112,18 +112,18 @@ Auth::Basic::UserRequest::module_start(AUTHCB * handler, void *data)
     /* mark this user as having verification in progress */
     user()->credentials(Auth::Pending);
     char buf[HELPER_INPUT_BUFFER];
-    static char username[HELPER_INPUT_BUFFER];
+    static char usern[HELPER_INPUT_BUFFER];
     static char pass[HELPER_INPUT_BUFFER];
     if (static_cast<Auth::Basic::Config*>(user()->config)->utf8) {
-        latin1_to_utf8(username, sizeof(username), user()->username());
+        latin1_to_utf8(usern, sizeof(usern), user()->username());
         latin1_to_utf8(pass, sizeof(pass), basic_auth->passwd);
-        xstrncpy(username, rfc1738_escape(username), sizeof(username));
+        xstrncpy(usern, rfc1738_escape(usern), sizeof(usern));
         xstrncpy(pass, rfc1738_escape(pass), sizeof(pass));
     } else {
-        xstrncpy(username, rfc1738_escape(user()->username()), sizeof(username));
+        xstrncpy(usern, rfc1738_escape(user()->username()), sizeof(usern));
         xstrncpy(pass, rfc1738_escape(basic_auth->passwd), sizeof(pass));
     }
-    int sz = snprintf(buf, sizeof(buf), "%s %s\n", username, pass);
+    int sz = snprintf(buf, sizeof(buf), "%s %s\n", usern, pass);
     if (sz<=0) {
         debugs(9, DBG_CRITICAL, "ERROR: Basic Authentication Failure. Can not build helper validation request.");
         handler(data);
index 54dbdc46139e54d5287c8ccdc84790e3e3a63334..b70f744659a0cf321a58a96d559a0d20b728ea80 100644 (file)
@@ -851,9 +851,9 @@ Auth::Digest::Config::decode(char const *proxy_auth)
         }
 
         /* find type */
-        http_digest_attr_type type = (http_digest_attr_type)httpHeaderIdByName(item, nlen, DigestFieldsInfo, DIGEST_ENUM_END);
+        http_digest_attr_type t = (http_digest_attr_type)httpHeaderIdByName(item, nlen, DigestFieldsInfo, DIGEST_ENUM_END);
 
-        switch (type) {
+        switch (t) {
         case DIGEST_USERNAME:
             safe_free(username);
             username = xstrndup(value.rawBuf(), value.size() + 1);
index 2d3d9e5b293afe04d49376681dad6f294379ca5c..414017771c97f509c370e500e19516cc177fa66d 100644 (file)
@@ -1695,8 +1695,8 @@ ClientHttpRequest::doCallouts()
 #endif
 
     if (calloutContext->error) {
-        const char *uri = urlCanonical(request);
-        StoreEntry *e= storeCreateEntry(uri, uri, request->flags, request->method);
+        const char *url = urlCanonical(request);
+        StoreEntry *e= storeCreateEntry(url, url, request->flags, request->method);
 #if USE_SSL
         if (sslBumpNeeded()) {
             // set final error but delay sending until we bump
index 63a8b32104909b9c50c6418a3e4c73dd7adc75eb..fdf5846aed0ef1263f42d90fe0df1f984ed0f239 100644 (file)
@@ -836,13 +836,13 @@ idnsVCClosed(const CommCloseCbParams &params)
 }
 
 static void
-idnsInitVC(int ns)
+idnsInitVC(int nsv)
 {
     nsvc *vc = cbdataAlloc(nsvc);
-    assert(ns < nns);
+    assert(nsv < nns);
     assert(vc->conn == NULL); // MUST be NULL from the construction process!
-    nameservers[ns].vc = vc;
-    vc->ns = ns;
+    nameservers[nsv].vc = vc;
+    vc->ns = nsv;
     vc->queue = new MemBuf;
     vc->msg = new MemBuf;
     vc->busy = 1;
@@ -854,7 +854,7 @@ idnsInitVC(int ns)
     else
         conn->local = Config.Addrs.udp_incoming;
 
-    conn->remote = nameservers[ns].S;
+    conn->remote = nameservers[nsv].S;
 
     if (conn->remote.IsIPv4()) {
         conn->local.SetIPv4();
@@ -868,17 +868,17 @@ idnsInitVC(int ns)
 }
 
 static void
-idnsSendQueryVC(idns_query * q, int ns)
+idnsSendQueryVC(idns_query * q, int nsn)
 {
-    assert(ns < nns);
-    if (nameservers[ns].vc == NULL)
-        idnsInitVC(ns);
+    assert(nsn < nns);
+    if (nameservers[nsn].vc == NULL)
+        idnsInitVC(nsn);
 
-    nsvc *vc = nameservers[ns].vc;
+    nsvc *vc = nameservers[nsn].vc;
 
     if (!vc) {
         char buf[MAX_IPSTRLEN];
-        debugs(78, DBG_IMPORTANT, "idnsSendQuery: Failed to initiate TCP connection to nameserver " << nameservers[ns].S.NtoA(buf,MAX_IPSTRLEN) << "!");
+        debugs(78, DBG_IMPORTANT, "idnsSendQuery: Failed to initiate TCP connection to nameserver " << nameservers[nsn].S.NtoA(buf,MAX_IPSTRLEN) << "!");
 
         return;
     }
@@ -912,28 +912,28 @@ idnsSendQuery(idns_query * q)
     assert(q->lru.prev == NULL);
 
     int x = -1, y = -1;
-    int ns;
+    int nsn;
 
     do {
-        ns = q->nsends % nns;
+        nsn = q->nsends % nns;
 
         if (q->need_vc) {
-            idnsSendQueryVC(q, ns);
+            idnsSendQueryVC(q, nsn);
             x = y = 0;
         } else {
-            if (DnsSocketB >= 0 && nameservers[ns].S.IsIPv6())
-                y = comm_udp_sendto(DnsSocketB, nameservers[ns].S, q->buf, q->sz);
+            if (DnsSocketB >= 0 && nameservers[nsn].S.IsIPv6())
+                y = comm_udp_sendto(DnsSocketB, nameservers[nsn].S, q->buf, q->sz);
             else if (DnsSocketA >= 0)
-                x = comm_udp_sendto(DnsSocketA, nameservers[ns].S, q->buf, q->sz);
+                x = comm_udp_sendto(DnsSocketA, nameservers[nsn].S, q->buf, q->sz);
         }
 
         ++ q->nsends;
 
         q->sent_t = current_time;
 
-        if (y < 0 && nameservers[ns].S.IsIPv6())
+        if (y < 0 && nameservers[nsn].S.IsIPv6())
             debugs(50, DBG_IMPORTANT, "idnsSendQuery: FD " << DnsSocketB << ": sendto: " << xstrerror());
-        if (x < 0 && nameservers[ns].S.IsIPv4())
+        if (x < 0 && nameservers[nsn].S.IsIPv4())
             debugs(50, DBG_IMPORTANT, "idnsSendQuery: FD " << DnsSocketA << ": sendto: " << xstrerror());
 
     } while ( (x<0 && y<0) && q->nsends % nns != 0);
@@ -945,7 +945,7 @@ idnsSendQuery(idns_query * q)
         fd_bytes(DnsSocketA, x, FD_WRITE);
     }
 
-    ++ nameservers[ns].nqueries;
+    ++ nameservers[nsn].nqueries;
     q->queue_t = current_time;
     dlinkAdd(q, &q->lru, &lru_list);
     q->pending = 1;
@@ -1016,9 +1016,8 @@ idnsCallback(idns_query *q, const char *error)
     if (q->master)
         q = q->master;
 
-    idns_query *q2;
     // If any of our subqueries are still pending then wait for them to complete before continuing
-    for ( q2 = q; q2; q2 = q2->slave) {
+    for (idns_query *q2 = q; q2; q2 = q2->slave) {
         if (q2->pending) {
             return;
         }
@@ -1030,7 +1029,7 @@ idnsCallback(idns_query *q, const char *error)
     int n = q->ancount;
     error = q->error;
 
-    while ( (q2 = q->slave) ) {
+    while ( idns_query *q2 = q->slave ) {
         debugs(78, 6, HERE << "Merging DNS results " << q->name << " A has " << n << " RR, AAAA has " << q2->ancount << " RR");
         q->slave = q2->slave;
         if ( !q2->error ) {
@@ -1252,7 +1251,6 @@ idnsRead(int fd, void *data)
     int len;
     int max = INCOMING_DNS_MAX;
     static char rbuf[SQUID_UDP_SO_RCVBUF];
-    int ns;
     Ip::Address from;
 
     debugs(78, 3, "idnsRead: starting with FD " << fd);
@@ -1304,10 +1302,10 @@ idnsRead(int fd, void *data)
         debugs(78, 3, "idnsRead: FD " << fd << ": received " << len << " bytes from " << from);
 
         /* BUG: see above. Its here that it becomes apparent that the content of bugbypass is gone. */
-        ns = idnsFromKnownNameserver(from);
+        int nsn = idnsFromKnownNameserver(from);
 
-        if (ns >= 0) {
-            ++ nameservers[ns].nreplies;
+        if (nsn >= 0) {
+            ++ nameservers[nsn].nreplies;
         }
 
         // Before unknown_nameservers check to avoid flooding cache.log on attacks,
@@ -1315,7 +1313,7 @@ idnsRead(int fd, void *data)
         if (!lru_list.head)
             continue; // Don't process replies if there is no pending query.
 
-        if (ns < 0 && Config.onoff.ignore_unknown_nameservers) {
+        if (nsn < 0 && Config.onoff.ignore_unknown_nameservers) {
             static time_t last_warning = 0;
 
             if (squid_curtime - last_warning > 60) {
@@ -1327,7 +1325,7 @@ idnsRead(int fd, void *data)
             continue;
         }
 
-        idnsGrokReply(rbuf, len, ns);
+        idnsGrokReply(rbuf, len, nsn);
     }
 }
 
index aa4dd966df532684f718a4a56268a9b6d4c41ea1..7a99f5a313f2c63cfc5216c87e64fc1910257602 100644 (file)
@@ -285,14 +285,14 @@ Rock::SwapDir::reconfigure()
 
 /// parse maximum db disk size
 void
-Rock::SwapDir::parseSize(const bool reconfiguring)
+Rock::SwapDir::parseSize(const bool reconfig)
 {
     const int i = GetInteger();
     if (i < 0)
         fatal("negative Rock cache_dir size value");
     const uint64_t new_max_size =
         static_cast<uint64_t>(i) << 20; // MBytes to Bytes
-    if (!reconfiguring)
+    if (!reconfig)
         max_size = new_max_size;
     else if (new_max_size != max_size) {
         debugs(3, DBG_IMPORTANT, "WARNING: cache_dir '" << path << "' size "
@@ -320,7 +320,7 @@ Rock::SwapDir::allowOptionReconfigure(const char *const option) const
 
 /// parses time-specific options; mimics ::SwapDir::optionObjectSizeParse()
 bool
-Rock::SwapDir::parseTimeOption(char const *option, const char *value, int reconfiguring)
+Rock::SwapDir::parseTimeOption(char const *option, const char *value, int reconfig)
 {
     // TODO: ::SwapDir or, better, Config should provide time-parsing routines,
     // including time unit handling. Same for size.
@@ -343,7 +343,7 @@ Rock::SwapDir::parseTimeOption(char const *option, const char *value, int reconf
 
     const time_msec_t newTime = static_cast<time_msec_t>(parsedValue);
 
-    if (!reconfiguring)
+    if (!reconfig)
         *storedTime = newTime;
     else if (*storedTime != newTime) {
         debugs(3, DBG_IMPORTANT, "WARNING: cache_dir " << path << ' ' << option
@@ -642,12 +642,12 @@ Rock::SwapDir::readCompleted(const char *buf, int rlen, int errflag, RefCount< :
         sio->offset_ += rlen;
     assert(sio->diskOffset + sio->offset_ <= diskOffsetLimit()); // post-factum
 
-    StoreIOState::STRCB *callback = sio->read.callback;
-    assert(callback);
+    StoreIOState::STRCB *callb = sio->read.callback;
+    assert(callb);
     sio->read.callback = NULL;
     void *cbdata;
     if (cbdataReferenceValidDone(sio->read.callback_data, &cbdata))
-        callback(cbdata, r->buf, rlen, sio.getRaw());
+        callb(cbdata, r->buf, rlen, sio.getRaw());
 }
 
 void
index 38e6ef4141414707ab3f6e2660641aac94ed8c70..7cf2619723fb0cb0023e0e8b5b962ac1c846ecb9 100644 (file)
@@ -255,23 +255,23 @@ Ipc::Coordinator::openListenSocket(const SharedListenRequest& request,
     debugs(54, 6, HERE << "opening listen FD at " << p.addr << " for kid" <<
            request.requestorId);
 
-    Comm::ConnectionPointer conn = new Comm::Connection;
-    conn->local = p.addr; // comm_open_listener may modify it
-    conn->flags = p.flags;
+    Comm::ConnectionPointer newConn = new Comm::Connection;
+    newConn->local = p.addr; // comm_open_listener may modify it
+    newConn->flags = p.flags;
 
     enter_suid();
-    comm_open_listener(p.sock_type, p.proto, conn, FdNote(p.fdNote));
-    errNo = Comm::IsConnOpen(conn) ? 0 : errno;
+    comm_open_listener(p.sock_type, p.proto, newConn, FdNote(p.fdNote));
+    errNo = Comm::IsConnOpen(newConn) ? 0 : errno;
     leave_suid();
 
-    debugs(54, 6, HERE << "tried listening on " << conn << " for kid" <<
+    debugs(54, 6, HERE << "tried listening on " << newConn << " for kid" <<
            request.requestorId);
 
     // cache positive results
-    if (Comm::IsConnOpen(conn))
-        listeners[request.params] = conn;
+    if (Comm::IsConnOpen(newConn))
+        listeners[request.params] = newConn;
 
-    return conn;
+    return newConn;
 }
 
 void Ipc::Coordinator::broadcastSignal(int sig) const
index ee54cfb114060537ed95e411f44c37e03360e13e..5f87f9986aba2566f5fb785464fbbd92a4361b14 100644 (file)
@@ -44,7 +44,7 @@ void Kid::start(pid_t cpid)
 }
 
 /// called when kid terminates, sets exiting status
-void Kid::stop(status_type exitStatus)
+void Kid::stop(status_type theExitStatus)
 {
     assert(running());
     assert(startTime != 0);
@@ -58,7 +58,7 @@ void Kid::stop(status_type exitStatus)
     else
         badFailures = 0; // the failures are not "frequent" [any more]
 
-    status = exitStatus;
+    status = theExitStatus;
 }
 
 /// returns true if tracking of kid is stopped
index 74cae6aa7a1a5d9416b86e286aa90ec38f4a30ff..eb293542053038cd412de974b496e6c59d15dfa9 100644 (file)
@@ -132,38 +132,38 @@ Ipc::TypedMsgHdr::putString(const String &s)
 }
 
 void
-Ipc::TypedMsgHdr::getFixed(void *raw, size_t size) const
+Ipc::TypedMsgHdr::getFixed(void *rawBuf, size_t rawSize) const
 {
     // no need to load size because it is constant
-    getRaw(raw, size);
+    getRaw(rawBuf, rawSize);
 }
 
 void
-Ipc::TypedMsgHdr::putFixed(const void *raw, size_t size)
+Ipc::TypedMsgHdr::putFixed(const void *rawBuf, size_t rawSize)
 {
     // no need to store size because it is constant
-    putRaw(raw, size);
+    putRaw(rawBuf, rawSize);
 }
 
 /// low-level loading of exactly size bytes of raw data
 void
-Ipc::TypedMsgHdr::getRaw(void *raw, size_t size) const
+Ipc::TypedMsgHdr::getRaw(void *rawBuf, size_t rawSize) const
 {
-    if (size > 0) {
-        Must(size <= data.size - offset);
-        memcpy(raw, data.raw + offset, size);
-        offset += size;
+    if (rawSize > 0) {
+        Must(rawSize <= data.size - offset);
+        memcpy(rawBuf, data.raw + offset, rawSize);
+        offset += rawSize;
     }
 }
 
 /// low-level storage of exactly size bytes of raw data
 void
-Ipc::TypedMsgHdr::putRaw(const void *raw, size_t size)
+Ipc::TypedMsgHdr::putRaw(const void *rawBuf, size_t rawSize)
 {
-    if (size > 0) {
-        Must(size <= sizeof(data.raw) - data.size);
-        memcpy(data.raw + data.size, raw, size);
-        data.size += size;
+    if (rawSize > 0) {
+        Must(rawSize <= sizeof(data.raw) - data.size);
+        memcpy(data.raw + data.size, rawBuf, rawSize);
+        data.size += rawSize;
     }
 }
 
index 578a6204f49d823ac31e7e1ec78a24255d5c0a18..8f96df20cabb21f3a5b991b371bb226793a49379 100644 (file)
@@ -20,7 +20,7 @@ Mgr::IndexAction::Create(const Command::Pointer &cmd)
     return new IndexAction(cmd);
 }
 
-Mgr::IndexAction::IndexAction(const Command::Pointer &cmd): Action(cmd)
+Mgr::IndexAction::IndexAction(const Command::Pointer &aCmd): Action(aCmd)
 {
     debugs(16, 5, HERE);
 }
@@ -37,7 +37,7 @@ Mgr::MenuAction::Create(const Command::Pointer &cmd)
     return new MenuAction(cmd);
 }
 
-Mgr::MenuAction::MenuAction(const Command::Pointer &cmd): Action(cmd)
+Mgr::MenuAction::MenuAction(const Command::Pointer &aCmd): Action(aCmd)
 {
     debugs(16, 5, HERE);
 }
@@ -64,7 +64,7 @@ Mgr::ShutdownAction::Create(const Command::Pointer &cmd)
     return new ShutdownAction(cmd);
 }
 
-Mgr::ShutdownAction::ShutdownAction(const Command::Pointer &cmd): Action(cmd)
+Mgr::ShutdownAction::ShutdownAction(const Command::Pointer &aCmd): Action(aCmd)
 {
     debugs(16, 5, HERE);
 }
@@ -82,8 +82,8 @@ Mgr::ReconfigureAction::Create(const Command::Pointer &cmd)
     return new ReconfigureAction(cmd);
 }
 
-Mgr::ReconfigureAction::ReconfigureAction(const Command::Pointer &cmd):
-        Action(cmd)
+Mgr::ReconfigureAction::ReconfigureAction(const Command::Pointer &aCmd):
+        Action(aCmd)
 {
     debugs(16, 5, HERE);
 }
@@ -102,7 +102,7 @@ Mgr::RotateAction::Create(const Command::Pointer &cmd)
     return new RotateAction(cmd);
 }
 
-Mgr::RotateAction::RotateAction(const Command::Pointer &cmd): Action(cmd)
+Mgr::RotateAction::RotateAction(const Command::Pointer &aCmd): Action(aCmd)
 {
     debugs(16, 5, HERE);
 }
@@ -125,8 +125,8 @@ Mgr::OfflineToggleAction::Create(const Command::Pointer &cmd)
     return new OfflineToggleAction(cmd);
 }
 
-Mgr::OfflineToggleAction::OfflineToggleAction(const Command::Pointer &cmd):
-        Action(cmd)
+Mgr::OfflineToggleAction::OfflineToggleAction(const Command::Pointer &aCmd):
+        Action(aCmd)
 {
     debugs(16, 5, HERE);
 }
index 322fdc8f25f17996a47143bb99a0fd64430ba66c..051c015e14856c26f31489e73307e63d07931e59 100644 (file)
@@ -90,8 +90,8 @@ Mgr::CountersAction::Create(const CommandPointer &cmd)
     return new CountersAction(cmd);
 }
 
-Mgr::CountersAction::CountersAction(const CommandPointer &cmd):
-        Action(cmd), data()
+Mgr::CountersAction::CountersAction(const CommandPointer &aCmd):
+        Action(aCmd), data()
 {
     debugs(16, 5, HERE);
 }
index 034a07dbc5cf4dcd7dfa4fd0cd659d5c5e5dd052..09fb699df0e61af2c7fd32d549b52335f3abf297 100644 (file)
@@ -131,8 +131,8 @@ Mgr::InfoAction::Create(const CommandPointer &cmd)
     return new InfoAction(cmd);
 }
 
-Mgr::InfoAction::InfoAction(const CommandPointer &cmd):
-        Action(cmd), data()
+Mgr::InfoAction::InfoAction(const CommandPointer &aCmd):
+        Action(aCmd), data()
 {
     debugs(16, 5, HERE);
 }
index 175995093d9444949d97f5843e5db593cb20da36..0e26732986e7835c32ad6fbd799984d1acf92467 100644 (file)
@@ -115,8 +115,8 @@ Mgr::IntervalAction::Create60min(const CommandPointer &cmd)
     return new IntervalAction(cmd, 60, 0);
 }
 
-Mgr::IntervalAction::IntervalAction(const CommandPointer &cmd, int aMinutes, int aHours):
-        Action(cmd), minutes(aMinutes), hours(aHours), data()
+Mgr::IntervalAction::IntervalAction(const CommandPointer &aCmd, int aMinutes, int aHours):
+        Action(aCmd), minutes(aMinutes), hours(aHours), data()
 {
     debugs(16, 5, HERE);
 }
index ed8db0ed95f5a648e174114ded4f8a6bc9750213..03a6670edd1d245af415e56f6491f56531238ab1 100644 (file)
@@ -43,8 +43,8 @@ Mgr::IoAction::Create(const CommandPointer &cmd)
     return new IoAction(cmd);
 }
 
-Mgr::IoAction::IoAction(const CommandPointer &cmd):
-        Action(cmd), data()
+Mgr::IoAction::IoAction(const CommandPointer &aCmd):
+        Action(aCmd), data()
 {
     debugs(16, 5, HERE);
 }
index b56af190b36a56b7dd8231e8eba013494d26cdd5..d4ae9ed04c55289491565fe2ea3b7078a3b00a8b 100644 (file)
@@ -55,8 +55,8 @@ Mgr::ServiceTimesAction::Create(const CommandPointer &cmd)
     return new ServiceTimesAction(cmd);
 }
 
-Mgr::ServiceTimesAction::ServiceTimesAction(const CommandPointer &cmd):
-        Action(cmd), data()
+Mgr::ServiceTimesAction::ServiceTimesAction(const CommandPointer &aCmd):
+        Action(aCmd), data()
 {
     debugs(16, 5, HERE);
 }
index c71f010dcabf5cac6c3cba1a839a8e63c21ef838..a1fef6820196854f80b960ddaac612accef80280 100644 (file)
@@ -33,8 +33,8 @@ Mgr::StoreIoAction::Create(const CommandPointer &cmd)
     return new StoreIoAction(cmd);
 }
 
-Mgr::StoreIoAction::StoreIoAction(const CommandPointer &cmd):
-        Action(cmd), data()
+Mgr::StoreIoAction::StoreIoAction(const CommandPointer &aCmd):
+        Action(aCmd), data()
 {
     debugs(16, 5, HERE);
 }
index 03da4618aa175f709315882e47325815545c7178..344651c0b8054ecf3991fe0314b3264797c3a527 100644 (file)
@@ -310,9 +310,9 @@ snmpOpenPorts(void)
         if (Ip::EnableIpv6&IPV6_SPECIAL_SPLITSTACK && snmpOutgoingConn->local.IsAnyAddr()) {
             snmpOutgoingConn->local.SetIPv4();
         }
-        AsyncCall::Pointer call = asyncCall(49, 2, "snmpOutgoingConnectionOpened",
-                                            Comm::UdpOpenDialer(&snmpPortOpened));
-        Ipc::StartListening(SOCK_DGRAM, IPPROTO_UDP, snmpOutgoingConn, Ipc::fdnOutSnmpSocket, call);
+        AsyncCall::Pointer c = asyncCall(49, 2, "snmpOutgoingConnectionOpened",
+                                         Comm::UdpOpenDialer(&snmpPortOpened));
+        Ipc::StartListening(SOCK_DGRAM, IPPROTO_UDP, snmpOutgoingConn, Ipc::fdnOutSnmpSocket, c);
     } else {
         snmpOutgoingConn = snmpIncomingConn;
         debugs(1, DBG_IMPORTANT, "Sending SNMP messages from " << snmpOutgoingConn->local);
@@ -651,7 +651,6 @@ snmpTreeNext(oid * Current, snint CurrentLen, oid ** Next, snint * NextLen)
         *NextLen = CurrentLen;
         *Next = (*mibTreeEntry->instancefunction) (Current, NextLen, mibTreeEntry, &Fn);
         if (*Next) {
-            MemBuf tmp;
             debugs(49, 6, "snmpTreeNext: Next : " << snmpDebugOid(*Next, *NextLen, tmp));
             return (Fn);
         }
@@ -695,7 +694,6 @@ snmpTreeNext(oid * Current, snint CurrentLen, oid ** Next, snint * NextLen)
     }
 
     if (*Next) {
-        MemBuf tmp;
         debugs(49, 6, "snmpTreeNext: Next : " << snmpDebugOid(*Next, *NextLen, tmp));
         return (Fn);
     } else
index 202193b8317e8ce9048315c5bbcaf1a9e98e55b7..93592a2073ad512725d36d3634a731c86091b9f9 100644 (file)
@@ -6,7 +6,7 @@
 #include "tests/STUB.h"
 
 HttpRequest::HttpRequest() : HttpMsg(hoRequest) STUB
-        HttpRequest::HttpRequest(const HttpRequestMethod& method, AnyP::ProtocolType protocol, const char *aUrlpath) : HttpMsg(hoRequest) STUB
+        HttpRequest::HttpRequest(const HttpRequestMethod& aMethod, AnyP::ProtocolType aProtocol, const char *aUrlpath) : HttpMsg(hoRequest) STUB
         HttpRequest::~HttpRequest() STUB
         void HttpRequest::packFirstLineInto(Packer * p, bool full_uri) const STUB
         bool HttpRequest::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error) STUB_RETVAL(false)
index 0c393741ca480a3995790fb2d4f12e5a56e77f2b..c1760c22098128b20a2c8ce981af109d93adf458 100644 (file)
@@ -44,7 +44,7 @@ void comm_read(const Comm::ConnectionPointer &conn, char*, int, AsyncCall::Point
 
 /* should be in stub_CommRead */
 #include "CommRead.h"
-CommRead::CommRead(const Comm::ConnectionPointer &, char *buf, int len, AsyncCall::Pointer &callback) STUB
+CommRead::CommRead(const Comm::ConnectionPointer &, char *, int, AsyncCall::Pointer &) STUB
 CommRead::CommRead() STUB
 DeferredReadManager::~DeferredReadManager() STUB
 DeferredRead::DeferredRead(DeferrableRead *, void *, CommRead const &) STUB
index 1bb41ecb7ebbaffa8ceaf0ac9e670883a86bfd32..4fa35172f7e6cc7c12bbac36d3779c731f0423ac 100644 (file)
@@ -33,7 +33,7 @@ Comm::ConnOpener::ConnOpener(Comm::ConnectionPointer &, AsyncCall::Pointer &, ti
         bool Comm::IsConnOpen(const Comm::ConnectionPointer &) STUB_RETVAL(false)
 
 #include "comm/IoCallback.h"
-        void Comm::IoCallback::setCallback(iocb_type type, AsyncCall::Pointer &cb, char *buf, FREE *func, int sz) STUB
+        void Comm::IoCallback::setCallback(iocb_type, AsyncCall::Pointer &, char *, FREE *, int) STUB
         void Comm::IoCallback::selectOrQueueWrite() STUB
         void Comm::IoCallback::cancel(const char *reason) STUB
         void Comm::IoCallback::finish(comm_err_t code, int xerrn) STUB
index 50ee2f7b9cf080ddf6d50b4db8cff936ee120f9a..a93cc8d3bd5fef95fa4eeea2bb8b11701a997872 100644 (file)
@@ -16,7 +16,7 @@ StoreIoStats store_io_stats;
 bool StoreEntry::checkDeferRead(int fd) const STUB_RETVAL(false)
 const char *StoreEntry::getMD5Text() const STUB_RETVAL(NULL)
 StoreEntry::StoreEntry() STUB
-StoreEntry::StoreEntry(const char *url, const char *log_url) STUB
+StoreEntry::StoreEntry(const char *, const char *) STUB
 StoreEntry::~StoreEntry() STUB
 HttpReply const *StoreEntry::getReply() const STUB_RETVAL(NULL)
 void StoreEntry::write(StoreIOBuffer) STUB
index 0d0ac4f956dd68bfa482f8bb886a7fcc13864f4d..6abcf9ace636e470719c6ca1786b1fa090fe4ded 100644 (file)
@@ -64,8 +64,7 @@ public:
     int calls;
     int lasttimeout;
     int return_timeout;
-    RecordingEngine(int return_timeout=0): calls(0), lasttimeout(0),
-            return_timeout(return_timeout) {}
+    RecordingEngine(int aTimeout=0): calls(0), lasttimeout(0), return_timeout(aTimeout) {}
 
     virtual int checkEvents(int timeout) {
         ++calls;
index b8125bf4ae65c764abbcf9e9fe851c4a89bf3939..c6254c071a98ec28a98963afdb5ae61e5116b55a 100644 (file)
@@ -13,8 +13,8 @@ class InspectingStatHist : public StatHist
 {
 public:
     bool operator==(const InspectingStatHist &);
-    bins_type counter(double val) {
-        return bins[findBin(val)];
+    bins_type counter(double v) {
+        return bins[findBin(v)];
     }
 };
 
index ea44317b84664f6529d5632f7608be3f7258f6bf..69b8119a6fddada89a8c42577139576af62374f2 100644 (file)
@@ -197,15 +197,18 @@ main(int argc, char *argv[])
         SplayCheck::BeginWalk();
         safeTop->walk(SplayCheck::WalkNodeRef, NULL);
     }
+
     /* check the check routine */
-    SplayCheck::BeginWalk();
-    intnode I;
-    I.i = 1;
-    /* check we don't segfault on NULL splay calls */
-    SplayCheck::WalkNodeRef(I, NULL);
-    I.i = 0;
-    SplayCheck::ExpectedFail = true;
-    SplayCheck::WalkNodeRef(I, NULL);
+    {
+        SplayCheck::BeginWalk();
+        intnode I;
+        I.i = 1;
+        /* check we don't segfault on NULL splay calls */
+        SplayCheck::WalkNodeRef(I, NULL);
+        I.i = 0;
+        SplayCheck::ExpectedFail = true;
+        SplayCheck::WalkNodeRef(I, NULL);
+    }
 
     {
         /* check for begin() */
index 36b473138fd733c6639b2aeeee45c54f8c1c5aef..ba8dd998fee7abb303686f24c3ac7028d90d4dc6 100644 (file)
@@ -344,8 +344,8 @@ action( int fd, size_t metasize,
             return false;
         }
 
-        int size = strlen(buffer);
-        if ( write( sockfd, buffer, size ) != size ) {
+        int content_size = strlen(buffer);
+        if ( write( sockfd, buffer, content_size ) != content_size ) {
             // error while talking to squid
             fprintf( stderr, "unable to talk to server: %s\n", strerror(errno) );
             close(sockfd);
@@ -563,23 +563,23 @@ dirlevel( const char* dirname, const REList* list, bool level=false )
 }
 
 int
-checkForPortOnly( const char* optarg )
+checkForPortOnly( const char* arg )
 // purpose: see if somebody just put in a port instead of a hostname
 // paramtr: optarg (IN): argument from commandline
 // returns: 0..65535 is the valid port number in network byte order,
 //          -1 if not a port
 {
     // if there is a period in there, it must be a valid hostname
-    if ( strchr( optarg, '.' ) != 0 ) return -1;
+    if ( strchr( arg, '.' ) != 0 ) return -1;
 
     // if it is just a number between 0 and 65535, it must be a port
     char* errstr = 0;
-    unsigned long result = strtoul( optarg, &errstr, 0 );
-    if ( result < 65536 && errstr != optarg ) return htons(result);
+    unsigned long result = strtoul( arg, &errstr, 0 );
+    if ( result < 65536 && errstr != arg ) return htons(result);
 
 #if 0
     // one last try, test for a symbolical service name
-    struct servent* service = getservbyname( optarg, "tcp" );
+    struct servent* service = getservbyname( arg, "tcp" );
     return service ? service->s_port : -1;
 #else
     return -1;
@@ -618,8 +618,8 @@ helpMe( void )
 
 void
 parseCommandline( int argc, char* argv[], REList*& head,
-                  char*& conffile, char*& copydir,
-                  struct in_addr& serverHost, unsigned short& serverPort )
+                  char*& conffile, char*& copyDirPath,
+                  struct in_addr& serverHostIp, unsigned short& serverHostPort )
 // paramtr: argc: see ::main().
 //          argv: see ::main().
 // returns: Does terminate the program on errors!
@@ -646,9 +646,9 @@ parseCommandline( int argc, char* argv[], REList*& head,
             break;
         case 'C':
             if ( optarg && *optarg ) {
-                if ( copydir ) xfree( (void*) copydir );
-                copydir = xstrdup(optarg);
-                assert(copydir);
+                if ( copyDirPath ) xfree( (void*) copyDirPath );
+                copyDirPath = xstrdup(optarg);
+                assert(copyDirPath);
             }
             break;
         case 'c':
@@ -739,23 +739,23 @@ parseCommandline( int argc, char* argv[], REList*& head,
                 port = checkForPortOnly( optarg );
                 if ( port == -1 ) {
                     // assume that main() did set the default port
-                    if ( convertHostname(optarg,serverHost) == -1 ) {
+                    if ( convertHostname(optarg,serverHostIp) == -1 ) {
                         fprintf( stderr, "unable to resolve host %s!\n", optarg );
                         exit(1);
                     }
                 } else {
                     // assume that main() did set the default host
-                    serverPort = port;
+                    serverHostPort = port;
                 }
             } else {
                 // colon used, port is extra
                 *colon = 0;
                 ++colon;
-                if ( convertHostname(optarg,serverHost) == -1 ) {
+                if ( convertHostname(optarg,serverHostIp) == -1 ) {
                     fprintf( stderr, "unable to resolve host %s!\n", optarg );
                     exit(1);
                 }
-                if ( convertPortname(colon,serverPort) == -1 ) {
+                if ( convertPortname(colon,serverHostPort) == -1 ) {
                     fprintf( stderr, "unable to resolve port %s!\n", colon );
                     exit(1);
                 }
@@ -793,8 +793,8 @@ parseCommandline( int argc, char* argv[], REList*& head,
     assert( head != 0 );
 
     // make sure that the copy out directory is there and accessible
-    if ( copydir && *copydir )
-        if ( assert_copydir( copydir ) != 0 ) exit(1);
+    if ( copyDirPath && *copyDirPath )
+        if ( assert_copydir( copyDirPath ) != 0 ) exit(1);
 
     // show results
     if ( showme ) {
@@ -807,15 +807,15 @@ parseCommandline( int argc, char* argv[], REList*& head,
         puts( ::verbose ? " + extra verbosity" : "" );
 
         printf( "# Copy-out directory: %s ",
-                copydir ? copydir : "copy-out mode disabled" );
-        if ( copydir )
+                copyDirPath ? copyDirPath : "copy-out mode disabled" );
+        if ( copyDirPath )
             printf( "(%s HTTP header)\n", ::envelope ? "prepend" : "no" );
         else
             puts("");
 
         printf( "# Squid config file : %s\n", conffile );
         printf( "# Cacheserveraddress: %s:%u\n",
-                inet_ntoa( serverHost ), ntohs( serverPort ) );
+                inet_ntoa( serverHostIp ), ntohs( serverHostPort ) );
         printf( "# purge mode        : 0x%02x\n", ::purgeMode );
         printf( "# Regular expression: " );
 
index d8884f10b8b704211632bb494f6ed10f1fbb90f0..2bd472cc145176e57bf7bb96d5f13578f2906c91 100644 (file)
@@ -218,9 +218,9 @@ serverSocket( struct in_addr host, unsigned short port,
     }
 
     if ( reuse ) {
-        int reuse = 1;
+        int opt = 1;
         if ( setsockopt( sockfd, SOL_SOCKET, SO_REUSEADDR,
-                         (char*) &reuse, sizeof(int) ) == -1) {
+                         (char*) &opt, sizeof(int) ) == -1) {
             perror( "setsockopt( SO_REUSEADDR )" );
             close( sockfd );
             return -1;