[PATCH v7 04/14] Fix indentation

Alejandro Colomar alx.manpages at gmail.com
Tue Feb 15 15:25:14 UTC 2022


Some lines (incorrectly) had an indenteation of 5 or 9 spaces
instead of 4 or 8.  Fix them.

Found with:

$ ## 5 spaces instead of 4:
$
$ find src/ -type f \
  |grep -n '^     [^ *]';

$ ## 9 spaces instead of 8:
$
$ find src/ -type f \
  |grep -l '^         [^ *]' \
  |xargs grep -L '^         [^ *].*)$' \
  |xargs grep -n '^         [^ *]'

Signed-off-by: Alejandro Colomar <alx.manpages at gmail.com>
Cc: Nginx Unit <unit at nginx.org>
Cc: "Valentin V. Bartenev" <vbart at nginx.com>
Cc: Zhidao HONG <z.hong at f5.com>
Cc: Igor Sysoev <igor at sysoev.ru>
Cc: Oisin Canty <o.canty at f5.com>
Cc: Andrei Zeliankou <zelenkov at nginx.com>
Cc: Maxim Romanov <m.romanov at f5.com>
---
 src/nxt_conf_validation.c |  4 ++--
 src/nxt_gnutls.c          |  4 ++--
 src/nxt_http.h            | 14 +++++++-------
 src/nxt_http_route.c      |  4 ++--
 src/nxt_main_process.c    |  2 +-
 src/nxt_time_parse.c      |  6 +++---
 src/nxt_unit.c            |  4 ++--
 src/nxt_work_queue.h      |  4 ++--
 src/perl/nxt_perl_psgi.c  |  2 +-
 9 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/nxt_conf_validation.c b/src/nxt_conf_validation.c
index 3f068bb..7edd638 100644
--- a/src/nxt_conf_validation.c
+++ b/src/nxt_conf_validation.c
@@ -114,7 +114,7 @@ static nxt_int_t nxt_conf_vldt_pass(nxt_conf_validation_t *vldt,
 static nxt_int_t nxt_conf_vldt_return(nxt_conf_validation_t *vldt,
     nxt_conf_value_t *value, void *data);
 static nxt_int_t nxt_conf_vldt_share(nxt_conf_validation_t *vldt,
-     nxt_conf_value_t *value, void *data);
+    nxt_conf_value_t *value, void *data);
 static nxt_int_t nxt_conf_vldt_share_element(nxt_conf_validation_t *vldt,
     nxt_conf_value_t *value);
 static nxt_int_t nxt_conf_vldt_proxy(nxt_conf_validation_t *vldt,
@@ -194,7 +194,7 @@ static nxt_int_t nxt_conf_vldt_java_classpath(nxt_conf_validation_t *vldt,
 static nxt_int_t nxt_conf_vldt_java_option(nxt_conf_validation_t *vldt,
     nxt_conf_value_t *value);
 static nxt_int_t nxt_conf_vldt_upstream(nxt_conf_validation_t *vldt,
-     nxt_str_t *name, nxt_conf_value_t *value);
+    nxt_str_t *name, nxt_conf_value_t *value);
 static nxt_int_t nxt_conf_vldt_server(nxt_conf_validation_t *vldt,
     nxt_str_t *name, nxt_conf_value_t *value);
 static nxt_int_t nxt_conf_vldt_server_weight(nxt_conf_validation_t *vldt,
diff --git a/src/nxt_gnutls.c b/src/nxt_gnutls.c
index 4618dce..aab4699 100644
--- a/src/nxt_gnutls.c
+++ b/src/nxt_gnutls.c
@@ -708,11 +708,11 @@ nxt_gnutls_log_error_level(nxt_event_conn_t *c, ssize_t err)
 
     case GNUTLS_E_UNKNOWN_CIPHER_SUITE:                      /*  -21 */
 
-         /* Disable gnutls_bye(), because it returns GNUTLS_E_INTERNAL_ERROR. */
+        /* Disable gnutls_bye(), because it returns GNUTLS_E_INTERNAL_ERROR. */
         ssltls = c->u.ssltls;
         ssltls->no_shutdown = 1;
 
-         /* Fall through. */
+        /* Fall through. */
 
     case GNUTLS_E_UNEXPECTED_PACKET_LENGTH:                  /*   -9 */
         c->socket.error = 1000;  /* Nonexistent errno code. */
diff --git a/src/nxt_http.h b/src/nxt_http.h
index 02d66f5..7cef134 100644
--- a/src/nxt_http.h
+++ b/src/nxt_http.h
@@ -90,17 +90,17 @@ typedef union {
 
 #define nxt_http_field_name_set(_field, _name)                                \
     do {                                                                      \
-         (_field)->name_length = nxt_length(_name);                           \
-         (_field)->name = (u_char *) _name;                                   \
+        (_field)->name_length = nxt_length(_name);                            \
+        (_field)->name = (u_char *) _name;                                    \
     } while (0)
 
 
 #define nxt_http_field_set(_field, _name, _value)                             \
     do {                                                                      \
-         (_field)->name_length = nxt_length(_name);                           \
-         (_field)->value_length = nxt_length(_value);                         \
-         (_field)->name = (u_char *) _name;                                   \
-         (_field)->value = (u_char *) _value;                                 \
+        (_field)->name_length = nxt_length(_name);                            \
+        (_field)->value_length = nxt_length(_value);                          \
+        (_field)->name = (u_char *) _name;                                    \
+        (_field)->value = (u_char *) _value;                                  \
     } while (0)
 
 
@@ -238,7 +238,7 @@ typedef struct {
     void (*body_read)(nxt_task_t *task, nxt_http_request_t *r);
     void (*local_addr)(nxt_task_t *task, nxt_http_request_t *r);
     void (*header_send)(nxt_task_t *task, nxt_http_request_t *r,
-         nxt_work_handler_t body_handler, void *data);
+        nxt_work_handler_t body_handler, void *data);
     void (*send)(nxt_task_t *task, nxt_http_request_t *r, nxt_buf_t *out);
     nxt_off_t (*body_bytes_sent)(nxt_task_t *task, nxt_http_proto_t proto);
     void (*discard)(nxt_task_t *task, nxt_http_request_t *r, nxt_buf_t *last);
diff --git a/src/nxt_http_route.c b/src/nxt_http_route.c
index 71ebf3f..26f0662 100644
--- a/src/nxt_http_route.c
+++ b/src/nxt_http_route.c
@@ -932,7 +932,7 @@ nxt_http_route_rule_create(nxt_task_t *task, nxt_mp_t *mp,
 
 nxt_http_route_addr_rule_t *
 nxt_http_route_addr_rule_create(nxt_task_t *task, nxt_mp_t *mp,
-     nxt_conf_value_t *cv)
+    nxt_conf_value_t *cv)
 {
     size_t                         size;
     uint32_t                       i, n;
@@ -2294,7 +2294,7 @@ nxt_http_route_cookie_parse(nxt_array_t *cookies, u_char *start, u_char *end)
 
             name = NULL;
             start = p + 1;
-         }
+        }
     }
 
     if (name != NULL) {
diff --git a/src/nxt_main_process.c b/src/nxt_main_process.c
index 9883f04..03761a1 100644
--- a/src/nxt_main_process.c
+++ b/src/nxt_main_process.c
@@ -579,7 +579,7 @@ nxt_main_process_created_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
                                          -1, msg->port_msg.stream, 0, NULL);
             return;
         }
