From 61c1ec99e549fce50481f7ba379cd40bb6e2f985 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Fri, 26 Jun 2026 15:23:36 +0100 Subject: [PATCH] Rename aliases --- src/base/array/array.c | 4 +-- src/base/array/array.h | 4 +-- src/base/dbl_list/dbl_list.c | 12 ++++----- src/base/dbl_list/dbl_list.h | 2 +- src/base/queue/queue.h | 6 ++--- src/base/strings/str8/str8.h | 4 +-- src/common/aliases/aliases.h | 10 +++---- src/common/assert/assert.h | 2 +- src/log/log.c | 18 ++++++------- src/os/allocators/arena/mem_arena_allocator.c | 20 +++++++------- src/os/file/file.h | 22 ++++++++-------- src/os/file/posix/file_posix.c | 20 +++++++------- src/os/file/win/file_win.c | 22 ++++++++-------- src/os/mem/mem_os.h | 4 +-- src/os/mem/posix/mem_os_posix.c | 2 +- src/os/mem/win/mem_os_win.c | 2 +- src/os/shell/commander/commander.c | 8 +++--- src/os/shell/commander/commander.h | 2 +- .../shell/termcolour/posix/termcolour_posix.c | 2 +- src/os/shell/termcolour/termcolour.h | 2 +- src/os/shell/termcolour/win/termcolour_win.c | 8 +++--- src/prng/xorshift/xorshift.c | 26 +++++++++---------- src/testing/tester/tester.c | 4 +-- src/uuid/uuid.c | 12 ++++----- src/uuid/uuid.h | 2 +- tests/allocator/test_allocator.c | 4 +-- tests/allocator/test_allocator.cc | 4 +-- tests/arena/test_arena.c | 14 +++++----- tests/arena/test_arena.cc | 14 +++++----- tests/file/test_file.c | 18 ++++++------- tests/file/test_file.cc | 18 ++++++------- 31 files changed, 146 insertions(+), 146 deletions(-) diff --git a/src/base/array/array.c b/src/base/array/array.c index e47c125..81bc262 100644 --- a/src/base/array/array.c +++ b/src/base/array/array.c @@ -9,7 +9,7 @@ #define _array_header(ARRAY) (ArrayHeader *)(wapp_pointer_offset(ARRAY, (i64)sizeof(ArrayHeader) * -1)) -wapp_persist inline void _array_validate(const GenericArray array, u64 item_size); +wp_persist inline void _array_validate(const GenericArray array, u64 item_size); u64 _array_count(GenericArray array) { wapp_debug_assert(array != NULL, "`array` should not be NULL"); @@ -259,7 +259,7 @@ GenericArray _array_from_preallocated_buffer(void *buffer, u64 buffer_size, Arra return output; } -wapp_persist inline void _array_validate(const GenericArray array, u64 item_size) { +wp_persist inline void _array_validate(const GenericArray array, u64 item_size) { ArrayHeader *header = _array_header(array); wapp_runtime_assert(WAPP_ARRAY_MAGIC == header->magic, "`array` is not a valid wapp array"); wapp_runtime_assert(item_size == header->item_size, "Invalid item type provided"); diff --git a/src/base/array/array.h b/src/base/array/array.h index 0bfc5f4..42030c0 100644 --- a/src/base/array/array.h +++ b/src/base/array/array.h @@ -52,7 +52,7 @@ typedef enum { \ TYPE items[_calc_array_capacity(TYPE, __VA_ARGS__)] = {__VA_ARGS__}; \ \ - wapp_persist u8 array[ \ + wp_persist u8 array[ \ sizeof(ArrayHeader) + _calc_array_capacity(TYPE, __VA_ARGS__) * sizeof(TYPE) \ ] = {0}; \ ArrayHeader *header = (ArrayHeader *)array; \ @@ -66,7 +66,7 @@ typedef enum { return (TYPE *)buf; \ }()) #define wapp_array_with_capacity(TYPE, CAPACITY, FLAGS) ([&]() { \ - wapp_persist u8 array[ \ + wp_persist u8 array[ \ sizeof(ArrayHeader) + CAPACITY * sizeof(TYPE) \ ] = {0}; \ ArrayHeader *header = (ArrayHeader *)array; \ diff --git a/src/base/dbl_list/dbl_list.c b/src/base/dbl_list/dbl_list.c index 8937738..9108c04 100644 --- a/src/base/dbl_list/dbl_list.c +++ b/src/base/dbl_list/dbl_list.c @@ -7,9 +7,9 @@ #include "../../common/platform/platform.h" #include -wapp_intern GenericList _node_to_list(GenericNode *node, u64 item_size); -wapp_intern inline void _dbl_list_validate(const GenericList *list, u64 item_size); -wapp_intern inline void _dbl_list_node_validate(const GenericList *list, const GenericNode *node, u64 item_size); +wp_intern GenericList _node_to_list(GenericNode *node, u64 item_size); +wp_intern inline void _dbl_list_validate(const GenericList *list, u64 item_size); +wp_intern inline void _dbl_list_node_validate(const GenericList *list, const GenericNode *node, u64 item_size); GenericList *_dbl_list_alloc(const Allocator *allocator, u64 item_size) { wapp_debug_assert(allocator != NULL, "`allocator` should not be NULL"); @@ -225,7 +225,7 @@ void _dbl_list_empty(GenericList *list, u64 item_size) { } } -wapp_intern GenericList _node_to_list(GenericNode *node, u64 item_size) { +wp_intern GenericList _node_to_list(GenericNode *node, u64 item_size) { GenericList output = { .magic = WAPP_DBL_LIST_MAGIC, .first = node, @@ -247,12 +247,12 @@ wapp_intern GenericList _node_to_list(GenericNode *node, u64 item_size) { return output; } -wapp_intern inline void _dbl_list_validate(const GenericList *list, u64 item_size) { +wp_intern inline void _dbl_list_validate(const GenericList *list, u64 item_size) { wapp_runtime_assert(list->magic == WAPP_DBL_LIST_MAGIC, "`list` isn't a valid wapp list type"); wapp_runtime_assert(list->item_size == item_size, "Invalid item provided"); } -wapp_intern inline void _dbl_list_node_validate(const GenericList *list, const GenericNode *node, u64 item_size) { +wp_intern inline void _dbl_list_node_validate(const GenericList *list, const GenericNode *node, u64 item_size) { wapp_runtime_assert(node->header.magic == WAPP_DBL_NODE_MAGIC, "`node` isn't a valid wapp node type"); wapp_runtime_assert(list->item_size == node->header.item_size, "Mismatched `list` and `node` types"); wapp_runtime_assert(node->header.item_size == item_size, "Invalid item provided"); diff --git a/src/base/dbl_list/dbl_list.h b/src/base/dbl_list/dbl_list.h index e220ce1..9b08a66 100644 --- a/src/base/dbl_list/dbl_list.h +++ b/src/base/dbl_list/dbl_list.h @@ -82,7 +82,7 @@ typedef GenericNode Str8Node; #define wapp_dbl_list(TYPE) \ GenericList{WAPP_DBL_LIST_MAGIC, 0, sizeof(TYPE), nullptr, nullptr} #define _dbl_list_node(TYPE, ITEM_PTR) ([&]() { \ - wapp_persist GenericNode node = { \ + wp_persist GenericNode node = { \ NodeHeader{WAPP_DBL_NODE_MAGIC, sizeof(TYPE), nullptr, nullptr}, \ ITEM_PTR, \ }; \ diff --git a/src/base/queue/queue.h b/src/base/queue/queue.h index 7d71fc5..befd615 100644 --- a/src/base/queue/queue.h +++ b/src/base/queue/queue.h @@ -42,8 +42,8 @@ typedef GenericQueue Str8Queue; #ifdef WP_PLATFORM_CPP #define wapp_queue(TYPE, CAPACITY) ([&]() { \ - wapp_persist GenericArray arr = wapp_array_with_capacity(TYPE, CAPACITY, ARRAY_INIT_FILLED); \ - wapp_persist GenericQueue queue = { \ + wp_persist GenericArray arr = wapp_array_with_capacity(TYPE, CAPACITY, ARRAY_INIT_FILLED); \ + wp_persist GenericQueue queue = { \ arr, \ 0, \ 0, \ @@ -53,7 +53,7 @@ typedef GenericQueue Str8Queue; return queue; \ }()) #define wapp_queue_alloc(TYPE, ALLOCATOR_PTR, CAPACITY) ([&]() { \ - wapp_persist GenericQueue queue = { \ + wp_persist GenericQueue queue = { \ wapp_array_alloc_capacity(TYPE, ALLOCATOR_PTR, CAPACITY, ARRAY_INIT_FILLED), \ 0, \ 0, \ diff --git a/src/base/strings/str8/str8.h b/src/base/strings/str8/str8.h index 3b23fc9..71b447a 100644 --- a/src/base/strings/str8/str8.h +++ b/src/base/strings/str8/str8.h @@ -37,14 +37,14 @@ typedef const Str8 Str8RO; #ifdef WP_PLATFORM_CPP // Uses a lambda to achieve the same behaviour achieved by the C macro #define wapp_str8_buf(CAPACITY) ([&](){ \ - wapp_persist c8 buf[CAPACITY] = {}; \ + wp_persist c8 buf[CAPACITY] = {}; \ memset(buf, 0, CAPACITY); \ return Str8{CAPACITY, 0, buf}; \ }()) // Uses a lambda to achieve the same behaviour achieved by the C macro #define wapp_str8_lit(STRING) ([&]() { \ - wapp_persist c8 buf[sizeof(STRING) * 2] = {}; \ + wp_persist c8 buf[sizeof(STRING) * 2] = {}; \ memcpy(buf, STRING, sizeof(STRING)); \ return Str8{(sizeof(STRING) - 1) * 2, sizeof(STRING) - 1, buf}; \ }()) diff --git a/src/common/aliases/aliases.h b/src/common/aliases/aliases.h index 825ff3a..01d52c0 100644 --- a/src/common/aliases/aliases.h +++ b/src/common/aliases/aliases.h @@ -54,13 +54,13 @@ typedef long double f128; typedef uintptr_t uptr; typedef intptr_t iptr; -#define wapp_extern extern -#define wapp_intern static -#define wapp_persist static +#define wp_extern extern +#define wp_intern static +#define wp_persist static #ifdef WP_PLATFORM_CPP -#define wapp_class_mem static -#define BEGIN_C_LINKAGE wapp_extern "C" { +#define wp_class_mem static +#define BEGIN_C_LINKAGE wp_extern "C" { #define END_C_LINKAGE } #endif // WP_PLATFORM_CPP diff --git a/src/common/assert/assert.h b/src/common/assert/assert.h index 6ec9109..76c520d 100644 --- a/src/common/assert/assert.h +++ b/src/common/assert/assert.h @@ -13,7 +13,7 @@ BEGIN_C_LINKAGE #endif // !WP_PLATFORM_CPP -#define wapp_static_assert(EXPR, MSG) wapp_extern char ASSERTION_FAILED[EXPR ? 1 : -1] +#define wapp_static_assert(EXPR, MSG) wp_extern char ASSERTION_FAILED[EXPR ? 1 : -1] #ifndef WAPP_NO_RUNTIME_ASSERT #define wapp_runtime_assert(EXPR, MSG) __wapp_runtime_assert(EXPR, MSG) diff --git a/src/log/log.c b/src/log/log.c index 0ef1b4b..1da7f83 100644 --- a/src/log/log.c +++ b/src/log/log.c @@ -11,9 +11,9 @@ #define MIN_LOG_MSG_LENGTH 32 #define TIME_BUF_CAPACITY 70 -wapp_intern Str8RO L_BRACKET = wapp_str8_lit_ro("["); -wapp_intern Str8RO R_BRACKET_SPACE = wapp_str8_lit_ro("] "); -wapp_intern Str8RO R_BRACKET_NEWLINE = wapp_str8_lit_ro("]\n"); +wp_intern Str8RO L_BRACKET = wapp_str8_lit_ro("["); +wp_intern Str8RO R_BRACKET_SPACE = wapp_str8_lit_ro("] "); +wp_intern Str8RO R_BRACKET_NEWLINE = wapp_str8_lit_ro("]\n"); typedef struct { WFile *outlog; @@ -23,10 +23,10 @@ typedef struct { wapp_misc_utils_reserve_padding(2 * sizeof(WFile *) + sizeof(LogLevel)); } LogConfig; -wapp_intern LogConfig LOG_CONFIG = { +wp_intern LogConfig LOG_CONFIG = { .level = WAPP_LOG_DEBUG, }; -wapp_intern Str8RO LOG_LEVEL_STRINGS[COUNT_LOG_LEVEL] = { +wp_intern Str8RO LOG_LEVEL_STRINGS[COUNT_LOG_LEVEL] = { [WAPP_LOG_FATAL] = wapp_str8_lit_ro_initialiser_list("fatal "), [WAPP_LOG_CRITICAL] = wapp_str8_lit_ro_initialiser_list("critical "), [WAPP_LOG_ERROR] = wapp_str8_lit_ro_initialiser_list("error "), @@ -35,8 +35,8 @@ wapp_intern Str8RO LOG_LEVEL_STRINGS[COUNT_LOG_LEVEL] = { [WAPP_LOG_DEBUG] = wapp_str8_lit_ro_initialiser_list("debug "), }; -wapp_intern void _get_current_time_string(Str8 *dst); -wapp_intern void _write_log_line(WFile *fp, const Logger *logger, Str8 msg, LogLevel level); +wp_intern void _get_current_time_string(Str8 *dst); +wp_intern void _write_log_line(WFile *fp, const Logger *logger, Str8 msg, LogLevel level); void wapp_log_set_level(LogLevel level) { LOG_CONFIG.level = level; @@ -100,7 +100,7 @@ void wapp_log_fatal(const Logger *logger, Str8 msg) { _write_log_line(fp, logger, msg, WAPP_LOG_FATAL); } -wapp_intern void _get_current_time_string(Str8 *dst) { +wp_intern void _get_current_time_string(Str8 *dst) { // TODO (Abdelrahman): Replace with proper date/time utilities char buf[TIME_BUF_CAPACITY]; time_t now = time(NULL); @@ -110,7 +110,7 @@ wapp_intern void _get_current_time_string(Str8 *dst) { wapp_str8_copy_cstr_capped(dst, buf); } -wapp_intern void _write_log_line(WFile *fp, const Logger *logger, Str8 msg, LogLevel level) { +wp_intern void _write_log_line(WFile *fp, const Logger *logger, Str8 msg, LogLevel level) { Str8 padding = wapp_str8_buf(MIN_LOG_MSG_LENGTH); u32 padding_size = msg.size < MIN_LOG_MSG_LENGTH ? MIN_LOG_MSG_LENGTH - msg.size + 1 : 0; wapp_str8_format(&padding, "%-*s", padding_size, " "); diff --git a/src/os/allocators/arena/mem_arena_allocator.c b/src/os/allocators/arena/mem_arena_allocator.c index fa020db..deb1f86 100644 --- a/src/os/allocators/arena/mem_arena_allocator.c +++ b/src/os/allocators/arena/mem_arena_allocator.c @@ -6,11 +6,11 @@ #include "../../../common/aliases/aliases.h" #include "../../../common/assert/assert.h" -wapp_intern void initialise_arena_allocator(Allocator *allocator); -wapp_intern void *mem_arena_alloc(u64 size, void *alloc_obj); -wapp_intern void *mem_arena_alloc_aligned(u64 size, u64 alignment, void *alloc_obj); -wapp_intern void *mem_arena_realloc(void *ptr, u64 old_size, u64 new_size, void *alloc_obj); -wapp_intern void *mem_arena_realloc_aligned(void *ptr, u64 old_size, u64 new_size, u64 alignment, +wp_intern void initialise_arena_allocator(Allocator *allocator); +wp_intern void *mem_arena_alloc(u64 size, void *alloc_obj); +wp_intern void *mem_arena_alloc_aligned(u64 size, u64 alignment, void *alloc_obj); +wp_intern void *mem_arena_realloc(void *ptr, u64 old_size, u64 new_size, void *alloc_obj); +wp_intern void *mem_arena_realloc_aligned(void *ptr, u64 old_size, u64 new_size, u64 alignment, void *alloc_obj); Allocator wapp_mem_arena_allocator_init_with_buffer(u8 *buffer, u64 buffer_size) { @@ -58,29 +58,29 @@ void wapp_mem_arena_allocator_destroy(Allocator *allocator) { *allocator = (Allocator){0}; } -wapp_intern void initialise_arena_allocator(Allocator *allocator) { +wp_intern void initialise_arena_allocator(Allocator *allocator) { allocator->alloc = mem_arena_alloc; allocator->alloc_aligned = mem_arena_alloc_aligned; allocator->realloc = mem_arena_realloc; allocator->realloc_aligned = mem_arena_realloc_aligned; } -wapp_intern void *mem_arena_alloc(u64 size, void *alloc_obj) { +wp_intern void *mem_arena_alloc(u64 size, void *alloc_obj) { Arena *arena = (Arena *)alloc_obj; return wapp_mem_arena_alloc(arena, size); } -wapp_intern void *mem_arena_alloc_aligned(u64 size, u64 alignment, void *alloc_obj) { +wp_intern void *mem_arena_alloc_aligned(u64 size, u64 alignment, void *alloc_obj) { Arena *arena = (Arena *)alloc_obj; return wapp_mem_arena_alloc_aligned(arena, size, alignment); } -wapp_intern void *mem_arena_realloc(void *ptr, u64 old_size, u64 new_size, void *alloc_obj) { +wp_intern void *mem_arena_realloc(void *ptr, u64 old_size, u64 new_size, void *alloc_obj) { Arena *arena = (Arena *)alloc_obj; return wapp_mem_arena_realloc(arena, ptr, old_size, new_size); } -wapp_intern void *mem_arena_realloc_aligned(void *ptr, u64 old_size, u64 new_size, u64 alignment, +wp_intern void *mem_arena_realloc_aligned(void *ptr, u64 old_size, u64 new_size, u64 alignment, void *alloc_obj) { Arena *arena = (Arena *)alloc_obj; return wapp_mem_arena_realloc_aligned(arena, ptr, old_size, new_size, alignment); diff --git a/src/os/file/file.h b/src/os/file/file.h index 875ac5a..abf06c3 100644 --- a/src/os/file/file.h +++ b/src/os/file/file.h @@ -36,15 +36,15 @@ typedef enum { // Return value should not be cached as it's not guaranteed to remain the same. Always call // wapp_file_stdin to get the standard input stream -wapp_extern WFile *wapp_file_stdin(void); +wp_extern WFile *wapp_file_stdin(void); // Return value should not be cached as it's not guaranteed to remain the same. Always call // wapp_file_stdout to get the standard output stream -wapp_extern WFile *wapp_file_stdout(void); +wp_extern WFile *wapp_file_stdout(void); // Return value should not be cached as it's not guaranteed to remain the same. Always call // wapp_file_stderr to get the standard error stream -wapp_extern WFile *wapp_file_stderr(void); +wp_extern WFile *wapp_file_stderr(void); WFile *wapp_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode); i64 wapp_file_get_current_position(WFile *file); @@ -61,14 +61,14 @@ i32 wapp_file_close(WFile *file); i32 wapp_file_rename(Str8RO *old_filepath, Str8RO *new_filepath); i32 wapp_file_remove(Str8RO *filepath); -wapp_extern WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode); -wapp_extern i64 _file_seek(WFile *file, i64 offset, FileSeekOrigin origin); -wapp_extern u64 _file_read(void *dst_buf, u64 byte_count, WFile *file, u64 file_length); -wapp_extern i64 _file_write(const void *src_buf, WFile *file, u64 byte_count); -wapp_extern i32 _file_flush(WFile *file); -wapp_extern i32 _file_close(WFile *file); -wapp_extern i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath); -wapp_extern i32 _file_remove(Str8RO *filepath); +wp_extern WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode); +wp_extern i64 _file_seek(WFile *file, i64 offset, FileSeekOrigin origin); +wp_extern u64 _file_read(void *dst_buf, u64 byte_count, WFile *file, u64 file_length); +wp_extern i64 _file_write(const void *src_buf, WFile *file, u64 byte_count); +wp_extern i32 _file_flush(WFile *file); +wp_extern i32 _file_close(WFile *file); +wp_extern i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath); +wp_extern i32 _file_remove(Str8RO *filepath); #ifdef WP_PLATFORM_CPP END_C_LINKAGE diff --git a/src/os/file/posix/file_posix.c b/src/os/file/posix/file_posix.c index ce71f3f..d51cc09 100644 --- a/src/os/file/posix/file_posix.c +++ b/src/os/file/posix/file_posix.c @@ -21,7 +21,7 @@ #include #include -wapp_intern i32 file_flags[FILE_ACCESS_MODE_COUNT] = { +wp_intern i32 file_flags[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_READ] = O_RDONLY, [WAPP_ACCESS_WRITE] = O_WRONLY | O_CREAT, [WAPP_ACCESS_APPEND] = O_WRONLY | O_APPEND | O_CREAT, @@ -32,7 +32,7 @@ wapp_intern i32 file_flags[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_WRITE_FAIL_ON_EXIST_EX] = O_RDWR | O_CREAT | O_EXCL, }; -wapp_intern mode_t file_modes[FILE_ACCESS_MODE_COUNT] = { +wp_intern mode_t file_modes[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_READ] = 0, [WAPP_ACCESS_WRITE] = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, [WAPP_ACCESS_APPEND] = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, @@ -43,29 +43,29 @@ wapp_intern mode_t file_modes[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_WRITE_FAIL_ON_EXIST_EX] = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, }; -wapp_intern i32 file_seek_origins[FILE_SEEK_ORIGIN_COUNT] = { +wp_intern i32 file_seek_origins[FILE_SEEK_ORIGIN_COUNT] = { [WAPP_SEEK_START] = SEEK_SET, [WAPP_SEEK_CURRENT] = SEEK_CUR, [WAPP_SEEK_END] = SEEK_END, }; WFile *wapp_file_stdin(void) { - wapp_persist WFile _stdin = { .fd = STDIN_FILENO }; + wp_persist WFile _stdin = { .fd = STDIN_FILENO }; return &_stdin; } WFile *wapp_file_stdout(void) { - wapp_persist WFile _stdout = { .fd = STDOUT_FILENO }; + wp_persist WFile _stdout = { .fd = STDOUT_FILENO }; return &_stdout; } WFile *wapp_file_stderr(void) { - wapp_persist WFile _stderr = { .fd = STDERR_FILENO }; + wp_persist WFile _stderr = { .fd = STDERR_FILENO }; return &_stderr; } WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode) { - wapp_persist c8 tmp[WAPP_PATH_MAX] = {0}; + wp_persist c8 tmp[WAPP_PATH_MAX] = {0}; memset(tmp, 0, WAPP_PATH_MAX); memcpy(tmp, filepath->buf, filepath->size); @@ -108,8 +108,8 @@ i32 _file_close(WFile *file) { } i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath) { - wapp_persist c8 old_tmp[WAPP_PATH_MAX] = {0}; - wapp_persist c8 new_tmp[WAPP_PATH_MAX] = {0}; + wp_persist c8 old_tmp[WAPP_PATH_MAX] = {0}; + wp_persist c8 new_tmp[WAPP_PATH_MAX] = {0}; memset(old_tmp, 0, WAPP_PATH_MAX); memcpy(old_tmp, old_filepath->buf, old_filepath->size); memset(new_tmp, 0, WAPP_PATH_MAX); @@ -124,7 +124,7 @@ i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath) { } i32 _file_remove(Str8RO *filepath) { - wapp_persist c8 tmp[WAPP_PATH_MAX] = {0}; + wp_persist c8 tmp[WAPP_PATH_MAX] = {0}; memset(tmp, 0, WAPP_PATH_MAX); memcpy(tmp, filepath->buf, filepath->size); diff --git a/src/os/file/win/file_win.c b/src/os/file/win/file_win.c index 293e8d5..375537d 100644 --- a/src/os/file/win/file_win.c +++ b/src/os/file/win/file_win.c @@ -15,7 +15,7 @@ #include #include -wapp_intern DWORD file_accesses[FILE_ACCESS_MODE_COUNT] = { +wp_intern DWORD file_accesses[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_READ] = FILE_READ_DATA, [WAPP_ACCESS_WRITE] = FILE_WRITE_DATA, [WAPP_ACCESS_APPEND] = FILE_APPEND_DATA, @@ -26,7 +26,7 @@ wapp_intern DWORD file_accesses[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_WRITE_FAIL_ON_EXIST_EX] = FILE_READ_DATA | FILE_WRITE_DATA, }; -wapp_intern DWORD creation_dispositions[FILE_ACCESS_MODE_COUNT] = { +wp_intern DWORD creation_dispositions[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_READ] = OPEN_EXISTING, [WAPP_ACCESS_WRITE] = CREATE_ALWAYS, [WAPP_ACCESS_APPEND] = OPEN_ALWAYS, @@ -37,7 +37,7 @@ wapp_intern DWORD creation_dispositions[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_WRITE_FAIL_ON_EXIST_EX] = CREATE_NEW, }; -wapp_intern DWORD sharing_modes[FILE_ACCESS_MODE_COUNT] = { +wp_intern DWORD sharing_modes[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_READ] = FILE_SHARE_READ | FILE_SHARE_WRITE, [WAPP_ACCESS_WRITE] = FILE_SHARE_READ, [WAPP_ACCESS_APPEND] = FILE_SHARE_READ, @@ -48,32 +48,32 @@ wapp_intern DWORD sharing_modes[FILE_ACCESS_MODE_COUNT] = { [WAPP_ACCESS_WRITE_FAIL_ON_EXIST_EX] = FILE_SHARE_READ, }; -wapp_intern DWORD file_seek_origins[FILE_SEEK_ORIGIN_COUNT] = { +wp_intern DWORD file_seek_origins[FILE_SEEK_ORIGIN_COUNT] = { [WAPP_SEEK_START] = FILE_BEGIN, [WAPP_SEEK_CURRENT] = FILE_CURRENT, [WAPP_SEEK_END] = FILE_END, }; WFile *wapp_file_stdin(void) { - wapp_persist WFile _stdin = { .fh = INVALID_HANDLE_VALUE }; + wp_persist WFile _stdin = { .fh = INVALID_HANDLE_VALUE }; _stdin.fh = GetStdHandle(STD_INPUT_HANDLE); return &_stdin; } WFile *wapp_file_stdout(void) { - wapp_persist WFile _stdout = { .fh = INVALID_HANDLE_VALUE }; + wp_persist WFile _stdout = { .fh = INVALID_HANDLE_VALUE }; _stdout.fh = GetStdHandle(STD_OUTPUT_HANDLE); return &_stdout; } WFile *wapp_file_stderr(void) { - wapp_persist WFile _stderr = { .fh = INVALID_HANDLE_VALUE }; + wp_persist WFile _stderr = { .fh = INVALID_HANDLE_VALUE }; _stderr.fh = GetStdHandle(STD_ERROR_HANDLE); return &_stderr; } WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode) { - wapp_persist c8 tmp[WAPP_PATH_MAX] = {0}; + wp_persist c8 tmp[WAPP_PATH_MAX] = {0}; memset(tmp, 0, WAPP_PATH_MAX); memcpy(tmp, filepath->buf, filepath->size); @@ -148,8 +148,8 @@ i32 _file_close(WFile *file) { } i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath) { - wapp_persist c8 old_tmp[WAPP_PATH_MAX] = {0}; - wapp_persist c8 new_tmp[WAPP_PATH_MAX] = {0}; + wp_persist c8 old_tmp[WAPP_PATH_MAX] = {0}; + wp_persist c8 new_tmp[WAPP_PATH_MAX] = {0}; memset(old_tmp, 0, WAPP_PATH_MAX); memcpy(old_tmp, old_filepath->buf, old_filepath->size); memset(new_tmp, 0, WAPP_PATH_MAX); @@ -163,7 +163,7 @@ i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath) { } i32 _file_remove(Str8RO *filepath) { - wapp_persist c8 tmp[WAPP_PATH_MAX] = {0}; + wp_persist c8 tmp[WAPP_PATH_MAX] = {0}; memset(tmp, 0, WAPP_PATH_MAX); memcpy(tmp, filepath->buf, filepath->size); diff --git a/src/os/mem/mem_os.h b/src/os/mem/mem_os.h index 937f96a..d508786 100644 --- a/src/os/mem/mem_os.h +++ b/src/os/mem/mem_os.h @@ -23,8 +23,8 @@ BEGIN_C_LINKAGE void *wapp_os_mem_alloc(void *addr, u64 size, MemAccess access, MemAllocFlags flags, MemInitType type); void wapp_os_mem_free(void *ptr, u64 size); -wapp_extern void *os_mem_allocate(void *addr, u64 size, MemAccess access, MemAllocFlags flags, MemInitType type); -wapp_extern void os_mem_free(void *ptr, u64 size); +wp_extern void *os_mem_allocate(void *addr, u64 size, MemAccess access, MemAllocFlags flags, MemInitType type); +wp_extern void os_mem_free(void *ptr, u64 size); #ifdef WP_PLATFORM_CPP END_C_LINKAGE diff --git a/src/os/mem/posix/mem_os_posix.c b/src/os/mem/posix/mem_os_posix.c index f08db86..0a43370 100644 --- a/src/os/mem/posix/mem_os_posix.c +++ b/src/os/mem/posix/mem_os_posix.c @@ -9,7 +9,7 @@ #include "../mem_os_ops.h" #include -wapp_intern const i32 access_types[] = { +wp_intern const i32 access_types[] = { [WAPP_MEM_ACCESS_NONE] = PROT_NONE, [WAPP_MEM_ACCESS_READ_ONLY] = PROT_READ, [WAPP_MEM_ACCESS_EXEC_ONLY] = PROT_EXEC, diff --git a/src/os/mem/win/mem_os_win.c b/src/os/mem/win/mem_os_win.c index 55dc742..191c59b 100644 --- a/src/os/mem/win/mem_os_win.c +++ b/src/os/mem/win/mem_os_win.c @@ -12,7 +12,7 @@ #include #include -wapp_intern const i32 access_types[] = { +wp_intern const i32 access_types[] = { [WAPP_MEM_ACCESS_NONE] = PAGE_NOACCESS, [WAPP_MEM_ACCESS_READ_ONLY] = PAGE_READONLY, [WAPP_MEM_ACCESS_EXEC_ONLY] = PAGE_EXECUTE, diff --git a/src/os/shell/commander/commander.c b/src/os/shell/commander/commander.c index b48c91a..0fd1222 100644 --- a/src/os/shell/commander/commander.c +++ b/src/os/shell/commander/commander.c @@ -17,8 +17,8 @@ #define CMD_BUF_LEN 8192 #define OUT_BUF_LEN 4096 -wapp_intern CMDResult execute_command(Str8RO *cmd, CMDOutHandling out_handling, Str8 *out_buf); -wapp_intern CMDError get_command_output(FILE *fp, CMDOutHandling out_handling, Str8 *out_buf); +wp_intern CMDResult execute_command(Str8RO *cmd, CMDOutHandling out_handling, Str8 *out_buf); +wp_intern CMDError get_command_output(FILE *fp, CMDOutHandling out_handling, Str8 *out_buf); CMDResult wapp_shell_commander_execute(CMDOutHandling out_handling, Str8 *out_buf, const Str8List *cmd) { if (!cmd) { @@ -43,7 +43,7 @@ CMDResult wapp_shell_commander_execute(CMDOutHandling out_handling, Str8 *out_bu return output; } -wapp_intern CMDResult execute_command(Str8RO *cmd, CMDOutHandling out_handling, Str8 *out_buf) { +wp_intern CMDResult execute_command(Str8RO *cmd, CMDOutHandling out_handling, Str8 *out_buf) { char cmd_buf[CMD_BUF_LEN] = {0}; wapp_str8_copy_to_cstr(cmd_buf, cmd, CMD_BUF_LEN); @@ -83,7 +83,7 @@ EXECUTE_COMMAND_CLOSE: return output; } -wapp_intern CMDError get_command_output(FILE *fp, CMDOutHandling out_handling, Str8 *out_buf) { +wp_intern CMDError get_command_output(FILE *fp, CMDOutHandling out_handling, Str8 *out_buf) { Str8 out = wapp_str8_buf(OUT_BUF_LEN); out.size = fread((void *)out.buf, sizeof(c8), out.capacity, fp); diff --git a/src/os/shell/commander/commander.h b/src/os/shell/commander/commander.h index 2afa0b1..8fbfd16 100644 --- a/src/os/shell/commander/commander.h +++ b/src/os/shell/commander/commander.h @@ -20,7 +20,7 @@ BEGIN_C_LINKAGE CMDResult wapp_shell_commander_execute(CMDOutHandling out_handling, Str8 *out_buf, const Str8List *cmd); -wapp_extern CMDError get_output_status(FILE *fp, i32 *status_out); +wp_extern CMDError get_output_status(FILE *fp, i32 *status_out); #ifdef WP_PLATFORM_CPP END_C_LINKAGE diff --git a/src/os/shell/termcolour/posix/termcolour_posix.c b/src/os/shell/termcolour/posix/termcolour_posix.c index 7a1b837..b235003 100644 --- a/src/os/shell/termcolour/posix/termcolour_posix.c +++ b/src/os/shell/termcolour/posix/termcolour_posix.c @@ -9,7 +9,7 @@ #include "../terminal_colours.h" #include -wapp_intern Str8RO colours[COUNT_TERM_COLOUR] = { +wp_intern Str8RO colours[COUNT_TERM_COLOUR] = { [WAPP_TERM_COLOUR_FG_BLACK] = wapp_str8_lit_ro_initialiser_list("\033[30m"), [WAPP_TERM_COLOUR_FG_RED] = wapp_str8_lit_ro_initialiser_list("\033[31m"), [WAPP_TERM_COLOUR_FG_GREEN] = wapp_str8_lit_ro_initialiser_list("\033[32m"), diff --git a/src/os/shell/termcolour/termcolour.h b/src/os/shell/termcolour/termcolour.h index b07563b..c7606f6 100644 --- a/src/os/shell/termcolour/termcolour.h +++ b/src/os/shell/termcolour/termcolour.h @@ -17,7 +17,7 @@ BEGIN_C_LINKAGE void wapp_shell_termcolour_print_text(Str8RO *text, TerminalColour colour); void wapp_shell_termcolour_clear_colour(void); -wapp_extern void print_coloured_text(Str8RO *text, TerminalColour colour); +wp_extern void print_coloured_text(Str8RO *text, TerminalColour colour); #ifdef WP_PLATFORM_CPP END_C_LINKAGE diff --git a/src/os/shell/termcolour/win/termcolour_win.c b/src/os/shell/termcolour/win/termcolour_win.c index ba05d3e..61274ba 100644 --- a/src/os/shell/termcolour/win/termcolour_win.c +++ b/src/os/shell/termcolour/win/termcolour_win.c @@ -22,9 +22,9 @@ struct TermcolourData { wapp_misc_utils_reserve_padding(sizeof(HANDLE) + sizeof(WORD) + sizeof(WORD)); }; -wapp_intern void init_data(TermcolourData *data); +wp_intern void init_data(TermcolourData *data); -wapp_intern WORD colours[COUNT_TERM_COLOUR] = { +wp_intern WORD colours[COUNT_TERM_COLOUR] = { [WAPP_TERM_COLOUR_FG_BLACK] = 0, [WAPP_TERM_COLOUR_FG_RED] = FOREGROUND_RED, [WAPP_TERM_COLOUR_FG_GREEN] = FOREGROUND_GREEN, @@ -44,7 +44,7 @@ wapp_intern WORD colours[COUNT_TERM_COLOUR] = { }; void print_coloured_text(Str8RO *text, TerminalColour colour) { - wapp_persist TermcolourData data = {0}; + wp_persist TermcolourData data = {0}; if (data.handle == 0) { init_data(&data); } @@ -59,7 +59,7 @@ void print_coloured_text(Str8RO *text, TerminalColour colour) { printf(WAPP_STR8_SPEC, wapp_str8_varg((*text))); } -wapp_intern void init_data(TermcolourData *data) { +wp_intern void init_data(TermcolourData *data) { // create handle data->handle = GetStdHandle(STD_OUTPUT_HANDLE); diff --git a/src/prng/xorshift/xorshift.c b/src/prng/xorshift/xorshift.c index fdfa134..9eb5eb5 100644 --- a/src/prng/xorshift/xorshift.c +++ b/src/prng/xorshift/xorshift.c @@ -12,13 +12,13 @@ struct SplitMix64State { u64 seed; }; -wapp_intern u64 rol64(u64 x, u64 bits); -wapp_intern u64 split_mix_64(SplitMix64State *state); -wapp_intern void seed_os_generator(void); -wapp_intern u64 generate_random_number(void); +wp_intern u64 rol64(u64 x, u64 bits); +wp_intern u64 split_mix_64(SplitMix64State *state); +wp_intern void seed_os_generator(void); +wp_intern u64 generate_random_number(void); XOR256State wapp_prng_xorshift_init_state(void) { - wapp_persist b8 seeded = false; + wp_persist b8 seeded = false; if (!seeded) { seeded = true; seed_os_generator(); @@ -75,11 +75,11 @@ u64 wapp_prng_xorshift_256p(XOR256State *state) { return result; } -wapp_intern u64 rol64(u64 x, u64 bits) { +wp_intern u64 rol64(u64 x, u64 bits) { return (x << bits) | (x >> (64 - bits)); } -wapp_intern u64 split_mix_64(SplitMix64State *state) { +wp_intern u64 split_mix_64(SplitMix64State *state) { state->seed += 0x9E3779B97f4A7C15; u64 result = state->seed; @@ -91,7 +91,7 @@ wapp_intern u64 split_mix_64(SplitMix64State *state) { #if defined(WP_PLATFORM_C) && WP_PLATFORM_C_VERSION >= WP_PLATFORM_C11_VERSION #ifdef WP_PLATFORM_POSIX -wapp_intern void seed_os_generator(void) { +wp_intern void seed_os_generator(void) { struct timespec ts = {0}; int result = clock_gettime(CLOCK_MONOTONIC_RAW, &ts); wapp_runtime_assert(result == 0, "Invalid seed value"); @@ -99,11 +99,11 @@ wapp_intern void seed_os_generator(void) { srand48(ts.tv_nsec); } -wapp_intern u64 generate_random_number(void) { +wp_intern u64 generate_random_number(void) { return lrand48(); } #else -wapp_intern void seed_os_generator(void) { +wp_intern void seed_os_generator(void) { struct timespec ts = {0}; int result = timespec_get(&ts, TIME_UTC); wapp_runtime_assert(result != 0, "Invalid seed value"); @@ -111,7 +111,7 @@ wapp_intern void seed_os_generator(void) { srand(ts.tv_nsec); } -wapp_intern u64 generate_random_number(void) { +wp_intern u64 generate_random_number(void) { i32 n1 = rand(); i32 n2 = rand(); @@ -119,14 +119,14 @@ wapp_intern u64 generate_random_number(void) { } #endif // !WP_PLATFORM_POSIX #else -wapp_intern void seed_os_generator(void) { +wp_intern void seed_os_generator(void) { time_t result = time(NULL); wapp_runtime_assert(result != (time_t)(-1), "Invalid seed value"); srand(result); } -wapp_intern u64 generate_random_number(void) { +wp_intern u64 generate_random_number(void) { i32 n1 = rand(); i32 n2 = rand(); diff --git a/src/testing/tester/tester.c b/src/testing/tester/tester.c index fc8773b..21db3be 100644 --- a/src/testing/tester/tester.c +++ b/src/testing/tester/tester.c @@ -8,7 +8,7 @@ #include #include -wapp_intern void handle_test_result(TestFuncResult result); +wp_intern void handle_test_result(TestFuncResult result); void run_tests(TestFunc *func1, ...) { printf("\n"); @@ -32,7 +32,7 @@ void run_tests(TestFunc *func1, ...) { printf("\n"); } -wapp_intern void handle_test_result(TestFuncResult result) { +wp_intern void handle_test_result(TestFuncResult result) { TerminalColour colour; Str8 result_text = wapp_str8_buf(64); diff --git a/src/uuid/uuid.c b/src/uuid/uuid.c index 06993fb..7e2f435 100644 --- a/src/uuid/uuid.c +++ b/src/uuid/uuid.c @@ -15,8 +15,8 @@ struct UUID4 { u64 low; }; -wapp_intern UUID4 generate_uuid4(void); -wapp_intern void uuid4_to_uuid(const UUID4* uuid4, WUUID *uuid); +wp_intern UUID4 generate_uuid4(void); +wp_intern void uuid4_to_uuid(const UUID4* uuid4, WUUID *uuid); WUUID *wapp_uuid_init_uuid4(WUUID *uuid) { wapp_debug_assert(uuid != NULL, "`uuid` should not be NULL"); @@ -27,9 +27,9 @@ WUUID *wapp_uuid_init_uuid4(WUUID *uuid) { return uuid; } -wapp_intern UUID4 generate_uuid4(void) { - wapp_persist XOR256State state = {0}; - wapp_persist b8 initialised = false; +wp_intern UUID4 generate_uuid4(void) { + wp_persist XOR256State state = {0}; + wp_persist b8 initialised = false; if (!initialised) { initialised = true; @@ -47,7 +47,7 @@ wapp_intern UUID4 generate_uuid4(void) { return uuid; } -wapp_intern void uuid4_to_uuid(const UUID4* uuid4, WUUID *uuid) { +wp_intern void uuid4_to_uuid(const UUID4* uuid4, WUUID *uuid) { u64 group1 = uuid4->high >> 32; u64 group2 = (uuid4->high << 32) >> 48; u64 group3 = (uuid4->high << 48) >> 48; diff --git a/src/uuid/uuid.h b/src/uuid/uuid.h index 3f4fa10..da01369 100644 --- a/src/uuid/uuid.h +++ b/src/uuid/uuid.h @@ -24,7 +24,7 @@ struct WUUID { #ifdef WP_PLATFORM_CPP #define wapp_uuid_gen_uuid4() ([&](){ \ - wapp_persist WUUID uuid = wapp_uuid_create(); \ + wp_persist WUUID uuid = wapp_uuid_create(); \ return *(wapp_uuid_init_uuid4(&uuid)); \ }()) #else diff --git a/tests/allocator/test_allocator.c b/tests/allocator/test_allocator.c index 28b5336..1538242 100644 --- a/tests/allocator/test_allocator.c +++ b/tests/allocator/test_allocator.c @@ -6,8 +6,8 @@ // allocation are aligned to power of 2 boundaries, the number of i32 values needed is hardcoded. #define TEMP_BUF_SIZE (40 + sizeof(i32) * 8) -wapp_intern u8 temp_buf[TEMP_BUF_SIZE] = {0}; -wapp_intern Allocator temp_allocator = {0}; +wp_intern u8 temp_buf[TEMP_BUF_SIZE] = {0}; +wp_intern Allocator temp_allocator = {0}; TestFuncResult test_arena_allocator(void) { Allocator allocator = wapp_mem_arena_allocator_init(4096); diff --git a/tests/allocator/test_allocator.cc b/tests/allocator/test_allocator.cc index 2ce49fd..adb4825 100644 --- a/tests/allocator/test_allocator.cc +++ b/tests/allocator/test_allocator.cc @@ -6,8 +6,8 @@ // allocation are aligned to power of 2 boundaries, the number of i32 values needed is hardcoded. #define TEMP_BUF_SIZE (40 + sizeof(i32) * 8) -wapp_intern u8 temp_buf[TEMP_BUF_SIZE] = {}; -wapp_intern Allocator temp_allocator = {}; +wp_intern u8 temp_buf[TEMP_BUF_SIZE] = {}; +wp_intern Allocator temp_allocator = {}; TestFuncResult test_arena_allocator(void) { Allocator allocator = wapp_mem_arena_allocator_init(4096); diff --git a/tests/arena/test_arena.c b/tests/arena/test_arena.c index 205fd64..718534e 100644 --- a/tests/arena/test_arena.c +++ b/tests/arena/test_arena.c @@ -8,13 +8,13 @@ // allocation are aligned to power of 2 boundaries, the number of i32 values needed is hardcoded. #define TEMP_BUF_SIZE (40 + sizeof(i32) * 8) -wapp_intern Arena *arena = NULL; -wapp_intern i32 count = 20; -wapp_intern i32 *array = NULL; -wapp_intern Arena *buf_arena = NULL; -wapp_intern u8 buf[ARENA_BUF_SIZE] = {0}; -wapp_intern Arena *temp_arena = NULL; -wapp_intern u8 temp_buf[TEMP_BUF_SIZE] = {0}; +wp_intern Arena *arena = NULL; +wp_intern i32 count = 20; +wp_intern i32 *array = NULL; +wp_intern Arena *buf_arena = NULL; +wp_intern u8 buf[ARENA_BUF_SIZE] = {0}; +wp_intern Arena *temp_arena = NULL; +wp_intern u8 temp_buf[TEMP_BUF_SIZE] = {0}; TestFuncResult test_arena_init_buffer(void) { b8 result = wapp_mem_arena_init_buffer(&buf_arena, buf, ARENA_BUF_SIZE); diff --git a/tests/arena/test_arena.cc b/tests/arena/test_arena.cc index 00a9f0b..8617007 100644 --- a/tests/arena/test_arena.cc +++ b/tests/arena/test_arena.cc @@ -8,13 +8,13 @@ // allocation are aligned to power of 2 boundaries, the number of i32 values needed is hardcoded. #define TEMP_BUF_SIZE (40 + sizeof(i32) * 8) -wapp_intern Arena *arena = NULL; -wapp_intern i32 count = 20; -wapp_intern i32 *array = NULL; -wapp_intern Arena *buf_arena = NULL; -wapp_intern u8 buf[ARENA_BUF_SIZE] = {}; -wapp_intern Arena *temp_arena = NULL; -wapp_intern u8 temp_buf[TEMP_BUF_SIZE] = {}; +wp_intern Arena *arena = NULL; +wp_intern i32 count = 20; +wp_intern i32 *array = NULL; +wp_intern Arena *buf_arena = NULL; +wp_intern u8 buf[ARENA_BUF_SIZE] = {}; +wp_intern Arena *temp_arena = NULL; +wp_intern u8 temp_buf[TEMP_BUF_SIZE] = {}; TestFuncResult test_arena_init_buffer(void) { b8 result = wapp_mem_arena_init_buffer(&buf_arena, buf, ARENA_BUF_SIZE); diff --git a/tests/file/test_file.c b/tests/file/test_file.c index 7025e8d..2b81403 100644 --- a/tests/file/test_file.c +++ b/tests/file/test_file.c @@ -3,15 +3,15 @@ #include "test_file.h" #define DST_CAPACITY 5 -wapp_intern Allocator arena = {0}; -wapp_intern Str8RO test_filename = wapp_str8_lit_ro_initialiser_list("wapptest.bin"); -wapp_intern Str8RO new_filename = wapp_str8_lit_ro_initialiser_list("wapptest2.bin"); -wapp_intern WFile *test_fp = NULL; -wapp_intern I32Array src_array1 = wapp_array(i32, 0, 1, 2, 3, 4); -wapp_intern I32Array src_array2 = wapp_array(i32, 5, 6, 7, 8, 9); -wapp_intern I32Array src_array3 = wapp_array(i32, 10, 11, 12, 13, 14); -wapp_intern I32Array dst_array = wapp_array_with_capacity(i32, DST_CAPACITY, false); -wapp_intern i32 dst_buf[DST_CAPACITY] = {0}; +wp_intern Allocator arena = {0}; +wp_intern Str8RO test_filename = wapp_str8_lit_ro_initialiser_list("wapptest.bin"); +wp_intern Str8RO new_filename = wapp_str8_lit_ro_initialiser_list("wapptest2.bin"); +wp_intern WFile *test_fp = NULL; +wp_intern I32Array src_array1 = wapp_array(i32, 0, 1, 2, 3, 4); +wp_intern I32Array src_array2 = wapp_array(i32, 5, 6, 7, 8, 9); +wp_intern I32Array src_array3 = wapp_array(i32, 10, 11, 12, 13, 14); +wp_intern I32Array dst_array = wapp_array_with_capacity(i32, DST_CAPACITY, false); +wp_intern i32 dst_buf[DST_CAPACITY] = {0}; TestFuncResult test_wapp_file_open(void) { arena = wapp_mem_arena_allocator_init(KiB(16)); diff --git a/tests/file/test_file.cc b/tests/file/test_file.cc index 046d17a..790b36e 100644 --- a/tests/file/test_file.cc +++ b/tests/file/test_file.cc @@ -3,15 +3,15 @@ #include "test_file.h" #define DST_CAPACITY 5 -wapp_intern Allocator arena = {}; -wapp_intern Str8RO test_filename = wapp_str8_lit_ro_initialiser_list("wapptest.bin"); -wapp_intern Str8RO new_filename = wapp_str8_lit_ro_initialiser_list("wapptest2.bin"); -wapp_intern WFile *test_fp = NULL; -wapp_intern i32 dst_buf[DST_CAPACITY] = {0}; -wapp_intern I32Array src_array1; -wapp_intern I32Array src_array2; -wapp_intern I32Array src_array3; -wapp_intern I32Array dst_array ; +wp_intern Allocator arena = {}; +wp_intern Str8RO test_filename = wapp_str8_lit_ro_initialiser_list("wapptest.bin"); +wp_intern Str8RO new_filename = wapp_str8_lit_ro_initialiser_list("wapptest2.bin"); +wp_intern WFile *test_fp = NULL; +wp_intern i32 dst_buf[DST_CAPACITY] = {0}; +wp_intern I32Array src_array1; +wp_intern I32Array src_array2; +wp_intern I32Array src_array3; +wp_intern I32Array dst_array ; TestFuncResult test_wapp_file_open(void) { arena = wapp_mem_arena_allocator_init(KiB(16));