diff options
author | Valentin Bartenev <vbart@nginx.com> | 2018-04-05 15:49:41 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2018-04-05 15:49:41 +0300 |
commit | d15b4ca90639d0e6a5caab9ec905e49228072faf (patch) | |
tree | b929a2fed7cc997a5e18e42e74858c09d8258306 /src | |
parent | 49bd3a21e0f995c895b445c0566227661418c2bc (diff) | |
download | unit-d15b4ca90639d0e6a5caab9ec905e49228072faf.tar.gz unit-d15b4ca90639d0e6a5caab9ec905e49228072faf.tar.bz2 |
Style.
Diffstat (limited to 'src')
-rw-r--r-- | src/nxt_application.h | 8 | ||||
-rw-r--r-- | src/nxt_buf.c | 9 | ||||
-rw-r--r-- | src/nxt_http_parse.c | 4 | ||||
-rw-r--r-- | src/nxt_php_sapi.c | 4 | ||||
-rw-r--r-- | src/nxt_port.h | 16 | ||||
-rw-r--r-- | src/nxt_port_memory.c | 4 | ||||
-rw-r--r-- | src/nxt_port_rpc.c | 2 | ||||
-rw-r--r-- | src/nxt_port_socket.c | 8 | ||||
-rw-r--r-- | src/test/nxt_utf8_test.c | 2 |
9 files changed, 30 insertions, 27 deletions
diff --git a/src/nxt_application.h b/src/nxt_application.h index bdff4a62..caf5b884 100644 --- a/src/nxt_application.h +++ b/src/nxt_application.h @@ -292,10 +292,10 @@ nxt_app_msg_read_length(u_char *src, size_t *length) src++; } else { - *length = ((src[0] & 0x7FU) << 24) + - (src[1] << 16) + - (src[2] << 8) + - src[3]; + *length = ((src[0] & 0x7FU) << 24) + + ( src[1] << 16) + + ( src[2] << 8) + + src[3]; src += 4; } diff --git a/src/nxt_buf.c b/src/nxt_buf.c index e2f1f047..91846e4d 100644 --- a/src/nxt_buf.c +++ b/src/nxt_buf.c @@ -73,8 +73,8 @@ nxt_buf_mem_ts_alloc(nxt_task_t *task, nxt_mp_t *mp, size_t size) b->is_ts = 1; if (size != 0) { - b->mem.start = nxt_pointer_to(b, NXT_BUF_MEM_SIZE + - sizeof(nxt_buf_ts_t)); + b->mem.start = nxt_pointer_to(b, NXT_BUF_MEM_SIZE + + sizeof(nxt_buf_ts_t)); b->mem.pos = b->mem.start; b->mem.free = b->mem.start; b->mem.end = b->mem.start + size; @@ -304,8 +304,9 @@ nxt_buf_make_plain(nxt_mp_t *mp, nxt_buf_t *src, size_t size) } for (i = src; i != NULL; i = i->next) { - if (nxt_slow_path(nxt_buf_mem_free_size(&b->mem) < - nxt_buf_used_size(i))) { + if (nxt_slow_path(nxt_buf_mem_free_size(&b->mem) + < nxt_buf_used_size(i))) + { break; } diff --git a/src/nxt_http_parse.c b/src/nxt_http_parse.c index 715ab089..cf0a0c7d 100644 --- a/src/nxt_http_parse.c +++ b/src/nxt_http_parse.c @@ -444,8 +444,8 @@ space_after_target: } if (rp->exten_start) { - rp->exten.length = rp->path.start + rp->path.length - - rp->exten_start; + rp->exten.length = rp->path.start + rp->path.length + - rp->exten_start; rp->exten.start = rp->exten_start; } diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c index 45260f1b..a7bfaac2 100644 --- a/src/nxt_php_sapi.c +++ b/src/nxt_php_sapi.c @@ -329,8 +329,8 @@ nxt_php_read_request(nxt_task_t *task, nxt_app_rmsg_t *rmsg, script_name.start = NULL; } - ctx->script.length = nxt_php_root.length + h->path.length + - script_name.length; + ctx->script.length = nxt_php_root.length + h->path.length + + script_name.length; p = ctx->script.start = nxt_malloc(ctx->script.length + 1); if (nxt_slow_path(p == NULL)) { return NXT_ERROR; diff --git a/src/nxt_port.h b/src/nxt_port.h index d916b34b..038ab0ef 100644 --- a/src/nxt_port.h +++ b/src/nxt_port.h @@ -67,26 +67,26 @@ typedef enum { _NXT_PORT_MSG_DATA = nxt_port_handler_idx(data), - NXT_PORT_MSG_MAX = sizeof(nxt_port_handlers_t) / - sizeof(nxt_port_handler_t), + NXT_PORT_MSG_MAX = sizeof(nxt_port_handlers_t) + / sizeof(nxt_port_handler_t), NXT_PORT_MSG_RPC_READY = _NXT_PORT_MSG_RPC_READY, NXT_PORT_MSG_RPC_READY_LAST = _NXT_PORT_MSG_RPC_READY | NXT_PORT_MSG_LAST, NXT_PORT_MSG_RPC_ERROR = _NXT_PORT_MSG_RPC_ERROR | NXT_PORT_MSG_LAST, - NXT_PORT_MSG_START_WORKER = _NXT_PORT_MSG_START_WORKER | - NXT_PORT_MSG_LAST, + NXT_PORT_MSG_START_WORKER = _NXT_PORT_MSG_START_WORKER + | NXT_PORT_MSG_LAST, NXT_PORT_MSG_SOCKET = _NXT_PORT_MSG_SOCKET | NXT_PORT_MSG_LAST, NXT_PORT_MSG_MODULES = _NXT_PORT_MSG_MODULES | NXT_PORT_MSG_LAST, NXT_PORT_MSG_CONF_STORE = _NXT_PORT_MSG_CONF_STORE | NXT_PORT_MSG_LAST, NXT_PORT_MSG_CHANGE_FILE = _NXT_PORT_MSG_CHANGE_FILE | NXT_PORT_MSG_LAST, NXT_PORT_MSG_NEW_PORT = _NXT_PORT_MSG_NEW_PORT | NXT_PORT_MSG_LAST, - NXT_PORT_MSG_MMAP = _NXT_PORT_MSG_MMAP | NXT_PORT_MSG_LAST | - NXT_PORT_MSG_CLOSE_FD | NXT_PORT_MSG_SYNC, + NXT_PORT_MSG_MMAP = _NXT_PORT_MSG_MMAP | NXT_PORT_MSG_LAST + | NXT_PORT_MSG_CLOSE_FD | NXT_PORT_MSG_SYNC, - NXT_PORT_MSG_PROCESS_READY = _NXT_PORT_MSG_PROCESS_READY | - NXT_PORT_MSG_LAST, + NXT_PORT_MSG_PROCESS_READY = _NXT_PORT_MSG_PROCESS_READY + | NXT_PORT_MSG_LAST, NXT_PORT_MSG_QUIT = _NXT_PORT_MSG_QUIT | NXT_PORT_MSG_LAST, NXT_PORT_MSG_REMOVE_PID = _NXT_PORT_MSG_REMOVE_PID | NXT_PORT_MSG_LAST, diff --git a/src/nxt_port_memory.c b/src/nxt_port_memory.c index 208c8b13..5f730030 100644 --- a/src/nxt_port_memory.c +++ b/src/nxt_port_memory.c @@ -20,7 +20,7 @@ nxt_inline void nxt_port_mmap_handler_use(nxt_port_mmap_handler_t *mmap_handler, int i) { - int c; + int c; c = nxt_atomic_fetch_add(&mmap_handler->use_count, i); @@ -888,7 +888,7 @@ nxt_port_mmap_get_method(nxt_task_t *task, nxt_port_t *port, nxt_buf_t *b) m = NXT_PORT_METHOD_ANY; - for (; b != NULL; b = b->next) { + for (/* void */; b != NULL; b = b->next) { if (nxt_buf_used_size(b) == 0) { /* empty buffers does not affect method */ continue; diff --git a/src/nxt_port_rpc.c b/src/nxt_port_rpc.c index 136e7f2b..401707f0 100644 --- a/src/nxt_port_rpc.c +++ b/src/nxt_port_rpc.c @@ -250,6 +250,7 @@ nxt_port_rpc_remove_from_peers(nxt_task_t *task, nxt_port_t *port, "registration (%p)", stream, reg->peer, reg->link.next); ret = nxt_lvlhsh_delete(&port->rpc_peers, &lhq); + } else { nxt_debug(task, "rpc: stream #%uD remove first pid %PI " "registration (%p)", stream, reg->peer, reg->link.next); @@ -264,6 +265,7 @@ nxt_port_rpc_remove_from_peers(nxt_task_t *task, nxt_port_t *port, ret = nxt_lvlhsh_insert(&port->rpc_peers, &lhq); } + } else { nxt_debug(task, "rpc: stream #%uD remove pid %PI " "registration (%p)", stream, reg->peer, reg->link.next); diff --git a/src/nxt_port_socket.c b/src/nxt_port_socket.c index e688530e..a545013f 100644 --- a/src/nxt_port_socket.c +++ b/src/nxt_port_socket.c @@ -118,10 +118,10 @@ nxt_port_write_enable(nxt_task_t *task, nxt_port_t *port) port->socket.error_handler = nxt_port_error_handler; if (port->iov == NULL) { - port->iov = nxt_mp_get(port->mem_pool, sizeof(struct iovec) * - NXT_IOBUF_MAX * 10); - port->mmsg_buf = nxt_mp_get(port->mem_pool, sizeof(uint32_t) * 3 * - NXT_IOBUF_MAX * 10); + port->iov = nxt_mp_get(port->mem_pool, + sizeof(struct iovec) * NXT_IOBUF_MAX * 10); + port->mmsg_buf = nxt_mp_get(port->mem_pool, + sizeof(uint32_t) * 3 * NXT_IOBUF_MAX * 10); } } diff --git a/src/test/nxt_utf8_test.c b/src/test/nxt_utf8_test.c index 5ca048ae..7a6dcd33 100644 --- a/src/test/nxt_utf8_test.c +++ b/src/test/nxt_utf8_test.c @@ -21,7 +21,7 @@ static u_char invalid[] = { 3, 0xC0, 0x00, 0x00, 0x00, 4, 0xC0, 0x00, 0x00, 0x00, - /* Invalid 0x0x110000 value. */ + /* Invalid 0x110000 value. */ 4, 0xF4, 0x90, 0x80, 0x80, /* Incomplete length. */ |