Using arena as token array, remove arenas idea

This commit is contained in:
Krzosa Karol
2023-02-09 12:36:36 +01:00
parent 5138ba0097
commit 7370e8b716
16 changed files with 295 additions and 407 deletions

View File

@@ -162,7 +162,7 @@ CORE_Static String32
string16_to_string32(Allocator *allocator, String16 string){
String32 result = {allocate_array(allocator, U32, string.len+1)};
for(S64 i = 0; i < string.len;){
UTF32_Result decode = utf16_to_utf32(string.str + i, string.len - i);
UTF32_Result decode = utf16_to_utf32(string.str + i, (S32)(string.len - i));
if(!decode.error){
i += decode.advance;
result.str[result.len++] = decode.out_str;
@@ -215,7 +215,7 @@ CORE_Static String
string16_to_string8(Allocator *allocator, String16 in){
String result = {allocate_array(allocator, U8, in.len*4+1)};
for(S64 i = 0; i < in.len;){
UTF32_Result decode = utf16_to_utf32(in.str + i, in.len - i);
UTF32_Result decode = utf16_to_utf32(in.str + i, (S32)(in.len - i));
if(!decode.error){
i += decode.advance;
UTF8_Result encode = utf32_to_utf8(decode.out_str);