From: Francesco Chemolli Date: Wed, 18 Nov 2009 15:48:32 +0000 (+0100) Subject: Fixed some cases of variable shadowing X-Git-Tag: SQUID_3_2_0_1~559 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5f8d05f15621442d74fb4106403f318632d2727;p=thirdparty%2Fsquid.git Fixed some cases of variable shadowing --- diff --git a/helpers/basic_auth/LDAP/basic_ldap_auth.cc b/helpers/basic_auth/LDAP/basic_ldap_auth.cc index 02b626c71c..5ec4ba0a97 100644 --- a/helpers/basic_auth/LDAP/basic_ldap_auth.cc +++ b/helpers/basic_auth/LDAP/basic_ldap_auth.cc @@ -181,21 +181,21 @@ squid_ldap_set_referrals(LDAP * ld, int referrals) ldap_set_option(ld, LDAP_OPT_REFERRALS, value); } static void -squid_ldap_set_timelimit(LDAP * ld, int timelimit) +squid_ldap_set_timelimit(LDAP * ld, int aTimeLimit) { - ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &timelimit); + ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &aTimeLimit); } static void -squid_ldap_set_connect_timeout(LDAP * ld, int timelimit) +squid_ldap_set_connect_timeout(LDAP * ld, int aTimeLimit) { #if defined(LDAP_OPT_NETWORK_TIMEOUT) struct timeval tv; - tv.tv_sec = timelimit; + tv.tv_sec = aTimeLimit; tv.tv_usec = 0; ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv); #elif defined(LDAP_X_OPT_CONNECT_TIMEOUT) - timelimit *= 1000; - ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &timelimit); + aTimeLimit *= 1000; + ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &aTimeLimit); #endif } static void diff --git a/helpers/basic_auth/MSNT/rfcnb-util.c b/helpers/basic_auth/MSNT/rfcnb-util.c index 1e96652855..9ec8363126 100644 --- a/helpers/basic_auth/MSNT/rfcnb-util.c +++ b/helpers/basic_auth/MSNT/rfcnb-util.c @@ -375,10 +375,10 @@ RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP) /* Disconnect the TCP connection to the server */ int -RFCNB_Close(int socket) +RFCNB_Close(int aSocket) { - close(socket); + close(aSocket); /* If we want to do error recovery, here is where we put it */ diff --git a/helpers/basic_auth/MSNT/valid.c b/helpers/basic_auth/MSNT/valid.c index 233cf3af96..8a8c91d294 100644 --- a/helpers/basic_auth/MSNT/valid.c +++ b/helpers/basic_auth/MSNT/valid.c @@ -9,7 +9,7 @@ int Valid_User(char *USERNAME, char *PASSWORD, char *SERVER, char *BACKUP, char *DOMAIN) { - const char *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0", + const char *supportedDialects[] = {"PC NETWORK PROGRAM 1.0", "MICROSOFT NETWORKS 1.03", "MICROSOFT NETWORKS 3.0", "LANMAN1.0", @@ -29,7 +29,7 @@ Valid_User(char *USERNAME, char *PASSWORD, char *SERVER, char *BACKUP, char *DOM return (NTV_SERVER_ERROR); } } - if (SMB_Negotiate(con, SMB_Prots) < 0) { /* An error */ + if (SMB_Negotiate(con, supportedDialects) < 0) { /* An error */ SMB_Discon(con, 0); return (NTV_PROTOCOL_ERROR); } diff --git a/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c b/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c index 67e5cefb1d..8e59ba464d 100644 --- a/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c +++ b/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c @@ -219,7 +219,7 @@ result_recv(u_int32_t host, u_short udp_port, char *buffer, int length) * Generate a random vector. */ static void -random_vector(char *vector) +random_vector(char *aVector) { int randno; int i; @@ -227,8 +227,8 @@ random_vector(char *vector) srand((time(0) ^ rand()) + rand()); for (i = 0; i < AUTH_VECTOR_LEN;) { randno = rand(); - memcpy(vector, &randno, sizeof(int)); - vector += sizeof(int); + memcpy(aVector, &randno, sizeof(int)); + aVector += sizeof(int); i += sizeof(int); } } diff --git a/helpers/digest_auth/eDirectory/ldap_backend.c b/helpers/digest_auth/eDirectory/ldap_backend.c index 397c0d037d..3cd5a7815a 100644 --- a/helpers/digest_auth/eDirectory/ldap_backend.c +++ b/helpers/digest_auth/eDirectory/ldap_backend.c @@ -97,21 +97,21 @@ squid_ldap_set_referrals(int referrals) ldap_set_option(ld, LDAP_OPT_REFERRALS, value); } static void -squid_ldap_set_timelimit(int timelimit) +squid_ldap_set_timelimit(int aTimeLimit) { - ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &timelimit); + ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &aTimeLimit); } static void -squid_ldap_set_connect_timeout(int timelimit) +squid_ldap_set_connect_timeout(int aTimeLimit) { #if defined(LDAP_OPT_NETWORK_TIMEOUT) struct timeval tv; - tv.tv_sec = timelimit; + tv.tv_sec = aTimeLimit; tv.tv_usec = 0; ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv); #elif defined(LDAP_X_OPT_CONNECT_TIMEOUT) - timelimit *= 1000; - ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &timelimit); + aTimeLimit *= 1000; + ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &aTimeLimit); #endif } @@ -135,12 +135,12 @@ squid_ldap_set_referrals(int referrals) ld->ld_options &= ~LDAP_OPT_REFERRALS; } static void -squid_ldap_set_timelimit(int timelimit) +squid_ldap_set_timelimit(int aTimeLimit) { - ld->ld_timelimit = timelimit; + ld->ld_timelimit = aTimeLimit; } static void -squid_ldap_set_connect_timeout(int timelimit) +squid_ldap_set_connect_timeout(int aTimeLimit) { fprintf(stderr, "Connect timeouts not supported in your LDAP library\n"); } diff --git a/helpers/digest_auth/ldap/ldap_backend.c b/helpers/digest_auth/ldap/ldap_backend.c index 47b440829c..6fa0d16375 100644 --- a/helpers/digest_auth/ldap/ldap_backend.c +++ b/helpers/digest_auth/ldap/ldap_backend.c @@ -95,21 +95,21 @@ squid_ldap_set_referrals(int referrals) ldap_set_option(ld, LDAP_OPT_REFERRALS, value); } static void -squid_ldap_set_timelimit(int timelimit) +squid_ldap_set_timelimit(int aTimeLimit) { - ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &timelimit); + ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &aTimeLimit); } static void -squid_ldap_set_connect_timeout(int timelimit) +squid_ldap_set_connect_timeout(int aTimeLimit) { #if defined(LDAP_OPT_NETWORK_TIMEOUT) struct timeval tv; - tv.tv_sec = timelimit; + tv.tv_sec = aTimeLimit; tv.tv_usec = 0; ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv); #elif defined(LDAP_X_OPT_CONNECT_TIMEOUT) - timelimit *= 1000; - ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &timelimit); + aTimeLimit *= 1000; + ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &aTimeLimit); #endif } @@ -133,12 +133,12 @@ squid_ldap_set_referrals(int referrals) ld->ld_options &= ~LDAP_OPT_REFERRALS; } static void -squid_ldap_set_timelimit(int timelimit) +squid_ldap_set_timelimit(int aTimeLimit) { - ld->ld_timelimit = timelimit; + ld->ld_timelimit = aTimeLimit; } static void -squid_ldap_set_connect_timeout(int timelimit) +squid_ldap_set_connect_timeout(int aTimeLimit) { fprintf(stderr, "Connect timeouts not supported in your LDAP library\n"); } diff --git a/helpers/digest_auth/password/text_backend.c b/helpers/digest_auth/password/text_backend.c index 0662555c72..9bbaf1d479 100644 --- a/helpers/digest_auth/password/text_backend.c +++ b/helpers/digest_auth/password/text_backend.c @@ -53,7 +53,7 @@ my_free(void *p) } static void -read_passwd_file(const char *passwdfile, int isHa1Mode) +read_passwd_file(const char *passwordFile, int isHa1Mode) { FILE *f; char buf[8192]; @@ -72,7 +72,7 @@ read_passwd_file(const char *passwdfile, int isHa1Mode) fprintf(stderr, "digest_pw_auth: cannot create hash table\n"); exit(1); } - f = fopen(passwdfile, "r"); + f = fopen(passwordFile, "r"); while (fgets(buf, 8192, f) != NULL) { if ((buf[0] == '#') || (buf[0] == ' ') || (buf[0] == '\t') || (buf[0] == '\n')) diff --git a/helpers/external_acl/ldap_group/squid_ldap_group.c b/helpers/external_acl/ldap_group/squid_ldap_group.c index a89c3f43aa..abf970ef04 100644 --- a/helpers/external_acl/ldap_group/squid_ldap_group.c +++ b/helpers/external_acl/ldap_group/squid_ldap_group.c @@ -141,21 +141,21 @@ squid_ldap_set_referrals(LDAP * ld, int referrals) ldap_set_option(ld, LDAP_OPT_REFERRALS, value); } static void -squid_ldap_set_timelimit(LDAP * ld, int timelimit) +squid_ldap_set_timelimit(LDAP * ld, int aTimeLimit) { - ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &timelimit); + ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &aTimeLimit); } static void -squid_ldap_set_connect_timeout(LDAP * ld, int timelimit) +squid_ldap_set_connect_timeout(LDAP * ld, int aTimeLimit) { #if defined(LDAP_OPT_NETWORK_TIMEOUT) struct timeval tv; - tv.tv_sec = timelimit; + tv.tv_sec = aTimeLimit; tv.tv_usec = 0; ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &tv); #elif defined(LDAP_X_OPT_CONNECT_TIMEOUT) - timelimit *= 1000; - ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &timelimit); + aTimeLimit *= 1000; + ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &aTimeLimit); #endif } static void diff --git a/helpers/ntlm_auth/smb_lm/smbval/rfcnb-util.c b/helpers/ntlm_auth/smb_lm/smbval/rfcnb-util.c index e12b36fc0a..50a6ce870d 100644 --- a/helpers/ntlm_auth/smb_lm/smbval/rfcnb-util.c +++ b/helpers/ntlm_auth/smb_lm/smbval/rfcnb-util.c @@ -359,10 +359,10 @@ RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP) /* Disconnect the TCP connection to the server */ int -RFCNB_Close(int socket) +RFCNB_Close(int aSocket) { - close(socket); + close(aSocket); /* If we want to do error recovery, here is where we put it */ diff --git a/helpers/ntlm_auth/smb_lm/smbval/valid.c b/helpers/ntlm_auth/smb_lm/smbval/valid.c index f481decbc2..4130dda766 100644 --- a/helpers/ntlm_auth/smb_lm/smbval/valid.c +++ b/helpers/ntlm_auth/smb_lm/smbval/valid.c @@ -22,7 +22,7 @@ int Valid_User(char *username, char *password, char *server, char *backup, char *domain) { int pass_is_precrypted_p = 0; - char const *SMB_Prots[] = { + char const *supportedDialects[] = { /* "PC NETWORK PROGRAM 1.0", */ /* "MICROSOFT NETWORKS 1.03", */ /* "MICROSOFT NETWORKS 3.0", */ @@ -43,7 +43,7 @@ Valid_User(char *username, char *password, char *server, char *backup, char *dom return (NTV_SERVER_ERROR); } } - if (SMB_Negotiate(con, SMB_Prots) < 0) { /* An error */ + if (SMB_Negotiate(con, supportedDialects) < 0) { /* An error */ SMB_Discon(con, 0); return (NTV_PROTOCOL_ERROR); } diff --git a/src/errorpage.cc b/src/errorpage.cc index a3382e97d1..b0b773ebfd 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -737,7 +737,7 @@ ErrorState::Convert(char token, bool url_presentable) break; } if (NULL != request) { - Packer p; + Packer pck; String urlpath_or_slash; if (request->urlpath.size() != 0) @@ -749,9 +749,9 @@ ErrorState::Convert(char token, bool url_presentable) RequestMethodStr(request->method), SQUIDSTRINGPRINT(urlpath_or_slash), request->http_ver.major, request->http_ver.minor); - packerToMemInit(&p, &mb); - request->header.packInto(&p); - packerClean(&p); + packerToMemInit(&pck, &mb); + request->header.packInto(&pck); + packerClean(&pck); } else if (request_hdrs) { p = request_hdrs; } else { diff --git a/src/event.cc b/src/event.cc index 6dc15dba40..612b8fcd71 100644 --- a/src/event.cc +++ b/src/event.cc @@ -108,9 +108,9 @@ EventDialer::print(std::ostream &os) const } -ev_entry::ev_entry(char const * aName, EVH * aFunction, void * aArgument, double when, - int weight, bool haveArgument) : name(aName), func(aFunction), - arg(haveArgument ? cbdataReference(aArgument) : aArgument), when(when), weight(weight), +ev_entry::ev_entry(char const * aName, EVH * aFunction, void * aArgument, double evWhen, + int aWeight, bool haveArgument) : name(aName), func(aFunction), + arg(haveArgument ? cbdataReference(aArgument) : aArgument), when(evWhen), weight(aWeight), cbdata(haveArgument) { } diff --git a/src/ftp.cc b/src/ftp.cc index e8e05eb8c7..be6a163d50 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -803,7 +803,7 @@ ftpListParseParts(const char *buf, struct _ftp_flags flags) p->type = 0; while (ct && *ct) { - time_t t; + time_t tm; int l = strcspn(ct, ","); char *tmp; @@ -821,12 +821,12 @@ ftpListParseParts(const char *buf, struct _ftp_flags flags) break; case 'm': - t = (time_t) strtol(ct + 1, &tmp, 0); + tm = (time_t) strtol(ct + 1, &tmp, 0); if (tmp != ct + 1) break; /* not a valid integer */ - p->date = xstrdup(ctime(&t)); + p->date = xstrdup(ctime(&tm)); *(strstr(p->date, "\n")) = '\0'; diff --git a/src/http.cc b/src/http.cc index 263444a377..e8ddbe92c1 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1353,10 +1353,10 @@ HttpStateData::maybeReadVirginBody() { // we may need to grow the buffer if headers do not fit const int minRead = flags.headers_parsed ? 0 :1024; - const int read_sz = replyBodySpace(*readBuf, minRead); + const int read_size = replyBodySpace(*readBuf, minRead); debugs(11,9, HERE << (flags.do_next_read ? "may" : "wont") << - " read up to " << read_sz << " bytes from FD " << fd); + " read up to " << read_size << " bytes from FD " << fd); /* * why <2? Because delayAwareRead() won't actually read if @@ -1366,13 +1366,13 @@ HttpStateData::maybeReadVirginBody() * handler until we get a notification from someone that * its okay to read again. */ - if (read_sz < 2) + if (read_size < 2) return; if (flags.do_next_read) { flags.do_next_read = 0; typedef CommCbMemFunT Dialer; - entry->delayAwareRead(fd, readBuf->space(read_sz), read_sz, + entry->delayAwareRead(fd, readBuf->space(read_size), read_size, asyncCall(11, 5, "HttpStateData::readReply", Dialer(this, &HttpStateData::readReply))); } diff --git a/src/store.cc b/src/store.cc index e16f869e78..583c500dfd 100644 --- a/src/store.cc +++ b/src/store.cc @@ -365,10 +365,10 @@ StoreEntry::StoreEntry() swap_dirn = -1; } -StoreEntry::StoreEntry(const char *url, const char *log_url) +StoreEntry::StoreEntry(const char *aUrl, const char *aLogUrl) { debugs(20, 3, HERE << "new StoreEntry " << this); - mem_obj = new MemObject(url, log_url); + mem_obj = new MemObject(aUrl, aLogUrl); expires = lastmod = lastref = timestamp = -1; @@ -1627,12 +1627,12 @@ StoreEntry::url() const } void -StoreEntry::createMemObject(const char *url, const char *log_url) +StoreEntry::createMemObject(const char *aUrl, const char *aLogUrl) { if (mem_obj) return; - mem_obj = new MemObject(url, log_url); + mem_obj = new MemObject(aUrl, aLogUrl); } /* this just sets DELAY_SENDING */