]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed some cases of variable shadowing
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 17 Nov 2009 15:44:34 +0000 (16:44 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 17 Nov 2009 15:44:34 +0000 (16:44 +0100)
lib/MemPool.cc
lib/rfc1123.c
src/CommCalls.h
src/ConfigOption.h
src/String.cci
src/auth/basic/auth_basic.cc
src/auth/digest/auth_digest.cc
src/auth/ntlm/auth_ntlm.cc
src/cbdata.h
src/fs/ufs/store_dir_ufs.cc
src/fs/ufs/store_io_ufs.cc

index b673b1c5632ef6868804aa22d9b2f7b29924f6b3..7150d4b900caf52efae19ca2aa4e5736683c9ca2 100644 (file)
@@ -848,7 +848,7 @@ size_t MemAllocator::RoundedSize(size_t s)
     return ((s + sizeof(void*) - 1) / sizeof(void*)) * sizeof(void*);
 }
 
-MemMalloc::MemMalloc(char const *label, size_t aSize) : MemImplementingAllocator(label, aSize) { inuse = 0; }
+MemMalloc::MemMalloc(char const *aLabel, size_t aSize) : MemImplementingAllocator(aLabel, aSize) { inuse = 0; }
 
 bool
 MemMalloc::idleTrigger(int shift) const
index 9bd85a8bc617636218d03473c955bf4f4dfd00a3..dd98d360ae007b4c5ccb370a1163e03be1be168f 100644 (file)
@@ -119,12 +119,12 @@ tmSaneValues(struct tm *tm)
 
 static struct tm *
 parse_date_elements(const char *day, const char *month, const char *year,
-                    const char *time, const char *zone) {
+                    const char *aTime, const char *zone) {
     static struct tm tm;
     char *t;
     memset(&tm, 0, sizeof(tm));
 
-    if (!day || !month || !year || !time)
+    if (!day || !month || !year || !aTime)
         return NULL;
     tm.tm_mday = atoi(day);
     tm.tm_mon = make_month(month);
@@ -137,8 +137,8 @@ parse_date_elements(const char *day, const char *month, const char *year,
         tm.tm_year += 100;
     else if (tm.tm_year > 19000)
         tm.tm_year -= 19000;
-    tm.tm_hour = make_num(time);
-    t = strchr(time, ':');
+    tm.tm_hour = make_num(aTime);
+    t = strchr(aTime, ':');
     if (!t)
         return NULL;
     t++;
@@ -158,7 +158,7 @@ parse_date(const char *str) {
     char *day = NULL;
     char *month = NULL;
     char *year = NULL;
-    char *time = NULL;
+    char *timestr = NULL;
     char *zone = NULL;
 
     xstrncpy(tmp, str, 64);
@@ -178,7 +178,7 @@ parse_date(const char *str) {
                     year = t;
                 }
             } else if (strchr(t, ':'))
-                time = t;
+                timestr = t;
             else if (!year)
                 year = t;
         } else if (!wday)
@@ -188,7 +188,7 @@ parse_date(const char *str) {
         else if (!zone)
             zone = t;
     }
-    tm = parse_date_elements(day, month, year, time, zone);
+    tm = parse_date_elements(day, month, year, timestr, zone);
 
     return tm;
 }
