]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/sortlist.qh
Merge branch 'terencehill/menu_optimization' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / sortlist.qh
index d4a1f183e15bc2e51fa9d94ec273b9054eae399b..af4b47ab8058ad35a8f8b6405538cc3f4ed32a31 100644 (file)
@@ -1,9 +1,8 @@
-#ifndef SORTLIST_H
-#define SORTLIST_H
+#pragma once
 
 entityclass(Sort);
-//.float(entity,entity) sort_cmp;
-class(Sort) .entity chain, sort_next, sort_prev;
+// .float(entity,entity) sort_cmp;
+class(Sort).entity chain, sort_next, sort_prev;
 
 entity Sort_Spawn();
 
@@ -12,12 +11,10 @@ entity Sort_Spawn();
  * @param a FIRST entity
  * @param b entity after a
  */
-#define SORT_SWAP(a,b)                                                                 \
-       b.sort_prev = a.sort_prev;                                                      \
-       a.sort_next = b.sort_next;                                                      \
-       if(b.sort_next) b.sort_next.sort_prev = a;                      \
-       if(a.sort_prev) a.sort_prev.sort_next = b;                      \
-       a.sort_prev = b;                                                                        \
+#define SORT_SWAP(a, b)                                  \
+       b.sort_prev = a.sort_prev;                          \
+       a.sort_next = b.sort_next;                          \
+       if (b.sort_next) b.sort_next.sort_prev = a;          \
+       if (a.sort_prev) a.sort_prev.sort_next = b;          \
+       a.sort_prev = b;                                    \
        b.sort_next = a
-
-#endif