diff options
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); } |