From 8fbeadda53243b701957a26dba1113d84ad5c7c4 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 17 Jul 2025 14:50:05 -0400 Subject: pke: handle pk.h breaking changes --- src/static-ui.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/static-ui.cpp') diff --git a/src/static-ui.cpp b/src/static-ui.cpp index 68fd551..1abd6b2 100644 --- a/src/static-ui.cpp +++ b/src/static-ui.cpp @@ -38,7 +38,7 @@ struct pke_ui_master { void pke_ui_init() { pke_ui_master.bkt = pk_mem_bucket_create("pke ui", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE); - pke_ui_master.root_boxes = pk_new(1, pke_ui_master.bkt); + pke_ui_master.root_boxes = pk_new_arr(1, pke_ui_master.bkt); pke_ui_master.h_root_boxes = 0; pke_ui_master.r_root_boxes = 1; pke_ui_master.bindings = {}; @@ -399,7 +399,7 @@ void pke_ui_teardown_box_recursive(pke_ui_box *box) { pke_ui_teardown_box_recursive(box->internal.children[i]); } if (box->internal.children != nullptr) { - pk_delete(box->internal.children, box->internal.r_children); + pk_delete_arr(box->internal.children, box->internal.r_children); } } @@ -407,7 +407,7 @@ void pke_ui_teardown() { for (pke_ui_box_count_T i = 0; i < pke_ui_master.h_root_boxes; ++i) { pke_ui_teardown_box_recursive(pke_ui_master.root_boxes[i]); } - pk_delete(pke_ui_master.root_boxes, pke_ui_master.r_root_boxes, pke_ui_master.bkt); + pk_delete_arr(pke_ui_master.root_boxes, pke_ui_master.r_root_boxes, pke_ui_master.bkt); pk_mem_bucket_destroy(pke_ui_master.bkt); pke_ui_master.bkt = nullptr; pke_ui_master.root_boxes = nullptr; @@ -480,11 +480,11 @@ pke_ui_box *pke_ui_box_new_root(const PKE_UI_BOX_TYPE type, pk_uuid uuid) { if (pke_ui_master.h_root_boxes == pke_ui_master.r_root_boxes) { pke_ui_box_count_T prev_r_root_boxes = pke_ui_master.r_root_boxes; pke_ui_master.r_root_boxes *= 1.5; - pke_ui_box **boxes = pk_new(pke_ui_master.r_root_boxes); + pke_ui_box **boxes = pk_new_arr(pke_ui_master.r_root_boxes); for (pke_ui_box_count_T i = 0; i < pke_ui_master.h_root_boxes; ++i) { boxes[i] = pke_ui_master.root_boxes[i]; } - if (pke_ui_master.root_boxes != nullptr) pk_delete(pke_ui_master.root_boxes, prev_r_root_boxes); + if (pke_ui_master.root_boxes != nullptr) pk_delete_arr(pke_ui_master.root_boxes, prev_r_root_boxes); pke_ui_master.root_boxes = boxes; } pke_ui_box *box = pk_new(pke_ui_master.bkt); @@ -512,12 +512,12 @@ pke_ui_box *pke_ui_box_new_child(pke_ui_box *parent, const PKE_UI_BOX_TYPE type, if (parent->internal.h_children == parent->internal.r_children) { pke_ui_box_count_T prev_r_children = parent->internal.r_children; parent->internal.r_children = PK_MAX(parent->internal.r_children * 1.5, 2); - pke_ui_box **boxes = pk_new(parent->internal.r_children); + pke_ui_box **boxes = pk_new_arr(parent->internal.r_children); for (pke_ui_box_count_T i = 0; i < parent->internal.h_children; ++i) { boxes[i] = parent->internal.children[i]; } if (parent->internal.children != nullptr) { - pk_delete(parent->internal.children, prev_r_children); + pk_delete_arr(parent->internal.children, prev_r_children); } parent->internal.children = boxes; } -- cgit v1.2.3