summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_vector.h
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2017-06-27 17:27:18 +0300
committerValentin Bartenev <vbart@nginx.com>2017-06-27 17:27:18 +0300
commitdfd3cc8c0eb7f3479ee08b5e518abd264da56a29 (patch)
treeb6cdbfab23ce9ea2c498bcb0f540d4847472f067 /src/nxt_vector.h
parentf86c80309885230df2960ef8e1db337f04b11926 (diff)
downloadunit-dfd3cc8c0eb7f3479ee08b5e518abd264da56a29.tar.gz
unit-dfd3cc8c0eb7f3479ee08b5e518abd264da56a29.tar.bz2
Applied nxt_pointer_to() and nxt_value_at() where possible.
Diffstat (limited to 'src/nxt_vector.h')
-rw-r--r--src/nxt_vector.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nxt_vector.h b/src/nxt_vector.h
index ddd3e220..e8836dbf 100644
--- a/src/nxt_vector.h
+++ b/src/nxt_vector.h
@@ -43,9 +43,8 @@ NXT_EXPORT void nxt_vector_remove(nxt_vector_t *vector, void *item);
#define \
nxt_vector_last(vector) \
- ((void *) \
- ((char *) (vector)->start \
- + (vector)->item_size * ((vector)->items - 1)))
+ nxt_pointer_to((vector)->start, \
+ (vector)->item_size * ((vector)->items - 1))
#define \
@@ -62,7 +61,7 @@ nxt_inline void *
nxt_vector_remove_last(nxt_vector_t *vector)
{
vector->items--;
- return (char *) vector->start + vector->item_size * vector->items;
+ return nxt_pointer_to(vector->start, vector->item_size * vector->items);
}