[njs] Style fixes.

Igor Sysoev igor at sysoev.ru
Tue Aug 16 16:14:35 UTC 2016


details:   http://hg.nginx.org/njs/rev/dcd8a105b5e7
branches:  
changeset: 156:dcd8a105b5e7
user:      Igor Sysoev <igor at sysoev.ru>
date:      Tue Aug 16 18:09:35 2016 +0300
description:
Style fixes.

diffstat:

 njs/njs_array.c          |  84 +++++++++++++++++++++++------------------------
 njs/njs_string.c         |  20 ++++++----
 njs/njs_vm.h             |   2 +-
 nxt/nxt_djb_hash.h       |   2 +-
 nxt/nxt_lvlhsh.c         |  46 +++++++++++++-------------
 nxt/nxt_lvlhsh.h         |  36 ++++++++++----------
 nxt/nxt_mem_cache_pool.c |   6 +-
 nxt/nxt_rbtree.c         |   2 +-
 nxt/nxt_rbtree.h         |   4 +-
 9 files changed, 102 insertions(+), 100 deletions(-)

diffs (606 lines):

diff -r e6e192a55774 -r dcd8a105b5e7 njs/njs_array.c
--- a/njs/njs_array.c	Mon Aug 15 11:33:37 2016 +0300
+++ b/njs/njs_array.c	Tue Aug 16 18:09:35 2016 +0300
@@ -79,28 +79,26 @@ typedef struct {
 } njs_array_sort_t;
 
 
