]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3178: gcc-4.6 complains unused variables
authorJiri Skala <jaskalnik@gmail.com>
Sun, 29 May 2011 06:02:19 +0000 (00:02 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 29 May 2011 06:02:19 +0000 (00:02 -0600)
13 files changed:
helpers/external_acl/ldap_group/squid_ldap_group.c
helpers/ntlm_auth/fakeauth/fakeauth_auth.c
src/DiskIO/AIO/AIODiskIOStrategy.cc
src/auth/User.cc
src/auth/negotiate/auth_negotiate.cc
src/auth/ntlm/auth_ntlm.cc
src/client_side_reply.cc
src/comm.cc
src/dns_internal.cc
src/errorpage.cc
src/fqdncache.cc
src/ftp.cc
src/neighbors.cc

index cb5686fa0f97c85e57d59f3878479bf815b64ee9..9199e33f07d757cc91112bf1ec5e1c77d3022cd0 100644 (file)
@@ -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);
index a57ba13968a67de923245c7275f2bd747048b47d..eee401d6e5ece63de2bc9353cf44e667e109467e 100644 (file)
@@ -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)
index 61f79921ad37e94ce33df54b43402247c6f272f0..96e11f4cb985c2ebb157584997c903d6a63bd043 100644 (file)
@@ -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;
index 71094e1c0653ab20992a29561cdb52f0d2f573f5..a972018cbfd3f71a8098b6ea9db7c7ef65c7385b 100644 (file)
@@ -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);
 
index de0ff19a95dbc8f9bfd1a82951d0a9a7d13a5cec..dada156abae539abff031294b81daec6a492523c 100644 (file)
@@ -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<negotiate_user_t *>(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<negotiate_user_t *>(local_auth_user);
     assert (this);
 
     /** Check that we are in the client side, where we can generate
index 4afd447faab4431c4fa2d1d4d5818628b4b28b69..3fa5b46f78ee5eea710ff10afbde3facc5cc6ec5 100644 (file)
@@ -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<ntlm_user_t *>(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<ntlm_user_t *>(local_auth_user);
     assert (this);
 
     /* Check that we are in the client side, where we can generate
index 8eb7e86e29193b19777b14bb28a71f391487a21b..cb5d84b3e0a5f37024f246f9abd70159c527d895 100644 (file)
@@ -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
index fdc1a54201826c3c09d669f3d09570405cc89e57..e9a87b18fb4c61a85d522248fa884ae4083a65b7 100644 (file)
@@ -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() )
index 2b7efba865adb6baf00828f2c12b16db131c1fbd..1775ec9870582cbeb3b8f01ae9b32d71f40ea4ce 100644 (file)
@@ -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);
         }
index 286e7d3fed18f6ab2c67ce578913d869607e514e..aa6606751cdc2ba472df173c3fa30a3d6cbd4318 100644 (file)
@@ -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");
index 3bd090265158cd70538655b6d4c96434a5634827..6a79b5f85904f6ed191181a75a32dd75cce87ad6 100644 (file)
@@ -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<generic_cbdata *>(data)->unwrap(&f);
-    n = ++FqdncacheStats.replies;
+    ++FqdncacheStats.replies;
     const int age = f->age();
     statHistCount(&statCounter.dns.svc_time, age);
 #if USE_DNSSERVERS
index a53c81652f68f1f3aefb0bfeb02f391974f1629c..d0c25644bccafd0c52b79cc720922d948cb64787 100644 (file)
@@ -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 " <<
index d4bc66fa9315efcd6c2e8050ec74ede65363a50b..a87931c1c111604318b24fbf4978d56418b35375 100644 (file)
@@ -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;