From: Jiri Skala Date: Sun, 29 May 2011 06:02:19 +0000 (-0600) Subject: Bug 3178: gcc-4.6 complains unused variables X-Git-Tag: SQUID_3_1_12_2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b26f59e3c55a31072adc9bcee6097b256da86753;p=thirdparty%2Fsquid.git Bug 3178: gcc-4.6 complains unused variables --- diff --git a/helpers/external_acl/ldap_group/squid_ldap_group.c b/helpers/external_acl/ldap_group/squid_ldap_group.c index cb5686fa0f..9199e33f07 100644 --- a/helpers/external_acl/ldap_group/squid_ldap_group.c +++ b/helpers/external_acl/ldap_group/squid_ldap_group.c @@ -219,7 +219,6 @@ main(int argc, char **argv) int use_extension_dn = 0; int strip_nt_domain = 0; int strip_kerberos_realm = 0; - int err = 0; setbuf(stdout, NULL); @@ -602,7 +601,6 @@ error: tryagain = 1; } } - err = 0; } if (ld) ldap_unbind(ld); diff --git a/helpers/ntlm_auth/fakeauth/fakeauth_auth.c b/helpers/ntlm_auth/fakeauth/fakeauth_auth.c index a57ba13968..eee401d6e5 100644 --- a/helpers/ntlm_auth/fakeauth/fakeauth_auth.c +++ b/helpers/ntlm_auth/fakeauth/fakeauth_auth.c @@ -141,7 +141,6 @@ ntlmMakeChallenge(struct ntlm_challenge *chal, int32_t flags) { static unsigned hash; int r; - char *d; int i; debug("ntlmMakeChallenge: flg %08x\n", flags); @@ -158,7 +157,6 @@ ntlmMakeChallenge(struct ntlm_challenge *chal, int32_t flags) chal->flags = flags; chal->unknown[6] = htole16(0x003a); - d = (char *) chal + 48; i = 0; if (authenticate_ntlm_domain != NULL) diff --git a/src/DiskIO/AIO/AIODiskIOStrategy.cc b/src/DiskIO/AIO/AIODiskIOStrategy.cc index 61f79921ad..96e11f4cb9 100644 --- a/src/DiskIO/AIO/AIODiskIOStrategy.cc +++ b/src/DiskIO/AIO/AIODiskIOStrategy.cc @@ -123,7 +123,6 @@ AIODiskIOStrategy::callback() void *cbdata; int callback_valid; void *buf; - int filedescriptor; async_queue_entry_t *aqe; async_queue_entry_type_t type; @@ -148,7 +147,6 @@ AIODiskIOStrategy::callback() /* Get the callback parameters */ freefunc = aqe->aq_e_free; buf = aqe->aq_e_buf; - filedescriptor = aqe->aq_e_fd; type = aqe->aq_e_type; callback_valid = cbdataReferenceValidDone(aqe->aq_e_callback_data, &cbdata); AIODiskFile * theFile = NULL; diff --git a/src/auth/User.cc b/src/auth/User.cc index 71094e1c06..a972018cbf 100644 --- a/src/auth/User.cc +++ b/src/auth/User.cc @@ -158,13 +158,11 @@ AuthUser::CachedACLsReset() */ AuthUserHashPointer *usernamehash; AuthUser *auth_user; - char const *username = NULL; debugs(29, 3, "AuthUser::CachedACLsReset: Flushing the ACL caches for all users."); hash_first(proxy_auth_username_cache); while ((usernamehash = ((AuthUserHashPointer *) hash_next(proxy_auth_username_cache)))) { auth_user = usernamehash->user(); - username = auth_user->username(); /* free cached acl results */ aclCacheMatchFlush(&auth_user->proxy_match_cache); diff --git a/src/auth/negotiate/auth_negotiate.cc b/src/auth/negotiate/auth_negotiate.cc index de0ff19a95..dada156aba 100644 --- a/src/auth/negotiate/auth_negotiate.cc +++ b/src/auth/negotiate/auth_negotiate.cc @@ -544,7 +544,6 @@ AuthNegotiateUserRequest::module_start(RH * handler, void *data) { authenticateStateData *r = NULL; static char buf[MAX_AUTHTOKEN_LEN]; - negotiate_user_t *negotiate_user; AuthUser *auth_user = user(); assert(data); @@ -552,8 +551,6 @@ AuthNegotiateUserRequest::module_start(RH * handler, void *data) assert(auth_user); assert(auth_user->auth_type == AUTH_NEGOTIATE); - negotiate_user = dynamic_cast(user()); - debugs(29, 8, "AuthNegotiateUserRequest::module_start: auth state is '" << auth_state << "'"); if (negotiateConfig.authenticate == NULL) { @@ -655,12 +652,10 @@ AuthNegotiateUserRequest::authenticate(HttpRequest * aRequest, ConnStateData * c /** \todo rename this!! */ AuthUser *local_auth_user; - negotiate_user_t *negotiate_user; local_auth_user = user(); assert(local_auth_user); assert(local_auth_user->auth_type == AUTH_NEGOTIATE); - negotiate_user = dynamic_cast(local_auth_user); assert (this); /** Check that we are in the client side, where we can generate diff --git a/src/auth/ntlm/auth_ntlm.cc b/src/auth/ntlm/auth_ntlm.cc index 4afd447faa..3fa5b46f78 100644 --- a/src/auth/ntlm/auth_ntlm.cc +++ b/src/auth/ntlm/auth_ntlm.cc @@ -460,7 +460,6 @@ AuthNTLMUserRequest::module_start(RH * handler, void *data) { authenticateStateData *r = NULL; static char buf[8192]; - ntlm_user_t *ntlm_user; AuthUser *auth_user = user(); assert(data); @@ -468,8 +467,6 @@ AuthNTLMUserRequest::module_start(RH * handler, void *data) assert(auth_user); assert(auth_user->auth_type == AUTH_NTLM); - ntlm_user = dynamic_cast(user()); - debugs(29, 8, "AuthNTLMUserRequest::module_start: auth state is '" << auth_state << "'"); if (ntlmConfig.authenticate == NULL) { @@ -572,12 +569,10 @@ AuthNTLMUserRequest::authenticate(HttpRequest * aRequest, ConnStateData * conn, /* TODO: rename this!! */ AuthUser *local_auth_user; - ntlm_user_t *ntlm_user; local_auth_user = user(); assert(local_auth_user); assert(local_auth_user->auth_type == AUTH_NTLM); - ntlm_user = dynamic_cast(local_auth_user); assert (this); /* Check that we are in the client side, where we can generate diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 8eb7e86e29..cb5d84b3e0 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1056,14 +1056,6 @@ clientReplyContext::storeNotOKTransferDone() const /* haven't found end of headers yet */ return 0; - int sending = SENDING_BODY; - - if (curReply->sline.status == HTTP_NO_CONTENT || - curReply->sline.status == HTTP_NOT_MODIFIED || - curReply->sline.status < HTTP_OK || - http->request->method == METHOD_HEAD) - sending = SENDING_HDRSONLY; - /* * Figure out how much data we are supposed to send. * If we are sending a body and we don't have a content-length, @@ -2029,13 +2021,10 @@ clientReplyContext::sendMoreData (StoreIOBuffer result) char *buf = next()->readBuffer.data; - char *body_buf = buf; - if (buf != result.data) { /* we've got to copy some data */ assert(result.length <= next()->readBuffer.length); xmemcpy(buf, result.data, result.length); - body_buf = buf; } #if USE_ZPH_QOS diff --git a/src/comm.cc b/src/comm.cc index fdc1a54201..e9a87b18fb 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -759,6 +759,7 @@ comm_openex(int sock_type, /* set TOS if needed */ if (TOS && comm_set_tos(new_socket, TOS) ) { tos = TOS; + (void)tos; } if ( Ip::EnableIpv6&IPV6_SPECIAL_SPLITSTACK && addr.IsIPv6() ) diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 2b7efba865..1775ec9870 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1376,8 +1376,6 @@ idnsInit(void) CBDATA_INIT_TYPE(idns_query); if (DnsSocketA < 0 && DnsSocketB < 0) { - int port; - IpAddress addrA; // since we don't want to alter Config.Addrs.udp_* and dont have one of our own. if (!Config.Addrs.udp_outgoing.IsNoAddr()) @@ -1413,12 +1411,12 @@ idnsInit(void) * statement. Doing so messes up the internal Debug::level */ if (DnsSocketB >= 0) { - port = comm_local_port(DnsSocketB); + comm_local_port(DnsSocketB); debugs(78, 1, "DNS Socket created at " << addrB << ", FD " << DnsSocketB); commSetSelect(DnsSocketB, COMM_SELECT_READ, idnsRead, NULL, 0); } if (DnsSocketA >= 0) { - port = comm_local_port(DnsSocketA); + comm_local_port(DnsSocketA); debugs(78, 1, "DNS Socket created at " << addrA << ", FD " << DnsSocketA); commSetSelect(DnsSocketA, COMM_SELECT_READ, idnsRead, NULL, 0); } diff --git a/src/errorpage.cc b/src/errorpage.cc index 286e7d3fed..aa6606751c 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -518,7 +518,6 @@ int ErrorState::Dump(MemBuf * mb) { MemBuf str; - const char *p = NULL; /* takes priority over mb if set */ char ntoabuf[MAX_IPSTRLEN]; str.reset(); @@ -573,10 +572,6 @@ ErrorState::Dump(MemBuf * mb) packerToMemInit(&pck, &str); request->header.packInto(&pck); packerClean(&pck); - } else if (request_hdrs) { - p = request_hdrs; - } else { - p = "[none]"; } str.Printf("\r\n"); diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 3bd0902651..6a79b5f859 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -497,10 +497,9 @@ fqdncacheHandleReply(void *data, char *reply) fqdncacheHandleReply(void *data, rfc1035_rr * answers, int na, const char *error_message) #endif { - int n; fqdncache_entry *f; static_cast(data)->unwrap(&f); - n = ++FqdncacheStats.replies; + ++FqdncacheStats.replies; const int age = f->age(); statHistCount(&statCounter.dns.svc_time, age); #if USE_DNSSERVERS diff --git a/src/ftp.cc b/src/ftp.cc index a53c81652f..d0c25644bc 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -2451,7 +2451,6 @@ ftpReadEPSV(FtpStateData* ftpState) { int code = ftpState->ctrl.replycode; char h1, h2, h3, h4; - int n; u_short port; IpAddress ipa_remote; int fd = ftpState->data.fd; @@ -2519,7 +2518,7 @@ ftpReadEPSV(FtpStateData* ftpState) buf = ftpState->ctrl.last_reply + strcspn(ftpState->ctrl.last_reply, "("); - n = sscanf(buf, "(%c%c%c%hu%c)", &h1, &h2, &h3, &port, &h4); + sscanf(buf, "(%c%c%c%hu%c)", &h1, &h2, &h3, &port, &h4); if (h1 != h2 || h1 != h3 || h1 != h4) { debugs(9, DBG_IMPORTANT, "Invalid EPSV reply from " << diff --git a/src/neighbors.cc b/src/neighbors.cc index d4bc66fa93..a87931c1c1 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -832,7 +832,6 @@ neighborsDigestSelect(HttpRequest * request) peer *best_p = NULL; #if USE_CACHE_DIGESTS - const cache_key *key; int best_rtt = 0; int choice_count = 0; int ichoice_count = 0; @@ -843,7 +842,7 @@ neighborsDigestSelect(HttpRequest * request) if (!request->flags.hierarchical) return NULL; - key = storeKeyPublicByRequest(request); + storeKeyPublicByRequest(request); for (i = 0, p = first_ping; i++ < Config.npeers; p = p->next) { lookup_t lookup;