From b4796e98cf75840cd033dade1480a8b462fb0dd9 Mon Sep 17 00:00:00 2001 From: Weird Constructor Date: Fri, 18 Jun 2021 05:09:36 +0200 Subject: [PATCH] fixed warnings --- src/dsp/node_ad.rs | 6 ++---- tests/common/mod.rs | 7 ++++++- tests/node_ad.rs | 10 +++++----- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/dsp/node_ad.rs b/src/dsp/node_ad.rs index 8152084..d1a4ddc 100644 --- a/src/dsp/node_ad.rs +++ b/src/dsp/node_ad.rs @@ -21,8 +21,6 @@ macro_rules! fa_ad_mult { ($formatter: expr, $v: expr, $denorm_v: expr) => { { write!($formatter, "{}", s) } } } -const AD_STAGES : i8 = 2; - /// A simple amplifier #[derive(Debug, Clone)] pub struct Ad { @@ -125,7 +123,7 @@ impl DspNode for Ad { atoms: &[SAtom], _params: &[ProcBuf], inputs: &[ProcBuf], outputs: &mut [ProcBuf], ctx_vals: LedPhaseVals) { - use crate::dsp::{out, inp, denorm, denorm_v, inp_dir, at}; + use crate::dsp::{out, inp, denorm, at}; let inp = inp::Ad::inp(inputs); let trig = inp::Ad::trig(inputs); @@ -260,7 +258,7 @@ impl DspNode for Ad { 0.0 } else { let x = x - a; - let delta = ((d - x) / d); + let delta = (d - x) / d; sqrt4_to_pow4(delta, dshp) } } else { diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 06de95a..d191f3b 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -209,11 +209,13 @@ macro_rules! assert_minmax_of_rms { } } +#[allow(unused)] pub fn pset_n(matrix: &mut Matrix, nid: NodeId, parm: &str, v_norm: f32) { let p = nid.inp_param(parm).unwrap(); matrix.set_param(p, SAtom::param(v_norm)); } +#[allow(unused)] pub fn pset_d(matrix: &mut Matrix, nid: NodeId, parm: &str, v_denorm: f32) { let p = nid.inp_param(parm).unwrap(); matrix.set_param(p, SAtom::param(p.norm(v_denorm))); @@ -317,6 +319,7 @@ pub fn run_and_get_first_rms_mimax( rms_mimax[0] } +#[allow(unused)] pub fn run_and_get_l_rms_mimax( node_exec: &mut hexodsp::nodes::NodeExecutor, len_ms: f32) -> (f32, f32, f32) @@ -326,6 +329,7 @@ pub fn run_and_get_l_rms_mimax( rms_mimax[1] } +#[allow(unused)] pub fn run_and_get_counted_freq( node_exec: &mut hexodsp::nodes::NodeExecutor, ms: f32) -> f64 @@ -359,7 +363,7 @@ pub fn run_and_get_counted_freq( trans_per_sample * 44100.0 * 0.5 } - +#[allow(unused)] pub fn run_and_get_fft4096( node_exec: &mut hexodsp::nodes::NodeExecutor, thres: u32, @@ -376,6 +380,7 @@ pub fn run_and_get_fft4096( fft_thres_at_ms(&mut out_l[..], FFT::F4096, thres, offs_ms) } +#[allow(unused)] pub fn run_and_get_fft4096_now( node_exec: &mut hexodsp::nodes::NodeExecutor, thres: u32) -> Vec<(u16, u32)> diff --git a/tests/node_ad.rs b/tests/node_ad.rs index 642c2f6..f9762de 100644 --- a/tests/node_ad.rs +++ b/tests/node_ad.rs @@ -76,7 +76,7 @@ fn check_node_ad_retrig() { matrix.set_param(trig_p, SAtom::param(0.0)); - let res = run_for_ms(&mut node_exec, 0.1); + run_for_ms(&mut node_exec, 0.1); matrix.set_param(trig_p, SAtom::param(1.0)); let res = run_for_ms(&mut node_exec, 1.5); assert_decimated_feq!(res.0, 2, vec![ @@ -153,7 +153,7 @@ fn check_node_ad_inp_sin() { // check if we have any frequencies resembling 440Hz matrix.set_param(trig_p, SAtom::param(1.0)); - let res = run_for_ms(&mut node_exec, 7.0); + run_for_ms(&mut node_exec, 7.0); let fft = run_and_get_fft4096_now(&mut node_exec, 6); assert_eq!(fft[0], (420, 6)); @@ -169,7 +169,7 @@ fn check_node_ad_inp_sin() { matrix.set_param(atk_p, SAtom::param(atk_p.norm(40.0))); matrix.set_param(trig_p, SAtom::param(1.0)); - let res = run_for_ms(&mut node_exec, 7.0); + run_for_ms(&mut node_exec, 7.0); let fft = run_and_get_fft4096_now(&mut node_exec, 300); assert_eq!(fft[0], (431, 322)); @@ -185,7 +185,7 @@ fn check_node_ad_inp_sin() { matrix.set_param(dcy_p, SAtom::param(dcy_p.norm(40.0))); matrix.set_param(trig_p, SAtom::param(1.0)); - let res = run_for_ms(&mut node_exec, 7.0); + run_for_ms(&mut node_exec, 7.0); let fft = run_and_get_fft4096_now(&mut node_exec, 300); assert_eq!(fft[0], (431, 489)); @@ -322,7 +322,7 @@ fn check_node_ad_atk_dcy() { pset_d(&mut matrix, ad, "atk", 20.0); pset_n(&mut matrix, test, "p", 0.0); - let res = run_for_ms(&mut node_exec, 10.0); + run_for_ms(&mut node_exec, 10.0); pset_n(&mut matrix, test, "p", 1.0); let res = run_for_ms(&mut node_exec, 10.0);