index d07cbd9e2472c8c3c7fb99a282b7844f410eac70..c5b39411a18d31bf10f61e5160e09ccb9c7d3167 100644 (file)
@@ -290,9 +290,9 @@ CommCbFunPtrCallT<Dialer> *commCbCall(int debugSection, int debugLevel,
 /* CommCbFunPtrCallT */
 
 template <class Dialer>
-CommCbFunPtrCallT<Dialer>::CommCbFunPtrCallT(int debugSection, int debugLevel,
+CommCbFunPtrCallT<Dialer>::CommCbFunPtrCallT(int aDebugSection, int aDebugLevel,
         const char *callName, const Dialer &aDialer):
-        AsyncCall(debugSection, debugLevel, callName),
+        AsyncCall(aDebugSection, aDebugLevel, callName),
         dialer(aDialer)
 {
 }
index 960ea9a8b8f46ecb7e3b22ac951cf0e53e7625f2..786350f4a21a358b195970721914615d534158d8 100644 (file)
@@ -67,9 +67,9 @@ class ConfigOptionAdapter : public ConfigOption
 public:
     ConfigOptionAdapter(C& theObject, bool (C::*parseFP)(char const *option, const char *value, int reconfiguring), void (C::*dumpFP) (StoreEntry * e) const) : object(theObject), parser (parseFP), dumper(dumpFP) {}
 
-    bool parse(char const *option, const char *value, int reconfiguring) {
+    bool parse(char const *option, const char *value, int isaReconf) {
         if (parser)
-            return (object.*parser)(option, value, reconfiguring);
+            return (object.*parser)(option, value, isaReconf);
 
         return false;
     }
index 66790f3d65d59a6e908cd299b3e05a31eb52e5c8..085f383517e5557fc7813dcd970d88455f4e89bb 100644 (file)
@@ -80,11 +80,11 @@ String::termedBuf() const
 }
 
 char
-String::operator [](unsigned int pos) const
+String::operator [](unsigned int aPos) const
 {
-    assert(pos < size_);
+    assert(aPos < size_);
 
-    return buf_[pos];
+    return buf_[aPos];
 }
 
 
index aae8d6a2b69276cf8a52fb52ebed07178ffaadb7..bc67847427cb48f481a57f0b9e58d53be34e5382 100644 (file)
@@ -211,11 +211,11 @@ AuthBasicUserRequest::module_direction()
 }
 
 void
-AuthBasicConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type type, HttpRequest * request)
+AuthBasicConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request)
 {
     if (authenticate) {
-        debugs(29, 9, HERE << "Sending type:" << type << " header: 'Basic realm=\"" << basicAuthRealm << "\"'");
-        httpHeaderPutStrf(&rep->header, type, "Basic realm=\"%s\"", basicAuthRealm);
+        debugs(29, 9, HERE << "Sending type:" << hdrType << " header: 'Basic realm=\"" << basicAuthRealm << "\"'");
+        httpHeaderPutStrf(&rep->header, hdrType, "Basic realm=\"%s\"", basicAuthRealm);
     }
 }
 
@@ -382,7 +382,7 @@ BasicUser::deleteSelf() const
     delete this;
 }
 
-BasicUser::BasicUser(AuthConfig *config) : AuthUser (config) , passwd (NULL), credentials_checkedtime(0), auth_queue(NULL), cleartext (NULL), currentRequest (NULL), httpAuthHeader (NULL)
+BasicUser::BasicUser(AuthConfig *aConfig) : AuthUser (aConfig) , passwd (NULL), credentials_checkedtime(0), auth_queue(NULL), cleartext (NULL), currentRequest (NULL), httpAuthHeader (NULL)
 {
     flags.credentials_ok = 0;
 }
index d482cfbae7ecdeb4ad10cd34b44915559794023c..ef01973720dfe8aa9d12945b54267d9fa4f371ac 100644 (file)
@@ -773,7 +773,7 @@ AuthDigestUserRequest::addTrailer(HttpReply * rep, int accel)
 
 /* add the [www-|Proxy-]authenticate header on a 407 or 401 reply */
 void
-AuthDigestConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type type, HttpRequest * request)
+AuthDigestConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request)
 {
     if (!authenticate)
         return;
@@ -791,13 +791,13 @@ AuthDigestConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep,
     /* on a 407 or 401 we always use a new nonce */
     digest_nonce_h *nonce = authenticateDigestNonceNew();
 
-    debugs(29, 9, "authenticateFixHeader: Sending type:" << type <<
+    debugs(29, 9, "authenticateFixHeader: Sending type:" << hdrType <<
            " header: 'Digest realm=\"" << digestAuthRealm << "\", nonce=\"" <<
            authenticateDigestNonceNonceb64(nonce) << "\", qop=\"" << QOP_AUTH <<
            "\", stale=" << (stale ? "true" : "false"));
 
     /* in the future, for WWW auth we may want to support the domain entry */
-    httpHeaderPutStrf(&rep->header, type, "Digest realm=\"%s\", nonce=\"%s\", qop=\"%s\", stale=%s", digestAuthRealm, authenticateDigestNonceNonceb64(nonce), QOP_AUTH, stale ? "true" : "false");
+    httpHeaderPutStrf(&rep->header, hdrType, "Digest realm=\"%s\", nonce=\"%s\", qop=\"%s\", stale=%s", digestAuthRealm, authenticateDigestNonceNonceb64(nonce), QOP_AUTH, stale ? "true" : "false");
 }
 
 DigestUser::~DigestUser()
index 003f9ebab996bb25b2d581b433231b5539e0ee3e..a2b119bf3e2461f243422201daf05e595e598e48 100644 (file)
@@ -259,7 +259,7 @@ AuthNTLMUserRequest::module_direction()
 }
 
 void
-AuthNTLMConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type type, HttpRequest * request)
+AuthNTLMConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request)
 {
     AuthNTLMUserRequest *ntlm_request;
 
@@ -272,8 +272,8 @@ AuthNTLMConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, ht
 
     /* New request, no user details */
     if (auth_user_request == NULL) {
-        debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << type << " header: 'NTLM'");
-        httpHeaderPutStrf(&rep->header, type, "NTLM");
+        debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << hdrType << " header: 'NTLM'");
+        httpHeaderPutStrf(&rep->header, hdrType, "NTLM");
 
         if (!keep_alive) {
             /* drop the connection */
@@ -301,14 +301,14 @@ AuthNTLMConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, ht
         case AUTHENTICATE_STATE_NONE:
             /* semantic change: do not drop the connection.
              * 2.5 implementation used to keep it open - Kinkie */
-            debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << type << " header: 'NTLM'");
-            httpHeaderPutStrf(&rep->header, type, "NTLM");
+            debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << hdrType << " header: 'NTLM'");
+            httpHeaderPutStrf(&rep->header, hdrType, "NTLM");
             break;
 
         case AUTHENTICATE_STATE_IN_PROGRESS:
             /* we're waiting for a response from the client. Pass it the blob */
-            debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << type << " header: 'NTLM " << ntlm_request->server_blob << "'");
-            httpHeaderPutStrf(&rep->header, type, "NTLM %s", ntlm_request->server_blob);
+            debugs(29, 9, "AuthNTLMConfig::fixHeader: Sending type:" << hdrType << " header: 'NTLM " << ntlm_request->server_blob << "'");
+            httpHeaderPutStrf(&rep->header, hdrType, "NTLM %s", ntlm_request->server_blob);
             safe_free(ntlm_request->server_blob);
             break;
 
@@ -716,7 +716,7 @@ NTLMUser::deleteSelf() const
     delete this;
 }
 
-NTLMUser::NTLMUser (AuthConfig *config) : AuthUser (config)
+NTLMUser::NTLMUser (AuthConfig *aConfig) : AuthUser (aConfig)
 {
     proxy_auth_list.head = proxy_auth_list.tail = NULL;
 }