-static njs_ret_t
-njs_array_prototype_to_string_continuation(njs_vm_t *vm, njs_value_t *args,
-    nxt_uint_t nargs, njs_index_t retval);
+static njs_ret_t njs_array_prototype_to_string_continuation(njs_vm_t *vm,
+    njs_value_t *args, nxt_uint_t nargs, njs_index_t retval);
 static njs_ret_t njs_array_prototype_join_continuation(njs_vm_t *vm,
     njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
-static nxt_noinline njs_value_t *njs_array_copy(njs_value_t *dst,
-    njs_value_t *src);
+static njs_value_t *njs_array_copy(njs_value_t *dst, njs_value_t *src);
 static njs_ret_t njs_array_index_of(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, nxt_bool_t first);
-static nxt_noinline njs_ret_t njs_array_prototype_for_each_cont(njs_vm_t *vm,
-    njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
-static nxt_noinline njs_ret_t njs_array_prototype_some_cont(njs_vm_t *vm,
-    njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
-static nxt_noinline njs_ret_t njs_array_prototype_every_cont(njs_vm_t *vm,
+static njs_ret_t njs_array_prototype_for_each_continuation(njs_vm_t *vm,
     njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
-static njs_ret_t njs_array_prototype_filter_cont(njs_vm_t *vm,
+static njs_ret_t njs_array_prototype_some_continuation(njs_vm_t *vm,
     njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
-static njs_ret_t njs_array_prototype_map_cont(njs_vm_t *vm, njs_value_t *args,
-    nxt_uint_t nargs, njs_index_t unused);
-static njs_ret_t njs_array_prototype_reduce_cont(njs_vm_t *vm,
+static njs_ret_t njs_array_prototype_every_continuation(njs_vm_t *vm,
     njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
-static njs_ret_t njs_array_prototype_reduce_right_cont(njs_vm_t *vm,
+static njs_ret_t njs_array_prototype_filter_continuation(njs_vm_t *vm,
+    njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
+static njs_ret_t njs_array_prototype_map_continuation(njs_vm_t *vm,
+    njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
+static njs_ret_t njs_array_prototype_reduce_continuation(njs_vm_t *vm,
+    njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
+static njs_ret_t njs_array_prototype_reduce_right_continuation(njs_vm_t *vm,
     njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
 static nxt_noinline njs_ret_t njs_array_iterator_args(njs_vm_t *vm,
     njs_value_t *args, nxt_uint_t nargs);
@@ -109,8 +107,8 @@ static nxt_noinline uint32_t njs_array_i
 static nxt_noinline njs_ret_t njs_array_iterator_apply(njs_vm_t *vm,
     njs_array_iter_t *iter, njs_value_t *args, nxt_uint_t nargs);
 static uint32_t njs_array_reduce_right_next(njs_array_t *array, int32_t n);
-static njs_ret_t njs_array_prototype_sort_cont(njs_vm_t *vm, njs_value_t *args,
-    nxt_uint_t nargs, njs_index_t unused);
+static njs_ret_t njs_array_prototype_sort_continuation(njs_vm_t *vm,
+    njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
 
 
 nxt_noinline njs_array_t *
@@ -932,7 +930,7 @@ njs_array_prototype_concat(njs_vm_t *vm,
 }
 
 
-static nxt_noinline njs_value_t *
+static njs_value_t *
 njs_array_copy(njs_value_t *dst, njs_value_t *src)
 {
     nxt_uint_t  n;
@@ -1031,14 +1029,14 @@ njs_array_prototype_for_each(njs_vm_t *v
     }
 
     iter = njs_continuation(vm->frame);
-    iter->u.cont.function = njs_array_prototype_for_each_cont;
+    iter->u.cont.function = njs_array_prototype_for_each_continuation;
 
-    return njs_array_prototype_for_each_cont(vm, args, nargs, unused);
+    return njs_array_prototype_for_each_continuation(vm, args, nargs, unused);
 }
 
 
 static njs_ret_t
-njs_array_prototype_for_each_cont(njs_vm_t *vm, njs_value_t *args,
+njs_array_prototype_for_each_continuation(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, njs_index_t unused)
 {
     njs_array_iter_t  *iter;
@@ -1067,15 +1065,15 @@ njs_array_prototype_some(njs_vm_t *vm, n
     }
 
     iter = njs_continuation(vm->frame);
-    iter->u.cont.function = njs_array_prototype_some_cont;
+    iter->u.cont.function = njs_array_prototype_some_continuation;
     iter->retval.data.truth = 0;
 
-    return njs_array_prototype_some_cont(vm, args, nargs, unused);
+    return njs_array_prototype_some_continuation(vm, args, nargs, unused);
 }
 
 
 static njs_ret_t
-njs_array_prototype_some_cont(njs_vm_t *vm, njs_value_t *args,
+njs_array_prototype_some_continuation(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, njs_index_t unused)
 {
     njs_array_iter_t   *iter;
@@ -1112,15 +1110,15 @@ njs_array_prototype_every(njs_vm_t *vm, 
     }
 
     iter = njs_continuation(vm->frame);
-    iter->u.cont.function = njs_array_prototype_every_cont;
+    iter->u.cont.function = njs_array_prototype_every_continuation;
     iter->retval.data.truth = 1;
 
-    return njs_array_prototype_every_cont(vm, args, nargs, unused);
+    return njs_array_prototype_every_continuation(vm, args, nargs, unused);
 }
 
 
 static njs_ret_t
-njs_array_prototype_every_cont(njs_vm_t *vm, njs_value_t *args,
+njs_array_prototype_every_continuation(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, njs_index_t unused)
 {
     njs_array_iter_t   *iter;
@@ -1157,7 +1155,7 @@ njs_array_prototype_filter(njs_vm_t *vm,
     }
 
     filter = njs_continuation(vm->frame);
-    filter->iter.u.cont.function = njs_array_prototype_filter_cont;
+    filter->iter.u.cont.function = njs_array_prototype_filter_continuation;
     filter->iter.retval.data.truth = 0;
 
     filter->array = njs_array_alloc(vm, 0, NJS_ARRAY_SPARE);
@@ -1165,12 +1163,12 @@ njs_array_prototype_filter(njs_vm_t *vm,
         return NXT_ERROR;
     }
 
-    return njs_array_prototype_filter_cont(vm, args, nargs, unused);
+    return njs_array_prototype_filter_continuation(vm, args, nargs, unused);
 }
 
 
 static njs_ret_t
-njs_array_prototype_filter_cont(njs_vm_t *vm, njs_value_t *args,
+njs_array_prototype_filter_continuation(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, njs_index_t unused)
 {
     nxt_int_t           ret;
@@ -1219,7 +1217,7 @@ njs_array_prototype_map(njs_vm_t *vm, nj
     }
 
     map = njs_continuation(vm->frame);
-    map->iter.u.cont.function = njs_array_prototype_map_cont;
+    map->iter.u.cont.function = njs_array_prototype_map_continuation;
     njs_set_invalid(&map->iter.retval);
 
     array = args[0].data.u.array;
@@ -1238,12 +1236,12 @@ njs_array_prototype_map(njs_vm_t *vm, nj
         size--;
     }
 
-    return njs_array_prototype_map_cont(vm, args, nargs, unused);
+    return njs_array_prototype_map_continuation(vm, args, nargs, unused);
 }
 
 
 static njs_ret_t
-njs_array_prototype_map_cont(njs_vm_t *vm, njs_value_t *args,
+njs_array_prototype_map_continuation(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, njs_index_t unused)
 {
     njs_array_map_t  *map;
@@ -1283,7 +1281,7 @@ njs_array_prototype_reduce(njs_vm_t *vm,
     }
 
     iter = njs_continuation(vm->frame);
-    iter->u.cont.function = njs_array_prototype_reduce_cont;
+    iter->u.cont.function = njs_array_prototype_reduce_continuation;
 
     if (nargs > 2) {
         iter->retval = args[2];
@@ -1302,12 +1300,12 @@ njs_array_prototype_reduce(njs_vm_t *vm,
         iter->next_index = njs_array_iterator_next(array, n + 1, array->length);
     }
 
-    return njs_array_prototype_reduce_cont(vm, args, nargs, unused);
+    return njs_array_prototype_reduce_continuation(vm, args, nargs, unused);
 }
 
 
 static njs_ret_t
-njs_array_prototype_reduce_cont(njs_vm_t *vm, njs_value_t *args,
+njs_array_prototype_reduce_continuation(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, njs_index_t unused)
 {
     nxt_int_t         n;
@@ -1431,7 +1429,7 @@ njs_array_prototype_reduce_right(njs_vm_
     }
 
     iter = njs_continuation(vm->frame);
-    iter->u.cont.function = njs_array_prototype_reduce_right_cont;
+    iter->u.cont.function = njs_array_prototype_reduce_right_continuation;
 
     array = args[0].data.u.array;
     iter->next_index = njs_array_reduce_right_next(array, array->length);
@@ -1451,8 +1449,8 @@ njs_array_prototype_reduce_right(njs_vm_
         iter->next_index = njs_array_reduce_right_next(array, n);
     }
 
-    return njs_array_prototype_reduce_right_cont(vm, args, nargs, unused);
-
+    return njs_array_prototype_reduce_right_continuation(vm, args, nargs,
+                                                         unused);
 type_error:
 
     vm->exception = &njs_exception_type_error;
@@ -1462,7 +1460,7 @@ type_error:
 
 
 static njs_ret_t
-njs_array_prototype_reduce_right_cont(njs_vm_t *vm, njs_value_t *args,
+njs_array_prototype_reduce_right_continuation(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, njs_index_t unused)
 {
     nxt_int_t         n;
@@ -1555,7 +1553,7 @@ njs_array_prototype_sort(njs_vm_t *vm, n
     if (njs_is_array(&args[0]) && args[0].data.u.array->length > 1) {
 
         sort = njs_continuation(vm->frame);
-        sort->u.cont.function = njs_array_prototype_sort_cont;
+        sort->u.cont.function = njs_array_prototype_sort_continuation;
         sort->current = 0;
         sort->retval = njs_value_zero;
 
@@ -1566,7 +1564,7 @@ njs_array_prototype_sort(njs_vm_t *vm, n
             sort->function = (njs_function_t *) &njs_array_string_sort_function;
         }
 
-        return njs_array_prototype_sort_cont(vm, args, nargs, unused);
+        return njs_array_prototype_sort_continuation(vm, args, nargs, unused);
     }
 
     vm->retval = args[0];
@@ -1576,7 +1574,7 @@ njs_array_prototype_sort(njs_vm_t *vm, n
 
 
 static njs_ret_t
-njs_array_prototype_sort_cont(njs_vm_t *vm, njs_value_t *args,
+njs_array_prototype_sort_continuation(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, njs_index_t unused)
 {
     nxt_int_t         n;
diff -r e6e192a55774 -r dcd8a105b5e7 njs/njs_string.c
--- a/njs/njs_string.c	Mon Aug 15 11:33:37 2016 +0300
+++ b/njs/njs_string.c	Tue Aug 16 18:09:35 2016 +0300
@@ -37,7 +37,7 @@ static nxt_noinline void njs_string_slic
     njs_slice_prop_t *slice, njs_value_t *args, nxt_uint_t nargs);
 static nxt_noinline void njs_string_slice_args(njs_slice_prop_t *slice,
     njs_value_t *args, nxt_uint_t nargs);
-static njs_ret_t njs_string_prototype_from_char_code(njs_vm_t *vm,
+static njs_ret_t njs_string_from_char_code(njs_vm_t *vm,
     njs_value_t *args, nxt_uint_t nargs, njs_index_t unused);
 static nxt_noinline ssize_t njs_string_index_of(njs_vm_t *vm,
     njs_value_t *src, njs_value_t *search_string, size_t index);
@@ -334,18 +334,18 @@ static const njs_object_prop_t  njs_stri
         .value = njs_native_getter(njs_object_prototype_create),
     },
 
+    /* String.fromCharCode(). */
     {
         .type = NJS_METHOD,
         .name = njs_string("fromCharCode"),
-        .value = njs_native_function(njs_string_prototype_from_char_code, 0, 0),
+        .value = njs_native_function(njs_string_from_char_code, 0, 0),
     },
 
-
-    /* ECMAScript 6, fromCodePoint(). */
+    /* String.fromCodePoint(), ECMAScript 6. */
     {
         .type = NJS_METHOD,
         .name = njs_string("fromCodePoint"),
-        .value = njs_native_function(njs_string_prototype_from_char_code, 0, 0),
+        .value = njs_native_function(njs_string_from_char_code, 0, 0),
     },
 };
 
@@ -1064,7 +1064,7 @@ done:
 
 
 static njs_ret_t
-njs_string_prototype_from_char_code(njs_vm_t *vm, njs_value_t *args,
+njs_string_from_char_code(njs_vm_t *vm, njs_value_t *args,
     nxt_uint_t nargs, njs_index_t unused)
 {
     u_char      *p;
@@ -1409,6 +1409,10 @@ njs_string_prototype_to_upper_case(njs_v
 }
 
 
+/*
+ * String.search([regexp])
+ */
+
 static njs_ret_t
 njs_string_prototype_search(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
     njs_index_t unused)
@@ -1482,6 +1486,7 @@ static njs_ret_t
 njs_string_prototype_match(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
     njs_index_t unused)
 {
+    int                   *captures;
     u_char                *start;
     int32_t               size, length;
     njs_ret_t             ret;
@@ -1490,7 +1495,6 @@ njs_string_prototype_match(njs_vm_t *vm,
     njs_array_t           *array;
     njs_string_prop_t     string;
     njs_regexp_pattern_t  *pattern;
-    int                   *captures;
 
     if (nargs == 1) {
         goto empty;
@@ -2047,7 +2051,7 @@ static const njs_object_prop_t  njs_stri
                      NJS_STRING_OBJECT_ARG, NJS_INTEGER_ARG),
     },
 
-    /* ECMAScript 6, codePointAt(). */
+    /* String.codePointAt(), ECMAScript 6. */
     {
         .type = NJS_METHOD,
         .name = njs_string("codePointAt"),
diff -r e6e192a55774 -r dcd8a105b5e7 njs/njs_vm.h
--- a/njs/njs_vm.h	Mon Aug 15 11:33:37 2016 +0300
+++ b/njs/njs_vm.h	Tue Aug 16 18:09:35 2016 +0300
@@ -780,7 +780,7 @@ struct njs_vm_s {
     nxt_lvlhsh_t             values_hash;
 
     /*
-     * The prototypes and constructors arrays must be togther because
+     * The prototypes and constructors arrays must be together because
      * they are copied from njs_vm_shared_t by single memcpy()
      * in njs_builtin_objects_clone().
      */
diff -r e6e192a55774 -r dcd8a105b5e7 nxt/nxt_djb_hash.h
--- a/nxt/nxt_djb_hash.h	Mon Aug 15 11:33:37 2016 +0300
+++ b/nxt/nxt_djb_hash.h	Tue Aug 16 18:09:35 2016 +0300
@@ -18,7 +18,7 @@ NXT_EXPORT uint32_t nxt_djb_hash_lowcase
 #define NXT_DJB_HASH_INIT  5381
 
 
-#define nxt_djb_hash_add(hash, val)                                            \
+#define nxt_djb_hash_add(hash, val)                                           \
     ((uint32_t) ((((hash) << 5) + (hash)) ^ (uint32_t) (val)))
 
 
diff -r e6e192a55774 -r dcd8a105b5e7 nxt/nxt_lvlhsh.c
--- a/nxt/nxt_lvlhsh.c	Mon Aug 15 11:33:37 2016 +0300
+++ b/nxt/nxt_lvlhsh.c	Tue Aug 16 18:09:35 2016 +0300
@@ -48,98 +48,98 @@
  * several levels.
  */
 
-#define nxt_lvlhsh_is_bucket(p)                                                \
+#define nxt_lvlhsh_is_bucket(p)                                               \
     ((uintptr_t) (p) & 1)
 
 
-#define nxt_lvlhsh_count_inc(n)                                                \
+#define nxt_lvlhsh_count_inc(n)                                               \
     n = (void *) ((uintptr_t) (n) + 2)
 
 
-#define nxt_lvlhsh_count_dec(n)                                                \
+#define nxt_lvlhsh_count_dec(n)                                               \
     n = (void *) ((uintptr_t) (n) - 2)
 
 
-#define nxt_lvlhsh_level_size(proto, nlvl)                                     \
+#define nxt_lvlhsh_level_size(proto, nlvl)                                    \
     ((uintptr_t) 1 << proto->shift[nlvl])
 
 
-#define nxt_lvlhsh_level(lvl, mask)                                            \
+#define nxt_lvlhsh_level(lvl, mask)                                           \
     (void **) ((uintptr_t) lvl & (~mask << 2))
 
 
-#define nxt_lvlhsh_level_entries(lvl, mask)                                    \
+#define nxt_lvlhsh_level_entries(lvl, mask)                                   \
     ((uintptr_t) lvl & (mask << 1))
 
 
-#define nxt_lvlhsh_store_bucket(slot, bkt)                                     \
+#define nxt_lvlhsh_store_bucket(slot, bkt)                                    \
     slot = (void **) ((uintptr_t) bkt | 2 | 1)
 
 
-#define nxt_lvlhsh_bucket_size(proto)                                          \
+#define nxt_lvlhsh_bucket_size(proto)                                         \
     proto->bucket_size
 
 
-#define nxt_lvlhsh_bucket(proto, bkt)                                          \
+#define nxt_lvlhsh_bucket(proto, bkt)                                         \
     (uint32_t *) ((uintptr_t) bkt & ~(uintptr_t) proto->bucket_mask)
 
 
-#define nxt_lvlhsh_bucket_entries(proto, bkt)                                  \
+#define nxt_lvlhsh_bucket_entries(proto, bkt)                                 \
     (((uintptr_t) bkt & (uintptr_t) proto->bucket_mask) >> 1)
 
 
-#define nxt_lvlhsh_bucket_end(proto, bkt)                                      \
+#define nxt_lvlhsh_bucket_end(proto, bkt)                                     \
     &bkt[proto->bucket_end]
 
 
-#define nxt_lvlhsh_free_entry(e)                                               \
+#define nxt_lvlhsh_free_entry(e)                                              \
     (!(nxt_lvlhsh_valid_entry(e)))
 
 
-#define nxt_lvlhsh_next_bucket(proto, bkt)                                     \
+#define nxt_lvlhsh_next_bucket(proto, bkt)                                    \
     ((void **) &bkt[proto->bucket_end])
 
 #if (NXT_64BIT)
 
-#define nxt_lvlhsh_valid_entry(e)                                              \
+#define nxt_lvlhsh_valid_entry(e)                                             \
     (((e)[0] | (e)[1]) != 0)
 
 
-#define nxt_lvlhsh_entry_value(e)                                              \
+#define nxt_lvlhsh_entry_value(e)                                             \
     (void *) (((uintptr_t) (e)[1] << 32) + (e)[0])
 
 
-#define nxt_lvlhsh_set_entry_value(e, n)                                       \
+#define nxt_lvlhsh_set_entry_value(e, n)                                      \
     (e)[0] = (uint32_t)  (uintptr_t) n;                                       \
     (e)[1] = (uint32_t) ((uintptr_t) n >> 32)
 
 
-#define nxt_lvlhsh_entry_key(e)                                                \
+#define nxt_lvlhsh_entry_key(e)                                               \
     (e)[2]
 
 
-#define nxt_lvlhsh_set_entry_key(e, n)                                         \
+#define nxt_lvlhsh_set_entry_key(e, n)                                        \
     (e)[2] = n
 
 #else
 
-#define nxt_lvlhsh_valid_entry(e)                                              \
+#define nxt_lvlhsh_valid_entry(e)                                             \
     ((e)[0] != 0)
 
 
-#define nxt_lvlhsh_entry_value(e)                                              \
+#define nxt_lvlhsh_entry_value(e)                                             \
     (void *) (e)[0]
 
 
-#define nxt_lvlhsh_set_entry_value(e, n)                                       \
+#define nxt_lvlhsh_set_entry_value(e, n)                                      \
     (e)[0] = (uint32_t) n
 
 
-#define nxt_lvlhsh_entry_key(e)                                                \
+#define nxt_lvlhsh_entry_key(e)                                               \
     (e)[1]
 
 
-#define nxt_lvlhsh_set_entry_key(e, n)                                         \
+#define nxt_lvlhsh_set_entry_key(e, n)                                        \
     (e)[1] = n
 
 #endif
diff -r e6e192a55774 -r dcd8a105b5e7 nxt/nxt_lvlhsh.h
--- a/nxt/nxt_lvlhsh.h	Mon Aug 15 11:33:37 2016 +0300
+++ b/nxt/nxt_lvlhsh.h	Tue Aug 16 18:09:35 2016 +0300
@@ -69,11 +69,11 @@ typedef void (*nxt_lvlhsh_free_t)(void *
 
 
 typedef struct {
-    uint32_t                 bucket_end;
-    uint32_t                 bucket_size;
-    uint32_t                 bucket_mask;
-    uint8_t                  shift[8];
-    uint32_t                 nalloc;
+    uint32_t                  bucket_end;
+    uint32_t                  bucket_size;
+    uint32_t                  bucket_mask;
+    uint8_t                   shift[8];
+    uint32_t                  nalloc;
 
     nxt_lvlhsh_test_t         test;
     nxt_lvlhsh_alloc_t        alloc;
@@ -87,28 +87,28 @@ typedef struct {
     nxt_lvlhsh_free_t         free;
 
     /* The maximum allowed aligned shift. */
-    uint32_t                 max_shift;
-    uint32_t                 nalloc;
+    uint32_t                  max_shift;
+    uint32_t                  nalloc;
 } nxt_lvlhsh_ctx_t;
 
 
 typedef struct {
-    void                      *slot;
+    void                       *slot;
 } nxt_lvlhsh_t;
 
 
 struct nxt_lvlhsh_query_s {
-    uint32_t                 key_hash;
-    nxt_str_t                key;
+    uint32_t                  key_hash;
+    nxt_str_t                 key;
 
-    uint8_t                  replace;     /* 1 bit */
-    void                     *value;
+    uint8_t                   replace;     /* 1 bit */
+    void                      *value;
 
     const nxt_lvlhsh_proto_t  *proto;
-    void                     *pool;
+    void                      *pool;
 
     /* Opaque data passed for the test function. */
-    void                     *data;
+    void                      *data;
 };
 
 
@@ -166,10 +166,10 @@ typedef struct {
      * bits, because entry positions are not aligned.  A current level is
      * stored as key bit path from the root.
      */
-    uint32_t                 *bucket;
-    uint32_t                 current;
-    uint32_t                 entry;
-    uint32_t                 entries;
+    uint32_t                  *bucket;
+    uint32_t                  current;
+    uint32_t                  entry;
+    uint32_t                  entries;
 } nxt_lvlhsh_each_t;
 
 
diff -r e6e192a55774 -r dcd8a105b5e7 nxt/nxt_mem_cache_pool.c
--- a/nxt/nxt_mem_cache_pool.c	Mon Aug 15 11:33:37 2016 +0300
+++ b/nxt/nxt_mem_cache_pool.c	Tue Aug 16 18:09:35 2016 +0300
@@ -110,15 +110,15 @@ struct nxt_mem_cache_pool_s {
 #define NXT_MEM_CACHE_EMBEDDED_BLOCK  2
 
 
-#define nxt_mem_cache_chunk_is_free(map, chunk)                                \
+#define nxt_mem_cache_chunk_is_free(map, chunk)                               \
     ((map[chunk / 8] & (0x80 >> (chunk & 7))) == 0)
 
 
-#define nxt_mem_cache_chunk_set_free(map, chunk)                               \
+#define nxt_mem_cache_chunk_set_free(map, chunk)                              \
     map[chunk / 8] &= ~(0x80 >> (chunk & 7))
 
 
-#define nxt_mem_cache_free_junk(p, size)                                       \
+#define nxt_mem_cache_free_junk(p, size)                                      \
     memset((p), 0x5A, size)
 
 
diff -r e6e192a55774 -r dcd8a105b5e7 nxt/nxt_rbtree.c
--- a/nxt/nxt_rbtree.c	Mon Aug 15 11:33:37 2016 +0300
+++ b/nxt/nxt_rbtree.c	Tue Aug 16 18:09:35 2016 +0300
@@ -54,7 +54,7 @@ nxt_rbtree_init(nxt_rbtree_t *tree, nxt_
 
     /*
      * The sentinel's right child is never used so
-     * or comparison callback can be safely stored here.
+     * comparison callback can be safely stored here.
      */
     tree->sentinel.right = (void *) compare;
 
diff -r e6e192a55774 -r dcd8a105b5e7 nxt/nxt_rbtree.h
--- a/nxt/nxt_rbtree.h	Mon Aug 15 11:33:37 2016 +0300
+++ b/nxt/nxt_rbtree.h	Tue Aug 16 18:09:35 2016 +0300
@@ -15,7 +15,7 @@ struct nxt_rbtree_node_s {
     nxt_rbtree_node_t         *right;
     nxt_rbtree_node_t         *parent;
 
-    uint8_t                  color;
+    uint8_t                   color;
 };
 
 
@@ -28,7 +28,7 @@ typedef struct {
 
 #define NXT_RBTREE_NODE(node)                                                 \
     nxt_rbtree_part_t         node;                                           \
-    uint8_t                  node##_color
+    uint8_t                   node##_color
 
 
 #define NXT_RBTREE_NODE_INIT  { NULL, NULL, NULL }, 0



More information about the nginx-devel mailing list