summaryrefslogtreecommitdiff
path: root/include/libHX/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libHX/list.h')
-rw-r--r--include/libHX/list.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/libHX/list.h b/include/libHX/list.h
index f226bec..fc43e20 100644
--- a/include/libHX/list.h
+++ b/include/libHX/list.h
@@ -55,6 +55,12 @@ static __inline__ void HXlist_del(struct HXlist_head *entry)
entry->next->prev = entry->prev;
entry->next = NULL;
entry->prev = NULL;
+ /*
+ * The node is now not connected to any (true) list head, so setting
+ * ``entry->next = entry;`` does not make much sense. You can call
+ * HXlist_init if needed, and the compiler will optimize the extraneous
+ * assignemtns from HXlist_del away.
+ */
}
static __inline__ bool HXlist_empty(const struct HXlist_head *head)
@@ -104,7 +110,7 @@ struct HXclist_head {
struct HXlist_head *next, *prev;
};
};
- unsigned int items;
+ size_t items;
};
#define HXCLIST_HEAD_INIT(name) {{{&(name).list, &(name).list}}, 0}