]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/sort.qh
Merge branch 'master' into Lyberta/TeamplayOverhaul
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / sort.qh
index 4313954cdc91c9a8497339d12af4dcaead45b665..565ebb29c81513276a8f49334cfebd2589cb0986 100644 (file)
@@ -1,10 +1,11 @@
 #pragma once
 
 /** is only ever called for i1 < i2 */
-typedef void (int i1, int i2, entity pass) swapfunc_t;
+USING(swapfunc_t, void (int i1, int i2, entity pass));
 /** <0 for <, ==0 for ==, >0 for > (like strcmp) */
-typedef int (int i1, int i2, entity pass) comparefunc_t;
+USING(comparefunc_t, int (int i1, int i2, entity pass));
 
+ERASEABLE
 void heapsort(int n, swapfunc_t swap, comparefunc_t cmp, entity pass)
 {
        #define heapify(_count) \
@@ -39,6 +40,7 @@ void heapsort(int n, swapfunc_t swap, comparefunc_t cmp, entity pass)
        }
 }
 
+ERASEABLE
 void shuffle(float n, swapfunc_t swap, entity pass)
 {
        for (int i = 1; i < n; ++i)