summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-02-03 04:59:17 -0800
committerVito Caputo <vcaputo@pengaru.com>2020-02-03 04:59:17 -0800
commited022ab4e3b17d488221c182a898d537569aa7e4 (patch)
treea819ba076af3ce233e46dcca78e4c40a01ec90a2 /src
parentdb99c38a5dfaab56e6255ed28cf6f7392c1a0a27 (diff)
libs/sig: cosmetic rearrangement
Make sig_ops_t.destroy functions consistently after init, no functional changes.
Diffstat (limited to 'src')
-rw-r--r--src/libs/sig/ops_lerp.c24
-rw-r--r--src/libs/sig/ops_mult.c10
2 files changed, 17 insertions, 17 deletions
diff --git a/src/libs/sig/ops_lerp.c b/src/libs/sig/ops_lerp.c
index 8002803..c4c0720 100644
--- a/src/libs/sig/ops_lerp.c
+++ b/src/libs/sig/ops_lerp.c
@@ -30,6 +30,18 @@ static void ops_lerp_init(void *context, va_list ap)
}
+static void ops_lerp_destroy(void *context)
+{
+ ops_lerp_ctxt_t *ctxt = context;
+
+ assert(ctxt);
+
+ sig_free(ctxt->a);
+ sig_free(ctxt->b);
+ sig_free(ctxt->t);
+}
+
+
static inline float lerp(float a, float b, float t)
{
return (1.f - t) * a + b * t;
@@ -48,18 +60,6 @@ static float ops_lerp_output(void *context, unsigned ticks_ms)
}
-static void ops_lerp_destroy(void *context)
-{
- ops_lerp_ctxt_t *ctxt = context;
-
- assert(ctxt);
-
- sig_free(ctxt->a);
- sig_free(ctxt->b);
- sig_free(ctxt->t);
-}
-
-
sig_ops_t sig_ops_lerp = {
.size = ops_lerp_size,
.init = ops_lerp_init,
diff --git a/src/libs/sig/ops_mult.c b/src/libs/sig/ops_mult.c
index 7133e25..2d4e1ac 100644
--- a/src/libs/sig/ops_mult.c
+++ b/src/libs/sig/ops_mult.c
@@ -29,24 +29,24 @@ static void ops_mult_init(void *context, va_list ap)
}
-static float ops_mult_output(void *context, unsigned ticks_ms)
+static void ops_mult_destroy(void *context)
{
ops_mult_ctxt_t *ctxt = context;
assert(ctxt);
- return sig_output(ctxt->a, ticks_ms) * sig_output(ctxt->b, ticks_ms);
+ sig_free(ctxt->a);
+ sig_free(ctxt->b);
}
-static void ops_mult_destroy(void *context)
+static float ops_mult_output(void *context, unsigned ticks_ms)
{
ops_mult_ctxt_t *ctxt = context;
assert(ctxt);
- sig_free(ctxt->a);
- sig_free(ctxt->b);
+ return sig_output(ctxt->a, ticks_ms) * sig_output(ctxt->b, ticks_ms);
}
© All Rights Reserved