Fix some style issues on files that can easily be synch'ed with 2.4.x
authorChristophe Jaillet <jailletc36@apache.org>
Wed, 30 Sep 2015 08:35:35 +0000 (08:35 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Wed, 30 Sep 2015 08:35:35 +0000 (08:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705983 13f79535-47bb-0310-9956-ffa450edef68

16 files changed:
modules/arch/netware/mod_netware.c
modules/arch/win32/mod_isapi.c
modules/cache/cache_storage.c
modules/dav/lock/locks.c
modules/examples/mod_case_filter_in.c
modules/filters/mod_buffer.c
modules/filters/mod_filter.c
modules/filters/mod_include.c
modules/filters/mod_reqtimeout.c
modules/filters/mod_request.c
modules/generators/mod_autoindex.c
modules/ldap/util_ldap_cache.c
modules/lua/lua_config.c
modules/mappers/mod_vhost_alias.c
modules/metadata/mod_ident.c
modules/test/mod_optional_fn_import.c

index b34a5222bb1a62f52fd7e049bfcfb52e80e262cf..f873827ecaec235a631662f5f7d087409e65e8b8 100644 (file)
@@ -137,8 +137,9 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
     }
 
     /* eliminate the '.' if there is one */
-    if (*ext == '.')
+    if (*ext == '.') {
         ++ext;
+    }
 
     /* check if we have a registered command for the extension*/
     new_cmd = apr_table_get(d->file_type_handlers, ext);
@@ -154,8 +155,9 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
         *cmd = apr_pstrcat (p, new_cmd, " ", cmd_only, NULL);
 
         /* Run in its own address space if specified */
-        if(apr_table_get(d->file_handler_mode, ext))
+        if (apr_table_get(d->file_handler_mode, ext)) {
             e_info->addrspace = 1;
+        }
     }
 
     /* Tokenize the full command string into its arguments */
index ce0875a5001fce060531b465dce6f885b54f2188..ec0d35e74f529fc022f94901335aca333e7d0461 100644 (file)
@@ -1415,7 +1415,7 @@ static apr_status_t isapi_handler (request_rec *r)
     apr_uint32_t read;
     int res;
 
