]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
simplify some linked list stuff
authorRudolf Polzer <divverent@alientrap.org>
Mon, 30 Apr 2012 10:45:16 +0000 (12:45 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 30 Apr 2012 10:45:16 +0000 (12:45 +0200)
qcsrc/menu/anim/animhost.c
qcsrc/menu/item/container.c

index 7388ee845d279530b314e4fe78af2b2d412e915b..ae84e0957da7be5efaff03271861b81b5810d6c4 100644 (file)
@@ -29,8 +29,7 @@ void AnimHost_addAnim(entity me, entity other)
 
        other.parent = me;
 
-       entity f, l;
-       f = me.firstChild;
+       entity l;
        l = me.lastChild;
 
        if(l)
index 0e8fa9ea0a6d1d627e780759e33edb3dac1fa557..6241cee03968c077249d62bfbdcb8b81a91ec3a9 100644 (file)
@@ -304,8 +304,7 @@ void Container_addItem(entity me, entity other, vector theOrigin, vector theSize
        other.Container_size = theSize;
        me.setAlphaOf(me, other, theAlpha);
 
-       entity f, l;
-       f = me.firstChild;
+       entity l;
        l = me.lastChild;
 
        if(l)
@@ -330,9 +329,7 @@ void Container_removeItem(entity me, entity other)
 
        other.parent = NULL;
 
-       entity n, p, f, l;
-       f = me.firstChild;
-       l = me.lastChild;
+       entity n, p;
        n = other.nextSibling;
        p = other.prevSibling;
 
@@ -371,13 +368,11 @@ void Container_setFocus(entity me, entity other)
 void Container_moveItemAfter(entity me, entity other, entity dest)
 {
        // first: remove other from the chain
-       entity n, p, f, l;
+       entity n, p;
 
        if(other.parent != me)
                error("Can't move in wrong container!");
 
-       f = me.firstChild;
-       l = me.lastChild;
        n = other.nextSibling;
        p = other.prevSibling;