deleting walls

This commit is contained in:
Luka Jankovic 2025-07-23 18:48:41 +02:00
parent b7b8bd8b1e
commit edbe4eb8ae
5 changed files with 22 additions and 0 deletions

View file

@ -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