1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-19 06:07:42 +02:00

Fix various other warnings

Fix warning about missing field initializers
  Don't compile unused static function
  Put braces around sub-object initializers
  Fix some warnings for unused variables and labels...
  Avoid unreachable code warning
This commit is contained in:
Paul Licameli 2016-09-19 11:48:10 -04:00
commit d63ffa123e
11 changed files with 78 additions and 52 deletions

View File

@ -1317,8 +1317,8 @@ bool SpectrumAnalyst::Calculate(Algorithm alg, int windowFunc,
} }
float mYMin = 1000000, mYMax = -1000000; float mYMin = 1000000, mYMax = -1000000;
switch (alg) {
double scale; double scale;
switch (alg) {
case Spectrum: case Spectrum:
// Convert to decibels // Convert to decibels
mYMin = 1000000.; mYMin = 1000000.;

View File

@ -51,7 +51,7 @@ wxString PlatformCompatibility::ConvertSlashInFileName(const wxString& filePath)
wxString path = filePath; wxString path = filePath;
wxString filename; wxString filename;
wxString newPath = filePath; wxString newPath = filePath;
int pathLen = 1; // int pathLen = 1;
while (!wxDirExists(wxPathOnly(newPath)) && ! path.IsEmpty()) { while (!wxDirExists(wxPathOnly(newPath)) && ! path.IsEmpty()) {
path = newPath.BeforeLast('/'); path = newPath.BeforeLast('/');
filename = newPath.AfterLast('/'); filename = newPath.AfterLast('/');

View File

@ -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 // Recursive routine to copy all groups and entries from one wxConfig object to another
static void CopyEntriesRecursive(wxString path, wxConfigBase *src, wxConfigBase *dst) 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); groupKeepGoing = src->GetNextGroup(groupName, groupIndex);
} }
} }
#endif
void InitPreferences() void InitPreferences()
{ {

View File

@ -181,9 +181,9 @@ ODLock &AudacityProject::AllProjectDeleteMutex()
}; };
#if defined(__WXMAC__) #if defined(__WXMAC__)
const int sbarSpaceWidth = 15; // const int sbarSpaceWidth = 15;
const int sbarControlWidth = 16; // const int sbarControlWidth = 16;
const int sbarExtraLen = 1; // 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 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__) #elif defined(__WXMSW__)
const int sbarSpaceWidth = 16; const int sbarSpaceWidth = 16;
@ -414,7 +414,7 @@ public:
bool OnDrop(wxCoord x, wxCoord y) override bool OnDrop(wxCoord x, wxCoord y) override
{ {
bool foundSupported = false; // bool foundSupported = false;
#if !wxCHECK_VERSION(3, 0, 0) #if !wxCHECK_VERSION(3, 0, 0)
bool firstFileAdded = false; bool firstFileAdded = false;
OSErr result; OSErr result;

View File

@ -98,26 +98,26 @@ FactoryPresets[] =
// Table DCBlock threshold floor Param1 Param2 Repeats // Table DCBlock threshold floor Param1 Param2 Repeats
// Defaults: 0 false -6.0 -70.0(off) 50.0 50.0 1 // 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("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("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("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("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("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("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("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("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("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("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("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, 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, 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, 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, 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("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("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"), { 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("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("Percussion Limiter"), {10, 0, -12.0, -70.0, 100.0, 30.0, 0 } },
}; };
const wxString defaultLabel[5] = const wxString defaultLabel[5] =

View File

@ -64,15 +64,15 @@ FactoryPresets[] =
{ {
// Room Pre Hf Tone Tone Wet Dry Stereo Wet // Room Pre Hf Tone Tone Wet Dry Stereo Wet
// Name Size, Delay, Reverb, Damping, Low, High, Gain, Gain, Width, Only // 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 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("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("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 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("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("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("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("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("Cathedral"), { 90, 16, 90, 50, 100, 0, 0, -20, 100, false } },
}; };
struct Reverb_priv_t struct Reverb_priv_t

View File

@ -143,7 +143,10 @@ void VSTControl::CreateCocoa()
// Get the final bounds of the effect GUI // Get the final bounds of the effect GUI
mLink->callDispatcher(effEditGetRect, 0, 0, &rect, 0.0); 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]; [mView setFrame:frame];
@ -245,7 +248,10 @@ void VSTControl::CreateCarbon()
mLink->callDispatcher(effEditGetRect, 0, 0, &rect, 0.0); mLink->callDispatcher(effEditGetRect, 0, 0, &rect, 0.0);
// Set the size of the scrollview to match // 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 // One effect, mutagene lipredemuco, doesn't return a valid rect so
// try to detect it and use the created view dimensions instead. // try to detect it and use the created view dimensions instead.

