ATTRIB(IntrusiveList, il_tail, entity);
ATTRIB(IntrusiveList, il_nextfld, .entity, nil);
ATTRIB(IntrusiveList, il_prevfld, .entity, nil);
- ATTRIB(IntrusiveList, il_loop_item, entity, nil);
+ ATTRIB(IntrusiveList, il_loop_item, entity, NULL);
INIT(IntrusiveList) { IL_INIT(this); }
DESTRUCTOR(IntrusiveList) { IL_DTOR(this); }
ENDCLASS(IntrusiveList)
entity prev = it.(il_prev);
if (prev) (this.il_tail = prev).(il_next) = NULL;
else this.il_head = this.il_tail = NULL;
+ if (this.il_loop_item == it)
+ this.il_loop_item = NULL;
+ it.(il_prev) = NULL;
return it;
}
entity next = it.(il_next);
if (next) (this.il_head = next).(il_prev) = NULL;
else this.il_head = this.il_tail = NULL;
+ if (this.il_loop_item == it)
+ this.il_loop_item = it.(il_next);
+ it.(il_next) = NULL;
return it;
}
else \
_next = it.(il_next); /* in case next item has changed */ \
} \
- this.il_loop_item = nil; \
+ this.il_loop_item = NULL; \
MACRO_END
.int il_id;