deleting walls
This commit is contained in:
parent
b7b8bd8b1e
commit
edbe4eb8ae
5 changed files with 22 additions and 0 deletions
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define KUBO_DRYNARRAY_DEFAULT_CAP 4
|
||||
|
||||
|
|
@ -80,6 +81,12 @@
|
|||
static inline void name##_clear(struct name *arr) { \
|
||||
free(arr->data); \
|
||||
name##_init(arr); \
|
||||
} \
|
||||
\
|
||||
static inline void name##_del(struct name *arr, size_t index) { \
|
||||
assert(index < arr->count); \
|
||||
memmove(arr->data + index, arr->data + index + 1, \
|
||||
(--arr->count - index) * sizeof(struct name)); \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue