revert accidental 3rd library reformat
This commit is contained in:
@@ -33,11 +33,11 @@
|
|||||||
#define SC_ARRAY_H
|
#define SC_ARRAY_H
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#define SC_ARRAY_VERSION "2.0.0"
|
#define SC_ARRAY_VERSION "2.0.0"
|
||||||
|
|
||||||
@@ -98,7 +98,8 @@
|
|||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
_cap = (a)->cap == 0 ? 8 : (a)->cap * 2; \
|
_cap = (a)->cap == 0 ? 8 : (a)->cap * 2; \
|
||||||
_p = sc_array_realloc((a)->elems, _cap * sizeof(*((a)->elems))); \
|
_p = sc_array_realloc((a)->elems, \
|
||||||
|
_cap * sizeof(*((a)->elems))); \
|
||||||
if (_p == NULL) { \
|
if (_p == NULL) { \
|
||||||
(a)->oom = true; \
|
(a)->oom = true; \
|
||||||
break; \
|
break; \
|
||||||
@@ -150,7 +151,7 @@
|
|||||||
size_t idx = (i); \
|
size_t idx = (i); \
|
||||||
assert(idx < (a)->size); \
|
assert(idx < (a)->size); \
|
||||||
\
|
\
|
||||||
const size_t _cnt = (a)->size - (idx)-1; \
|
const size_t _cnt = (a)->size - (idx) - 1; \
|
||||||
if (_cnt > 0) { \
|
if (_cnt > 0) { \
|
||||||
memmove(&((a)->elems[idx]), &((a)->elems[idx + 1]), \
|
memmove(&((a)->elems[idx]), &((a)->elems[idx + 1]), \
|
||||||
_cnt * sizeof(*((a)->elems))); \
|
_cnt * sizeof(*((a)->elems))); \
|
||||||
|
|||||||
Reference in New Issue
Block a user