View File

@ -1753,7 +1753,7 @@ void AudioUnitEffect::SetHostUI(EffectUIHostInterface *host)
bool AudioUnitEffect::PopulateUI(wxWindow *parent) bool AudioUnitEffect::PopulateUI(wxWindow *parent)
{ {
OSStatus result; // OSStatus result;
mDialog = static_cast<wxDialog *>(wxGetTopLevelParent(parent)); mDialog = static_cast<wxDialog *>(wxGetTopLevelParent(parent));
mParent = parent; mParent = parent;
@ -1948,17 +1948,35 @@ bool AudioUnitEffect::SetRateAndChannels()
mUnitInitialized = false; mUnitInitialized = false;
} }
AudioStreamBasicDescription streamFormat = {0}; AudioStreamBasicDescription streamFormat {
// Float64 mSampleRate;
mSampleRate,
streamFormat.mSampleRate = mSampleRate; // UInt32 mFormatID;
streamFormat.mFormatID = kAudioFormatLinearPCM; kAudioFormatLinearPCM,
streamFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked |
kAudioFormatFlagIsNonInterleaved; // UInt32 mFormatFlags;
streamFormat.mBitsPerChannel = sizeof(float) * 8; (kAudioFormatFlagsNativeFloatPacked |
streamFormat.mChannelsPerFrame = mAudioIns; kAudioFormatFlagIsNonInterleaved),
streamFormat.mFramesPerPacket = 1;
streamFormat.mBytesPerFrame = sizeof(float); // UInt32 mBytesPerPacket;
streamFormat.mBytesPerPacket = sizeof(float); sizeof(float),
// UInt32 mFramesPerPacket;
1,
// UInt32 mBytesPerFrame;
sizeof(float),
// UInt32 mChannelsPerFrame;
mAudioIns,
// UInt32 mBitsPerChannel;
sizeof(float) * 8,
// UInt32 mReserved;
0
};
result = AudioUnitSetProperty(mUnit, result = AudioUnitSetProperty(mUnit,
kAudioUnitProperty_SampleRate, kAudioUnitProperty_SampleRate,

View File

@ -392,7 +392,7 @@ int QTImportFileHandle::Import(TrackFactory *trackFactory,
} }
} while (false); } while (false);
done: // done:
if (maer) { if (maer) {
MovieAudioExtractionEnd(maer); MovieAudioExtractionEnd(maer);
@ -441,7 +441,7 @@ void QTImportFileHandle::AddMetadata(Tags *tags)
for (int i = 0; i < WXSIZEOF(names); i++) { for (int i = 0; i < WXSIZEOF(names); i++) {
QTMetaDataItem item = kQTMetaDataItemUninitialized; QTMetaDataItem item = kQTMetaDataItemUninitialized;
OSType key = names[i].key; // OSType key = names[i].key;
err = QTMetaDataGetNextItem(metaDataRef, err = QTMetaDataGetNextItem(metaDataRef,
kQTMetaDataStorageFormatWildcard, kQTMetaDataStorageFormatWildcard,

View File

@ -832,7 +832,7 @@ void ToolDock::Updated()
// //
void ToolDock::OnGrabber( GrabberEvent & event ) void ToolDock::OnGrabber( GrabberEvent & event )
{ {
auto pos = event.GetPosition(); // auto pos = event.GetPosition();
if (!event.IsEscaping()) { if (!event.IsEscaping()) {
ToolBar *t = mBars[ event.GetId() ]; ToolBar *t = mBars[ event.GetId() ];

View File

@ -55,7 +55,7 @@ enum {
}; };
static const double MinStutter = 0.2; static const double MinStutter = 0.2;
static const double MaxDragSpeed = 1.0; // static const double MaxDragSpeed = 1.0;
namespace { namespace {
double FindScrubbingSpeed(const ViewInfo &viewInfo, double maxScrubSpeed, double screen, double timeAtMouse) double FindScrubbingSpeed(const ViewInfo &viewInfo, double maxScrubSpeed, double screen, double timeAtMouse)