From 887eebf31d78f14f2a95d867401ba62fb35ef35d Mon Sep 17 00:00:00 2001 From: kichikuou Date: Fri, 20 Mar 2026 11:03:24 +0900 Subject: [PATCH 1/3] MainEXFile: Add stub for ReloadDebugEXFile --- src/hll/MainEXFile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hll/MainEXFile.c b/src/hll/MainEXFile.c index 2b957fd..6ddff20 100644 --- a/src/hll/MainEXFile.c +++ b/src/hll/MainEXFile.c @@ -130,7 +130,7 @@ static void MainEXFile_ModuleFini(void) nr_handles = 0; } -//static bool MainEXFile_ReloadDebugEXFile(void); +HLL_WARN_UNIMPLEMENTED(false, bool, MainEXFile, ReloadDebugEXFile, void); /* * Get handle for top-level value. @@ -663,7 +663,7 @@ static bool MainEXFile_GetEXName(struct string *tree_path, int index, struct str HLL_LIBRARY(MainEXFile, HLL_EXPORT(_ModuleInit, MainEXFile_ModuleInit), HLL_EXPORT(_ModuleFini, MainEXFile_ModuleFini), - HLL_TODO_EXPORT(ReloadDebugEXFile, MainEXFile_ReloadDebugEXFile), + HLL_EXPORT(ReloadDebugEXFile, MainEXFile_ReloadDebugEXFile), HLL_EXPORT(Handle, MainEXFile_Handle), HLL_EXPORT(AHandle, MainEXFile_AHandle), HLL_EXPORT(A2Handle, MainEXFile_A2Handle), From 1e29930f4cdc5750ff07282cdef71eee69544434 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Wed, 1 Apr 2026 10:16:46 +0900 Subject: [PATCH 2/3] MainEXFile: Fix set_indices/map_handles for EX_LIST items->value was always indexing the first item; use items[i].value to properly assign IDs and map handles for all list items. --- src/hll/MainEXFile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hll/MainEXFile.c b/src/hll/MainEXFile.c index 6ddff20..035d0be 100644 --- a/src/hll/MainEXFile.c +++ b/src/hll/MainEXFile.c @@ -51,7 +51,7 @@ static int set_indices(struct ex_value *val, int id) break; case EX_LIST: for (unsigned i = 0; i < val->list->nr_items; i++) { - id = set_indices(&val->list->items->value, id); + id = set_indices(&val->list->items[i].value, id); } break; case EX_TREE: @@ -86,7 +86,7 @@ static void map_handles(struct ex_value *val) break; case EX_LIST: for (unsigned i = 0; i < val->list->nr_items; i++) { - map_handles(&val->list->items->value); + map_handles(&val->list->items[i].value); } break; case EX_TREE: From 2bc9a3d2cb4e20931ff7ab06259698409a95613e Mon Sep 17 00:00:00 2001 From: kichikuou Date: Fri, 10 Apr 2026 14:29:20 +0900 Subject: [PATCH 3/3] MainEXFile: Fix Col() to accept EX_LIST MainEXFile.Col() returns the number of items for EX_LIST handles. Also removed the FIXME comments from Row and Col since the semantics appear correct. --- src/hll/MainEXFile.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hll/MainEXFile.c b/src/hll/MainEXFile.c index 035d0be..5e04388 100644 --- a/src/hll/MainEXFile.c +++ b/src/hll/MainEXFile.c @@ -225,13 +225,16 @@ static int MainEXFile_RA2Handle(int handle, int row, struct string *format_name) static int MainEXFile_Row(int handle) { struct ex_table *t = handle_to_table(handle); - return t ? t->nr_rows : 0; // FIXME: should this be nr_columns? + return t ? t->nr_rows : 0; } static int MainEXFile_Col(int handle) { + if (handle > 0 && (unsigned)handle < nr_handles && + handles[handle]->type == EX_LIST) + return handles[handle]->list->nr_items; struct ex_table *t = handle_to_table(handle); - return t ? t->nr_columns : 0; // FIXME: should this be nr_rows? + return t ? t->nr_columns : 0; } static int MainEXFile_Type(int handle)