From: Dmitry Kurochkin Date: Wed, 29 Jun 2011 03:58:58 +0000 (+0400) Subject: Fix GCC v4.6.1 "variable set but not used" warnings. X-Git-Tag: take07~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90110b9645849db8e9fae42ffb5827a17d22c152;p=thirdparty%2Fsquid.git Fix GCC v4.6.1 "variable set but not used" warnings. --- 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 847cdb9e41..69aa83b91c 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1071,14 +1071,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, @@ -2061,13 +2053,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..6fdcca0112 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,10 @@ idnsInit(void) * statement. Doing so messes up the internal Debug::level */ if (DnsSocketB >= 0) { - port = 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); 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/ftp.cc b/src/ftp.cc index 5858e024d3..2b9fb757e7 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -2368,7 +2368,6 @@ ftpReadEPSV(FtpStateData* ftpState) { int code = ftpState->ctrl.replycode; char h1, h2, h3, h4; - int n; u_short port; Ip::Address ipa_remote; int fd = ftpState->data.fd; @@ -2436,7 +2435,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 " <<