From c5cdab2601dd53f45c47e11ddd0f5eb5748b8ad5 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 24 Jun 2022 19:38:44 +0200 Subject: [PATCH] clang-tidy: Apply modernize-use-bool-literals (#6448) ... and remove never-executed code: This removes a condition that was always true and two statements guarded by conditions that were always false. --- plugins/LadspaEffect/caps/Amp.cc | 7 ++----- plugins/LadspaEffect/caps/dsp/Delay.h | 3 --- plugins/MidiImport/MidiImport.cpp | 2 +- plugins/ZynAddSubFx/LocalZynAddSubFx.cpp | 2 +- src/core/audio/AudioOss.cpp | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/plugins/LadspaEffect/caps/Amp.cc b/plugins/LadspaEffect/caps/Amp.cc index 8bf49fd53..74bde2b75 100644 --- a/plugins/LadspaEffect/caps/Amp.cc +++ b/plugins/LadspaEffect/caps/Amp.cc @@ -388,9 +388,7 @@ AmpV::one_cycle (int frames) v = v * v * .06 + .46; a = filter[0].process (a + normal); - if (0) - a = filter[2].process (a); - + a = g * (a + supply * .001); a = v * tube.transfer_clip (up.upsample (a)); @@ -399,8 +397,7 @@ AmpV::one_cycle (int frames) a = down.process (a); a = filter[1].process (a - normal); - if (1) - a = filter[2].process (a + normal); + a = filter[2].process (a + normal); { for (int o = 1; o < OVERSAMPLE; ++o) diff --git a/plugins/LadspaEffect/caps/dsp/Delay.h b/plugins/LadspaEffect/caps/dsp/Delay.h index ab18d894c..29b03fd78 100644 --- a/plugins/LadspaEffect/caps/dsp/Delay.h +++ b/plugins/LadspaEffect/caps/dsp/Delay.h @@ -154,9 +154,6 @@ class DelayTapA int n; fistp (f, n); /* read: n = (int) f; relies on FPTruncateMode */ f -= n; - if (0 && f < .5) - f += 1, - n -= 1; sample_t x = d[n]; f = (1 - f) / (1 + f); diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index e9962838c..73ea4d8c2 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -605,7 +605,7 @@ invalid_format: } // search for "data" chunk - while( 1 ) + while( true ) { const int id = readID(); const int len = read32LE(); diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp index fd1d2b838..2b0c0d974 100644 --- a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp @@ -86,7 +86,7 @@ LocalZynAddSubFx::LocalZynAddSubFx() : m_ioEngine = new NulEngine; m_master = new Master(); - m_master->swaplr = 0; + m_master->swaplr = false; } diff --git a/src/core/audio/AudioOss.cpp b/src/core/audio/AudioOss.cpp index 76f10a61e..4480e399c 100644 --- a/src/core/audio/AudioOss.cpp +++ b/src/core/audio/AudioOss.cpp @@ -219,7 +219,7 @@ QString AudioOss::probeDevice() if( QFileInfo( dev ).isWritable() == false ) { int instance = -1; - while( 1 ) + while( true ) { dev = PATH_DEV_DSP + QString::number( ++instance ); if( !QFileInfo( dev ).exists() )