Compare commits
6 Commits
ab91bb2c9e
...
7be1b42107
| Author | SHA1 | Date | |
|---|---|---|---|
| 7be1b42107 | |||
| 41cac2ef7f | |||
| 24716505be | |||
| 7e21961943 | |||
| 6f27d5ea91 | |||
| 54691a8ede |
@@ -83,7 +83,7 @@ void _dbl_list_empty(GenericList *list, u64 item_size);
|
|||||||
// Base list types
|
// Base list types
|
||||||
typedef struct str8 Str8;
|
typedef struct str8 Str8;
|
||||||
|
|
||||||
WAPP_DEF_DBL_LIST_TYPE(void * , VoidPtrNode , VoidPtrList);
|
WAPP_DEF_DBL_LIST_TYPE(void *, VoidPtrNode, VoidPtrList);
|
||||||
WAPP_DEF_DBL_LIST_TYPE(c8 , C8Node , C8List);
|
WAPP_DEF_DBL_LIST_TYPE(c8 , C8Node , C8List);
|
||||||
WAPP_DEF_DBL_LIST_TYPE(c16 , C16Node , C16List);
|
WAPP_DEF_DBL_LIST_TYPE(c16 , C16Node , C16List);
|
||||||
WAPP_DEF_DBL_LIST_TYPE(c32 , C32Node , C32List);
|
WAPP_DEF_DBL_LIST_TYPE(c32 , C32Node , C32List);
|
||||||
|
|||||||
@@ -58,7 +58,9 @@ typedef const Str8 Str8RO;
|
|||||||
// address of compound literals is valid in C to create a string on the stack
|
// address of compound literals is valid in C to create a string on the stack
|
||||||
#define wapp_str8_lit(STRING) ((Str8){.capacity = (sizeof(STRING) - 1) * 2, \
|
#define wapp_str8_lit(STRING) ((Str8){.capacity = (sizeof(STRING) - 1) * 2, \
|
||||||
.size = sizeof(STRING) - 1, \
|
.size = sizeof(STRING) - 1, \
|
||||||
.buf = memcpy(&((c8 [sizeof(STRING) * 2]){0}), STRING, sizeof(STRING))})
|
.buf = memcpy(&((c8 [sizeof(STRING) * 2]){0}), \
|
||||||
|
STRING, \
|
||||||
|
sizeof(STRING))})
|
||||||
#define wapp_str8_lit_ro(STRING) ((Str8RO){.capacity = sizeof(STRING) - 1, \
|
#define wapp_str8_lit_ro(STRING) ((Str8RO){.capacity = sizeof(STRING) - 1, \
|
||||||
.size = sizeof(STRING) - 1, \
|
.size = sizeof(STRING) - 1, \
|
||||||
.buf = (c8 *)STRING})
|
.buf = (c8 *)STRING})
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ int main(void) {
|
|||||||
test_i32_array_set,
|
test_i32_array_set,
|
||||||
test_i32_array_append_capped,
|
test_i32_array_append_capped,
|
||||||
test_i32_array_extend_capped,
|
test_i32_array_extend_capped,
|
||||||
test_i32_array_clear,
|
|
||||||
test_i32_array_pop,
|
|
||||||
test_i32_array_copy_capped,
|
test_i32_array_copy_capped,
|
||||||
test_i32_array_alloc_capacity,
|
test_i32_array_alloc_capacity,
|
||||||
test_i32_array_append_alloc,
|
test_i32_array_append_alloc,
|
||||||
test_i32_array_extend_alloc,
|
test_i32_array_extend_alloc,
|
||||||
test_i32_array_copy_alloc,
|
test_i32_array_copy_alloc,
|
||||||
|
test_i32_array_pop,
|
||||||
|
test_i32_array_clear,
|
||||||
test_str8_lit,
|
test_str8_lit,
|
||||||
test_str8_lit_ro,
|
test_str8_lit_ro,
|
||||||
test_str8_buf,
|
test_str8_buf,
|
||||||
|
|||||||
Reference in New Issue
Block a user