diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-02-03 04:59:17 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-02-03 04:59:17 -0800 |
commit | ed022ab4e3b17d488221c182a898d537569aa7e4 (patch) | |
tree | a819ba076af3ce233e46dcca78e4c40a01ec90a2 /src/libs | |
parent | db99c38a5dfaab56e6255ed28cf6f7392c1a0a27 (diff) |
libs/sig: cosmetic rearrangement
Make sig_ops_t.destroy functions consistently after init, no
functional changes.
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/sig/ops_lerp.c | 24 | ||||
-rw-r--r-- | src/libs/sig/ops_mult.c | 10 |
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); } |