diff options
Diffstat (limited to 'include/list.h')
-rw-r--r-- | include/list.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/list.h b/include/list.h index c67b24b2..d9cd9d34 100644 --- a/include/list.h +++ b/include/list.h @@ -56,7 +56,8 @@ typedef struct list { static inline element_t *get_head(list_t *list) { - return &list->element_prealloc_buf[0]; + /* The first element is the head */ + return list->element_prealloc_buf; } @@ -106,6 +107,7 @@ static inline void list_append(list_t *list, void *el) { if (!el_box) FATAL("foreach over uninitialized list"); \ while (el_box != head) { \ \ + __attribute__((unused)) \ type *el = (type *)((el_box)->data); \ /* get next so el_box can be unlinked */ \ element_t *next = el_box->next; \ |