summaryrefslogtreecommitdiffhomepage
path: root/stc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-08-31 23:43:32 +0200
committerTyge Løvset <[email protected]>2020-08-31 23:43:32 +0200
commit8c4daa7f91d9a6e7a30e0f6dfdafaf2664d68f2d (patch)
treedc3e7a19038f29ac905bbc938cacda2f9b5b8bb6 /stc
parent55c84dee6cce33e31a4ca3e0cdcbdbe85fcccac6 (diff)
downloadSTC-modified-8c4daa7f91d9a6e7a30e0f6dfdafaf2664d68f2d.tar.gz
STC-modified-8c4daa7f91d9a6e7a30e0f6dfdafaf2664d68f2d.zip
Added example gaussian. Some cleanup.
Diffstat (limited to 'stc')
-rw-r--r--stc/cdefs.h3
-rw-r--r--stc/clist.h13
2 files changed, 9 insertions, 7 deletions
diff --git a/stc/cdefs.h b/stc/cdefs.h
index 73f3e9d3..8692cdc6 100644
--- a/stc/cdefs.h
+++ b/stc/cdefs.h
@@ -74,10 +74,11 @@
#define c_foreach(it, prefix, container) \
for (prefix##_iter_t it = prefix##_begin(&container); it.item != it.end; prefix##_next(&it))
+
#define c_items(...) __VA_ARGS__
#define c_push(container, prefix, items) do { \
const prefix##_input_t __arr[] = { items }; \
- prefix##_push_n(container, __arr, sizeof(__arr)/sizeof(prefix##_input_t)); \
+ prefix##_push_n(container, __arr, sizeof(__arr)/sizeof(__arr[0])); \
} while (0)
diff --git a/stc/clist.h b/stc/clist.h
index e5dbf6f3..3a972a96 100644
--- a/stc/clist.h
+++ b/stc/clist.h
@@ -56,16 +56,17 @@
}
*/
-#define declare_clist(...) c_MACRO_OVERLOAD(declare_clist, __VA_ARGS__)
+#define declare_clist(...) c_MACRO_OVERLOAD(declare_clist, __VA_ARGS__)
#define declare_clist_2(tag, Value) \
- declare_clist_3(tag, Value, c_default_destroy)
+ declare_clist_3(tag, Value, c_default_destroy)
#define declare_clist_3(tag, Value, valueDestroy) \
- declare_clist_4(tag, Value, valueDestroy, c_default_compare)
+ declare_clist_4(tag, Value, valueDestroy, c_default_compare)
#define declare_clist_4(tag, Value, valueDestroy, valueCompare) \
- declare_clist_7(tag, Value, valueDestroy, Value, valueCompare, c_default_to_raw, c_default_from_raw)
-#define declare_clist_str() \
- declare_clist_7(str, cstr_t, cstr_destroy, const char*, cstr_compare_raw, cstr_to_raw, cstr_make)
+ declare_clist_7(tag, Value, valueDestroy, Value, \
+ valueCompare, c_default_to_raw, c_default_from_raw)
+#define declare_clist_str() declare_clist_7(str, cstr_t, cstr_destroy, const char*, \
+ cstr_compare_raw, cstr_to_raw, cstr_make)
#define declare_clist_types(tag, Value) \
typedef struct clist_##tag##_node { \