]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/arraylist.qh
Merge branch 'martin-t/nottarg' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / arraylist.qh
index 1209ef5af4f1c1b8ba5b3b86a2cc0d75251b96fe..18305177bf8a266261e1be9ad143dfde695fcace 100644 (file)
@@ -1,15 +1,13 @@
-#ifndef ARRAYLIST_H
-#define ARRAYLIST_H
+#pragma once
 
-typedef entity ArrayList;
+USING(ArrayList, entity);
 .int al_buf;
 .int al_len;
 
 #define AL_NEW(this, n, default, T) \
        MACRO_BEGIN \
        { \
-               ArrayList _al = this = new(ArrayList); \
-               make_pure(_al); \
+               ArrayList _al = this = new_pure(ArrayList); \
                _al.al_buf = buf_create(); \
                for (int i = 0, _n = _al.al_len = n; i < _n; ++i) \
                { \
@@ -22,7 +20,7 @@ typedef entity ArrayList;
        MACRO_BEGIN \
        { \
                buf_del(this.al_buf); \
-               remove(this); \
+               delete(this); \
                this = NULL; \
        } MACRO_END
 
@@ -70,5 +68,3 @@ entity al_ftoe(int i) = #80;
                        if (cond) { body } \
                } \
        } MACRO_END
-
-#endif