From: Francesco Chemolli Date: Tue, 17 Nov 2009 15:44:34 +0000 (+0100) Subject: Fixed some cases of variable shadowing X-Git-Tag: SQUID_3_2_0_1~568 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18ec8500ce3dc21de9f8325af0f2d5cf93132fcd;p=thirdparty%2Fsquid.git Fixed some cases of variable shadowing --- diff --git a/lib/MemPool.cc b/lib/MemPool.cc index b673b1c563..7150d4b900 100644 --- a/lib/MemPool.cc +++ b/lib/MemPool.cc @@ -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 diff --git a/lib/rfc1123.c b/lib/rfc1123.c index 9bd85a8bc6..dd98d360ae 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -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; } diff --git a/src/CommCalls.h b/src/CommCalls.h index d07cbd9e24..c5b39411a1 100644 --- a/src/CommCalls.h +++ b/src/CommCalls.h @@ -290,9 +290,9 @@ CommCbFunPtrCallT *commCbCall(int debugSection, int debugLevel, /* CommCbFunPtrCallT */ template -CommCbFunPtrCallT::CommCbFunPtrCallT(int debugSection, int debugLevel, +CommCbFunPtrCallT::CommCbFunPtrCallT(int aDebugSection, int aDebugLevel, const char *callName, const Dialer &aDialer): - AsyncCall(debugSection, debugLevel, callName), + AsyncCall(aDebugSection, aDebugLevel, callName), dialer(aDialer) { } diff --git a/src/ConfigOption.h b/src/ConfigOption.h index 960ea9a8b8..786350f4a2 100644 --- a/src/ConfigOption.h +++ b/src/ConfigOption.h @@ -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; } diff --git a/src/String.cci b/src/String.cci index 66790f3d65..085f383517 100644 --- a/src/String.cci +++ b/src/String.cci @@ -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]; } diff --git a/src/auth/basic/auth_basic.cc b/src/auth/basic/auth_basic.cc index aae8d6a2b6..bc67847427 100644 --- a/src/auth/basic/auth_basic.cc +++ b/src/auth/basic/auth_basic.cc @@ -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; } diff --git a/src/auth/digest/auth_digest.cc b/src/auth/digest/auth_digest.cc index d482cfbae7..ef01973720 100644 --- a/src/auth/digest/auth_digest.cc +++ b/src/auth/digest/auth_digest.cc @@ -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() diff --git a/src/auth/ntlm/auth_ntlm.cc b/src/auth/ntlm/auth_ntlm.cc index 003f9ebab9..a2b119bf3e 100644 --- a/src/auth/ntlm/auth_ntlm.cc +++ b/src/auth/ntlm/auth_ntlm.cc @@ -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; } diff --git a/src/cbdata.h b/src/cbdata.h index 5c4b0320e5..617f3dfac8 100644 --- a/src/cbdata.h +++ b/src/cbdata.h @@ -448,7 +448,7 @@ class generic_cbdata { public: - generic_cbdata(void * data) : data(data) {} + generic_cbdata(void * aData) : data(aData) {} templatevoid unwrap(wrapped_type **output) { *output = static_cast(data); diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index 70ce7af7fe..9cd380cdb6 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -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 diff --git a/src/fs/ufs/store_io_ufs.cc b/src/fs/ufs/store_io_ufs.cc index 9b374e7f6d..035e6935fa 100644 --- a/src/fs/ufs/store_io_ufs.cc +++ b/src/fs/ufs/store_io_ufs.cc @@ -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;