From 54c993c4f55dd429e771c4542fb9e9ccaa1819d4 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 18 Sep 2016 10:46:40 -0400 Subject: [PATCH 1/5] Avoid unreachable code warning --- src/FreqWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index ccb377235..3f6bde889 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -1317,8 +1317,8 @@ bool SpectrumAnalyst::Calculate(Algorithm alg, int windowFunc, } float mYMin = 1000000, mYMax = -1000000; - switch (alg) { double scale; + switch (alg) { case Spectrum: // Convert to decibels mYMin = 1000000.; From 53936ac9700902416445edc858894f4c5d1306d6 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 18 Sep 2016 10:59:50 -0400 Subject: [PATCH 2/5] Fix some warnings for unused variables and labels... ... But not in cases where a return status is ignored. --- src/PlatformCompatibility.cpp | 2 +- src/Project.cpp | 8 ++++---- src/effects/audiounits/AudioUnitEffect.cpp | 2 +- src/import/ImportQT.cpp | 4 ++-- src/toolbars/ToolDock.cpp | 2 +- src/tracks/ui/Scrubbing.cpp | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/PlatformCompatibility.cpp b/src/PlatformCompatibility.cpp index 0c79d72d1..6133a3cf9 100644 --- a/src/PlatformCompatibility.cpp +++ b/src/PlatformCompatibility.cpp @@ -51,7 +51,7 @@ wxString PlatformCompatibility::ConvertSlashInFileName(const wxString& filePath) wxString path = filePath; wxString filename; wxString newPath = filePath; - int pathLen = 1; + // int pathLen = 1; while (!wxDirExists(wxPathOnly(newPath)) && ! path.IsEmpty()) { path = newPath.BeforeLast('/'); filename = newPath.AfterLast('/'); diff --git a/src/Project.cpp b/src/Project.cpp index 8bbae5beb..a415cd9f2 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -181,9 +181,9 @@ ODLock &AudacityProject::AllProjectDeleteMutex() }; #if defined(__WXMAC__) -const int sbarSpaceWidth = 15; -const int sbarControlWidth = 16; -const int sbarExtraLen = 1; +// const int sbarSpaceWidth = 15; +// const int sbarControlWidth = 16; +// const int sbarExtraLen = 1; const int sbarHjump = 30; //STM: This is how far the thumb jumps when the l/r buttons are pressed, or auto-scrolling occurs -- in pixels #elif defined(__WXMSW__) const int sbarSpaceWidth = 16; @@ -414,7 +414,7 @@ public: bool OnDrop(wxCoord x, wxCoord y) override { - bool foundSupported = false; + // bool foundSupported = false; #if !wxCHECK_VERSION(3, 0, 0) bool firstFileAdded = false; OSErr result; diff --git a/src/effects/audiounits/AudioUnitEffect.cpp b/src/effects/audiounits/AudioUnitEffect.cpp index 22284a61a..cb428c8eb 100644 --- a/src/effects/audiounits/AudioUnitEffect.cpp +++ b/src/effects/audiounits/AudioUnitEffect.cpp @@ -1753,7 +1753,7 @@ void AudioUnitEffect::SetHostUI(EffectUIHostInterface *host) bool AudioUnitEffect::PopulateUI(wxWindow *parent) { - OSStatus result; + // OSStatus result; mDialog = static_cast(wxGetTopLevelParent(parent)); mParent = parent; diff --git a/src/import/ImportQT.cpp b/src/import/ImportQT.cpp index c7eca9bc9..32b189382 100644 --- a/src/import/ImportQT.cpp +++ b/src/import/ImportQT.cpp @@ -392,7 +392,7 @@ int QTImportFileHandle::Import(TrackFactory *trackFactory, } } while (false); -done: +// done: if (maer) { MovieAudioExtractionEnd(maer); @@ -441,7 +441,7 @@ void QTImportFileHandle::AddMetadata(Tags *tags) for (int i = 0; i < WXSIZEOF(names); i++) { QTMetaDataItem item = kQTMetaDataItemUninitialized; - OSType key = names[i].key; + // OSType key = names[i].key; err = QTMetaDataGetNextItem(metaDataRef, kQTMetaDataStorageFormatWildcard, diff --git a/src/toolbars/ToolDock.cpp b/src/toolbars/ToolDock.cpp index 7d8a3e3e9..d8ee5ee05 100644 --- a/src/toolbars/ToolDock.cpp +++ b/src/toolbars/ToolDock.cpp @@ -832,7 +832,7 @@ void ToolDock::Updated() // void ToolDock::OnGrabber( GrabberEvent & event ) { - auto pos = event.GetPosition(); + // auto pos = event.GetPosition(); if (!event.IsEscaping()) { ToolBar *t = mBars[ event.GetId() ]; diff --git a/src/tracks/ui/Scrubbing.cpp b/src/tracks/ui/Scrubbing.cpp index f41442a3e..275a82111 100644 --- a/src/tracks/ui/Scrubbing.cpp +++ b/src/tracks/ui/Scrubbing.cpp @@ -55,7 +55,7 @@ enum { }; static const double MinStutter = 0.2; -static const double MaxDragSpeed = 1.0; +// static const double MaxDragSpeed = 1.0; namespace { double FindScrubbingSpeed(const ViewInfo &viewInfo, double maxScrubSpeed, double screen, double timeAtMouse) From 412e4955af8684ed82d3d97a670ca55f92b0b74e Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 18 Sep 2016 11:19:22 -0400 Subject: [PATCH 3/5] Put braces around sub-object initializers --- src/effects/Distortion.cpp | 40 ++++++++++++++++---------------- src/effects/Reverb.cpp | 18 +++++++------- src/effects/VST/VSTControlOSX.mm | 10 ++++++-- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/effects/Distortion.cpp b/src/effects/Distortion.cpp index 1452b0365..61b6ec772 100644 --- a/src/effects/Distortion.cpp +++ b/src/effects/Distortion.cpp @@ -98,26 +98,26 @@ FactoryPresets[] = // Table DCBlock threshold floor Param1 Param2 Repeats // Defaults: 0 false -6.0 -70.0(off) 50.0 50.0 1 // - XO("Hard clip -12dB, 80% make-up gain"), { 0, 0, -12.0, -70.0, 0.0, 80.0, 0 }, - XO("Soft clip -12dB, 80% make-up gain"), { 1, 0, -12.0, -70.0, 50.0, 80.0, 0 }, - XO("Fuzz Box"), { 1, 0, -30.0, -70.0, 80.0, 80.0, 0 }, - XO("Walkie-talkie"), { 1, 0, -50.0, -70.0, 60.0, 80.0, 0 }, - XO("Blues drive sustain"), { 2, 0, -6.0, -70.0, 30.0, 80.0, 0 }, - XO("Light Crunch Overdrive"), { 3, 0, -6.0, -70.0, 20.0, 80.0, 0 }, - XO("Heavy Overdrive"), { 4, 0, -6.0, -70.0, 90.0, 80.0, 0 }, - XO("3rd Harmonic (Perfect Fifth)"), { 5, 0, -6.0, -70.0, 100.0, 60.0, 0 }, - XO("Valve Overdrive"), { 6, 1, -6.0, -70.0, 30.0, 40.0, 0 }, - XO("2nd Harmonic (Octave)"), { 6, 1, -6.0, -70.0, 50.0, 0.0, 0 }, - XO("Gated Expansion Distortion"), { 7, 0, -6.0, -70.0, 30.0, 80.0, 0 }, - XO("Leveller, Light, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 1 }, - XO("Leveller, Moderate, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 2 }, - XO("Leveller, Heavy, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 3 }, - XO("Leveller, Heavier, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 4 }, - XO("Leveller, Heaviest, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 5 }, - XO("Half-wave Rectifier"), { 9, 0, -6.0, -70.0, 50.0, 50.0, 0 }, - XO("Full-wave Rectifier"), { 9, 0, -6.0, -70.0, 100.0, 50.0, 0 }, - XO("Full-wave Rectifier (DC blocked)"), { 9, 1, -6.0, -70.0, 100.0, 50.0, 0 }, - XO("Percussion Limiter"), {10, 0, -12.0, -70.0, 100.0, 30.0, 0 }, + { XO("Hard clip -12dB, 80% make-up gain"), { 0, 0, -12.0, -70.0, 0.0, 80.0, 0 } }, + { XO("Soft clip -12dB, 80% make-up gain"), { 1, 0, -12.0, -70.0, 50.0, 80.0, 0 } }, + { XO("Fuzz Box"), { 1, 0, -30.0, -70.0, 80.0, 80.0, 0 } }, + { XO("Walkie-talkie"), { 1, 0, -50.0, -70.0, 60.0, 80.0, 0 } }, + { XO("Blues drive sustain"), { 2, 0, -6.0, -70.0, 30.0, 80.0, 0 } }, + { XO("Light Crunch Overdrive"), { 3, 0, -6.0, -70.0, 20.0, 80.0, 0 } }, + { XO("Heavy Overdrive"), { 4, 0, -6.0, -70.0, 90.0, 80.0, 0 } }, + { XO("3rd Harmonic (Perfect Fifth)"), { 5, 0, -6.0, -70.0, 100.0, 60.0, 0 } }, + { XO("Valve Overdrive"), { 6, 1, -6.0, -70.0, 30.0, 40.0, 0 } }, + { XO("2nd Harmonic (Octave)"), { 6, 1, -6.0, -70.0, 50.0, 0.0, 0 } }, + { XO("Gated Expansion Distortion"), { 7, 0, -6.0, -70.0, 30.0, 80.0, 0 } }, + { XO("Leveller, Light, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 1 } }, + { XO("Leveller, Moderate, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 2 } }, + { XO("Leveller, Heavy, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 3 } }, + { XO("Leveller, Heavier, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 4 } }, + { XO("Leveller, Heaviest, -70dB noise floor"), { 8, 0, -6.0, -70.0, 0.0, 50.0, 5 } }, + { XO("Half-wave Rectifier"), { 9, 0, -6.0, -70.0, 50.0, 50.0, 0 } }, + { XO("Full-wave Rectifier"), { 9, 0, -6.0, -70.0, 100.0, 50.0, 0 } }, + { XO("Full-wave Rectifier (DC blocked)"), { 9, 1, -6.0, -70.0, 100.0, 50.0, 0 } }, + { XO("Percussion Limiter"), {10, 0, -12.0, -70.0, 100.0, 30.0, 0 } }, }; const wxString defaultLabel[5] = diff --git a/src/effects/Reverb.cpp b/src/effects/Reverb.cpp index d11e7b55b..5deafd34a 100644 --- a/src/effects/Reverb.cpp +++ b/src/effects/Reverb.cpp @@ -64,15 +64,15 @@ FactoryPresets[] = { // Room Pre Hf Tone Tone Wet Dry Stereo Wet // Name Size, Delay, Reverb, Damping, Low, High, Gain, Gain, Width, Only - XO("Vocal I" ), { 70, 20, 40, 99, 100, 50, -12, 0, 70, false }, - XO("Vocal II"), { 50, 0, 50, 99, 50, 100, -1, -1, 70, false }, - XO("Bathroom"), { 16, 8, 80, 0, 0, 100, -6, 0, 100, false }, - XO("Small Room Bright"), { 30, 10, 50, 50, 50, 100, -1, -1, 100, false }, - XO("Small Room Dark"), { 30, 10, 50, 50, 100, 0, -1, -1, 100, false }, - XO("Medium Room"), { 75, 10, 40, 50, 100, 70, -1, -1, 70, false }, - XO("Large Room"), { 85, 10, 40, 50, 100, 80, 0, -6, 90, false }, - XO("Church Hall"), { 90, 32, 60, 50, 100, 50, 0, -12, 100, false }, - XO("Cathedral"), { 90, 16, 90, 50, 100, 0, 0, -20, 100, false }, + { XO("Vocal I" ), { 70, 20, 40, 99, 100, 50, -12, 0, 70, false } }, + { XO("Vocal II"), { 50, 0, 50, 99, 50, 100, -1, -1, 70, false } }, + { XO("Bathroom"), { 16, 8, 80, 0, 0, 100, -6, 0, 100, false } }, + { XO("Small Room Bright"), { 30, 10, 50, 50, 50, 100, -1, -1, 100, false } }, + { XO("Small Room Dark"), { 30, 10, 50, 50, 100, 0, -1, -1, 100, false } }, + { XO("Medium Room"), { 75, 10, 40, 50, 100, 70, -1, -1, 70, false } }, + { XO("Large Room"), { 85, 10, 40, 50, 100, 80, 0, -6, 90, false } }, + { XO("Church Hall"), { 90, 32, 60, 50, 100, 50, 0, -12, 100, false } }, + { XO("Cathedral"), { 90, 16, 90, 50, 100, 0, 0, -20, 100, false } }, }; struct Reverb_priv_t diff --git a/src/effects/VST/VSTControlOSX.mm b/src/effects/VST/VSTControlOSX.mm index 19c0c5bef..17eeac3c1 100644 --- a/src/effects/VST/VSTControlOSX.mm +++ b/src/effects/VST/VSTControlOSX.mm @@ -143,7 +143,10 @@ void VSTControl::CreateCocoa() // Get the final bounds of the effect GUI mLink->callDispatcher(effEditGetRect, 0, 0, &rect, 0.0); - NSRect frame = { 0, 0, (CGFloat) rect->right - rect->left, (CGFloat) rect->bottom - rect->top }; + NSRect frame = { + { 0, 0 }, + { (CGFloat) rect->right - rect->left, (CGFloat) rect->bottom - rect->top } + }; [mView setFrame:frame]; @@ -245,7 +248,10 @@ void VSTControl::CreateCarbon() mLink->callDispatcher(effEditGetRect, 0, 0, &rect, 0.0); // Set the size of the scrollview to match - HIRect r = { 0, 0, (CGFloat) rect->right - rect->left, (CGFloat) rect->bottom - rect->top }; + HIRect r = { + { 0, 0 }, + { (CGFloat) rect->right - rect->left, (CGFloat) rect->bottom - rect->top } + }; // One effect, mutagene lipredemuco, doesn't return a valid rect so // try to detect it and use the created view dimensions instead. From f9f95471b577a5304d1c2b138102bdc8591a93f0 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 18 Sep 2016 17:21:34 -0400 Subject: [PATCH 4/5] Don't compile unused static function --- src/Prefs.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Prefs.cpp b/src/Prefs.cpp index eff26389d..9c5bc269c 100755 --- a/src/Prefs.cpp +++ b/src/Prefs.cpp @@ -102,6 +102,7 @@ static void CopyEntry(wxString path, wxConfigBase *src, wxConfigBase *dst, wxStr } } +#if 0 // Recursive routine to copy all groups and entries from one wxConfig object to another static void CopyEntriesRecursive(wxString path, wxConfigBase *src, wxConfigBase *dst) { @@ -128,6 +129,7 @@ static void CopyEntriesRecursive(wxString path, wxConfigBase *src, wxConfigBase groupKeepGoing = src->GetNextGroup(groupName, groupIndex); } } +#endif void InitPreferences() { From 9310c8ae9b8a1f317dcf652a1aa13c1452d5750f Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 18 Sep 2016 17:31:43 -0400 Subject: [PATCH 5/5] Fix warning about missing field initializers --- src/effects/audiounits/AudioUnitEffect.cpp | 38 ++++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/effects/audiounits/AudioUnitEffect.cpp b/src/effects/audiounits/AudioUnitEffect.cpp index cb428c8eb..9d94562a9 100644 --- a/src/effects/audiounits/AudioUnitEffect.cpp +++ b/src/effects/audiounits/AudioUnitEffect.cpp @@ -1948,17 +1948,35 @@ bool AudioUnitEffect::SetRateAndChannels() mUnitInitialized = false; } - AudioStreamBasicDescription streamFormat = {0}; + AudioStreamBasicDescription streamFormat { + // Float64 mSampleRate; + mSampleRate, - streamFormat.mSampleRate = mSampleRate; - streamFormat.mFormatID = kAudioFormatLinearPCM; - streamFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | - kAudioFormatFlagIsNonInterleaved; - streamFormat.mBitsPerChannel = sizeof(float) * 8; - streamFormat.mChannelsPerFrame = mAudioIns; - streamFormat.mFramesPerPacket = 1; - streamFormat.mBytesPerFrame = sizeof(float); - streamFormat.mBytesPerPacket = sizeof(float); + // UInt32 mFormatID; + kAudioFormatLinearPCM, + + // UInt32 mFormatFlags; + (kAudioFormatFlagsNativeFloatPacked | + kAudioFormatFlagIsNonInterleaved), + + // UInt32 mBytesPerPacket; + sizeof(float), + + // UInt32 mFramesPerPacket; + 1, + + // UInt32 mBytesPerFrame; + sizeof(float), + + // UInt32 mChannelsPerFrame; + mAudioIns, + + // UInt32 mBitsPerChannel; + sizeof(float) * 8, + + // UInt32 mReserved; + 0 + }; result = AudioUnitSetProperty(mUnit, kAudioUnitProperty_SampleRate,