]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3676: Fix various shadowed variables
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 2 Jan 2013 23:40:49 +0000 (12:40 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 2 Jan 2013 23:40:49 +0000 (12:40 +1300)
Also, fixes logformat dumper to output 'logformat' instead of 'format'.
'format' directive is the planned future name but is not yet parsed.

 Detected by GCC 4.7 with -Wshadow

src/CommCalls.h
src/comm/ConnOpener.cc
src/comm/ConnOpener.h
src/format/Format.cc
src/format/Format.h
src/ipc/StoreMap.h

index 3a74154fb596a34c495b2fe07bce3533dfe3b49b..fe8b735318f44b0a1a9c5b2bac86ff0dc3ced784 100644 (file)
@@ -169,9 +169,9 @@ public:
     typedef Params_ Params;
     typedef void (C::*Method)(const Params &io);
 
-    CommCbMemFunT(const CbcPointer<C> &job, Method meth): JobDialer<C>(job),
-            CommDialerParamsT<Params_>(job.get()),
-            method(meth) {}
+    CommCbMemFunT(const CbcPointer<C> &aJob, Method aMeth): JobDialer<C>(aJob),
+            CommDialerParamsT<Params_>(aJob.get()),
+            method(aMeth) {}
 
     virtual bool canDial(AsyncCall &c) {
         return JobDialer<C>::canDial(c) &&
index d0272af30555a114aff2b0e578837024157c71a8..0cb62c434acba5d3b199be509f608ae6dcf4cf97 100644 (file)
@@ -112,7 +112,7 @@ Comm::ConnOpener::getHost() const
  * NP: on errors the earlyAbort call should be cancelled first with a reason.
  */
 void
-Comm::ConnOpener::doneConnecting(comm_err_t status, int xerrno)
+Comm::ConnOpener::doneConnecting(comm_err_t errFlag, int xerrno)
 {
     // only mark the address good/bad AFTER connect is finished.
     if (host_ != NULL) {
@@ -131,7 +131,7 @@ Comm::ConnOpener::doneConnecting(comm_err_t status, int xerrno)
         typedef CommConnectCbParams Params;
         Params &params = GetCommParams<Params>(callback_);
         params.conn = conn_;
-        params.flag = status;
+        params.flag = errFlag;
         params.xerrno = xerrno;
         ScheduleCallHere(callback_);
         callback_ = NULL;
index 45e4c41287a388ac5c6b0abcd4af8d27d2c7a32c..e3fd1aeb3f905b0177223984b2cc4e1134733593 100644 (file)
@@ -40,7 +40,7 @@ private:
 
     void earlyAbort(const CommCloseCbParams &);
     void timeout(const CommTimeoutCbParams &);
-    void doneConnecting(comm_err_t status, int xerrno);
+    void doneConnecting(comm_err_t errFlag, int xerrno);
     static void InProgressConnectRetry(int fd, void *data);
     static void DelayedConnectRetry(void *data);
     void connect();
index d07bfc96bd87d0e0150677e2fa89c4988787fda2..b65c817e3508fadb11f25e2e6764e6ddc3e098b1 100644 (file)
@@ -79,16 +79,16 @@ Format::Format::parse(const char *def)
 }
 
 void
-Format::Format::dump(StoreEntry * entry, const char *name)
+Format::Format::dump(StoreEntry * entry, const char *directiveName)
 {
     debugs(46, 4, HERE);
 
     // loop rather than recursing to conserve stack space.
-    for (Format *format = this; format; format = format->next) {
-        debugs(46, 3, HERE << "Dumping format definition for " << format->name);
-        storeAppendPrintf(entry, "format %s ", format->name);
+    for (Format *fmt = this; fmt; fmt = fmt->next) {
+        debugs(46, 3, HERE << "Dumping format definition for " << fmt->name);
+        storeAppendPrintf(entry, "%s %s ", directiveName, fmt->name);
 
-        for (Token *t = format->format; t; t = t->next) {
+        for (Token *t = fmt->format; t; t = t->next) {
             if (t->type == LFT_STRING)
                 storeAppendPrintf(entry, "%s", t->data.string);
             else {
index 2415815c08ae25bdf5138c32571164c436141846..a998327cad70e0dcc50b8809caa083f509afc49a 100644 (file)
@@ -41,7 +41,7 @@ public:
     void assemble(MemBuf &mb, const AccessLogEntryPointer &al, int logSequenceNumber) const;
 
     /// dump this whole list of formats into the provided StoreEntry
-    void dump(StoreEntry * entry, const char *name);
+    void dump(StoreEntry * entry, const char *directiveName);
 
     char *name;
     Token *format;
index 444073a3595de9abfd68a810c206693a37d57163..fcb7f9d1a3ae0f18f86721d1855e946adfea7345 100644 (file)
@@ -169,8 +169,8 @@ StoreMapWithExtras<ExtrasT>::Init(const char *const path, const int limit)
 }
 
 template <class ExtrasT>
-StoreMapWithExtras<ExtrasT>::StoreMapWithExtras(const char *const path):
-        StoreMap(path)
+StoreMapWithExtras<ExtrasT>::StoreMapWithExtras(const char *const aPath):
+        StoreMap(aPath)
 {
     const size_t sharedSizeWithoutExtras =
         Shared::SharedMemorySize(entryLimit(), 0);