diff options
author | Valentin Bartenev <vbart@nginx.com> | 2017-06-27 17:27:18 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2017-06-27 17:27:18 +0300 |
commit | dfd3cc8c0eb7f3479ee08b5e518abd264da56a29 (patch) | |
tree | b6cdbfab23ce9ea2c498bcb0f540d4847472f067 /src/nxt_array.c | |
parent | f86c80309885230df2960ef8e1db337f04b11926 (diff) | |
download | unit-dfd3cc8c0eb7f3479ee08b5e518abd264da56a29.tar.gz unit-dfd3cc8c0eb7f3479ee08b5e518abd264da56a29.tar.bz2 |
Applied nxt_pointer_to() and nxt_value_at() where possible.
Diffstat (limited to 'src/nxt_array.c')
-rw-r--r-- | src/nxt_array.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_array.c b/src/nxt_array.c index d7bc28bd..f26670f5 100644 --- a/src/nxt_array.c +++ b/src/nxt_array.c @@ -18,7 +18,7 @@ nxt_array_create(nxt_mp_t *mp, nxt_uint_t n, size_t size) return NULL; } - array->elts = (char *) array + sizeof(nxt_array_t); + array->elts = nxt_pointer_to(array, sizeof(nxt_array_t)); array->nelts = 0; array->size = size; array->nalloc = n; @@ -61,7 +61,7 @@ nxt_array_add(nxt_array_t *array) array->nalloc = new_alloc; } - p = (char *) array->elts + array->size * array->nelts; + p = nxt_pointer_to(array->elts, array->size * array->nelts); array->nelts++; return p; |