From 63e3080a20b60469f494748b92ff7e6ed3164b48 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 16 Sep 2020 18:54:46 +0200 Subject: Added some missing templates in cmap. --- examples/complex.c | 2 +- examples/replace.c | 2 +- stc/cdefs.h | 2 +- stc/cmap.h | 16 +++++++++++++--- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/examples/complex.c b/examples/complex.c index e0bc5200..0c3e5c38 100644 --- a/examples/complex.c +++ b/examples/complex.c @@ -33,5 +33,5 @@ int main() { printf("value (%d, %d) is: %f\n", y, x, *carray2f_at(&table, y, x)); } - c_destroy(cmap_s, &myMap); // free up everything! + c_dtor(cmap_s, &myMap); // free up everything! } \ No newline at end of file diff --git a/examples/replace.c b/examples/replace.c index bcc4952e..c68a8940 100644 --- a/examples/replace.c +++ b/examples/replace.c @@ -29,5 +29,5 @@ int main () cstr_replace(&s, 22, 1, "!!!"); // "this is a short phrase!!!" (5) printf("(5) %s\n", s.str); - c_destroy(cstr, &s, &m); + c_dtor(cstr, &s, &m); // destroy } diff --git a/stc/cdefs.h b/stc/cdefs.h index 6ec64bc7..f73eec06 100644 --- a/stc/cdefs.h +++ b/stc/cdefs.h @@ -97,7 +97,7 @@ while (__i != __last) = *__i++ = __val; \ } while (0) -#define c_destroy(ctype, ...) do { \ +#define c_dtor(ctype, ...) do { \ struct ctype* __arr[] = {__VA_ARGS__}; \ for (size_t i=0; i