From: Stefan Fritsch Date: Tue, 3 Aug 2010 22:12:19 +0000 (+0000) Subject: remove more unused variables X-Git-Tag: 2.3.7~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a527986832e89ad468e4288508374d890b117df3;p=thirdparty%2Fapache%2Fhttpd.git remove more unused variables revove some obsolete comments netware file is untested git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982050 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 6c3e91deb19..6e6fc0ca7f0 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -357,14 +357,12 @@ static apr_status_t sock_writev(int fd, request_rec *r, int count, ...) int rc; struct iovec *vec; int i; - int total_bytes = 0; vec = (struct iovec *)apr_palloc(r->pool, count * sizeof(struct iovec)); va_start(ap, count); for (i = 0; i < count; i++) { vec[i].iov_base = va_arg(ap, caddr_t); vec[i].iov_len = va_arg(ap, apr_size_t); - total_bytes += vec[i].iov_len; } va_end(ap); diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c index e4226a6dce2..92c011e9efa 100644 --- a/modules/slotmem/mod_slotmem_shm.c +++ b/modules/slotmem/mod_slotmem_shm.c @@ -184,7 +184,6 @@ static void restore_slotmem(void *ptr, const char *name, apr_size_t size, static apr_status_t cleanup_slotmem(void *param) { ap_slotmem_instance_t **mem = param; - apr_status_t rv; apr_pool_t *pool = NULL; if (*mem) { @@ -192,7 +191,7 @@ static apr_status_t cleanup_slotmem(void *param) pool = next->gpool; while (next) { store_slotmem(next); - rv = apr_shm_destroy((apr_shm_t *)next->shm); + apr_shm_destroy((apr_shm_t *)next->shm); next = next->next; } apr_pool_destroy(pool); diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index 5ee27f47b17..e5ac041339e 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -1839,14 +1839,12 @@ long ssl_io_data_cb(BIO *bio, int cmd, SSL *ssl; conn_rec *c; server_rec *s; - SSLSrvConfigRec *sc; if ((ssl = (SSL *)BIO_get_callback_arg(bio)) == NULL) return rc; if ((c = (conn_rec *)SSL_get_app_data(ssl)) == NULL) return rc; s = mySrvFromConn(c); - sc = mySrvConfig(s); if ( cmd == (BIO_CB_WRITE|BIO_CB_RETURN) || cmd == (BIO_CB_READ |BIO_CB_RETURN) ) { diff --git a/modules/ssl/ssl_engine_pphrase.c b/modules/ssl/ssl_engine_pphrase.c index c7fc5de65eb..4f431c7f0dc 100644 --- a/modules/ssl/ssl_engine_pphrase.c +++ b/modules/ssl/ssl_engine_pphrase.c @@ -159,7 +159,6 @@ void ssl_pphrase_Handle(server_rec *s, apr_pool_t *p) char *an; char *cp; apr_time_t pkey_mtime = 0; - int isterm = 1; apr_status_t rv; /* * Start with a fresh pass phrase array @@ -419,7 +418,7 @@ void ssl_pphrase_Handle(server_rec *s, apr_pool_t *p) */ if (cpPassPhraseCur == NULL) { if (nPassPhraseDialogCur && pkey_mtime && - !(isterm = isatty(fileno(stdout)))) /* XXX: apr_isatty() */ + !isatty(fileno(stdout))) /* XXX: apr_isatty() */ { ap_log_error(APLOG_MARK, APLOG_ERR, 0, pServ, diff --git a/modules/ssl/ssl_engine_rand.c b/modules/ssl/ssl_engine_rand.c index a4b7ca50bd8..a45012a3097 100644 --- a/modules/ssl/ssl_engine_rand.c +++ b/modules/ssl/ssl_engine_rand.c @@ -45,19 +45,17 @@ int ssl_rand_seed(server_rec *s, apr_pool_t *p, ssl_rsctx_t nCtx, char *prefix) ssl_randseed_t *pRandSeeds; ssl_randseed_t *pRandSeed; unsigned char stackdata[256]; - int nReq, nDone; + int nDone; apr_file_t *fp; int i, n, l; mc = myModConfig(s); - nReq = 0; nDone = 0; apRandSeed = mc->aRandSeed; pRandSeeds = (ssl_randseed_t *)apRandSeed->elts; for (i = 0; i < apRandSeed->nelts; i++) { pRandSeed = &pRandSeeds[i]; if (pRandSeed->nCtx == nCtx) { - nReq += pRandSeed->nBytes; if (pRandSeed->nSrc == SSL_RSSRC_FILE) { /* * seed in contents of an external file diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 371eb6620d2..df320b56677 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -1155,7 +1155,6 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) ap_server_conf, "event_loop: unexpected state %d", cs->state); - AP_DEBUG_ASSERT(0); } apr_thread_mutex_lock(timeout_mutex); diff --git a/server/mpm/event/fdqueue.c b/server/mpm/event/fdqueue.c index 10015b7d39d..7d7d4d019e3 100644 --- a/server/mpm/event/fdqueue.c +++ b/server/mpm/event/fdqueue.c @@ -165,7 +165,6 @@ apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t * queue_info) queue_info->idlers_mutex); if (rv != APR_SUCCESS) { apr_status_t rv2; - AP_DEBUG_ASSERT(0); rv2 = apr_thread_mutex_unlock(queue_info->idlers_mutex); if (rv2 != APR_SUCCESS) { return rv2; diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index 482509737b0..0387f028fca 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -345,7 +345,6 @@ void worker_main(void *arg) { ap_listen_rec *lr, *first_lr, *last_lr = NULL; apr_pool_t *ptrans; - apr_pool_t *pbucket; apr_allocator_t *allocator; apr_bucket_alloc_t *bucket_alloc; conn_rec *current_conn; @@ -617,7 +616,6 @@ static int hold_off_on_exponential_spawning; static void perform_idle_server_maintenance(apr_pool_t *p) { int i; - int to_kill; int idle_count; worker_score *ws; int free_length; @@ -628,7 +626,6 @@ static void perform_idle_server_maintenance(apr_pool_t *p) /* initialize the free_list */ free_length = 0; - to_kill = -1; idle_count = 0; last_non_dead = -1; total_non_dead = 0; @@ -660,13 +657,6 @@ static void perform_idle_server_maintenance(apr_pool_t *p) */ if (status <= WORKER_READY) { ++ idle_count; - /* always kill the highest numbered child if we have to... - * no really well thought out reason ... other than observing - * the server behaviour under linux where lower numbered children - * tend to service more hits (and hence are more likely to have - * their data in cpu caches). - */ - to_kill = i; } ++total_non_dead; @@ -978,13 +968,10 @@ static int netware_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) static int netware_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp) { - int debug; char *addrname = NULL; mpm_state = AP_MPMQ_STARTING; - debug = ap_exists_config_define("DEBUG"); - is_graceful = 0; ap_my_pid = getpid(); addrname = getaddressspacename (NULL, NULL); diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 307e81252fb..89e8f28aa72 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -800,7 +800,6 @@ static int hold_off_on_exponential_spawning; static void perform_idle_server_maintenance(apr_pool_t *p) { int i; - int to_kill; int idle_count; worker_score *ws; int free_length; @@ -811,7 +810,6 @@ static void perform_idle_server_maintenance(apr_pool_t *p) /* initialize the free_list */ free_length = 0; - to_kill = -1; idle_count = 0; last_non_dead = -1; total_non_dead = 0; @@ -839,13 +837,6 @@ static void perform_idle_server_maintenance(apr_pool_t *p) */ if (status <= SERVER_READY) { ++ idle_count; - /* always kill the highest numbered child if we have to... - * no really well thought out reason ... other than observing - * the server behaviour under linux where lower numbered children - * tend to service more hits (and hence are more likely to have - * their data in cpu caches). - */ - to_kill = i; } ++total_non_dead; diff --git a/server/mpm_common.c b/server/mpm_common.c index 3f80625e195..56bc70c8754 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -264,7 +264,6 @@ int ap_coredumpdir_configured; const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy, const char *arg) { - apr_status_t rv; apr_finfo_t finfo; const char *fname; const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); @@ -277,7 +276,7 @@ const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy, return apr_pstrcat(cmd->pool, "Invalid CoreDumpDirectory path ", arg, NULL); } - if ((rv = apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool)) != APR_SUCCESS) { + if (apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS) { return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, " does not exist", NULL); } diff --git a/server/mpm_unix.c b/server/mpm_unix.c index a9cde5c0bb4..81abbb1a2ad 100644 --- a/server/mpm_unix.c +++ b/server/mpm_unix.c @@ -626,7 +626,6 @@ int ap_signal_server(int *exit_status, apr_pool_t *pconf) apr_status_t rv; pid_t otherpid; int running = 0; - int have_pid_file = 0; const char *status; *exit_status = 0; @@ -644,7 +643,6 @@ int ap_signal_server(int *exit_status, apr_pool_t *pconf) status = "httpd (no pid file) not running"; } else { - have_pid_file = 1; if (kill(otherpid, 0) == 0) { running = 1; status = apr_psprintf(pconf, @@ -715,12 +713,10 @@ void ap_mpm_rewrite_args(process_rec *process) apr_getopt_t *opt; char optbuf[3]; const char *optarg; - int fixed_args; mpm_new_argv = apr_array_make(process->pool, process->argc, sizeof(const char **)); *(const char **)apr_array_push(mpm_new_argv) = process->argv[0]; - fixed_args = mpm_new_argv->nelts; apr_getopt_init(&opt, process->pool, process->argc, process->argv); opt->errfn = NULL; optbuf[0] = '-'; diff --git a/server/request.c b/server/request.c index 7ce9b80cd49..494099a392b 100644 --- a/server/request.c +++ b/server/request.c @@ -398,7 +398,6 @@ static walk_cache_t *prep_walk_cache(apr_size_t t, request_rec *r) static int resolve_symlink(char *d, apr_finfo_t *lfi, int opts, apr_pool_t *p) { apr_finfo_t fi; - int res; const char *savename; if (!(opts & (OPT_SYM_OWNER | OPT_SYM_LINKS))) { @@ -410,9 +409,9 @@ static int resolve_symlink(char *d, apr_finfo_t *lfi, int opts, apr_pool_t *p) /* if OPT_SYM_OWNER is unset, we only need to check target accessible */ if (!(opts & OPT_SYM_OWNER)) { - if ((res = apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME - | APR_FINFO_LINK), p)) - != APR_SUCCESS) { + if (apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME | APR_FINFO_LINK), p) + != APR_SUCCESS) + { return HTTP_FORBIDDEN; } @@ -431,15 +430,14 @@ static int resolve_symlink(char *d, apr_finfo_t *lfi, int opts, apr_pool_t *p) * owner of the symlink, then get the info of the target. */ if (!(lfi->valid & APR_FINFO_OWNER)) { - if ((res = apr_stat(lfi, d, - lfi->valid | APR_FINFO_LINK | APR_FINFO_OWNER, p)) - != APR_SUCCESS) { + if (apr_stat(lfi, d, lfi->valid | APR_FINFO_LINK | APR_FINFO_OWNER, p) + != APR_SUCCESS) + { return HTTP_FORBIDDEN; } } - if ((res = apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME), p)) - != APR_SUCCESS) { + if (apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME), p) != APR_SUCCESS) { return HTTP_FORBIDDEN; } diff --git a/server/util_ebcdic.c b/server/util_ebcdic.c index dbcdfd4693a..df5d4fb9661 100644 --- a/server/util_ebcdic.c +++ b/server/util_ebcdic.c @@ -29,7 +29,6 @@ APLOG_USE_MODULE(core); apr_status_t ap_init_ebcdic(apr_pool_t *pool) { apr_status_t rv; - char buf[80]; rv = apr_xlate_open(&ap_hdrs_to_ascii, "ISO-8859-1", APR_DEFAULT_CHARSET, pool); if (rv) {