summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-11-04 02:29:26 -0800
committerVito Caputo <vcaputo@pengaru.com>2020-11-04 02:30:38 -0800
commit214297a0a6ed78dc6f1ab0ce10dc146b57fa903e (patch)
treeff502c8dd8b48a0ed90df3f96928c92c58bfbf11
parentf73822a6b74690dd8189d048b67a83eb863c4083 (diff)
thunk: s/_THUNK_GEN_INSTANTIATE/_THUNK_GEN_INITIALIZE/
this internal macro just generates the initializer, just switching to a more accurate name.
-rw-r--r--thunk.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/thunk.h b/thunk.h
index cc07868..e4e4a08 100644
--- a/thunk.h
+++ b/thunk.h
@@ -154,34 +154,34 @@ struct thunk_t {
/* Macros for populating the thunk environment struct members when instantiating the
* thunk, we need a variant for each supported arity. */
-#define _THUNK_GEN_INSTANTIATE_0(_env, _nil)
+#define _THUNK_GEN_INITIALIZE_0(_env, _nil)
-#define _THUNK_GEN_INSTANTIATE_2(_env, _t_a, _n_a) \
+#define _THUNK_GEN_INITIALIZE_2(_env, _t_a, _n_a) \
_env->_n_a = _n_a;
-#define _THUNK_GEN_INSTANTIATE_4(_env, _t_a, _n_a, _t_b, _n_b) \
+#define _THUNK_GEN_INITIALIZE_4(_env, _t_a, _n_a, _t_b, _n_b) \
_env->_n_a = _n_a; \
_env->_n_b = _n_b;
-#define _THUNK_GEN_INSTANTIATE_6(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c) \
+#define _THUNK_GEN_INITIALIZE_6(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c) \
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c;
-#define _THUNK_GEN_INSTANTIATE_8(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d)\
+#define _THUNK_GEN_INITIALIZE_8(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d)\
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c; \
_env->_n_d = _n_d;
-#define _THUNK_GEN_INSTANTIATE_10(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e)\
+#define _THUNK_GEN_INITIALIZE_10(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e)\
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c; \
_env->_n_d = _n_d; \
_env->_n_e = _n_e;
-#define _THUNK_GEN_INSTANTIATE_12(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f)\
+#define _THUNK_GEN_INITIALIZE_12(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f)\
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c; \
@@ -189,7 +189,7 @@ struct thunk_t {
_env->_n_e = _n_e; \
_env->_n_f = _n_f;
-#define _THUNK_GEN_INSTANTIATE_14(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g)\
+#define _THUNK_GEN_INITIALIZE_14(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g)\
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c; \
@@ -198,7 +198,7 @@ struct thunk_t {
_env->_n_f = _n_f; \
_env->_n_g = _n_g;
-#define _THUNK_GEN_INSTANTIATE_16(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h)\
+#define _THUNK_GEN_INITIALIZE_16(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h)\
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c; \
@@ -208,7 +208,7 @@ struct thunk_t {
_env->_n_g = _n_g; \
_env->_n_h = _n_h;
-#define _THUNK_GEN_INSTANTIATE_18(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h, _t_i, _n_i)\
+#define _THUNK_GEN_INITIALIZE_18(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h, _t_i, _n_i)\
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c; \
@@ -219,7 +219,7 @@ struct thunk_t {
_env->_n_h = _n_h; \
_env->_n_i = _n_i;
-#define _THUNK_GEN_INSTANTIATE_20(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h, _t_i, _n_i, _t_j, _n_j)\
+#define _THUNK_GEN_INITIALIZE_20(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h, _t_i, _n_i, _t_j, _n_j)\
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c; \
@@ -231,7 +231,7 @@ struct thunk_t {
_env->_n_i = _n_i; \
_env->_n_j = _n_j;
-#define _THUNK_GEN_INSTANTIATE_22(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h, _t_i, _n_i, _t_j, _n_j, _t_k, _n_k)\
+#define _THUNK_GEN_INITIALIZE_22(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h, _t_i, _n_i, _t_j, _n_j, _t_k, _n_k)\
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c; \
@@ -244,7 +244,7 @@ struct thunk_t {
_env->_n_j = _n_j; \
_env->_n_k = _n_k;
-#define _THUNK_GEN_INSTANTIATE_24(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h, _t_i, _n_i, _t_j, _n_j, _t_k, _n_k, _t_l, _n_l)\
+#define _THUNK_GEN_INITIALIZE_24(_env, _t_a, _n_a, _t_b, _n_b, _t_c, _n_c, _t_d, _n_d, _t_e, _n_e, _t_f, _n_f, _t_g, _n_g, _t_h, _n_h, _t_i, _n_i, _t_j, _n_j, _t_k, _n_k, _t_l, _n_l)\
_env->_n_a = _n_a; \
_env->_n_b = _n_b; \
_env->_n_c = _n_c; \
@@ -258,14 +258,14 @@ struct thunk_t {
_env->_n_k = _n_k; \
_env->_n_l = _n_l;
-#define _THUNK_GEN_INSTANTIATE__(_env, _count, ...) \
- _THUNK_GEN_INSTANTIATE_##_count(_env, __VA_ARGS__)
+#define _THUNK_GEN_INITIALIZE__(_env, _count, ...) \
+ _THUNK_GEN_INITIALIZE_##_count(_env, __VA_ARGS__)
-#define _THUNK_GEN_INSTANTIATE_(_env, _count, ...) \
- _THUNK_GEN_INSTANTIATE__(_env, _count, __VA_ARGS__)
+#define _THUNK_GEN_INITIALIZE_(_env, _count, ...) \
+ _THUNK_GEN_INITIALIZE__(_env, _count, __VA_ARGS__)
-#define _THUNK_GEN_INSTANTIATE(_env, ...) \
- _THUNK_GEN_INSTANTIATE_(_env, _C99_NARGS(__VA_ARGS__), __VA_ARGS__)
+#define _THUNK_GEN_INITIALIZE(_env, ...) \
+ _THUNK_GEN_INITIALIZE_(_env, _C99_NARGS(__VA_ARGS__), __VA_ARGS__)
/* Macros for dispatching the embedded thunk from its associated environment,
@@ -400,13 +400,13 @@ struct thunk_t {
} \
\
static thunk_t * _THUNK_GEN_PROTO(__thunk_instantiate_##_name, __VA_ARGS__) {\
- /* allocate and populate environment, return it */ \
+ /* allocate and initialize environment, return it */ \
__thunk_environment_##_name *env; \
\
env = malloc(sizeof(*env)); \
assert(env); \
\
- _THUNK_GEN_INSTANTIATE(env, __VA_ARGS__); \
+ _THUNK_GEN_INITIALIZE(env, __VA_ARGS__); \
env->__thunk.dispatch = __thunk_dispatch_##_name; \
\
return &env->__thunk; \
© 2021 All Rights Reserved