fix build (Win32)

Wed, 31 Dec 2025 09:16:02 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 31 Dec 2025 09:16:02 +0100
changeset 1034
330b415910bd
parent 1033
eda1ff20cb27
child 1035
86d3a45dc928

fix build (Win32)

ucx/cx/array_list.h file | annotate | diff | comparison | revisions
ui/win32/button.c file | annotate | diff | comparison | revisions
ui/win32/grid.c file | annotate | diff | comparison | revisions
ui/win32/list.c file | annotate | diff | comparison | revisions
--- a/ucx/cx/array_list.h	Mon Dec 29 17:46:10 2025 +0100
+++ b/ucx/cx/array_list.h	Wed Dec 31 09:16:02 2025 +0100
@@ -280,12 +280,12 @@
  *
  * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation
  * @param array the name of the array where the element shall be added
- * @param element (@c void*) a pointer to the element that shall be added
+ * @param element the element that shall be added
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
  */
 #define cx_array_add_a(allocator, array, element) \
-        cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (array).size, element, 1)
+        cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (array).size, (void*)&(element), 1)
 
 /**
  * Appends an element to an array.
@@ -308,12 +308,12 @@
  * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation
  * @param array the name of the array where the element shall be inserted
  * @param index (@c size_t) the index where to insert the @p element
- * @param element (@c void*) a pointer to the element that shall be inserted
+ * @param element the element that shall be inserted
  * @retval zero success
  * @retval non-zero a re-allocation was necessary but failed
  */
 #define cx_array_insert_a(allocator, array, index, element) \
-        cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), index, element, 1)
+        cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), index, (void*)&(element), 1)
 
 /**
  * Inserts an element into an array.
--- a/ui/win32/button.c	Mon Dec 29 17:46:10 2025 +0100
+++ b/ui/win32/button.c	Wed Dec 31 09:16:02 2025 +0100
@@ -242,7 +242,7 @@
         if (i->obj) {
             group = i->obj;
         } else {
-            group = cxArrayListCreate(obj->ctx->allocator, NULL, CX_STORE_POINTERS, 8);
+            group = cxArrayListCreate(obj->ctx->allocator, CX_STORE_POINTERS, 8);
             i->obj = group;
         }
 
--- a/ui/win32/grid.c	Mon Dec 29 17:46:10 2025 +0100
+++ b/ui/win32/grid.c	Wed Dec 31 09:16:02 2025 +0100
@@ -36,7 +36,7 @@
 
 UiGridLayout* ui_grid_layout_create(const CxAllocator *a, short columnspacing, short rowspacing) {
     UiGridLayout *grid = cxZalloc(a, sizeof(UiGridLayout));
-    grid->widgets = cxArrayListCreate(a, NULL, sizeof(GridElm), 32);
+    grid->widgets = cxArrayListCreate(a, sizeof(GridElm), 32);
     grid->columnspacing = columnspacing;
     grid->rowspacing = rowspacing;
     return grid;
--- a/ui/win32/list.c	Mon Dec 29 17:46:10 2025 +0100
+++ b/ui/win32/list.c	Wed Dec 31 09:16:02 2025 +0100
@@ -191,17 +191,17 @@
 static UiListSelection listview_get_selection2(HWND hwnd) {
     UiListSelection sel = { 0, NULL };
 
-    CX_ARRAY_DECLARE(int, indices);
-    cx_array_initialize(indices, 8);
+    CX_ARRAY(int, indices);
+    cx_array_init(indices, 8);
 
     int index = -1;
     while ((index = ListView_GetNextItem(hwnd, index, LVNI_SELECTED)) != -1) {
-        cx_array_simple_add(indices, index);
+        cx_array_add(indices, index);
     }
 
-    if (indices_size > 0) {
-        sel.rows = indices;
-        sel.count = indices_size;
+    if (indices.size > 0) {
+        sel.rows = indices.data;
+        sel.count = indices.size;
     }
 
     return sel;

mercurial