From 683f13deab9e50c6d4af59a35a65c2be1804944a Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sat, 14 Dec 2024 08:50:28 -0500 Subject: [PATCH] fixes for array container based on testing in Unreal --- base/dependencies/containers.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/dependencies/containers.hpp b/base/dependencies/containers.hpp index 9fb6f36..13386e6 100644 --- a/base/dependencies/containers.hpp +++ b/base/dependencies/containers.hpp @@ -149,7 +149,7 @@ usize array_grow_formula(ssize value) { template inline bool array_append_array(Array* array, Array other) { - return array_append_items(array, (Type*)other, num(other)); + return array_append_items(array, (Type*)other, array_num(other)); } template inline @@ -179,13 +179,13 @@ bool array_append_items(Array* array, Type* items, usize item_num) GEN_ASSERT(* array != nullptr); GEN_ASSERT(items != nullptr); GEN_ASSERT(item_num > 0); - ArrayHeader* header = array_get_header(array); + ArrayHeader* header = array_get_header(* array); if (header->Num + item_num > header->Capacity) { - if ( ! grow(array, header->Capacity + item_num)) + if ( ! array_grow(array, header->Capacity + item_num)) return false; - header = array_get_header(array); + header = array_get_header(* array); } mem_copy((Type*)array + header->Num, items, item_num * sizeof(Type));