From: Jiri Skala Date: Sun, 29 May 2011 05:42:07 +0000 (+1200) Subject: Bug 3178: gcc-4.6 complains unused variables X-Git-Tag: take08~55^2~165 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e91e2a72f292d140b569f2b26899b2e249eaecb8;p=thirdparty%2Fsquid.git Bug 3178: gcc-4.6 complains unused variables --- diff --git a/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc b/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc index f8b2ea14b5..c843d07390 100644 --- a/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc +++ b/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc @@ -230,7 +230,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); @@ -613,7 +612,6 @@ recover: tryagain = 1; } } - err = 0; } if (ld) ldap_unbind(ld); 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/client_side_reply.cc b/src/client_side_reply.cc index 889bdd8c68..8b24aa4ae7 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1069,14 +1069,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, @@ -2059,13 +2051,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); memcpy(buf, result.data, result.length); - body_buf = buf; } if (reqofs==0 && !logTypeIsATcpHit(http->logType)) { diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 6d8a67474f..ec815d7df7 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1477,8 +1477,6 @@ idnsInit(void) CBDATA_INIT_TYPE(idns_query); if (DnsSocketA < 0 && DnsSocketB < 0) { - int port; - Ip::Address addrA; // since we don't want to alter Config.Addrs.udp_* and dont have one of our own. if (!Config.Addrs.udp_outgoing.IsNoAddr()) @@ -1514,12 +1512,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); Comm::SetSelect(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); Comm::SetSelect(DnsSocketA, COMM_SELECT_READ, idnsRead, NULL, 0); } diff --git a/src/errorpage.cc b/src/errorpage.cc index 1b266a4295..db7ecc342b 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -568,7 +568,6 @@ int ErrorState::Dump(MemBuf * mb) { MemBuf str; - const char *p = NULL; /* takes priority over mb if set */ char ntoabuf[MAX_IPSTRLEN]; str.reset(); @@ -623,10 +622,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 ef75be1622..4f474204bf 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -496,10 +496,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/neighbors.cc b/src/neighbors.cc index 80597932fe..14cc40d186 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;