Merge branch 'codegen'
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
#include "../../mem/allocator/mem_allocator.h"
|
||||
#include "../../mem/arena/mem_arena_allocator.h"
|
||||
#include "../../strings/str8/str8.h"
|
||||
#include "../../strings/str8/str8_list.h"
|
||||
#include "../../../containers/dbl_list/dbl_list.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
u32 wapp_cpath_join_path(Str8 *dst, const DBL_LIST(Str8) *parts) {
|
||||
u32 wapp_cpath_join_path(Str8 *dst, const Str8List *parts) {
|
||||
if (!dst || !parts) {
|
||||
return CPATH_JOIN_INVALID_ARGS;
|
||||
}
|
||||
@@ -28,12 +28,12 @@ u32 wapp_cpath_join_path(Str8 *dst, const DBL_LIST(Str8) *parts) {
|
||||
}
|
||||
|
||||
// Handle first node
|
||||
const DBL_NODE(Str8) *first_node = wapp_dbl_list_get(Str8, parts, 0);
|
||||
const Str8Node *first_node = wapp_str8_list_get(parts, 0);
|
||||
wapp_str8_copy_str8_capped(dst, first_node->item);
|
||||
|
||||
// NOTE (Abdelrahman): Uses a while loop instead of a for loop to get rid of
|
||||
// MSVC Spectre mitigation warnings
|
||||
const DBL_NODE(Str8) *node = first_node;
|
||||
const Str8Node *node = first_node;
|
||||
u64 node_index = 1;
|
||||
bool running = true;
|
||||
while (running && node->next) {
|
||||
@@ -91,7 +91,7 @@ Str8 *dirup(const Allocator *allocator, Str8RO *path, u64 levels) {
|
||||
goto RETURN_DIRUP;
|
||||
}
|
||||
|
||||
DBL_LIST(Str8) *parts = wapp_str8_split(&tmp_arena, path, &separator);
|
||||
Str8List *parts = wapp_str8_split(&tmp_arena, path, &separator);
|
||||
if (!parts) {
|
||||
goto RETURN_DIRUP;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ Str8 *dirup(const Allocator *allocator, Str8RO *path, u64 levels) {
|
||||
wapp_str8_push_back(output, absolute ? PATH_SEP : '.');
|
||||
} else {
|
||||
for (u64 i = 0; i < levels; ++i) {
|
||||
wapp_dbl_list_pop_back(Str8, parts);
|
||||
wapp_str8_list_pop_back(parts);
|
||||
}
|
||||
|
||||
u64 alignment = sizeof(void *) * 2;
|
||||
|
@@ -28,7 +28,7 @@ enum {
|
||||
CPATH_JOIN_INSUFFICIENT_DST_CAPACITY,
|
||||
};
|
||||
|
||||
u32 wapp_cpath_join_path(Str8 *dst, const DBL_LIST(Str8) *parts);
|
||||
u32 wapp_cpath_join_path(Str8 *dst, const Str8List *parts);
|
||||
Str8 *dirup(const Allocator *allocator, Str8RO *path, u64 levels);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user