From c62375851b2739024285b2c3b23000408e1ed098 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 8 Sep 2015 11:10:16 +0000 Subject: [PATCH] Merge r1700317, r1700318, r1700319, r1700320, r1700321, r1700322, r1700326, r1700328, r1700330, r1700331, r1700332, r1700334, r1700336, r1700338 from trunk: Fix some spurious ident spotted by sparse Silence a sparse warning about inconsistent indenting Silence a sparse warning about inconsistent indenting Silence a sparse warning about inconsistent indenting Silence a sparse warning about inconsistent indenting Silence a sparse warning about inconsistent indenting Silence a sparse warning about inconsistent indenting + some minor style issues Remove useless line Silence a sparse warning about inconsistent indenting + some minor style issues Silence a sparse warning about inconsistent indenting + some minor style issues Silence a sparse warning about inconsistent indenting + some minor style issues Fix some spurious ident spotted by sparse Silence a sparse warning about inconsistent indenting + some minor style issues Silence a sparse warning about inconsistent indenting + some minor style issues Submitted by: jailletc36 Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1701772 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 20 -------------------- modules/cache/mod_cache_disk.c | 14 ++++++++------ modules/cache/mod_cache_socache.c | 1 - modules/ldap/util_ldap.c | 24 ++++++++++++------------ modules/loggers/mod_log_config.c | 9 +++++---- modules/metadata/mod_cern_meta.c | 4 ++-- modules/proxy/ajp_header.c | 31 +++++++++++++++++-------------- modules/proxy/ajp_msg.c | 2 +- modules/proxy/mod_proxy_ftp.c | 2 +- server/log.c | 6 +++--- server/request.c | 7 +++---- support/ab.c | 2 +- support/htdbm.c | 2 +- support/logresolve.c | 8 ++++---- support/passwd_common.c | 6 +++--- 15 files changed, 61 insertions(+), 77 deletions(-) diff --git a/STATUS b/STATUS index 58e436e756..1796e177b2 100644 --- a/STATUS +++ b/STATUS @@ -109,26 +109,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) Fix some spurious and/or inconsistant indent spotted by sparse - Fix some minor style issues. - trunk: http://svn.apache.org/r1700317 - http://svn.apache.org/r1700318 - http://svn.apache.org/r1700319 - http://svn.apache.org/r1700320 - http://svn.apache.org/r1700321 - http://svn.apache.org/r1700322 - http://svn.apache.org/r1700326 - http://svn.apache.org/r1700328 - http://svn.apache.org/r1700330 - http://svn.apache.org/r1700331 - http://svn.apache.org/r1700332 - http://svn.apache.org/r1700334 - http://svn.apache.org/r1700336 - http://svn.apache.org/r1700338 - 2.4.x: http://people.apache.org/~jailletc36/sparse.diff - +1: jailletc36, ylavic, covener - jailletc36: To ease review http://people.apache.org/~jailletc36/sparse_nospace.diff - is the same file as above but generated using svn diff -x --ignore-all-space PATCHES PROPOSED TO BACKPORT FROM TRUNK: diff --git a/modules/cache/mod_cache_disk.c b/modules/cache/mod_cache_disk.c index ddf6431440..14dee81ff7 100644 --- a/modules/cache/mod_cache_disk.c +++ b/modules/cache/mod_cache_disk.c @@ -185,7 +185,8 @@ static apr_status_t file_cache_el_final(disk_cache_conf *conf, disk_cache_file_t return rv; } -static apr_status_t file_cache_temp_cleanup(void *dummy) { +static apr_status_t file_cache_temp_cleanup(void *dummy) +{ disk_cache_file_t *file = (disk_cache_file_t *)dummy; /* clean up the temporary file */ @@ -293,7 +294,7 @@ static const char* regen_key(apr_pool_t *p, apr_table_t *headers, * quoted-string expectation-extensions. */ - for(i=0, k=0; i < varray->nelts; i++) { + for (i=0, k=0; i < varray->nelts; i++) { header = apr_table_get(headers, elts[i]); if (!header) { header = ""; @@ -738,7 +739,7 @@ static apr_status_t read_array(request_rec *r, apr_array_header_t* arr, break; } - *((const char **) apr_array_push(arr)) = apr_pstrdup(r->pool, w); + *((const char **) apr_array_push(arr)) = apr_pstrdup(r->pool, w); } return APR_SUCCESS; @@ -1045,7 +1046,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r) APR_BUFFERED | APR_EXCL, dobj->hdrs.pool); if (rv != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, APLOGNO(00725) + ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, APLOGNO(00725) "could not create header file %s", dobj->hdrs.tempfile); return rv; @@ -1332,7 +1333,7 @@ static apr_status_t commit_entity(cache_handle_t *h, request_rec *r) if (!dobj->disk_info.header_only) { rv = file_cache_el_final(conf, &dobj->data, r); } - else if (dobj->data.file){ + else if (dobj->data.file) { rv = apr_file_remove(dobj->data.file, dobj->data.pool); } } @@ -1382,7 +1383,8 @@ static void *create_dir_config(apr_pool_t *p, char *dummy) return dconf; } -static void *merge_dir_config(apr_pool_t *p, void *basev, void *addv) { +static void *merge_dir_config(apr_pool_t *p, void *basev, void *addv) +{ disk_cache_dir_conf *new = (disk_cache_dir_conf *) apr_pcalloc(p, sizeof(disk_cache_dir_conf)); disk_cache_dir_conf *add = (disk_cache_dir_conf *) addv; disk_cache_dir_conf *base = (disk_cache_dir_conf *) basev; diff --git a/modules/cache/mod_cache_socache.c b/modules/cache/mod_cache_socache.c index c5b49ab998..6761bf7e2e 100644 --- a/modules/cache/mod_cache_socache.c +++ b/modules/cache/mod_cache_socache.c @@ -191,7 +191,6 @@ static apr_status_t read_table(cache_handle_t *handle, request_rec *r, apr_size_t *slider) { apr_size_t key = *slider, colon = 0, len = 0; - ; while (*slider < buffer_len) { if (buffer[*slider] == ':') { diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 156e131d2c..52acafb06a 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -209,8 +209,9 @@ static apr_status_t uldap_connection_unbind(void *param) * * The caller should hold the lock for this connection */ -static apr_status_t util_ldap_connection_remove (void *param) { - util_ldap_connection_t *ldc = param, *l = NULL, *prev = NULL; +static apr_status_t util_ldap_connection_remove (void *param) +{ + util_ldap_connection_t *ldc = param, *l = NULL, *prev = NULL; util_ldap_state_t *st; if (!ldc) return APR_SUCCESS; @@ -2670,16 +2671,17 @@ static const char *util_ldap_set_referral_hop_limit(cmd_parms *cmd, return NULL; } -static void *util_ldap_create_dir_config(apr_pool_t *p, char *d) { - util_ldap_config_t *dc = - (util_ldap_config_t *) apr_pcalloc(p,sizeof(util_ldap_config_t)); +static void *util_ldap_create_dir_config(apr_pool_t *p, char *d) +{ + util_ldap_config_t *dc = + (util_ldap_config_t *) apr_pcalloc(p,sizeof(util_ldap_config_t)); - /* defaults are AP_LDAP_CHASEREFERRALS_ON and AP_LDAP_DEFAULT_HOPLIMIT */ - dc->client_certs = apr_array_make(p, 10, sizeof(apr_ldap_opt_tls_cert_t)); - dc->ChaseReferrals = AP_LDAP_CHASEREFERRALS_ON; - dc->ReferralHopLimit = AP_LDAP_HOPLIMIT_UNSET; + /* defaults are AP_LDAP_CHASEREFERRALS_ON and AP_LDAP_DEFAULT_HOPLIMIT */ + dc->client_certs = apr_array_make(p, 10, sizeof(apr_ldap_opt_tls_cert_t)); + dc->ChaseReferrals = AP_LDAP_CHASEREFERRALS_ON; + dc->ReferralHopLimit = AP_LDAP_HOPLIMIT_UNSET; - return dc; + return dc; } static const char *util_ldap_set_op_timeout(cmd_parms *cmd, @@ -2891,7 +2893,6 @@ static void *util_ldap_merge_config(apr_pool_t *p, void *basev, static apr_status_t util_ldap_cleanup_module(void *data) { - server_rec *s = data; util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config( s->module_config, &ldap_module); @@ -2901,7 +2902,6 @@ static apr_status_t util_ldap_cleanup_module(void *data) } return APR_SUCCESS; - } static int util_ldap_pre_config(apr_pool_t *pconf, apr_pool_t *plog, diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index d5687c2446..4dd140f60a 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -1172,12 +1172,13 @@ static int config_log_transaction(request_rec *r, config_log_state *cls, if (!log_writer) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00645) "log writer isn't correctly setup"); - return HTTP_INTERNAL_SERVER_ERROR; + return HTTP_INTERNAL_SERVER_ERROR; } rv = log_writer(r, cls->log_writer, strs, strl, format->nelts, len); - if (rv != APR_SUCCESS) - ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, APLOGNO(00646) "Error writing to %s", - cls->fname); + if (rv != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, APLOGNO(00646) + "Error writing to %s", cls->fname); + } return OK; } diff --git a/modules/metadata/mod_cern_meta.c b/modules/metadata/mod_cern_meta.c index f06c464c1d..09a41e1cc6 100644 --- a/modules/metadata/mod_cern_meta.c +++ b/modules/metadata/mod_cern_meta.c @@ -246,7 +246,7 @@ static int scan_meta_file(request_rec *r, apr_file_t *f) char *endp = l + strlen(l) - 1; while (endp > l && apr_isspace(*endp)) - *endp-- = '\0'; + *endp-- = '\0'; tmp = apr_pstrdup(r->pool, l); ap_content_type_tolower(tmp); @@ -332,7 +332,7 @@ static int add_cern_meta_data(request_rec *r) */ rr = ap_sub_req_lookup_file(metafilename, r, NULL); if (rr->status != HTTP_OK) { - ap_destroy_sub_req(rr); + ap_destroy_sub_req(rr); return DECLINED; } ap_destroy_sub_req(rr); diff --git a/modules/proxy/ajp_header.c b/modules/proxy/ajp_header.c index edb9d23cac..0ec94ad780 100644 --- a/modules/proxy/ajp_header.c +++ b/modules/proxy/ajp_header.c @@ -37,7 +37,7 @@ static const char *long_res_header_for_sc(int sc) { const char *rc = NULL; sc = sc & 0X00FF; - if(sc <= SC_RES_HEADERS_NUM && sc > 0) { + if (sc <= SC_RES_HEADERS_NUM && sc > 0) { rc = response_trans_headers[sc - 1]; } @@ -89,39 +89,39 @@ static int sc_for_req_header(const char *header_name) return UNKNOWN_METHOD; break; case 'C': - if(strcmp(p, "OOKIE2") == 0) + if (strcmp(p, "OOKIE2") == 0) return SC_COOKIE2; else if (strcmp(p, "OOKIE") == 0) return SC_COOKIE; - else if(strcmp(p, "ONNECTION") == 0) + else if (strcmp(p, "ONNECTION") == 0) return SC_CONNECTION; - else if(strcmp(p, "ONTENT-TYPE") == 0) + else if (strcmp(p, "ONTENT-TYPE") == 0) return SC_CONTENT_TYPE; - else if(strcmp(p, "ONTENT-LENGTH") == 0) + else if (strcmp(p, "ONTENT-LENGTH") == 0) return SC_CONTENT_LENGTH; else return UNKNOWN_METHOD; break; case 'H': - if(strcmp(p, "OST") == 0) + if (strcmp(p, "OST") == 0) return SC_HOST; else return UNKNOWN_METHOD; break; case 'P': - if(strcmp(p, "RAGMA") == 0) + if (strcmp(p, "RAGMA") == 0) return SC_PRAGMA; else return UNKNOWN_METHOD; break; case 'R': - if(strcmp(p, "EFERER") == 0) + if (strcmp(p, "EFERER") == 0) return SC_REFERER; else return UNKNOWN_METHOD; break; case 'U': - if(strcmp(p, "SER-AGENT") == 0) + if (strcmp(p, "SER-AGENT") == 0) return SC_USER_AGENT; else return UNKNOWN_METHOD; @@ -548,7 +548,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, rc = ajp_msg_get_uint16(msg, &status); if (rc != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00983) + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00983) "ajp_unmarshal_response: Null status"); return rc; } @@ -561,7 +561,8 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, ap_xlate_proto_from_ascii(ptr, strlen(ptr)); #endif r->status_line = apr_psprintf(r->pool, "%d %s", status, ptr); - } else { + } + else { r->status_line = NULL; } @@ -581,7 +582,8 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, apr_table_do(addit_dammit, save_table, r->headers_out, "Set-Cookie", NULL); r->headers_out = save_table; - } else { + } + else { r->headers_out = NULL; num_headers = 0; } @@ -590,7 +592,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, "ajp_unmarshal_response: Number of headers is = %d", num_headers); - for(i = 0 ; i < (int) num_headers ; i++) { + for (i = 0; i < (int)num_headers; i++) { apr_uint16_t name; const char *stringname; const char *value; @@ -609,7 +611,8 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, name); return AJP_EBAD_HEADER; } - } else { + } + else { name = 0; rc = ajp_msg_get_string(msg, &stringname); if (rc != APR_SUCCESS) { diff --git a/modules/proxy/ajp_msg.c b/modules/proxy/ajp_msg.c index 71bc1dd902..06bee9be7d 100644 --- a/modules/proxy/ajp_msg.c +++ b/modules/proxy/ajp_msg.c @@ -78,7 +78,7 @@ apr_status_t ajp_msg_dump(apr_pool_t *pool, ajp_msg_t *msg, char *err, line_len = AJP_MSG_DUMP_BYTES_PER_LINE; } for (j = 0; j < line_len; j++) { - x = msg->buf[i + j]; + x = msg->buf[i + j]; *current++ = hex_table[x >> 4]; *current++ = hex_table[x & 0x0f]; diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c index 5c689aa1d4..a62a2828b8 100644 --- a/modules/proxy/mod_proxy_ftp.c +++ b/modules/proxy/mod_proxy_ftp.c @@ -172,7 +172,7 @@ static int ftp_check_globbingchars(const char *path) { for ( ; *path; ++path) { if (*path == '\\') - ++path; + ++path; if (*path != '\0' && strchr(FTP_GLOBBING_CHARS, *path) != NULL) return TRUE; } diff --git a/server/log.c b/server/log.c index 03de91a2b2..b9364659a7 100644 --- a/server/log.c +++ b/server/log.c @@ -497,8 +497,8 @@ int ap_open_logs(apr_pool_t *pconf, apr_pool_t *p /* plog */, * as stdin. This in turn would prevent the piped logger from * exiting. */ - apr_file_close(s_main->error_log); - s_main->error_log = stderr_log; + apr_file_close(s_main->error_log); + s_main->error_log = stderr_log; } } /* note that stderr may still need to be replaced with something @@ -624,7 +624,7 @@ static int log_ctime(const ap_errorlog_info *info, const char *arg, int time_len = buflen; int option = AP_CTIME_OPTION_NONE; - while(arg && *arg) { + while (arg && *arg) { switch (*arg) { case 'u': option |= AP_CTIME_OPTION_USEC; break; diff --git a/server/request.c b/server/request.c index 750b15111a..849aad1863 100644 --- a/server/request.c +++ b/server/request.c @@ -568,10 +568,9 @@ static void core_opts_merge(const ap_conf_vector_t *sec, core_opts_t *opts) opts->override_opts = this_dir->override_opts; } - if (this_dir->override_list != NULL) { + if (this_dir->override_list != NULL) { opts->override_list = this_dir->override_list; - } - + } } @@ -614,7 +613,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r) ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00029) "Module bug? Request filename is missing for URI %s", r->uri); - return OK; + return OK; } /* Canonicalize the file path without resolving filename case or aliases diff --git a/support/ab.c b/support/ab.c index 7b13d20222..05f18b0703 100644 --- a/support/ab.c +++ b/support/ab.c @@ -1222,7 +1222,7 @@ static void start_connect(struct connection * c) apr_status_t rv; if (!(started < requests)) - return; + return; c->read = 0; c->bread = 0; diff --git a/support/htdbm.c b/support/htdbm.c index 1cd0591fe6..40a3d23293 100644 --- a/support/htdbm.c +++ b/support/htdbm.c @@ -345,7 +345,7 @@ int main(int argc, const char * const argv[]) case 'n': need_file = 0; cmd = HTDBM_NOFILE; - args_left--; + args_left--; break; case 'l': need_pwd = 0; diff --git a/support/logresolve.c b/support/logresolve.c index b0ba6ec1d1..71dca45243 100644 --- a/support/logresolve.c +++ b/support/logresolve.c @@ -122,7 +122,7 @@ static void usage(void) "Options:" NL " -s Record statistics to STATFILE when finished." NL NL - " -c Perform double lookups when resolving IP addresses." NL, + " -c Perform double lookups when resolving IP addresses." NL, shortname, shortname); exit(1); } @@ -200,7 +200,7 @@ int main(int argc, const char * const argv[]) apr_file_buffer_set(outfile, outbuffer, WRITE_BUF_SIZE); cache = apr_hash_make(pool); - if(apr_pool_create(&pline, pool) != APR_SUCCESS){ + if (apr_pool_create(&pline, pool) != APR_SUCCESS) { return 1; } @@ -220,7 +220,7 @@ int main(int argc, const char * const argv[]) /* Check if this could even be an IP address */ if (!apr_isxdigit(line[0]) && line[0] != ':') { - withname++; + withname++; apr_file_puts(line, outfile); continue; } @@ -315,7 +315,7 @@ int main(int argc, const char * const argv[]) if (stats) { apr_file_t *statsfile; if (apr_file_open(&statsfile, stats, - APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE, + APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE, APR_OS_DEFAULT, pool) != APR_SUCCESS) { apr_file_printf(errfile, "%s: Could not open %s for writing.", shortname, stats); diff --git a/support/passwd_common.c b/support/passwd_common.c index 343fa79064..113236c399 100644 --- a/support/passwd_common.c +++ b/support/passwd_common.c @@ -99,9 +99,9 @@ static int generate_salt(char *s, size_t size, const char **errstr, size--; val >>= 6; bits -= 6; - } - *s = '\0'; - return 0; + } + *s = '\0'; + return 0; } void putline(apr_file_t *f, const char *l) -- 2.40.0