-     }
+    }
 
 #endif
 
diff --git a/src/nxt_time_parse.c b/src/nxt_time_parse.c
index 5a32b21..94c4328 100644
--- a/src/nxt_time_parse.c
+++ b/src/nxt_time_parse.c
@@ -282,9 +282,9 @@ nxt_time_parse(const u_char *p, size_t len)
     days = days - 719527 + 31 + 28;
 
     s = (uint64_t) days * 86400
-         + (nxt_uint_t) hour * 3600
-         + (nxt_uint_t) min * 60
-         + (nxt_uint_t) sec;
+        + (nxt_uint_t) hour * 3600
+        + (nxt_uint_t) min * 60
+        + (nxt_uint_t) sec;
 
 #if (NXT_TIME_T_SIZE <= 4)
 
diff --git a/src/nxt_unit.c b/src/nxt_unit.c
index dac612b..32bb07a 100644
--- a/src/nxt_unit.c
+++ b/src/nxt_unit.c
@@ -5114,9 +5114,9 @@ nxt_unit_ctx_alloc(nxt_unit_ctx_t *ctx, void *data)
 
     rc = nxt_unit_ctx_init(lib, new_ctx, data);
     if (nxt_slow_path(rc != NXT_UNIT_OK)) {
-         nxt_unit_free(ctx, new_ctx);
+        nxt_unit_free(ctx, new_ctx);
 
-         return NULL;
+        return NULL;
     }
 
     queue_fd = -1;
diff --git a/src/nxt_work_queue.h b/src/nxt_work_queue.h
index 6c2d6c2..ffa21d2 100644
--- a/src/nxt_work_queue.h
+++ b/src/nxt_work_queue.h
@@ -16,12 +16,12 @@ struct nxt_task_s {
     uint32_t      ident;
     nxt_work_t    *next_work;
 
-     /* TODO: exception_handler, prev/next task, subtasks. */
+    /* TODO: exception_handler, prev/next task, subtasks. */
 };
 
 
 #define nxt_task_next_ident()                                                 \
-     ((uint32_t) nxt_atomic_fetch_add(&nxt_task_ident, 1) & 0x3FFFFFFF)
+    ((uint32_t) nxt_atomic_fetch_add(&nxt_task_ident, 1) & 0x3FFFFFFF)
 
 
 /*
diff --git a/src/perl/nxt_perl_psgi.c b/src/perl/nxt_perl_psgi.c
index 749ebd8..08a6f29 100644
--- a/src/perl/nxt_perl_psgi.c
+++ b/src/perl/nxt_perl_psgi.c
@@ -612,7 +612,7 @@ nxt_perl_psgi_env_create(PerlInterpreter *my_perl,
     do {                                                                      \
         if (nxt_slow_path((FNS) != NXT_UNIT_OK))                              \
             goto fail;                                                        \
-     } while (0)
+    } while (0)
 
 #define NL(S) (S), sizeof(S)-1
 
-- 
2.34.1



More information about the unit mailing list