From 3d92926a902017e7cf1f5738e99ff62da596ce12 Mon Sep 17 00:00:00 2001 From: Ethan Werner Date: Sun, 9 Aug 2026 15:02:21 +0400 Subject: refactor --- lib/volume_oscillator.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/volume_oscillator.c') diff --git a/lib/volume_oscillator.c b/lib/volume_oscillator.c index 6aa59f0..37d34c4 100644 --- a/lib/volume_oscillator.c +++ b/lib/volume_oscillator.c @@ -23,7 +23,7 @@ ts_parameter_t const ts_volume_oscillator_p = { .n_inputs = 1, .n_outputs = 1, . uint_t ts_volume_oscillator_offset( ts_constant_t const *c ) { ( void )c; - return ( c ? ((ts_volume_oscillator_params_t *)c)->slow_k > 0 ? (uint_t)(((ts_volume_oscillator_params_t *)c)->slow_k - 1) : 0 : 0 ); + return ( c ? ((ts_volume_oscillator_params_t const *)c)->slow_k > 0 ? (uint_t)(((ts_volume_oscillator_params_t const *)c)->slow_k - 1) : 0 : 0 ); } int ts_volume_oscillator( @@ -34,10 +34,9 @@ int ts_volume_oscillator( { TS_PROLOGUE( ts_volume_oscillator_p ); if ( !c ) return -1; - fp_t fast_k = ((ts_volume_oscillator_params_t *)c)->fast_k; - fp_t slow_k = ((ts_volume_oscillator_params_t *)c)->slow_k; + fp_t fast_k = ((ts_volume_oscillator_params_t const *)c)->fast_k; + fp_t slow_k = ((ts_volume_oscillator_params_t const *)c)->slow_k; if (fast_k == 0 || slow_k == 0) return -1; - if (n == 0) return -1; fp_t fast_a = 2.0 / (fast_k + 1); fp_t slow_a = 2.0 / (slow_k + 1); -- cgit v1.3.1