]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/intrusivelist.qh
Revert IL_REMOVE fix (breaks too much)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / intrusivelist.qh
index 10de3e9630e8c55ba1ba86455ce4a530cd908e85..4fa49d3f3bfef7bc41035a9bb56e35cf1db755a4 100644 (file)
@@ -16,8 +16,8 @@ void IL_ENDFRAME();
  *   freed entities must be removed from the list
  */
 CLASS(IntrusiveList, Object)
-       ATTRIB(IntrusiveList, il_head, entity, NULL);
-       ATTRIB(IntrusiveList, il_tail, entity, NULL);
+       ATTRIB(IntrusiveList, il_head, entity);
+       ATTRIB(IntrusiveList, il_tail, entity);
        ATTRIB(IntrusiveList, il_nextfld, .entity, nil);
        ATTRIB(IntrusiveList, il_prevfld, .entity, nil);
        INIT(IntrusiveList) { IL_INIT(this); }
@@ -121,13 +121,14 @@ void IL_REMOVE(IntrusiveList this, entity it)
        assert(this, return);
        .entity il_next = this.il_nextfld;
        .entity il_prev = this.il_prevfld;
+       //assert(!IL_CONTAINS(this, it), return);
        entity next = it.(il_next);
        entity prev = it.(il_prev);
        entity ohead = this.il_head;
        entity otail = this.il_tail;
        next ? next.(il_prev) = prev : this.il_tail = prev;
        prev ? prev.(il_next) = next : this.il_head = next;
-       LOG_DEBUGF("remove %i (%i :: %i), head: %i -> %i, tail: %i -> %i\n", it, it.(il_prev), it.(il_next), ohead, this.il_head, otail, this.il_tail);
+       LOG_DEBUGF("remove %i (%i :: %i), head: %i -> %i, tail: %i -> %i", it, it.(il_prev), it.(il_next), ohead, this.il_head, otail, this.il_tail);
        it.(il_next) = it.(il_prev) = NULL;
 }
 
@@ -147,7 +148,7 @@ void IL_REMOVE(IntrusiveList this, entity it)
 /**
  * Delete the list
  */
-#define IL_DELETE(this, dtor) \
+#define IL_DELETE(this) \
        MACRO_BEGIN \
        { \
                delete(this); \
@@ -204,7 +205,7 @@ void IL_INIT(IntrusiveList this)
                        return;
                }
        }
-       LOG_WARNINGF("IntrusiveList overflow");
+       LOG_WARNF("IntrusiveList overflow");
 }
 
 void IL_DTOR(IntrusiveList this)