]> git.kaiwu.me - nginx.git/commitdiff
merge r2920, r2934, r3116, r3119:
authorIgor Sysoev <igor@sysoev.ru>
Mon, 26 Oct 2009 16:06:11 +0000 (16:06 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 26 Oct 2009 16:06:11 +0000 (16:06 +0000)
style fixes

src/core/ngx_hash.c
src/core/ngx_string.c
src/http/modules/ngx_http_geo_module.c
src/http/modules/ngx_http_log_module.c
src/http/modules/ngx_http_xslt_filter_module.c
src/os/unix/ngx_files.h

index 2eadbf3e3a3e52f6d0ed45b5da28c0e9ace3b5e9..2a5b0adc7d712ee23682235d8898cc1a30974398 100644 (file)
@@ -534,7 +534,7 @@ ngx_hash_wildcard_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names,
 
             next_name->key.len = names[n].key.len - len;
             next_name->key.data = names[n].key.data + len;
-            next_name->key_hash= 0;
+            next_name->key_hash = 0;
             next_name->value = names[n].value;
 
 #if 0
@@ -562,7 +562,7 @@ ngx_hash_wildcard_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names,
 
             next_name->key.len = names[i].key.len - dot_len;
             next_name->key.data = names[i].key.data + dot_len;
-            next_name->key_hash= 0;
+            next_name->key_hash = 0;
             next_name->value = names[i].value;
 
 #if 0
index e73dc41d8a2e0808eef449d02e3f77dc389be161..c0bcc1d123f459dca21da0631594dd5afe62be65 100644 (file)
@@ -30,12 +30,15 @@ ngx_cpystrn(u_char *dst, u_char *src, size_t n)
         return dst;
     }
 
-    for ( /* void */ ; --n; dst++, src++) {
+    while (--n) {
         *dst = *src;
 
         if (*dst == '\0') {
             return dst;
         }
+
+        dst++;
+        src++;
     }
 
     *dst = '\0';
@@ -565,8 +568,8 @@ ngx_strcasecmp(u_char *s1, u_char *s2)
         c1 = (ngx_uint_t) *s1++;
         c2 = (ngx_uint_t) *s2++;
 
-        c1  = (c1 >= 'A' && c1 <= 'Z') ? (c1 | 0x20) : c1;
-        c2  = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
+        c1 = (c1 >= 'A' && c1 <= 'Z') ? (c1 | 0x20) : c1;
+        c2 = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
 
         if (c1 == c2) {
 
@@ -591,8 +594,8 @@ ngx_strncasecmp(u_char *s1, u_char *s2, size_t n)
         c1 = (ngx_uint_t) *s1++;
         c2 = (ngx_uint_t) *s2++;
 
-        c1  = (c1 >= 'A' && c1 <= 'Z') ? (c1 | 0x20) : c1;
-        c2  = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
+        c1 = (c1 >= 'A' && c1 <= 'Z') ? (c1 | 0x20) : c1;
+        c2 = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
 
         if (c1 == c2) {
 
@@ -680,7 +683,7 @@ ngx_strcasestrn(u_char *s1, char *s2, size_t n)
     ngx_uint_t  c1, c2;
 
     c2 = (ngx_uint_t) *s2++;
-    c2  = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
+    c2 = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
 
     do {
         do {
@@ -690,7 +693,7 @@ ngx_strcasestrn(u_char *s1, char *s2, size_t n)
                 return NULL;
             }
 
-            c1  = (c1 >= 'A' && c1 <= 'Z') ? (c1 | 0x20) : c1;
+            c1 = (c1 >= 'A' && c1 <= 'Z') ? (c1 | 0x20) : c1;
 
         } while (c1 != c2);
 
@@ -712,7 +715,7 @@ ngx_strlcasestrn(u_char *s1, u_char *last, u_char *s2, size_t n)
     ngx_uint_t  c1, c2;
 
     c2 = (ngx_uint_t) *s2++;
-    c2  = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
+    c2 = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
     last -= n;
 
     do {
@@ -723,7 +726,7 @@ ngx_strlcasestrn(u_char *s1, u_char *last, u_char *s2, size_t n)
 
             c1 = (ngx_uint_t) *s1++;
 
-            c1  = (c1 >= 'A' && c1 <= 'Z') ? (c1 | 0x20) : c1;
+            c1 = (c1 >= 'A' && c1 <= 'Z') ? (c1 | 0x20) : c1;
 
         } while (c1 != c2);
 
@@ -1337,7 +1340,7 @@ ngx_escape_uri(u_char *dst, u_char *src, size_t size, ngx_uint_t type)
 
         /* find the number of the characters to be escaped */
 
-        n  = 0;
+        n = 0;
 
         for (i = 0; i < size; i++) {
             if (escape[*src >> 5] & (1 << (*src & 0x1f))) {
index a3898563230c90d32a7111b7ceea07c1f5f2b40f..e6fd67a28ef34cb12a1b8ba0f3b05800ae48bc2f 100644 (file)
@@ -864,7 +864,7 @@ ngx_http_geo_cidr(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
 
         /* rc == NGX_BUSY */
 
-        old  = (ngx_http_variable_value_t *)
+        old = (ngx_http_variable_value_t *)
               ngx_radix32tree_find(ctx->tree, cidr.u.in.addr & cidr.u.in.mask);
 
         ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
index 170e3a2649b6de212e4a8c91c6b7ba08d5e677c2..1ff105821cfe67f89a6ca296400afdd1d7435146 100644 (file)
@@ -676,7 +676,7 @@ ngx_http_log_escape(u_char *dst, u_char *src, size_t size)
 
         /* find the number of the characters to be escaped */
 
-        n  = 0;
+        n = 0;
 
         for (i = 0; i < size; i++) {
             if (escape[*src >> 5] & (1 << (*src & 0x1f))) {
index cfaa8e1b330370d28fcc328a8bce16f825623e44..c14d1c4a18bbfbd8625f9062df72c0c21c7a377d 100644 (file)
@@ -404,7 +404,7 @@ ngx_http_xslt_add_chunk(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t *ctx,
         sax->endElementNs = ngx_http_xslt_sax_end_element;
 
         sax->characters = ngx_http_xslt_sax_characters;
-        sax->ignorableWhitespace  = ngx_http_xslt_sax_characters;
+        sax->ignorableWhitespace = ngx_http_xslt_sax_characters;
         sax->cdataBlock = ngx_http_xslt_sax_cdata_block;
         sax->getEntity = ngx_http_xslt_sax_get_entity;
         sax->resolveEntity = ngx_http_xslt_sax_resolve_entity;
index cf5c3ed9170dcac16d9bfcb463309de39ef44d88..5395acd03c32843b08d04abd6f78a4ac01c33e63 100644 (file)
@@ -18,13 +18,13 @@ typedef ino_t                    ngx_file_uniq_t;
 
 
 typedef struct {
-    DIR                        *dir;
-    struct dirent              *de;
-    struct stat                 info;
+    DIR                         *dir;
+    struct dirent               *de;
+    struct stat                  info;
 
-    unsigned                    type:8;
-    unsigned                    valid_info:1;
-    unsigned                    valid_type:1;
+    unsigned                     type:8;
+    unsigned                     valid_info:1;
+    unsigned                     valid_type:1;
 } ngx_dir_t;