From a55c20be66dc9e3d45665a35606983f5ce13c58e Mon Sep 17 00:00:00 2001 From: businessmanprogrammersteve Date: Fri, 12 Feb 2010 21:36:20 +0000 Subject: [PATCH] Fix most of the compile warnings I get on Linux (but not the Audacity Logo xpm stuff or a few things in FFMPEG export) --- src/FFT.cpp | 2 +- src/Lyrics.cpp | 2 -- src/MixerBoard.cpp | 3 +-- src/NoteTrack.cpp | 2 +- src/NoteTrack.h | 2 +- src/Project.cpp | 3 +-- src/TrackArtist.cpp | 15 +++++++++------ src/blockfile/ODDecodeBlockFile.cpp | 8 ++++---- src/commands/CommandManager.cpp | 20 ++++++++++---------- src/commands/CommandManager.h | 20 ++++++++++---------- src/commands/GetProjectInfoCommand.cpp | 4 ++-- src/effects/Contrast.cpp | 3 --- src/effects/FindClipping.cpp | 2 -- src/effects/SBSMSEffect.cpp | 4 ---- src/effects/SoundTouchEffect.cpp | 2 -- src/effects/ToneGen.cpp | 2 +- src/effects/ladspa/LoadLadspa.cpp | 2 +- src/effects/vamp/VampEffect.cpp | 4 ++-- src/export/ExportCL.cpp | 2 +- src/import/ImportOGG.cpp | 1 - src/ondemand/ODDecodeFlacTask.cpp | 6 ------ src/prefs/DirectoriesPrefs.cpp | 4 ++-- src/widgets/FileHistory.cpp | 2 +- src/widgets/FileHistory.h | 4 ++-- src/widgets/Meter.cpp | 2 ++ src/widgets/ProgressDialog.cpp | 4 ++-- src/widgets/Ruler.cpp | 1 - 27 files changed, 54 insertions(+), 72 deletions(-) diff --git a/src/FFT.cpp b/src/FFT.cpp index ab0bb34c7..c1e68c179 100644 --- a/src/FFT.cpp +++ b/src/FFT.cpp @@ -330,7 +330,7 @@ void RealFFT(int NumSamples, float *RealIn, float *RealOut, float *ImagOut) delete[]tmpReal; delete[]tmpImag; -#endif EXPERIMENTAL_USE_REALFFTF +#endif //EXPERIMENTAL_USE_REALFFTF } #ifdef EXPERIMENTAL_USE_REALFFTF diff --git a/src/Lyrics.cpp b/src/Lyrics.cpp index c8ebd6b7d..6b72a6599 100644 --- a/src/Lyrics.cpp +++ b/src/Lyrics.cpp @@ -245,11 +245,9 @@ void Lyrics::Measure(wxDC *dc) // only for drawn text { this->SetDrawnFont(dc); int width = 0, height = 0; - int maxLineWidth = 0; // only for kHighlightLyrics const int kIndent = 4; int x = 2*kIndent; - int y = kIndent; unsigned int i; for(i=0; iserialize(&duplicate->mSerializationBuffer, + mSeq->serialize((void**)&duplicate->mSerializationBuffer, &duplicate->mSerializationLength); } else if (mSerializationBuffer) { assert(!mSeq); diff --git a/src/NoteTrack.h b/src/NoteTrack.h index 3364cd21e..b7526f248 100644 --- a/src/NoteTrack.h +++ b/src/NoteTrack.h @@ -91,7 +91,7 @@ class AUDACITY_DLL_API NoteTrack:public Track { // mSeq variable. (TrackArtist should check to make sure this // flip-flop from mSeq to mSerializationBuffer happened an // even number of times, otherwise mSeq will be NULL). - void *mSerializationBuffer; // NULL means no buffer + char *mSerializationBuffer; // NULL means no buffer long mSerializationLength; double mLen; diff --git a/src/Project.cpp b/src/Project.cpp index 19d4fd54b..a6d1a3bcf 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -663,7 +663,6 @@ void GetNextWindowPlacement(wxRect *nextRect, bool *pMaximized, bool *pIconized) nextRect->y -= inc; bottomRight = nextRect->GetBottomRight(); if (bottomRight.y > screenRect.GetBottom()) { - int newheight = screenRect.GetHeight() - nextRect->GetBottom(); nextRect->SetBottom(screenRect.GetBottom()); } } @@ -724,7 +723,6 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id, const wxSize & size) : wxFrame(parent, id, wxT("Audacity"), pos, size), mLastPlayMode(normalPlay), - mFreqWindow(NULL), mRate((double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), AudioIO::GetOptimalSupportedSampleRate())), mDefaultFormat((sampleFormat) gPrefs-> Read(wxT("/SamplingRate/DefaultProjectSampleFormat"), floatSample)), @@ -742,6 +740,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id, mMixerBoard(NULL), mMixerBoardFrame(NULL), #endif + mFreqWindow(NULL), mToolManager(NULL), mAudioIOToken(-1), mIsDeleting(false), diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index edca2ec85..3b276afdd 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -1489,7 +1489,6 @@ void TrackArtist::DrawClipSpectrum(WaveTrack *track, double sel0 = viewInfo->sel0; double sel1 = viewInfo->sel1; - sampleCount numSamples = clip->GetNumSamples(); double tOffset = clip->GetOffset(); double rate = clip->GetRate(); double sps = 1./rate; @@ -1657,10 +1656,11 @@ void TrackArtist::DrawClipSpectrum(WaveTrack *track, const float // e=exp(1.0f), - log2=log(2.0f), f=rate/2.0f/half, lmin=log(float(minFreq)), lmax=log(float(maxFreq)), +#ifdef EXPERIMENTAL_FIND_NOTES + log2=log(2.0f), #ifdef EXPERIMENTAL_FFT_SKIP_POINTS lmins=log(float(minFreq)/(mFftSkipPoints+1)), lmaxs=log(float(maxFreq)/(mFftSkipPoints+1)), @@ -1668,12 +1668,15 @@ void TrackArtist::DrawClipSpectrum(WaveTrack *track, lmins=lmin, lmaxs=lmax, #endif //EXPERIMENTAL_FFT_SKIP_POINTS - scale=lmax-lmin, - scale2=(lmax-lmin)/log2, - lmin2=lmin/log2 /*, +#endif //EXPERIMENTAL_FIND_NOTES + scale=lmax-lmin /*, expo=exp(scale)*/ ; #ifdef EXPERIMENTAL_FFT_Y_GRID + const float + scale2=(lmax-lmin)/log2, + lmin2=lmin/log2; + bool *yGrid; yGrid=new bool[mid.height]; for (int y = 0; y < mid.height; y++) { @@ -2293,7 +2296,7 @@ void TrackArtist::DrawNoteTrack(NoteTrack *track, //for every event Alg_event_ptr evt; printf ("go time\n"); - while (evt = iterator.next()) { + while ( (evt = iterator.next()) ) { //printf ("one note"); diff --git a/src/blockfile/ODDecodeBlockFile.cpp b/src/blockfile/ODDecodeBlockFile.cpp index d0bb13718..20990018a 100644 --- a/src/blockfile/ODDecodeBlockFile.cpp +++ b/src/blockfile/ODDecodeBlockFile.cpp @@ -42,9 +42,9 @@ ODDecodeBlockFile::ODDecodeBlockFile(wxFileName baseFileName,wxFileName audioFil sampleCount aliasLen, int aliasChannel,unsigned int decodeType): SimpleBlockFile(baseFileName,NULL,aliasLen,floatSample,true,true), //floatSample has no effect. last two bools - bypass writing of blockfile and cache + mType(decodeType), mAliasStart(aliasStart), - mAliasChannel(aliasChannel), - mType(decodeType) + mAliasChannel(aliasChannel) { mDataAvailable=false; mAudioFileName = audioFileName; @@ -56,9 +56,9 @@ ODDecodeBlockFile::ODDecodeBlockFile(wxFileName existingFile, wxFileName audioFi float min, float max, float rms, bool dataAvailable): SimpleBlockFile(existingFile,aliasLen,min,max,rms), + mType(decodeType), mAliasStart(aliasStart), - mAliasChannel(aliasChannel), - mType(decodeType) + mAliasChannel(aliasChannel) { mDataAvailable=dataAvailable; mAudioFileName = audioFileName; diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index d4f836758..a9557cb59 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -455,8 +455,8 @@ void CommandManager::AddCheck(const wxChar *name, const wxChar *label, CommandFunctor *callback, int checkmark, - int flags, - int mask) + unsigned int flags, + unsigned int mask) { AddItem(name, label, callback, wxT(""), flags, mask, checkmark); } @@ -464,8 +464,8 @@ void CommandManager::AddCheck(const wxChar *name, void CommandManager::AddItem(const wxChar *name, const wxChar *label, CommandFunctor *callback, - int flags, - int mask) + unsigned int flags, + unsigned int mask) { AddItem(name, label, callback, wxT(""), flags, mask); } @@ -474,8 +474,8 @@ void CommandManager::AddItem(const wxChar *name, const wxChar *label_in, CommandFunctor *callback, const wxChar *accel, - int flags, - int mask, + unsigned int flags, + unsigned int mask, int checkmark) { wxString label(label_in); @@ -582,8 +582,8 @@ void CommandManager::AddItemList(wxString name, wxArrayString labels, void CommandManager::AddCommand(const wxChar *name, const wxChar *label, CommandFunctor *callback, - int flags, - int mask) + unsigned int flags, + unsigned int mask) { AddCommand(name, label, callback, wxT(""), flags, mask); } @@ -592,8 +592,8 @@ void CommandManager::AddCommand(const wxChar *name, const wxChar *label_in, CommandFunctor *callback, const wxChar *accel, - int flags, - int mask) + unsigned int flags, + unsigned int mask) { wxString label(label_in); label += wxT("\t"); diff --git a/src/commands/CommandManager.h b/src/commands/CommandManager.h index 73955fbbf..36492e5cd 100644 --- a/src/commands/CommandManager.h +++ b/src/commands/CommandManager.h @@ -106,21 +106,21 @@ class AUDACITY_DLL_API CommandManager: public XMLTagHandler const wxChar *label, CommandFunctor *callback, int checkmark, - int flags, - int mask); + unsigned int flags, + unsigned int mask); void AddItem(const wxChar *name, const wxChar *label, CommandFunctor *callback, - int flags = NoFlagsSpecifed, - int mask = NoFlagsSpecifed); + unsigned int flags = NoFlagsSpecifed, + unsigned int mask = NoFlagsSpecifed); void AddItem(const wxChar *name, const wxChar *label_in, CommandFunctor *callback, const wxChar *accel, - int flags = NoFlagsSpecifed, - int mask = NoFlagsSpecifed, + unsigned int flags = NoFlagsSpecifed, + unsigned int mask = NoFlagsSpecifed, int checkmark = -1); void AddSeparator(); @@ -130,15 +130,15 @@ class AUDACITY_DLL_API CommandManager: public XMLTagHandler void AddCommand(const wxChar *name, const wxChar *label, CommandFunctor *callback, - int flags = NoFlagsSpecifed, - int mask = NoFlagsSpecifed); + unsigned int flags = NoFlagsSpecifed, + unsigned int mask = NoFlagsSpecifed); void AddCommand(const wxChar *name, const wxChar *label, CommandFunctor *callback, const wxChar *accel, - int flags = NoFlagsSpecifed, - int mask = NoFlagsSpecifed); + unsigned int flags = NoFlagsSpecifed, + unsigned int mask = NoFlagsSpecifed); // // Command masks diff --git a/src/commands/GetProjectInfoCommand.cpp b/src/commands/GetProjectInfoCommand.cpp index 3674ed009..5f2234f8b 100644 --- a/src/commands/GetProjectInfoCommand.cpp +++ b/src/commands/GetProjectInfoCommand.cpp @@ -57,11 +57,11 @@ bool GetProjectInfoCommand::Apply(CommandExecutionContext context) } else if (mode.IsSameAs(wxT("FocusedTrackID"))) { - int FocusedTrackID = SendFocusedTrackIndex(context); + SendFocusedTrackIndex(context); } else if (mode.IsSameAs(wxT("NumberOfTracks"))) { - int NumberOfTracks = SendNumberOfTracks(context); + SendNumberOfTracks(context); } else if (mode.IsSameAs(wxT("SelectedTracks"))) { diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index 3521273cb..cd13957fc 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -247,7 +247,6 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, if (mForegroundEndT == NULL) { - AudacityProject *p = GetActiveProject(); mForegroundEndT = new TimeTextCtrl(this, ID_FOREGROUNDEND_T, @@ -271,7 +270,6 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, S.AddFixedText(_("Background:")); if (mBackgroundStartT == NULL) { - AudacityProject *p = GetActiveProject(); mBackgroundStartT = new TimeTextCtrl(this, ID_BACKGROUNDSTART_T, @@ -289,7 +287,6 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, if (mBackgroundEndT == NULL) { - AudacityProject *p = GetActiveProject(); mBackgroundEndT = new TimeTextCtrl(this, ID_BACKGROUNDEND_T, diff --git a/src/effects/FindClipping.cpp b/src/effects/FindClipping.cpp index 99e870344..4e28d1075 100644 --- a/src/effects/FindClipping.cpp +++ b/src/effects/FindClipping.cpp @@ -144,8 +144,6 @@ bool EffectFindClipping::ProcessOne(LabelTrack * l, float *ptr = buffer; - bool first = true; - sampleCount startrun = 0; sampleCount stoprun = 0; sampleCount samps = 0; diff --git a/src/effects/SBSMSEffect.cpp b/src/effects/SBSMSEffect.cpp index 1aad8a8cd..d853fea06 100644 --- a/src/effects/SBSMSEffect.cpp +++ b/src/effects/SBSMSEffect.cpp @@ -188,11 +188,8 @@ bool EffectSBSMS::Process() for (t = iter.First(); t->GetKind() != Track::Wave; t = iter.Next()); if (!t) return false; - WaveTrack* leftTrack = (WaveTrack*)t; - WaveTrack* saveLeft = leftTrack; mCurTrackNum = 0; - double len = leftTrack->GetEndTime() - leftTrack->GetStartTime(); double maxDuration = 0.0; if(rateStart == rateEnd) @@ -347,7 +344,6 @@ bool EffectSBSMS::Process() long pos = 0; long lastPos = 0; long ret = 0; - bool stopped = false; while(lastPosGetEndTime() - leftTrack->GetStartTime(); - // we only do a "group change" in the first selected track of the group. // ClearAndPaste has a call to Paste that does changes to the group tracks bool first = true; diff --git a/src/effects/ToneGen.cpp b/src/effects/ToneGen.cpp index 00a0d609c..4fc54be7f 100644 --- a/src/effects/ToneGen.cpp +++ b/src/effects/ToneGen.cpp @@ -57,7 +57,7 @@ wxString EffectToneGen::GetEffectDescription() { // Note: This is useful only after values have been set. /// \todo update to include *all* chirp parameters?? const wxChar* waveformNames[] = {wxT("sine"), wxT("square"), wxT("sawtooth"), wxT("square, no alias")}; - const wxChar* interpolationNames[] = {wxT("linear"), wxT("logarithmic")}; + //const wxChar* interpolationNames[] = {wxT("linear"), wxT("logarithmic")}; return wxString::Format(_("Applied effect: Generate %s wave %s, frequency = %.2f Hz, amplitude = %.2f, %.6lf seconds"), waveformNames[waveform], mbChirp ? wxT("chirp") : wxT("tone"), frequency[0], amplitude[0], mDuration); } diff --git a/src/effects/ladspa/LoadLadspa.cpp b/src/effects/ladspa/LoadLadspa.cpp index d61146a74..3238b5d6a 100644 --- a/src/effects/ladspa/LoadLadspa.cpp +++ b/src/effects/ladspa/LoadLadspa.cpp @@ -180,10 +180,10 @@ void LoadLadspaPlugins() wxSortedArrayString uniq; wxString pathVar; unsigned int i; - EffectManager& em = EffectManager::Get(); #if defined(USE_LIBLRDF) && defined(EFFECT_CATEGORIES) + EffectManager& em = EffectManager::Get(); wxArrayString rdfPathList; wxString rdfPathVar; wxArrayString rdfFiles; diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index 496d1b275..93cba68dc 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -473,7 +473,7 @@ VampEffectDialog::VampEffectDialog(VampEffect *effect, for (size_t i = 0; i < mParameters[p].valueNames.size(); ++i) { wxString choice = wxString (mParameters[p].valueNames[i].c_str(), wxConvISO8859_1); - if (int(value - mParameters[p].minValue + 0.5) == i) { + if (size_t(value - mParameters[p].minValue + 0.5) == i) { selected = choice; } choices.Add(choice); @@ -707,7 +707,7 @@ void VampEffectDialog::UpdateFromPlugin() for (size_t i = 0; i < mParameters[p].valueNames.size(); ++i) { wxString choice = wxString (mParameters[p].valueNames[i].c_str(), wxConvISO8859_1); - if (int(value - mParameters[p].minValue + 0.5) == i) { + if (size_t(value - mParameters[p].minValue + 0.5) == i) { selected = choice; break; } diff --git a/src/export/ExportCL.cpp b/src/export/ExportCL.cpp index c6ddeaee4..8d00b3d74 100644 --- a/src/export/ExportCL.cpp +++ b/src/export/ExportCL.cpp @@ -426,7 +426,7 @@ int ExportCL::Export(AudacityProject *project, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); ShuttleGui S(&dlg, eIsCreating); - wxTextCtrl *tc = S.AddTextWindow(output); + S.AddTextWindow(output); S.StartHorizontalLay(wxALIGN_CENTER, false); { S.Id(wxID_OK).AddButton(_("&OK"))->SetDefault(); diff --git a/src/import/ImportOGG.cpp b/src/import/ImportOGG.cpp index 784c9e77f..0fa75f9be 100644 --- a/src/import/ImportOGG.cpp +++ b/src/import/ImportOGG.cpp @@ -242,7 +242,6 @@ int OggImportFileHandle::Import(TrackFactory *trackFactory, Track ***outTracks, } vorbis_info *vi = ov_info(mVorbisFile, i); - vorbis_comment *vc = ov_comment(mVorbisFile, i); mChannels[i] = new WaveTrack *[vi->channels]; diff --git a/src/ondemand/ODDecodeFlacTask.cpp b/src/ondemand/ODDecodeFlacTask.cpp index fe7d2a07d..169b44c01 100644 --- a/src/ondemand/ODDecodeFlacTask.cpp +++ b/src/ondemand/ODDecodeFlacTask.cpp @@ -27,12 +27,6 @@ extern "C" { #define DESC _("FLAC files") -static const wxChar *exts[] = -{ - wxT("flac"), - wxT("flc") -}; - ODDecodeFlacTask::~ODDecodeFlacTask() { } diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index a0221cf76..a938cfc40 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -50,8 +50,8 @@ END_EVENT_TABLE() DirectoriesPrefs::DirectoriesPrefs(wxWindow * parent) : PrefsPanel(parent, _("Directories")), - mTempDir(NULL), - mFreeSpace(NULL) + mFreeSpace(NULL), + mTempDir(NULL) { Populate(); } diff --git a/src/widgets/FileHistory.cpp b/src/widgets/FileHistory.cpp index f0d0453e3..bf6446004 100644 --- a/src/widgets/FileHistory.cpp +++ b/src/widgets/FileHistory.cpp @@ -21,7 +21,7 @@ #include "FileHistory.h" -FileHistory::FileHistory(int maxfiles, wxWindowID base) +FileHistory::FileHistory(size_t maxfiles, wxWindowID base) { mMaxFiles = maxfiles; mIDBase = base; diff --git a/src/widgets/FileHistory.h b/src/widgets/FileHistory.h index b4ddfbeae..ed618bb13 100644 --- a/src/widgets/FileHistory.h +++ b/src/widgets/FileHistory.h @@ -22,7 +22,7 @@ class AUDACITY_DLL_API FileHistory { public: - FileHistory(int maxfiles = 9, wxWindowID idbase = wxID_FILE); + FileHistory(size_t maxfiles = 9, wxWindowID idbase = wxID_FILE); virtual ~FileHistory(); void AddFileToHistory(const wxString & file, bool update = true); @@ -40,7 +40,7 @@ class AUDACITY_DLL_API FileHistory wxString GetHistoryFile(size_t i) const; private: - int mMaxFiles; + size_t mMaxFiles; wxWindowID mIDBase; wxArrayPtrVoid mMenus; diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 7feefe768..651ffe6d0 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -630,8 +630,10 @@ void Meter::OnMeterUpdate(wxTimerEvent &evt) { MeterUpdateMsg msg; int numChanges = 0; +#ifdef AUTOMATED_INPUT_LEVEL_ADJUSTMENT double maxPeak = 0.0; bool discarded = false; +#endif // There may have been several update messages since the last // time we got to this function. Catch up to real-time by // popping them off until there are none left. It is necessary diff --git a/src/widgets/ProgressDialog.cpp b/src/widgets/ProgressDialog.cpp index 2ffe5ead8..f3fd61092 100644 --- a/src/widgets/ProgressDialog.cpp +++ b/src/widgets/ProgressDialog.cpp @@ -1002,8 +1002,8 @@ ProgressDialog::ProgressDialog(const wxString & title, const wxString & message, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT), - mDisable(NULL), - mLastValue(0) + mLastValue(0), + mDisable(NULL) { wxBoxSizer *v; wxWindow *w; diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index 697bfa48a..e6d80e966 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -1111,7 +1111,6 @@ void Ruler::Update( Envelope *speedEnv, long minSpeed, long maxSpeed ) double hiLog = log10(mMax); double scale = mLength/(hiLog - loLog); int loDecade = (int) floor(loLog); - int hiDecade = (int) ceil(hiLog); int pos; double val;