index 5c4b0320e541d6c47e930808f267d7021aa2efc0..617f3dfac8b8e96b14f4c74a3a90339d221202ae 100644 (file)
@@ -448,7 +448,7 @@ class generic_cbdata
 {
 public:
 
-    generic_cbdata(void * data) : data(data) {}
+    generic_cbdata(void * aData) : data(aData) {}
 
     template<typename wrapped_type>void unwrap(wrapped_type **output) {
         *output = static_cast<wrapped_type *>(data);
index 70ce7af7fed0b28da9749289c73da32266679ce6..9cd380cdb66b697ae710870fadd42e920ac1c4ef 100644 (file)
@@ -155,12 +155,12 @@ UFSSwapDir::changeIO(DiskIOModule *module)
 }
 
 bool
-UFSSwapDir::optionIOParse(char const *option, const char *value, int reconfiguring)
+UFSSwapDir::optionIOParse(char const *option, const char *value, int isaReconfig)
 {
     if (strcmp(option, "IOEngine") != 0)
         return false;
 
-    if (reconfiguring)
+    if (isaReconfig)
         /* silently ignore this */
         return true;
 
@@ -432,15 +432,15 @@ UFSSwapDir::dereference(StoreEntry & e)
 }
 
 StoreIOState::Pointer
-UFSSwapDir::createStoreIO(StoreEntry &e, StoreIOState::STFNCB * file_callback, StoreIOState::STIOCB * callback, void *callback_data)
+UFSSwapDir::createStoreIO(StoreEntry &e, StoreIOState::STFNCB * file_callback, StoreIOState::STIOCB * aCallback, void *callback_data)
 {
-    return IO->create (this, &e, file_callback, callback, callback_data);
+    return IO->create (this, &e, file_callback, aCallback, callback_data);
 }
 
 StoreIOState::Pointer
-UFSSwapDir::openStoreIO(StoreEntry &e, StoreIOState::STFNCB * file_callback, StoreIOState::STIOCB * callback, void *callback_data)
+UFSSwapDir::openStoreIO(StoreEntry &e, StoreIOState::STFNCB * file_callback, StoreIOState::STIOCB * aCallback, void *callback_data)
 {
-    return IO->open (this, &e, file_callback, callback, callback_data);
+    return IO->open (this, &e, file_callback, aCallback, callback_data);
 }
 
 int
index 9b374e7f6dcfd234089ee6eb98b577d7a2264ae6..035e6935fa2ce11f00127e3145dc048a720bb247 100644 (file)
@@ -65,9 +65,9 @@ UFSStrategy::~UFSStrategy ()
 }
 
 StoreIOState::Pointer
-UFSStrategy::createState(SwapDir *SD, StoreEntry *e, StoreIOState::STIOCB * callback, void *callback_data) const
+UFSStrategy::createState(SwapDir *SD, StoreEntry *e, StoreIOState::STIOCB * aCallback, void *callback_data) const
 {
-    return new UFSStoreState (SD, e, callback, callback_data);
+    return new UFSStoreState (SD, e, aCallback, callback_data);
 }
 
 DiskFile::Pointer
@@ -198,7 +198,7 @@ UFSStoreState::close()
 }
 
 void