-    if(strcmp(r->handler, "isapi-isa")
+    if (strcmp(r->handler, "isapi-isa")
         && strcmp(r->handler, "isapi-handler")) {
         /* Hang on to the isapi-isa for compatibility with older docs
          * (wtf did '-isa' mean in the first place?) but introduce
index 234eb9bb7453141bc8ba121455052779e951b65f..59d12aca15f64bcf676228b3f585e2fed423e4f4 100644 (file)
@@ -50,7 +50,7 @@ int cache_remove_url(cache_request_rec *cache, request_rec *r)
                  "cache: Removing url %s from the cache", h->cache_obj->key);
 
     /* for each specified cache type, delete the URL */
-    while(list) {
+    while (list) {
         list->provider->remove_url(h, r);
         list = list->next;
     }
index ccf972d33e4b5d769aaf13bf25a790fab6ac74b3..17b9ee69c02588e4806c7e9485e8af7848fcefd3 100644 (file)
@@ -465,11 +465,11 @@ static dav_error * dav_generic_save_lock_record(dav_lockdb *lockdb,
         return NULL;
     }
 
-    while(dp) {
+    while (dp) {
         val.dsize += dav_size_direct(dp);
         dp = dp->next;
     }
-    while(ip) {
+    while (ip) {
         val.dsize += dav_size_indirect(ip);
         ip = ip->next;
     }
@@ -480,7 +480,7 @@ static dav_error * dav_generic_save_lock_record(dav_lockdb *lockdb,
     dp  = direct;
     ip  = indirect;
 
-    while(dp) {
+    while (dp) {
         /* Direct lock - lock_discovery struct follows */
         *ptr++ = DAV_LOCK_DIRECT;
         memcpy(ptr, dp, sizeof(dp->f));        /* Fixed portion of struct */
@@ -505,7 +505,7 @@ static dav_error * dav_generic_save_lock_record(dav_lockdb *lockdb,
         dp = dp->next;
     }
 
-    while(ip) {
+    while (ip) {
         /* Indirect lock prefix */
         *ptr++ = DAV_LOCK_INDIRECT;
 
index 7200765b3aa896e453fde862f92c0b992878e768..5116e3b9f62251d1d49a99257dddee9065e190fd 100644 (file)
@@ -99,7 +99,7 @@ static apr_status_t CaseFilterInFilter(ap_filter_t *f,
          * for a file or socket buffer, for example...
          */
 
-        if(APR_BUCKET_IS_EOS(pbktIn)) {
+        if (APR_BUCKET_IS_EOS(pbktIn)) {
             APR_BUCKET_REMOVE(pbktIn);
             APR_BRIGADE_INSERT_TAIL(pbbOut, pbktIn);
             break;
index 8140af5d454b418edf78509592cc0bacf55737d5..203e6724502f2b963fcc80315fa199f90d7ff4d3 100644 (file)
@@ -52,7 +52,8 @@ typedef struct buffer_ctx {
 /**
  * Buffer buckets being written to the output filter stack.
  */
-static apr_status_t buffer_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) {
+static apr_status_t buffer_out_filter(ap_filter_t *f, apr_bucket_brigade *bb)
+{
     apr_bucket *e;
     request_rec *r = f->r;
     buffer_ctx *ctx = f->ctx;
@@ -74,7 +75,6 @@ static apr_status_t buffer_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) {
         ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx));
         ctx->bb = apr_brigade_create(r->pool, f->c->bucket_alloc);
         ctx->conf = ap_get_module_config(f->r->per_dir_config, &buffer_module);
-
     }
 
     /* Do nothing if asked to filter nothing. */
@@ -187,7 +187,8 @@ static apr_status_t buffer_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) {
  * Buffer buckets being read from the input filter stack.
  */
 static apr_status_t buffer_in_filter(ap_filter_t *f, apr_bucket_brigade *bb,
-        ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) {
+        ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes)
+{
     apr_bucket *e, *after;
     apr_status_t rv;
     buffer_ctx *ctx = f->ctx;
@@ -294,7 +295,8 @@ static apr_status_t buffer_in_filter(ap_filter_t *f, apr_bucket_brigade *bb,
     return APR_SUCCESS;
 }
 
-static void *create_buffer_config(apr_pool_t *p, char *dummy) {
+static void *create_buffer_config(apr_pool_t *p, char *dummy)
+{
     buffer_conf *new = (buffer_conf *) apr_pcalloc(p, sizeof(buffer_conf));
 
     new->size_set = 0; /* unset */
@@ -303,7 +305,8 @@ static void *create_buffer_config(apr_pool_t *p, char *dummy) {
     return (void *) new;
 }
 
-static void *merge_buffer_config(apr_pool_t *p, void *basev, void *addv) {
+static void *merge_buffer_config(apr_pool_t *p, void *basev, void *addv)
+{
     buffer_conf *new = (buffer_conf *) apr_pcalloc(p, sizeof(buffer_conf));
     buffer_conf *add = (buffer_conf *) addv;
     buffer_conf *base = (buffer_conf *) basev;
@@ -314,7 +317,8 @@ static void *merge_buffer_config(apr_pool_t *p, void *basev, void *addv) {
     return new;
 }
 
-static const char *set_buffer_size(cmd_parms *cmd, void *dconf, const char *arg) {
+static const char *set_buffer_size(cmd_parms *cmd, void *dconf, const char *arg)
+{
     buffer_conf *conf = dconf;
 
     if (APR_SUCCESS != apr_strtoff(&(conf->size), arg, NULL, 10) || conf->size
@@ -330,7 +334,8 @@ static const command_rec buffer_cmds[] = { AP_INIT_TAKE1("BufferSize",
         set_buffer_size, NULL, ACCESS_CONF,
         "Maximum size of the buffer used by the buffer filter"), { NULL } };
 
-static void register_hooks(apr_pool_t *p) {
+static void register_hooks(apr_pool_t *p)
+{
     ap_register_output_filter(bufferFilterName, buffer_out_filter, NULL,
             AP_FTYPE_CONTENT_SET);
     ap_register_input_filter(bufferFilterName, buffer_in_filter, NULL,
index bd2cf7ac1766b0dc6f2adb0b7b3f60ef0cd1dcac..d3a8b2be3b7f5170590213d325dc84a5b056fd94 100644 (file)
@@ -351,7 +351,7 @@ static const char *filter_protocol(cmd_parms *cmd, void *CFG, const char *fname,
     }
     else {
         /* Find provider */
-        for (provider = filter->providers; provider; provider = provider->next){
+        for (provider = filter->providers; provider; provider = provider->next) {
             if (!strcasecmp(provider->frec->name, pname)) {
                 break;
             }
index 3a681437d8ad9a74448a0984059f0bb137bd518c..480911cd178e48c97e3de49bfc91e2277e5de8e2 100644 (file)
@@ -1950,7 +1950,7 @@ static apr_status_t handle_echo(include_ctx_t *ctx, ap_filter_t *f,
                 d = apr_pstrdup(ctx->pool, decoding);
                 token = apr_strtok(d, ", \t", &last);
 
-                while(token) {
+                while (token) {
                     if (!strcasecmp(token, "none")) {
                         /* do nothing */
                     }
@@ -1986,7 +1986,7 @@ static apr_status_t handle_echo(include_ctx_t *ctx, ap_filter_t *f,
                 e = apr_pstrdup(ctx->pool, encoding);
                 token = apr_strtok(e, ", \t", &last);
 
-                while(token) {
+                while (token) {
                     if (!strcasecmp(token, "none")) {
                         /* do nothing */
                     }
@@ -2588,7 +2588,7 @@ static apr_status_t handle_set(include_ctx_t *ctx, ap_filter_t *f,
                 d = apr_pstrdup(ctx->pool, decoding);
                 token = apr_strtok(d, ", \t", &last);
 
-                while(token) {
+                while (token) {
                     if (!strcasecmp(token, "none")) {
                         /* do nothing */
                     }
@@ -2624,7 +2624,7 @@ static apr_status_t handle_set(include_ctx_t *ctx, ap_filter_t *f,
                 e = apr_pstrdup(ctx->pool, encoding);
                 token = apr_strtok(e, ", \t", &last);
 
-                while(token) {
+                while (token) {
                     if (!strcasecmp(token, "none")) {
                         /* do nothing */
                     }
@@ -3726,7 +3726,7 @@ static apr_status_t send_parsed_content(ap_filter_t *f, apr_bucket_brigade *bb)
 
         } /* switch(ctx->state) */
 
-    } /* while(brigade) */
+    } /* while (brigade) */
 
     /* End of stream. Final cleanup */
     if (intern->seen_eos) {
@@ -4139,13 +4139,13 @@ static const char *set_default_time_fmt(cmd_parms *cmd, void *mconfig,
  */
 
 static int include_post_config(apr_pool_t *p, apr_pool_t *plog,
-                                apr_pool_t *ptemp, server_rec *s)
+                               apr_pool_t *ptemp, server_rec *s)
 {
     include_handlers = apr_hash_make(p);
 
     ssi_pfn_register = APR_RETRIEVE_OPTIONAL_FN(ap_register_include_handler);
 
-    if(ssi_pfn_register) {
+    if (ssi_pfn_register) {
         ssi_pfn_register("if", handle_if);
         ssi_pfn_register("set", handle_set);
         ssi_pfn_register("else", handle_else);
index bc7789964ad926e02684f4cb2b92bfbdb339fa67..206e621796eadd1ab9a7b2b33d565d0a5f90c00a 100644 (file)
@@ -479,7 +479,8 @@ static void *reqtimeout_merge_srv_config(apr_pool_t *p, void *base_, void *add_)
     return cfg;
 }
 
-static const char *parse_int(apr_pool_t *p, const char *arg, int *val) {
+static const char *parse_int(apr_pool_t *p, const char *arg, int *val)
+{
     char *endptr;
     *val = strtol(arg, &endptr, 10);
 
index 9cbde0a98815ed562f33b0911d8abfce81a41097..21db7de36cf86c4c79920c56b87ac2dde02994c5 100644 (file)
@@ -178,7 +178,8 @@ typedef struct kept_body_filter_ctx {
  * been removed from the body during storage. We need to change the request
  * from Transfer-Encoding: chunked to an explicit Content-Length.
  */
-static int kept_body_filter_init(ap_filter_t *f) {
+static int kept_body_filter_init(ap_filter_t *f)
+{
     apr_off_t length = 0;
     request_rec *r = f->r;
     apr_bucket_brigade *kept_body = r->kept_body;
index 8f8cc8e2e66b8a8a77df8971ca76ab170fdfca05..a9e962315c6dc3059c1204649a4f098c92420a10 100644 (file)
@@ -1336,7 +1336,7 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent,
         return (NULL);
     }
 
-    if((autoindex_opts & SHOW_FORBIDDEN)
+    if ((autoindex_opts & SHOW_FORBIDDEN)
         && (rr->status == HTTP_UNAUTHORIZED || rr->status == HTTP_FORBIDDEN)) {
         show_forbidden = 1;
     }
index b1346f05121c41c76cc11b6e9cbc4434a2c41777..d8c1ed9b5bf217c9d557d3af1f93784ca4c0d939 100644 (file)
@@ -181,8 +181,8 @@ void *util_ldap_search_node_copy(util_ald_cache_t *cache, void *c)
             util_ldap_search_node_free(cache, newnode);
             return NULL;
         }
-        if(node->bindpw) {
-            if(!(newnode->bindpw = util_ald_strdup(cache, node->bindpw))) {
+        if (node->bindpw) {
+            if (!(newnode->bindpw = util_ald_strdup(cache, node->bindpw))) {
                 util_ldap_search_node_free(cache, newnode);
                 return NULL;
             }
@@ -305,14 +305,14 @@ void util_ldap_compare_node_display(request_rec *r, util_ald_cache_t *cache, voi
         cmp_result = apr_itoa(r->pool, node->result);
     }
 
-    if(node->subgroupList) {
+    if (node->subgroupList) {
         sub_groups_val = "Yes";
     }
     else {
         sub_groups_val = "No";
     }
 
-    if(node->sgl_processed) {
+    if (node->sgl_processed) {
         sub_groups_checked = "Yes";
     }
     else {
index bb082380732ac4e926120ae86cc468a043558434..3b307ebc0e4d7ca2eaedbc1f745ea4e97b7f925c 100644 (file)
@@ -141,7 +141,8 @@ static int cfg_directory(lua_State *L)
     return 1;
 }
 
-/*static int cfg_root(lua_State *L) {
+/*static int cfg_root(lua_State *L)
+{
     ap_lua_dir_cfg *cfg = check_dir_config(L, 1);
     lua_pushstring(L, cfg->root_path);
     return 1;
index 70c857d4ee421d7dbee722ad46af9b05dc25cac0..0b6169479d29d58e5b47c54c727056af65ac1471 100644 (file)
@@ -269,7 +269,7 @@ static void vhost_alias_interpolate(request_rec *r, const char *name,
 
     ndots = 0;
     dots[ndots++] = name-1; /* slightly naughty */
-    for (p = name; *p; ++p){
+    for (p = name; *p; ++p) {
         if (*p == '.' && ndots < MAXDOTS) {
             dots[ndots++] = p;
         }
index 87e7c2b32e74a70393c3df96b88810a7ed19dd9d..5520a802ec97cb9d9fa35ed976f6235935adbddd 100644 (file)
@@ -202,7 +202,7 @@ static apr_status_t rfc1413_query(apr_socket_t *sock, conn_rec *conn,
      * Note that the strchr function below checks for \012 instead of '\n'
      * this allows it to work on both ASCII and EBCDIC machines.
      */
-    while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) {
+    while ((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) {
         apr_size_t j = sizeof(buffer) - 1 - i;
         apr_status_t status;
         status = apr_socket_recv(sock, buffer+i, &j);
index a01a3e74fdc34601248c9eed785cb26b299df6bf..aba70e12b509f3f0141cbdaa05621291c3eae2c8 100644 (file)
@@ -27,14 +27,14 @@ static APR_OPTIONAL_FN_TYPE(TestOptionalFn) *pfn;
 
 static int ImportLogTransaction(request_rec *r)
 {
-    if(pfn)
+    if (pfn)
         return pfn(r->the_request);
     return DECLINED;
 }
 
 static void ImportFnRetrieve(void)
 {
-    pfn=APR_RETRIEVE_OPTIONAL_FN(TestOptionalFn);
+    pfn = APR_RETRIEVE_OPTIONAL_FN(TestOptionalFn);
 }
 
 static void ImportRegisterHooks(apr_pool_t *p)