]> granicus.if.org Git - apache/commitdiff
Merge r1700317, r1700318, r1700319, r1700320, r1700321, r1700322, r1700326, r1700328...
authorJim Jagielski <jim@apache.org>
Tue, 8 Sep 2015 11:10:16 +0000 (11:10 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 8 Sep 2015 11:10:16 +0000 (11:10 +0000)
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

15 files changed:
STATUS
modules/cache/mod_cache_disk.c
modules/cache/mod_cache_socache.c
modules/ldap/util_ldap.c
modules/loggers/mod_log_config.c
modules/metadata/mod_cern_meta.c
modules/proxy/ajp_header.c
modules/proxy/ajp_msg.c
modules/proxy/mod_proxy_ftp.c
server/log.c
server/request.c
support/ab.c
support/htdbm.c
support/logresolve.c
support/passwd_common.c

diff --git a/STATUS b/STATUS
index 58e436e7563cff206fbc79b0dd59a0f44a6be690..1796e177b2216651cf7b0154b65190fe878a6633 100644 (file)
--- 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:
index ddf6431440c0ec98965e219612999055e01fd3bc..14dee81ff72a827405489ce60ebc141dcf50929a 100644 (file)
@@ -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;
index c5b49ab998f252e6d53209ed1ef676e64fea7220..6761bf7e2e0a1a59ce3258aa0c2e7bb92b8e7503 100644 (file)
@@ -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] == ':') {
index 156e131d2cde5f575e9ba5edf55c470d55592689..52acafb06a1b793e98bd93ef200d4e801d280b0b 100644 (file)
@@ -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,
index d5687c2446b9a6b9f07e62aa80b9271f39accd41..4dd140f60a63f541efac949e8b3039f25d758eb9 100644 (file)
@@ -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;
 }
 
index f06c464c1d9d9e0570f585abeac07c4c8cb90813..09a41e1cc692bad47ee4300d762accc7fe68dd23 100644 (file)
@@ -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);
index edb9d23cac965baaff6859816f98fc1aeef46113..0ec94ad7806ad5a6f1d59110f0212930bdb6d931 100644 (file)
@@ -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) {
index 71bc1dd902a04fe9b6c5027d943d11aeac67703d..06bee9be7d43fe913f1200f9be07ba4a81f58e2f 100644 (file)
@@ -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];
index 5c689aa1d449688923bdb65e3aeacc4a7f187250..a62a2828b8ad72397fd6c0a0ea7bae146ff11f76 100644 (file)
@@ -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;
     }
index 03de91a2b2e3a0cc7a14bedd9f0eecd8cd6c1b42..b9364659a7cbc6fef95f1d4fc0159494c5af73ea 100644 (file)
@@ -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;
index 750b15111a2ea93d2a0cdada80b7f25735eda6dd..849aad186326bfcf24594fba0a5b457aa64c4f96 100644 (file)
@@ -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
index 7b13d2022217b414dea1b9c6bfcf5c207bf51fde..05f18b0703a7bbd14080a8b3fe201dfc1a977541 100644 (file)
@@ -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;
index 1cd0591fe6bd0a70c0edf564d96187830f4d8a11..40a3d232938a28030881135d5e084a0e53ce4100 100644 (file)
@@ -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;
index b0ba6ec1d15786fee09fbcfa703d20c95a78c9b8..71dca45243183381862bce2bf524f5faa998c55b 100644 (file)
@@ -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);
index 343fa7906431821913e34b20f3ce70bca42e3926..113236c39928492787dc7dffacc554dd887edeb4 100644 (file)
@@ -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)