-UFSStoreState::read_(char *buf, size_t size, off_t offset, STRCB * aCallback, void *aCallbackData)
+UFSStoreState::read_(char *buf, size_t size, off_t aOffset, STRCB * aCallback, void *aCallbackData)
 {
     assert(read.callback == NULL);
     assert(read.callback_data == NULL);
@@ -208,7 +208,7 @@ UFSStoreState::read_(char *buf, size_t size, off_t offset, STRCB * aCallback, vo
 
     if (!theFile->canRead()) {
         debugs(79, 3, "UFSStoreState::read_: queueing read because theFile can't read");
-        queueRead (buf, size, offset, aCallback, aCallbackData);
+        queueRead (buf, size, aOffset, aCallback, aCallbackData);
         return;
     }
 
@@ -216,10 +216,10 @@ UFSStoreState::read_(char *buf, size_t size, off_t offset, STRCB * aCallback, vo
     read.callback_data = cbdataReference(aCallbackData);
     debugs(79, 3, "UFSStoreState::read_: dirno " << swap_dirn  << ", fileno "<<
            std::setfill('0') << std::hex << std::uppercase << std::setw(8) << swap_filen);
-    offset_ = offset;
+    offset_ = aOffset;
     read_buf = buf;
     reading = true;
-    theFile->read(new ReadRequest(buf,offset,size));
+    theFile->read(new ReadRequest(buf,aOffset,size));
 }
 
 
@@ -232,7 +232,7 @@ UFSStoreState::read_(char *buf, size_t size, off_t offset, STRCB * aCallback, vo
  * code simpler and always go through the pending_writes queue.
  */
 void
-UFSStoreState::write(char const *buf, size_t size, off_t offset, FREE * free_func)
+UFSStoreState::write(char const *buf, size_t size, off_t aOffset, FREE * free_func)
 {
     debugs(79, 3, "UFSStoreState::write: dirn " << swap_dirn  << ", fileno "<<
            std::setfill('0') << std::hex << std::uppercase << std::setw(8) << swap_filen);
@@ -244,7 +244,7 @@ UFSStoreState::write(char const *buf, size_t size, off_t offset, FREE * free_fun
         return;
     }
 
-    queueWrite(buf, size, offset, free_func);
+    queueWrite(buf, size, aOffset, free_func);
     drainWriteQueue();
 }
 
@@ -461,7 +461,7 @@ UFSStoreState::kickReadQueue()
 }
 
 void
-UFSStoreState::queueRead(char *buf, size_t size, off_t offset, STRCB *callback_, void *callback_data_)
+UFSStoreState::queueRead(char *buf, size_t size, off_t aOffset, STRCB *callback_, void *callback_data_)
 {
     debugs(79, 3, "UFSStoreState::queueRead: queueing read");
     assert(opening);
@@ -469,7 +469,7 @@ UFSStoreState::queueRead(char *buf, size_t size, off_t offset, STRCB *callback_,
     _queued_read *q = new _queued_read;
     q->buf = buf;
     q->size = size;
-    q->offset = offset;
+    q->offset = aOffset;
     q->callback = callback_;
     q->callback_data = cbdataReference(callback_data_);
     linklistPush(&pending_reads, q);
@@ -537,7 +537,7 @@ UFSStoreState::tryClosing()
 }
 
 void
-UFSStoreState::queueWrite(char const *buf, size_t size, off_t offset, FREE * free_func)
+UFSStoreState::queueWrite(char const *buf, size_t size, off_t aOffset, FREE * free_func)
 {
     debugs(79, 3, HERE << this << " UFSStoreState::queueWrite: queueing write of size " << size);
 
@@ -545,20 +545,20 @@ UFSStoreState::queueWrite(char const *buf, size_t size, off_t offset, FREE * fre
     q = new _queued_write;
     q->buf = buf;
     q->size = size;
-    q->offset = offset;
+    q->offset = aOffset;
     q->free_func = free_func;
     linklistPush(&pending_writes, q);
 }
 
 StoreIOState::Pointer
 UFSStrategy::open(SwapDir * SD, StoreEntry * e, StoreIOState::STFNCB * file_callback,
-                  StoreIOState::STIOCB * callback, void *callback_data)
+                  StoreIOState::STIOCB * aCallback, void *callback_data)
 {
     assert (((UFSSwapDir *)SD)->IO == this);
     debugs(79, 3, "UFSStrategy::open: fileno "<< std::setfill('0') << std::hex << std::uppercase << std::setw(8) << e->swap_filen);
 
     /* to consider: make createstate a private UFSStrategy call */
-    StoreIOState::Pointer sio = createState (SD, e, callback, callback_data);
+    StoreIOState::Pointer sio = createState (SD, e, aCallback, callback_data);
 
     sio->mode |= O_RDONLY;
 
@@ -587,7 +587,7 @@ UFSStrategy::open(SwapDir * SD, StoreEntry * e, StoreIOState::STFNCB * file_call
 
 StoreIOState::Pointer
 UFSStrategy::create(SwapDir * SD, StoreEntry * e, StoreIOState::STFNCB * file_callback,
-                    StoreIOState::STIOCB * callback, void *callback_data)
+                    StoreIOState::STIOCB * aCallback, void *callback_data)
 {
     assert (((UFSSwapDir *)SD)->IO == this);
     /* Allocate a number */
@@ -596,7 +596,7 @@ UFSStrategy::create(SwapDir * SD, StoreEntry * e, StoreIOState::STFNCB * file_ca
 
     /* Shouldn't we handle a 'bitmap full' error here? */
 
-    StoreIOState::Pointer sio = createState (SD, e, callback, callback_data);
+    StoreIOState::Pointer sio = createState (SD, e, aCallback, callback_data);
 
     sio->mode |= O_WRONLY | O_CREAT | O_TRUNC;