mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Use dynamic array element type instead of __auto_type
This allows using 0 for pointer arrays.
This commit is contained in:
parent
a5f57a8a4c
commit
4e739f6b36
1 changed files with 3 additions and 3 deletions
|
@ -186,10 +186,10 @@
|
|||
#define DARRAY_APPEND(array, value) \
|
||||
({ \
|
||||
__auto_type ar = (array); \
|
||||
__auto_type ob = (value); \
|
||||
typeof(ar->a[0]) ob = (value); \
|
||||
size_t sz = ar->size; \
|
||||
DARRAY_RESIZE (ar, ar->size + 1); \
|
||||
ar->a[sz] = ob; \
|
||||
ar->a[sz] = ob; \
|
||||
})
|
||||
|
||||
/** Open a hole in the array for bulk copying of data.
|
||||
|
@ -259,7 +259,7 @@
|
|||
#define DARRAY_INSERT_AT(array, value, index) \
|
||||
({ \
|
||||
__auto_type ar = (array); \
|
||||
__auto_type ob = (value); \
|
||||
typeof(ar->a[0]) ob = (value); \
|
||||
*DARRAY_OPEN_AT (ar, index, 1) = ob; \
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue