From 162418ff071af5bad1b15cb9bdd74578a35ead8e Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 10 Jun 2015 02:04:07 -0400 Subject: [PATCH] Fix compilation warnings --- src/Envelope.cpp | 4 ++-- src/commands/CommandHandler.cpp | 2 +- src/effects/nyquist/Nyquist.cpp | 2 +- src/import/ImportMIDI.cpp | 2 +- src/prefs/LibraryPrefs.cpp | 3 +++ 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Envelope.cpp b/src/Envelope.cpp index 6504be230..61b719e47 100644 --- a/src/Envelope.cpp +++ b/src/Envelope.cpp @@ -336,7 +336,7 @@ float Envelope::ValueOfPixel( int y, int height, bool upper, bool dB, // TODO: Cache the gPrefs value. Reading it every time is inefficient. dBRange = gPrefs->Read(wxT("/GUI/EnvdBRange"), ENV_DB_RANGE); - float v = ::ValueOfPixel(y, height, mContourOffset, dB, dBRange, zoomMin, zoomMax); + float v = ::ValueOfPixel(y, height, 0 != mContourOffset, dB, dBRange, zoomMin, zoomMax); // MB: this is mostly equivalent to what the old code did, I'm not sure // if anything special is needed for asymmetric ranges @@ -1413,7 +1413,7 @@ double Envelope::SolveIntegralOfInverse( double t0, double area ) if(area == 0.0) return t0; - unsigned int count = mEnv.Count(); + int count = mEnv.Count(); if(count == 0) // 'empty' envelope return t0 + area * mDefaultValue; diff --git a/src/commands/CommandHandler.cpp b/src/commands/CommandHandler.cpp index 82d3f4094..d117d22d4 100644 --- a/src/commands/CommandHandler.cpp +++ b/src/commands/CommandHandler.cpp @@ -32,7 +32,7 @@ CommandHandler::~CommandHandler() delete mCurrentContext; } -void CommandHandler::SetProject(AudacityProject *proj) +void CommandHandler::SetProject(AudacityProject *) { // TODO: Review if the extend command handling is ever utilized // mCurrentContext->proj = proj; diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 1d91ea46a..244067e6f 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -1391,7 +1391,7 @@ void NyquistEffect::Parse(wxString line) long v; // Splits are restored by default. Set to 0 to prevent. tokens[1].ToLong(&v); - mRestoreSplits = v; + mRestoreSplits = !!v; return; } #endif diff --git a/src/import/ImportMIDI.cpp b/src/import/ImportMIDI.cpp index 3d5aae7cd..e03aff042 100644 --- a/src/import/ImportMIDI.cpp +++ b/src/import/ImportMIDI.cpp @@ -69,7 +69,7 @@ bool ImportMIDI(wxString fName, NoteTrack * dest) Alg_event_ptr evt; int note_count = 0; int pitch_sum = 0; - while ((evt = iterator.next())) { + while (NULL != (evt = iterator.next())) { // if the event is a note if (evt->get_type() == 'n') { Alg_note_ptr note = (Alg_note_ptr) evt; diff --git a/src/prefs/LibraryPrefs.cpp b/src/prefs/LibraryPrefs.cpp index ed67ab3c8..b1b42ec33 100644 --- a/src/prefs/LibraryPrefs.cpp +++ b/src/prefs/LibraryPrefs.cpp @@ -140,6 +140,9 @@ void LibraryPrefs::PopulateOrExchange(ShuttleGui & S) #if !defined(USE_FFMPEG) || defined(DISABLE_DYNAMIC_LOADING_FFMPEG) bdwn->Enable(FALSE); bfnd->Enable(FALSE); +#else + // fix compilation warnings about unused variables + bfnd, bdwn; #endif } S.EndTwoColumn();