From bd781f335c8ca4924787b52dfbbf91baa30035f9 Mon Sep 17 00:00:00 2001 From: masterexplorer Date: Mon, 7 Oct 2024 12:46:15 +0200 Subject: [PATCH] progress --- main.cpp | 6 ++++++ simap.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 5b12090..b7cff44 100644 --- a/main.cpp +++ b/main.cpp @@ -5,6 +5,12 @@ void test_basics(amap mapdo, void *map) { assert(NULL == mapdo(map, AMAP_GET, "asdf", NULL)); + int i = 42; + int *iptr; + assert(NULL != mapdo(map, AMAP_SET, "meanging", &i)); + assert(NULL != (iptr = (int *)mapdo(map, AMAP_GET, "asdf", NULL))); + assert(*iptr == 42); + assert(iptr == &i); } int main() { diff --git a/simap.h b/simap.h index ea46660..d02927c 100644 --- a/simap.h +++ b/simap.h @@ -210,7 +210,7 @@ static inline void *simap_force_add_internal(simap_instance *map, const char *ke /* Administer usage_end offset */ map->usage_end += storage_needed; - return NULL; + return data; } /**