]> granicus.if.org Git - apache/commitdiff
- Remove a load of unused variables (or variables that are set but never read).
authorStefan Fritsch <sf@apache.org>
Tue, 3 Aug 2010 19:45:21 +0000 (19:45 +0000)
committerStefan Fritsch <sf@apache.org>
Tue, 3 Aug 2010 19:45:21 +0000 (19:45 +0000)
- Move some declarations into the correct #ifdef scope.

I couldn't compile/test netware, but the changes look obvious enough.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982016 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_authnz_ldap.c
modules/arch/netware/mod_netware.c
modules/arch/netware/mod_nw_ssl.c
modules/cache/mod_cache.c
modules/dav/main/mod_dav.c
modules/filters/mod_filter.c
modules/filters/mod_include.c
modules/filters/regexp.c
modules/proxy/mod_proxy_fcgi.c
modules/proxy/proxy_util.c

index 1966556ea5f20aed23095928e97ea53b1c728055..c075dfdc39535cdbfc6fe5fa94391878bf59672e 100644 (file)
@@ -119,13 +119,10 @@ static char *to_charset = NULL;           /* UTF-8 identifier derived from the c
 /* Derive a code page ID give a language name or ID */
 static char* derive_codepage_from_lang (apr_pool_t *p, char *language)
 {
-    int lang_len;
     char *charset;
 
     if (!language)          /* our default codepage */
         return apr_pstrdup(p, "ISO-8859-1");
-    else
-        lang_len = strlen(language);
 
     charset = (char*) apr_hash_get(charset_conversions, language, APR_HASH_KEY_STRING);
 
index 138007810fa63c2c218c65e964105176ba770e35..a93926a6ffa6954c3a12a8a516cb38bcbbd693d3 100644 (file)
@@ -101,7 +101,6 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
     char *cmd_only, *ptr;
     const char *new_cmd;
     netware_dir_config *d;
-    apr_file_t *fh;
     const char *args = "";
 
     d = (netware_dir_config *)ap_get_module_config(r->per_dir_config,
index af997717fe65f9edb3be9d456fc3e9aeb584ec0d..89b04836571d5c66d6508d6189c95a018955bfdd 100644 (file)
@@ -233,12 +233,10 @@ static int make_secure_socket(apr_pool_t *pconf, const struct sockaddr_in *serve
                               char* key, int mutual, server_rec *sconf)
 {
     int s;
-    int one = 1;
     char addr[MAX_ADDRESS];
     struct sslserveropts opts;
     unsigned int optParam;
     WSAPROTOCOL_INFO SecureProtoInfo;
-    int no = 1;
 
     if (server->sin_addr.s_addr != htonl(INADDR_ANY))
         apr_snprintf(addr, sizeof(addr), "address %s port %d",
@@ -546,7 +544,6 @@ static const char *set_secure_upgradeable_listener(cmd_parms *cmd, void *dummy,
                                        const char *ips, const char* key)
 {
     NWSSLSrvConfigRec* sc = get_nwssl_cfg(cmd->server);
-    seclistenup_rec *listen_node;
     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
     char *ports, *addr;
     unsigned short port;
@@ -626,8 +623,6 @@ static int nwssl_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
                          apr_pool_t *ptemp)
 {
     seclisten_rec* ap_old_seclisteners;
-    char *ports, *addr;
-    unsigned short port;
     ap_listen_rec **walk;
     seclisten_rec **secwalk;
     apr_sockaddr_t *sa;
@@ -724,7 +719,6 @@ static int nwssl_post_config(apr_pool_t *pconf, apr_pool_t *plog,
     ap_listen_rec *walk;
     seclisten_rec *secwalk, *lastsecwalk;
     apr_sockaddr_t *sa;
-    int found_listener = 0;
 
     /* Walk the old listeners list and compare it to the secure
        listeners list and remove any secure listener records that
@@ -896,8 +890,6 @@ static int isSecureUpgraded (const request_rec *r)
 
 static int nwssl_hook_Fixup(request_rec *r)
 {
-    int i;
-
     if (!isSecure(r) && !isSecureUpgraded(r))
         return DECLINED;
 
index 02ba0a61a38704411390f9dce4a0dedf2b5fc9f9..ad87936c4604cb39f58e3280105f6d83130371b9 100644 (file)
@@ -885,7 +885,6 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in)
          * buckets and use their length to calculate the size
          */
         int all_buckets_here=0;
-        int unresolved_length = 0;
         size=0;
         for (e = APR_BRIGADE_FIRST(in);
              e != APR_BRIGADE_SENTINEL(in);
@@ -896,7 +895,6 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in)
                 break;
             }
             if (APR_BUCKET_IS_FLUSH(e)) {
-                unresolved_length = 1;
                 continue;
             }
             if (e->length == (apr_size_t)-1) {
index f4461b984d372a730b2d625d48db139d36ed3332..081d72440330cc94d66cfbad9f11b736b2cd0968 100644 (file)
@@ -1984,7 +1984,6 @@ static int dav_method_propfind(request_rec *r)
     dav_error *err;
     int result;
     apr_xml_doc *doc;
-    const apr_xml_elem *child;
     dav_walker_ctx ctx = { { 0 } };
     dav_response *multi_status;
 
@@ -2035,15 +2034,14 @@ static int dav_method_propfind(request_rec *r)
 
     /* ### validate that only one of these three elements is present */
 
-    if (doc == NULL
-        || (child = dav_find_child(doc->root, "allprop")) != NULL) {
+    if (doc == NULL || dav_find_child(doc->root, "allprop") != NULL) {
         /* note: no request body implies allprop */
         ctx.propfind_type = DAV_PROPFIND_IS_ALLPROP;
     }
-    else if ((child = dav_find_child(doc->root, "propname")) != NULL) {
+    else if (dav_find_child(doc->root, "propname") != NULL) {
         ctx.propfind_type = DAV_PROPFIND_IS_PROPNAME;
     }
-    else if ((child = dav_find_child(doc->root, "prop")) != NULL) {
+    else if (dav_find_child(doc->root, "prop") != NULL) {
         ctx.propfind_type = DAV_PROPFIND_IS_PROP;
     }
     else {
index 16dc6626336c42b1688b29566af972d830397ce7..3970c836e74b98bb0e4f80b64cac202a319b5a44 100644 (file)
@@ -133,16 +133,16 @@ static int filter_init(ap_filter_t *f)
 static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter)
 {
     ap_filter_provider_t *provider;
-    const char *str = NULL;
-    char *str1;
     int match;
     int err = 0;
     unsigned int proto_flags;
     request_rec *r = f->r;
     harness_ctx *ctx = f->ctx;
     provider_ctx *pctx;
+#ifndef NO_PROTOCOL
     mod_filter_ctx *rctx = ap_get_module_config(r->request_config,
                                                 &filter_module);
+#endif
 
     /* Check registered providers in order */
     for (provider = filter->providers; provider; provider = provider->next) {
@@ -178,9 +178,10 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter)
                 }
 
                 if (proto_flags & AP_FILTER_PROTO_TRANSFORM) {
-                    str = apr_table_get(r->headers_out, "Cache-Control");
+                    const char *str = apr_table_get(r->headers_out,
+                                                    "Cache-Control");
                     if (str) {
-                        str1 = apr_pstrdup(r->pool, str);
+                        char *str1 = apr_pstrdup(r->pool, str);
                         ap_str_tolower(str1);
                         if (strstr(str1, "no-transform")) {
                             /* can't use this provider; try next */
@@ -235,8 +236,10 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter)
 static apr_status_t filter_harness(ap_filter_t *f, apr_bucket_brigade *bb)
 {
     apr_status_t ret;
+#ifndef NO_PROTOCOL
     const char *cachecontrol;
     char *str;
+#endif
     harness_ctx *ctx = f->ctx;
     ap_filter_rec_t *filter = f->frec;
 
index 2931b46b017c1df3ed2871b75144d9b95d82ec68..3921787633e659f11739f4c23b098ce35a2fc077 100644 (file)
@@ -3069,10 +3069,6 @@ static apr_status_t includes_filter(ap_filter_t *f, apr_bucket_brigade *b)
 
 static int include_fixup(request_rec *r)
 {
-    include_dir_config *conf;
-
-    conf = ap_get_module_config(r->per_dir_config, &include_module);
-
     if (r->handler && (strcmp(r->handler, "server-parsed") == 0))
     {
         if (!r->content_type || !*r->content_type) {
@@ -3088,6 +3084,9 @@ static int include_fixup(request_rec *r)
     }
 #else
     {
+        include_dir_config *conf = ap_get_module_config(r->per_dir_config,
+                                                        &include_module);
+
         if (conf->xbithack == XBITHACK_OFF) {
             return DECLINED;
         }
index 51a7ec9d5a783e7a09bfbb425f64c71ca898b4c9..a0f170bdb0407a9fcb4b5f554a27fa5ceaa27037 100644 (file)
@@ -142,7 +142,6 @@ char *sed_compile(sed_commands_t *commands, sed_comp_args *compargs,
     int lc;
     int i, cflg;
     int iflag; /* used for non-ascii characters in brackets */
-    int nodelim = 0;
     char *sp = commands->cp;
     int regerrno = 0;
 
@@ -150,7 +149,6 @@ char *sed_compile(sed_commands_t *commands, sed_comp_args *compargs,
     if ((c = GETC()) == eof || c == '\n') {
         if (c == '\n') {
             UNGETC(c);
-            nodelim = 1;
         }
         commands->cp = sp;
         goto out;
index 3fad127e68b84cb07364e10e3cc7985db91c610a..3e8fdb52938204fc8ca59aadad157c40e9e10a86 100644 (file)
@@ -517,7 +517,6 @@ static void dump_header_to_log(request_rec *r, unsigned char fheader[],
 
     while (posn < length) {
         unsigned char c = fheader[posn]; 
-        char hexval[3];
 
         if (i >= 20) {
             i = 0;
index a6e8682399f91fb0e6e70f864e745dff3508dc23..abc8de483107c7b8fd3cdc76bab1ed25232fb39f 100644 (file)
@@ -59,10 +59,11 @@ APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(proxy, PROXY, int, create_req,
 /* already called in the knowledge that the characters are hex digits */
 PROXY_DECLARE(int) ap_proxy_hex2c(const char *x)
 {
-    int i, ch;
+    int i;
 
 #if !APR_CHARSET_EBCDIC
-    ch = x[0];
+    int ch = x[0];
+
     if (apr_isdigit(ch)) {
         i = ch - '0';
     }