summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_list.h
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-11-20 17:08:29 +0300
committerMax Romanov <max.romanov@nginx.com>2017-11-20 17:08:29 +0300
commit6bbed85899d16b063df41ffc2cbf314402ad73e6 (patch)
tree79ac837f8c959bc19a7bb1beafaacf336681b7d7 /src/nxt_list.h
parentfa76ea700ff2326c929f9c9f5ff40915a41d0a89 (diff)
downloadunit-6bbed85899d16b063df41ffc2cbf314402ad73e6.tar.gz
unit-6bbed85899d16b063df41ffc2cbf314402ad73e6.tar.bz2
Fixing Coverity warnings.
CID 200496 CID 200494 CID 200490 CID 200489 CID 200483 CID 200482 CID 200472 CID 200465
Diffstat (limited to 'src/nxt_list.h')
-rw-r--r--src/nxt_list.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nxt_list.h b/src/nxt_list.h
index f400a356..ecbb67a9 100644
--- a/src/nxt_list.h
+++ b/src/nxt_list.h
@@ -13,6 +13,7 @@ typedef struct nxt_list_part_s nxt_list_part_t;
struct nxt_list_part_s {
nxt_list_part_t *next;
uintptr_t nelts;
+ char data[];
};
@@ -43,12 +44,12 @@ nxt_list_part(list) \
#define \
nxt_list_data(part) \
- nxt_pointer_to(part, sizeof(nxt_list_part_t))
+ ((void *) part->data)
#define \
nxt_list_first(list) \
- (void *) nxt_list_data(nxt_list_part(list))
+ nxt_list_data(nxt_list_part(list))
nxt_inline void *
@@ -80,7 +81,7 @@ nxt_list_elt(nxt_list_t *list, nxt_uint_t n)
nxt_list_part_t *_part = nxt_list_part(list); \
\
do { \
- elt = (void *) nxt_list_data(_part); \
+ elt = nxt_list_data(_part); \
\
for (_end = (elt + _part->nelts); elt != _end; elt++) { \