summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2011-04-30 23:18:58 +0200
committerJeff Trawick <trawick@apache.org>2011-04-30 23:18:58 +0200
commit782c7118932094c4a084bd9891cb0da82413700e (patch)
treec3c8773de72220e32ab5900e4a297d04fbfd79ce
parentFollow on to 1057048: (diff)
downloadapache2-782c7118932094c4a084bd9891cb0da82413700e.tar.xz
apache2-782c7118932094c4a084bd9891cb0da82413700e.zip
fix some dead assignments found by the clang analyzer
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1098162 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/cluster/mod_heartmonitor.c5
-rw-r--r--modules/filters/mod_deflate.c2
-rw-r--r--modules/generators/mod_autoindex.c4
-rw-r--r--modules/generators/mod_cgid.c7
-rw-r--r--modules/mappers/mod_negotiation.c1
-rw-r--r--modules/mappers/mod_rewrite.c2
-rw-r--r--modules/mappers/mod_vhost_alias.c2
-rw-r--r--modules/metadata/mod_expires.c3
-rw-r--r--modules/metadata/mod_setenvif.c2
-rw-r--r--modules/metadata/mod_unique_id.c1
-rw-r--r--server/core_filters.c5
-rw-r--r--support/htcacheclean.c1
12 files changed, 8 insertions, 27 deletions
diff --git a/modules/cluster/mod_heartmonitor.c b/modules/cluster/mod_heartmonitor.c
index 4c80e2d75c..822a2cd33f 100644
--- a/modules/cluster/mod_heartmonitor.c
+++ b/modules/cluster/mod_heartmonitor.c
@@ -252,8 +252,9 @@ static apr_status_t hm_file_update_stat(hm_ctx_t *ctx, hm_server_t *s, apr_pool_
char *t;
apr_table_t *hbt = apr_table_make(pool, 10);
apr_bucket_alloc_t *ba = apr_bucket_alloc_create(pool);
- apr_bucket_brigade *bb = apr_brigade_create(pool, ba);
- apr_bucket_brigade *tmpbb = apr_brigade_create(pool, ba);
+ apr_bucket_brigade *bb;
+ apr_bucket_brigade *tmpbb;
+
rv = apr_file_info_get(&fi, APR_FINFO_SIZE | APR_FINFO_MTIME, fpin);
if (rv) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s,
diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c
index 254cb0e06a..4776fac7b0 100644
--- a/modules/filters/mod_deflate.c
+++ b/modules/filters/mod_deflate.c
@@ -540,7 +540,7 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
/* skip parameters, XXX: ;q=foo evaluation? */
while (*accepts == ';') {
++accepts;
- token = ap_get_token(r->pool, &accepts, 1);
+ ap_get_token(r->pool, &accepts, 1);
}
/* retrieve next token */
diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c
index 8416677267..fcb0a95ee6 100644
--- a/modules/generators/mod_autoindex.c
+++ b/modules/generators/mod_autoindex.c
@@ -1504,7 +1504,6 @@ static void output_directories(struct ent **ar, int n,
{
int x;
apr_size_t rv;
- char *name = r->uri;
char *tp;
int static_columns = !!(autoindex_opts & SUPPRESS_COLSORT);
apr_pool_t *scratch;
@@ -1515,9 +1514,6 @@ static void output_directories(struct ent **ar, int n,
char *breakrow = "";
apr_pool_create(&scratch, r->pool);
- if (name[0] == '\0') {
- name = "/";
- }
name_width = d->name_width;
desc_width = d->desc_width;
diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c
index 91d290e9ce..5f3b2c4c88 100644
--- a/modules/generators/mod_cgid.c
+++ b/modules/generators/mod_cgid.c
@@ -1444,13 +1444,6 @@ static int cgid_handler(request_rec *r)
apr_os_pipe_put_ex(&tempsock, &sd, 1, r->pool);
apr_pool_cleanup_kill(r->pool, (void *)((long)sd), close_unix_socket);
- if ((argv0 = strrchr(r->filename, '/')) != NULL) {
- argv0++;
- }
- else {
- argv0 = r->filename;
- }
-
/* Transfer any put/post args, CERN style...
* Note that we already ignore SIGPIPE in the core server.
*/
diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c
index 5073968eaa..101beeb27d 100644
--- a/modules/mappers/mod_negotiation.c
+++ b/modules/mappers/mod_negotiation.c
@@ -1583,7 +1583,6 @@ static void set_language_quality(negotiation_state *neg, var_rec *variant)
p = NULL;
bestthistag = NULL;
longest_lang_range_len = 0;
- alen = 0;
/* lang is the variant's language-tag, which is the one
* we are allowed to use the prefix of in HTTP/1.1
diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c
index 14027d246f..27b7cd7d23 100644
--- a/modules/mappers/mod_rewrite.c
+++ b/modules/mappers/mod_rewrite.c
@@ -1479,7 +1479,6 @@ static char *lookup_map_program(request_rec *r, apr_file_t *fpin,
}
if (nbytes == 1 && !found_nl) {
- i = 0;
continue;
}
}
@@ -4254,7 +4253,6 @@ static int apply_rewrite_list(request_rec *r, apr_array_header_t *rewriterules,
while ( i < rewriterules->nelts
&& s > 0) {
i++;
- p = &entries[i];
s--;
}
}
diff --git a/modules/mappers/mod_vhost_alias.c b/modules/mappers/mod_vhost_alias.c
index 2ea7380a14..a2bb7a80c9 100644
--- a/modules/mappers/mod_vhost_alias.c
+++ b/modules/mappers/mod_vhost_alias.c
@@ -306,7 +306,7 @@ static void vhost_alias_interpolate(request_rec *r, const char *name,
continue;
}
/* deal with %-N+.-M+ -- syntax is already checked */
- N = M = 0; /* value */
+ M = 0; /* value */
Np = Mp = 0; /* is there a plus? */
Nd = Md = 0; /* is there a dash? */
if (*map == '-') ++map, Nd = 1;
diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c
index ebf02c8b8b..f8a9946868 100644
--- a/modules/metadata/mod_expires.c
+++ b/modules/metadata/mod_expires.c
@@ -217,7 +217,7 @@ static char *check_code(apr_pool_t *p, const char *code, char **real_code)
char base = 'X';
int modifier = 0;
int num = 0;
- int factor = 0;
+ int factor;
/* 0.0.4 compatibility?
*/
@@ -274,7 +274,6 @@ static char *check_code(apr_pool_t *p, const char *code, char **real_code)
return apr_pstrcat(p, "bad expires code, missing <type>", NULL);
}
- factor = 0;
if (!strncasecmp(word, "years", 1)) {
factor = 60 * 60 * 24 * 365;
}
diff --git a/modules/metadata/mod_setenvif.c b/modules/metadata/mod_setenvif.c
index 48ffd3fb49..53f78b4811 100644
--- a/modules/metadata/mod_setenvif.c
+++ b/modules/metadata/mod_setenvif.c
@@ -453,7 +453,6 @@ static const char *add_setenvifexpr(cmd_parms *cmd, void *mconfig,
char *expr;
sei_cfg_rec *sconf;
sei_entry *new;
- sei_entry *entries;
const char *err;
/*
@@ -465,7 +464,6 @@ static const char *add_setenvifexpr(cmd_parms *cmd, void *mconfig,
? (sei_cfg_rec *) mconfig
: (sei_cfg_rec *) ap_get_module_config(cmd->server->module_config,
&setenvif_module);
- entries = (sei_entry *) sconf->conditionals->elts;
/* get expr */
expr = ap_getword_conf(cmd->pool, &args);
if (!*expr) {
diff --git a/modules/metadata/mod_unique_id.c b/modules/metadata/mod_unique_id.c
index fa2d871e41..7b67b557c7 100644
--- a/modules/metadata/mod_unique_id.c
+++ b/modules/metadata/mod_unique_id.c
@@ -307,7 +307,6 @@ static const char *gen_unique_id(const request_rec *r)
/* we'll use a temporal buffer to avoid uuencoding the possible internal
* paddings of the original structure */
x = (unsigned char *) &paddedbuf;
- y = (unsigned char *) &new_unique_id;
k = 0;
for (i = 0; i < UNIQUE_ID_REC_MAX; i++) {
y = ((unsigned char *) &new_unique_id) + unique_id_rec_offset[i];
diff --git a/server/core_filters.c b/server/core_filters.c
index a1b670c25b..ec969fcffe 100644
--- a/server/core_filters.c
+++ b/server/core_filters.c
@@ -599,7 +599,6 @@ static apr_status_t send_brigade_nonblocking(apr_socket_t *s,
for (bucket = APR_BRIGADE_FIRST(bb);
bucket != APR_BRIGADE_SENTINEL(bb);
bucket = next) {
- int did_sendfile = 0;
next = APR_BUCKET_NEXT(bucket);
#if APR_HAS_SENDFILE
if (APR_BUCKET_IS_FILE(bucket)) {
@@ -613,7 +612,6 @@ static apr_status_t send_brigade_nonblocking(apr_socket_t *s,
if ((apr_file_flags_get(fd) & APR_SENDFILE_ENABLED) &&
(bucket->length >= AP_MIN_SENDFILE_BYTES)) {
- did_sendfile = 1;
if (nvec > 0) {
(void)apr_socket_opt_set(s, APR_TCP_NOPUSH, 1);
rv = writev_nonblocking(s, vec, nvec, bb, bytes_written, c);
@@ -634,7 +632,8 @@ static apr_status_t send_brigade_nonblocking(apr_socket_t *s,
}
}
#endif /* APR_HAS_SENDFILE */
- if (!did_sendfile && !APR_BUCKET_IS_METADATA(bucket)) {
+ /* didn't sendfile */
+ if (!APR_BUCKET_IS_METADATA(bucket)) {
const char *data;
apr_size_t length;
rv = apr_bucket_read(bucket, &data, &length, APR_BLOCK_READ);
diff --git a/support/htcacheclean.c b/support/htcacheclean.c
index 0ce21cdbc0..567d0856d7 100644
--- a/support/htcacheclean.c
+++ b/support/htcacheclean.c
@@ -614,7 +614,6 @@ static int process_dir(char *path, apr_pool_t *pool, apr_off_t *nodes)
apr_pool_create(&p, pool);
h = apr_hash_make(p);
fd = NULL;
- skip = 0;
deviation = MAXDEVIATION * APR_USEC_PER_SEC;
if (apr_dir_open(&dir, path, p) != APR_SUCCESS) {