Initialize the new "flags" integer when creating a list.

This commit is contained in:
Wayne Davison 2006-03-07 22:05:44 +00:00
parent 974fd9b633
commit 5fd72f0f1a
2 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,7 @@ newlinklist(void)
list = (LinkList) zhalloc(sizeof *list);
list->list.first = NULL;
list->list.last = &list->node;
list->list.flags = 0;
return list;
}
@ -53,6 +54,7 @@ znewlinklist(void)
list = (LinkList) zalloc(sizeof *list);
list->list.first = NULL;
list->list.last = &list->node;
list->list.flags = 0;
return list;
}

View File

@ -415,12 +415,14 @@ union linkroot {
do { \
(N).list.first = NULL; \
(N).list.last = &(N).node; \
(N).list.flags = 0; \
} while (0)
#define local_list1(N) union linkroot N; struct linknode __n0
#define init_list1(N,V0) \
do { \
(N).list.first = &__n0; \
(N).list.last = &__n0; \
(N).list.flags = 0; \
__n0.next = NULL; \
__n0.prev = &(N).node; \
__n0.dat = (void *) (V0); \