diff --git a/src/VoiceKey.cpp b/src/VoiceKey.cpp index 9876bf7f6..b1c39c6d1 100644 --- a/src/VoiceKey.cpp +++ b/src/VoiceKey.cpp @@ -306,8 +306,15 @@ sampleCount VoiceKey::OnBackward ( //Initialize these trend markers atrend and ztrend. They keep track of the //up/down trends at the start and end of the evaluation window. int atrend = sgn(buffer[remaining - 2]-buffer[remaining - 1]); + int ztrend = sgn(buffer[remaining - WindowSizeInt - 2] - - buffer[remaining - WindowSizeInt - 2]); + buffer[remaining - WindowSizeInt + // PVS-Studio detected a probable error here + // when it read - 2. + // is - 1 correct? + // This code is unused. I didn't study further. + - 1 + ]); double erg=0; double sc = 0; diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index 732e0a3c7..b5e703baf 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -369,8 +369,11 @@ bool EffectEqualization::ValidateUI() { // If editing a batch chain, we don't want to be using the unnamed curve so // we offer to save it. - while (mDisallowCustom && mCurveName.IsSameAs(wxT("unnamed"))) + + if (mDisallowCustom && mCurveName.IsSameAs(wxT("unnamed"))) { + // PRL: This is unreachable. mDisallowCustom is always false. + Effect::MessageBox(_("To use this EQ curve in a batch chain, please choose a new name for it.\nChoose the 'Save/Manage Curves...' button and rename the 'unnamed' curve, then use that one."), wxOK | wxCENTRE, _("EQ Curve needs a different name")); diff --git a/src/effects/vamp/LoadVamp.cpp b/src/effects/vamp/LoadVamp.cpp index 2956b6692..9ff7d8bf7 100644 --- a/src/effects/vamp/LoadVamp.cpp +++ b/src/effects/vamp/LoadVamp.cpp @@ -166,7 +166,7 @@ wxArrayString VampEffectsModule::FindPluginPaths(PluginManagerInterface & WXUNUS if (j->sampleType == Plugin::OutputDescriptor::FixedSampleRate || j->sampleType == Plugin::OutputDescriptor::OneSamplePerStep || !j->hasFixedBinCount || - (j->hasFixedBinCount && j->binCount > 1)) + j->binCount > 1) { // All of these qualities disqualify (see notes above) @@ -299,7 +299,7 @@ std::unique_ptr VampEffectsModule::FindPlugin(const wxString & pat if (j->sampleType == Plugin::OutputDescriptor::FixedSampleRate || j->sampleType == Plugin::OutputDescriptor::OneSamplePerStep || !j->hasFixedBinCount || - (j->hasFixedBinCount && j->binCount > 1)) + j->binCount > 1) { // All of these qualities disqualify (see notes above) diff --git a/src/export/ExportFFmpeg.cpp b/src/export/ExportFFmpeg.cpp index 65a208da3..0e81fc4c3 100644 --- a/src/export/ExportFFmpeg.cpp +++ b/src/export/ExportFFmpeg.cpp @@ -227,7 +227,7 @@ ExportFFmpeg::ExportFFmpeg() SetDescription(ExportFFmpegOptions::fmts[newfmt].Description(), fmtindex); int canmeta = ExportFFmpegOptions::fmts[newfmt].canmetadata; - if (canmeta && (canmeta == AV_VERSION_INT(-1,-1,-1) || canmeta <= avfver)) + if (canmeta && (canmeta == AV_CANMETA || canmeta <= avfver)) { SetCanMetaData(true,fmtindex); } diff --git a/src/export/ExportFFmpegDialogs.cpp b/src/export/ExportFFmpegDialogs.cpp index 00bb0f850..16f64ee81 100644 --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -1218,11 +1218,11 @@ static wxString iAACProfileNames(int index) /// List of export types ExposedFormat ExportFFmpegOptions::fmts[] = { - {FMT_M4A, wxT("M4A"), wxT("m4a"), wxT("ipod"), 48, AV_VERSION_INT(-1,-1,-1), true, XO("M4A (AAC) Files (FFmpeg)"), AV_CODEC_ID_AAC, true}, + {FMT_M4A, wxT("M4A"), wxT("m4a"), wxT("ipod"), 48, AV_CANMETA, true, XO("M4A (AAC) Files (FFmpeg)"), AV_CODEC_ID_AAC, true}, {FMT_AC3, wxT("AC3"), wxT("ac3"), wxT("ac3"), 7, AV_VERSION_INT(0,0,0), false, XO("AC3 Files (FFmpeg)"), AV_CODEC_ID_AC3, true}, {FMT_AMRNB, wxT("AMRNB"), wxT("amr"), wxT("amr"), 1, AV_VERSION_INT(0,0,0), false, XO("AMR (narrow band) Files (FFmpeg)"), AV_CODEC_ID_AMR_NB, true}, {FMT_WMA2, wxT("WMA"), wxT("wma"), wxT("asf"), 2, AV_VERSION_INT(52,53,0), false, XO("WMA (version 2) Files (FFmpeg)"), AV_CODEC_ID_WMAV2, true}, - {FMT_OTHER, wxT("FFMPEG"), wxT(""), wxT(""), 255, AV_VERSION_INT(-1,-1,-1), true, XO("Custom FFmpeg Export"), AV_CODEC_ID_NONE, true} + {FMT_OTHER, wxT("FFMPEG"), wxT(""), wxT(""), 255, AV_CANMETA, true, XO("Custom FFmpeg Export"), AV_CODEC_ID_NONE, true} }; wxString ExposedFormat::Description() const diff --git a/src/export/ExportFFmpegDialogs.h b/src/export/ExportFFmpegDialogs.h index 0f02b0196..252191dbe 100644 --- a/src/export/ExportFFmpegDialogs.h +++ b/src/export/ExportFFmpegDialogs.h @@ -38,6 +38,8 @@ enum FFmpegExposedFormat FMT_LAST }; +#define AV_CANMETA (AV_VERSION_INT(255, 255, 255)) + /// Describes export type struct ExposedFormat { @@ -46,7 +48,7 @@ struct ExposedFormat const wxChar *extension; //!< default extension for this format. More extensions may be added later via AddExtension. const wxChar *shortname; //!< used to guess the format unsigned maxchannels; //!< how many channels this format could handle - int canmetadata; //!< !=0 if format supports metadata, -1 any avformat version, otherwise version support added + const int canmetadata; //!< !=0 if format supports metadata, AV_CANMETA any avformat version, otherwise version support added bool canutf8; //!< true if format supports metadata in UTF-8, false otherwise const wxChar *description_; //!< format description (will be shown in export dialog) (untranslated!) AVCodecID codecid; //!< codec ID (see libavcodec/avcodec.h) diff --git a/src/prefs/ExtImportPrefs.cpp b/src/prefs/ExtImportPrefs.cpp index 80bede526..324c1e2cc 100644 --- a/src/prefs/ExtImportPrefs.cpp +++ b/src/prefs/ExtImportPrefs.cpp @@ -602,7 +602,8 @@ void ExtImportPrefs::OnDelRule(wxCommandEvent& WXUNUSED(event)) int msgres = AudacityMessageBox (_("Do you really want to delete selected rule?"), _("Rule deletion confirmation"), wxYES_NO, RuleTable); - if (msgres == wxNO || msgres != wxYES) + // Yes or no, there is no third! + if (msgres != wxYES) return; RuleTable->DeleteRows (last_selected); diff --git a/src/widgets/AButton.cpp b/src/widgets/AButton.cpp index d21e39100..30510744a 100644 --- a/src/widgets/AButton.cpp +++ b/src/widgets/AButton.cpp @@ -299,12 +299,12 @@ AButton::AButtonState AButton::GetState() } } else { - if (mToggle) { + //if (mToggle) { state = mButtonIsDown ? AButtonDown : AButtonUp; - } - else { - state = mButtonIsDown ? AButtonDown : AButtonUp; - } + //} + //else { + //state = mButtonIsDown ? AButtonDown : AButtonUp; + //} } return state; diff --git a/src/widgets/ASlider.cpp b/src/widgets/ASlider.cpp index 7814098db..071b624c2 100644 --- a/src/widgets/ASlider.cpp +++ b/src/widgets/ASlider.cpp @@ -391,10 +391,10 @@ LWSlider::LWSlider(wxWindow *parent, break; case DB_SLIDER: minValue = -36.0f; - if (orientation == wxHORIZONTAL) + //if (orientation == wxHORIZONTAL) maxValue = 36.0f; - else - maxValue = 36.0f; // for MixerBoard //v Previously was 6dB for MixerBoard, but identical for now. + //else + //maxValue = 36.0f; // for MixerBoard //v Previously was 6dB for MixerBoard, but identical for now. stepValue = 1.0f; speed = 0.5; break; diff --git a/src/widgets/ExpandingToolBar.cpp b/src/widgets/ExpandingToolBar.cpp index b175d7a3a..d6f6674c9 100644 --- a/src/widgets/ExpandingToolBar.cpp +++ b/src/widgets/ExpandingToolBar.cpp @@ -291,10 +291,10 @@ class ExpandingToolBarEvtHandler final : public wxEvtHandler bool ProcessEvent(wxEvent& evt) override { - if (mToolBar->IsCursorInWindow()) - mToolBar->TryAutoExpand(); - else +// if (mToolBar->IsCursorInWindow()) mToolBar->TryAutoExpand(); +// else +// mToolBar->TryAutoExpand(); return mInheritedEvtHandler->ProcessEvent(evt); } diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index e6f5f23e4..d84223648 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -2427,10 +2427,10 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt) // Do this hack so scrubber can detect mouse drags anywhere evt.ResumePropagation(wxEVENT_PROPAGATE_MAX); - if (scrubber.IsScrubbing()) - evt.Skip(); - else + //if (scrubber.IsScrubbing()) evt.Skip(); + //else + //evt.Skip(); // Don't do this, it slows down drag-scrub on Mac. // Timer updates of display elsewhere make it unnecessary.