From c7daafede22fc2f8cc2bbd725adfa5a0dba4eedb Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Sat, 24 Aug 2013 20:30:47 +0000 Subject: [PATCH] In off-list discussion, Steve mentioned that kdevelop / kate highlighting recognizes "FIXME", but not "FIX-ME", which has been the Audacity convention. This commit changes Audacity code to use the "FIXME" convention (though I've never known it as convention and MSVC doesn't recognize it). Also, minor change in WaveTrack.cpp in the effort on bug 641. Should have no functional difference. --- src/AudacityApp.cpp | 4 ++-- src/BatchCommands.cpp | 4 ++-- src/DirManager.cpp | 2 +- src/Menus.cpp | 24 ++++++++++++------------ src/Project.cpp | 4 ++-- src/Resample.cpp | 4 ++-- src/Sequence.cpp | 2 +- src/Track.h | 4 ++-- src/TrackPanel.cpp | 4 ++-- src/WaveTrack.cpp | 15 ++++++++------- src/effects/Contrast.cpp | 2 +- src/effects/TruncSilence.cpp | 2 +- src/export/ExportFFmpeg.cpp | 2 +- src/export/ExportFFmpegDialogs.cpp | 4 ++-- src/ondemand/ODWaveTrackTaskQueue.cpp | 4 ++-- src/toolbars/DeviceToolBar.cpp | 2 +- src/widgets/Ruler.cpp | 10 +++++----- 17 files changed, 47 insertions(+), 46 deletions(-) diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index dfa711120..e420bafcc 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -737,7 +737,7 @@ void AudacityApp::OnMacOpenFile(wxCommandEvent & event) while (ofqueue.GetCount()) { wxString name(ofqueue[0]); ofqueue.RemoveAt(0); - MRUOpen(name); // FIX-ME: Check the return result? + MRUOpen(name); // FIXME: Check the return result? } } #endif //__WXMAC__ @@ -794,7 +794,7 @@ bool AudacityApp::MRUOpen(wxString fullPathStr) { // Make sure it isn't already open. // Test here even though AudacityProject::OpenFile() also now checks, because // that method does not return the bad result. - // That itself may be a FIX-ME. + // That itself may be a FIXME. if (AudacityProject::IsAlreadyOpen(fullPathStr)) return false; diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index f7094d8c2..2043ac498 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -450,7 +450,7 @@ bool BatchCommands::ApplySpecialCommand(int iCommand, const wxString command,con // We have a command index, but we don't use it! // TODO: Make this special-batch-command code use the menu item code.... - // FIX-ME: No error reporting on write file failure in batch mode. + // FIXME: No error reporting on write file failure in batch mode. if (command == wxT("NoAction")) { return true; } else if (!mFileName.IsEmpty() && command == wxT("Import")) { @@ -536,7 +536,7 @@ bool BatchCommands::ApplyEffectCommand( Effect * f, const wxString command, co AudacityProject *project = GetActiveProject(); - //FIX-ME: for later versions may want to not select-all in batch mode. + //FIXME: for later versions may want to not select-all in batch mode. //IF nothing selected, THEN select everything // (most effects require that you have something selected). project->SelectAllIfNone(); diff --git a/src/DirManager.cpp b/src/DirManager.cpp index 5356b6bbc..9dec58d7e 100644 --- a/src/DirManager.cpp +++ b/src/DirManager.cpp @@ -856,7 +856,7 @@ wxFileName DirManager::MakeBlockFileName() }else break; } } - // FIX-ME: Might we get here without midkey having been set? + // FIXME: Might we get here without midkey having been set? BalanceFileAdd(midkey); return ret; } diff --git a/src/Menus.cpp b/src/Menus.cpp index ba76056ea..20b97b15f 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -122,7 +122,7 @@ simplifies construction of menu items. enum { kAlignEndToEnd=0, - kAlign, // FIX-ME: bad name for "Align Together". + kAlign, // FIXME: bad name for "Align Together". kAlignZero, kAlignCursor, kAlignSelStart, @@ -390,13 +390,13 @@ void AudacityProject::CreateMenusAndCommands() ///////////////////////////////////////////////////////////////////////////// - // FIX-ME: Wave track should be required in this menu. + // FIXME: Wave track should be required in this menu. c->BeginSubMenu(_("La&beled Audio")); c->SetDefaultFlags(AudioIONotBusyFlag | LabelsSelectedFlag | TimeSelectedFlag, AudioIONotBusyFlag | LabelsSelectedFlag | TimeSelectedFlag); /* i18n-hint: (verb)*/ - // FIX-ME: Most of these command labels are exact duplicates of those in 'Remove Audio or Labels' + // FIXME: Most of these command labels are exact duplicates of those in 'Remove Audio or Labels' // which is a problem in keyboard preferences. c->AddItem(wxT("CutLabels"), _("&Cut"), FN(OnCutLabels), wxT("Alt+X"), AudioIONotBusyFlag | LabelsSelectedFlag | TimeSelectedFlag | IsNotSyncLockedFlag, @@ -730,20 +730,20 @@ void AudacityProject::CreateMenusAndCommands() wxArrayString alignLabels; alignLabels.Add(_("&Align End to End")); - alignLabels.Add(_("Align Tracks To&gether")); // FIX-ME: Visibility of Access Key with descender. + alignLabels.Add(_("Align Tracks To&gether")); // FIXME: Visibility of Access Key with descender. // TODO: Add a separator here. How? alignLabels.Add(_("Align with &Zero")); alignLabels.Add(_("Align with &Cursor")); - alignLabels.Add(_("Align with Selection &Start")); // FIX-ME: Duplicate of 'Align with Cursor'. + alignLabels.Add(_("Align with Selection &Start")); // FIXME: Duplicate of 'Align with Cursor'. alignLabels.Add(_("Align with Selection &End")); alignLabels.Add(_("Align End with Cu&rsor")); - alignLabels.Add(_("Align End with Selection Star&t")); // FIX-ME: Duplicate of 'Align End with Cursor'. + alignLabels.Add(_("Align End with Selection Star&t")); // FIXME: Duplicate of 'Align End with Cursor'. alignLabels.Add(_("Align End with Selection En&d")); c->BeginSubMenu(_("&Align Tracks")); c->AddItemList(wxT("Align"), alignLabels, FN(OnAlign)); - // FIX-ME: These flags don't grey out menu. + // FIXME: These flags don't grey out menu. c->SetCommandFlags(wxT("Align"), AudioIONotBusyFlag | TracksSelectedFlag, AudioIONotBusyFlag | TracksSelectedFlag); @@ -777,7 +777,7 @@ void AudacityProject::CreateMenusAndCommands() c->AddSeparator(); #ifdef EXPERIMENTAL_SYNC_LOCK - // FIX-ME: Sync Lock should not be greyed out during AudioIOBusy. + // FIXME: Sync Lock should not be greyed out during AudioIOBusy. c->AddCheck(wxT("SyncLock"), _("Sync-&Lock Tracks"), FN(OnSyncLock), 0); c->AddSeparator(); @@ -1346,7 +1346,7 @@ void AudacityProject::RebuildMenuBar() // Under Windows we delete the menus, since we will soon recreate them. // rather oddly, the menus don't vanish as a result of doing this. // Under Linux we can't delete them as this crashes gtk2.... -// FIX-ME: So we have a memory leak of menu items under linux? Oops. +// FIXME: So we have a memory leak of menu items under linux? Oops. #ifdef __WXMSW__ wxMenuBar *menuBar = GetMenuBar(); @@ -4202,7 +4202,7 @@ void AudacityProject::OnSplitNew() // n = iter.Next(); // } // -// wxASSERT(label); // per Vigilant Sentry report on possible null deref, FIX-ME: Report error or validate? +// wxASSERT(label); // per Vigilant Sentry report on possible null deref, FIXME: Report error or validate? // for(int i = 0; i < label->GetNumLabels(); i++) { // wxString name = label->GetLabel(i)->title; // double begin = label->GetLabel(i)->t; @@ -5109,8 +5109,8 @@ void AudacityProject::HandleAlign(int index, bool moveSel) while (t) { // This shifts different tracks in different ways, so no sync-lock move. - // FIX-ME: We only want to move Wave Tracks and Note Tracks. - // FIX-ME: Tracks misaligned if stereo channels have different starts or ends. + // FIXME: We only want to move Wave Tracks and Note Tracks. + // FIXME: Tracks misaligned if stereo channels have different starts or ends. if (t->GetSelected()) { t->SetOffset(newPos); } diff --git a/src/Project.cpp b/src/Project.cpp index 50182e598..017c2f2d5 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -2307,7 +2307,7 @@ bool AudacityProject::WarnOfLegacyFile( ) } -// FIX-ME? This should return a result that is checked. +// FIXME? This should return a result that is checked. // See comment in AudacityApp::MRUOpen(). void AudacityProject::OpenFile(wxString fileName, bool addtohistory) { @@ -2394,7 +2394,7 @@ void AudacityProject::OpenFile(wxString fileName, bool addtohistory) } } - //FIX-ME: //v Surely we could be smarter about this, + //FIXME: //v Surely we could be smarter about this, // like checking much earlier that this is a .aup file. if (temp.Mid(0, 6) != wxT("SetMethod(useBestMethod); if (!src_is_valid_ratio (dMinFactor) || !src_is_valid_ratio (dMaxFactor)) { fprintf(stderr, "libsamplerate supports only resampling factors between 1/SRC_MAX_RATIO and SRC_MAX_RATIO.\n"); - // FIX-ME: Audacity will hang after this if branch. + // FIXME: Audacity will hang after this if branch. mHandle = NULL; return; } diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 26c512bca..49af67e9b 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -505,7 +505,7 @@ bool Sequence::Paste(sampleCount s, const Sequence *src) return ConsistencyCheck(wxT("Paste branch one")); } - // FIX-ME: "b" is unsigned, so it's pointless to check that it's >= 0. + // FIXME: "b" is unsigned, so it's pointless to check that it's >= 0. if (b >= 0 && b < numBlocks && ((mBlock->Item(b)->f->GetLength() + addedLen) < mMaxSamples)) { // Special case: we can fit all of the new samples inside of diff --git a/src/Track.h b/src/Track.h index dd033b4ca..ad2e813b3 100644 --- a/src/Track.h +++ b/src/Track.h @@ -357,7 +357,7 @@ class AUDACITY_DLL_API TrackList:public wxEvtHandler friend class TrackListIterator; /// Add this Track or all children of this TrackGroup - // FIX-ME: What does that comment mean by "TrackGroup"? There was no such class at tag Audacity_1_3_13. + // FIXME: What does that comment mean by "TrackGroup"? There was no such class at tag Audacity_1_3_13. void Add(Track * t); void AddToHead(Track * t); @@ -365,7 +365,7 @@ class AUDACITY_DLL_API TrackList:public wxEvtHandler void Replace(Track * t, Track * with, bool deletetrack = false); /// Remove this Track or all children of this TrackGroup - // FIX-ME: What does that comment mean by "TrackGroup"? There was no such class at tag Audacity_1_3_13. + // FIXME: What does that comment mean by "TrackGroup"? There was no such class at tag Audacity_1_3_13. void Remove(Track * t, bool deletetrack = false); /// Make the list empty diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 8c33df954..967605f9c 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -5175,7 +5175,7 @@ void TrackPanel::OnMouseEvent(wxMouseEvent & event) bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &r, wxMouseEvent &event) { - // FIX-ME: Disable this and return true when CutLines aren't showing? + // FIXME: Disable this and return true when CutLines aren't showing? // (Don't use gPerfs-> for the fix as registry access is slow). if (mMouseCapture == WasOverCutLine) @@ -5544,7 +5544,7 @@ int TrackPanel::DetermineToolToUse( ToolsToolBar * pTtb, wxMouseEvent & event) } else if( trackKind != Track::Wave) { currentTool = selectTool; // So we are in a wave track. - //FIX-ME: Not necessarily. Haven't checked Track::Note (#if defined(USE_MIDI)). + //FIXME: Not necessarily. Haven't checked Track::Note (#if defined(USE_MIDI)). // From here on the order in which we hit test determines // which tool takes priority in the rare cases where it // could be more than one. diff --git a/src/WaveTrack.cpp b/src/WaveTrack.cpp index 1e2065b2c..ae4348a41 100644 --- a/src/WaveTrack.cpp +++ b/src/WaveTrack.cpp @@ -1843,8 +1843,8 @@ void WaveTrack::GetEnvelopeValues(double *buffer, int bufferLen, return; // This is useful in debugging, to easily find null envelope settings, but - // should not be necessary in release build. - // If we were going to set it to failsafe values, better to set each element to 1.0. + // should not be necessary in Release build. + // If we were going to set it to failsafe values in Release build, better to set each element to 1.0. #ifdef __WXDEBUG__ memset(buffer, 0, sizeof(double)*bufferLen); #endif @@ -1863,8 +1863,6 @@ void WaveTrack::GetEnvelopeValues(double *buffer, int bufferLen, { double* rbuf = buffer; int rlen = bufferLen; - if (rlen <= 0) - return; // loop completion double rt0 = t0; if (rt0 < dClipStartTime) @@ -1877,16 +1875,19 @@ void WaveTrack::GetEnvelopeValues(double *buffer, int bufferLen, if (rt0 + rlen*tstep > dClipEndTime) { + //vvvvv debugging int nStartSample = clip->GetStartSample(); + //vvvvv debugging int nEndSample = clip->GetEndSample(); int nClipLen = clip->GetEndSample() - clip->GetStartSample(); + if (nClipLen <= 0) // Testing for bug 641, this problem is consistently '== 0', but doesn't hurt to check <. + return; + // This check prevents problem cited in http://bugzilla.audacityteam.org/show_bug.cgi?id=528#c11, // Gale's cross_fade_out project, which was already corrupted by bug 528. // This conditional prevents the previous write past the buffer end, in clip->GetEnvelope() call. if (nClipLen < rlen) // Never increase rlen here. rlen = nClipLen; } - if (rlen <= 0) - return; // loop completion clip->GetEnvelope()->GetValues(rbuf, rlen, rt0, tstep); } } @@ -2290,7 +2291,7 @@ bool WaveTrack::Resample(int rate, ProgressDialog *progress) if (!it->GetData()->Resample(rate, progress)) { wxLogDebug( wxT("Resampling problem! We're partially resampled") ); - // FIX-ME: The track is now in an inconsistent state since some + // FIXME: The track is now in an inconsistent state since some // clips are resampled and some are not return false; } diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index 0373fdcaa..905ebc6c7 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -94,7 +94,7 @@ void CloseContrastDialog() float ContrastDialog::GetDB() { -// FIX-ME: what if more than one track? +// FIXME: what if more than one track? float rms = float(0.0); AudacityProject *p = GetActiveProject(); diff --git a/src/effects/TruncSilence.cpp b/src/effects/TruncSilence.cpp index fc28414f4..c7e228737 100644 --- a/src/effects/TruncSilence.cpp +++ b/src/effects/TruncSilence.cpp @@ -287,7 +287,7 @@ bool EffectTruncSilence::Process() } // Intersection may create regions smaller than allowed; ignore them. - // FIX-ME: See http://bugzilla.audacityteam.org/show_bug.cgi?id=434#c10 and + // FIXME: See http://bugzilla.audacityteam.org/show_bug.cgi?id=434#c10 and // http://bugzilla.audacityteam.org/show_bug.cgi?id=434#c11 about the 0.0001 fudge factor. if ((r->end - r->start) < ((mTruncInitialAllowedSilentMs / 1000.0) - 0.0001)) continue; diff --git a/src/export/ExportFFmpeg.cpp b/src/export/ExportFFmpeg.cpp index c5fc628b2..13bff19c7 100644 --- a/src/export/ExportFFmpeg.cpp +++ b/src/export/ExportFFmpeg.cpp @@ -541,7 +541,7 @@ bool ExportFFmpeg::Finalize() // If codec supports CODEC_CAP_SMALL_LAST_FRAME, we can feed it with smaller frame // If codec is FLAC, feed it anyway (it doesn't have CODEC_CAP_SMALL_LAST_FRAME, but it works) // If frame_size is 1, then it's some kind of PCM codec, they don't have frames - // If user configured the exporter to feed the encoder with silence // FIX-ME: Finish the sentence! + // If user configured the exporter to feed the encoder with silence // FIXME: Finish the sentence! if ((codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) || codec->id == CODEC_ID_FLAC || mEncAudioCodecCtx->frame_size == 1 diff --git a/src/export/ExportFFmpegDialogs.cpp b/src/export/ExportFFmpegDialogs.cpp index 7c979ba92..ba2eb9058 100644 --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -427,7 +427,7 @@ FFmpegPresets::FFmpegPresets() FFmpegPresets::~FFmpegPresets() { XMLFileWriter writer; - // FIX-ME: Catch XMLFileWriterException + // FIXME: Catch XMLFileWriterException wxFileName xmlFileName(FileNames::DataDir(), wxT("ffmpeg_presets.xml")); writer.Open(xmlFileName.GetFullPath(),wxT("wb")); WriteXMLHeader(writer); @@ -444,7 +444,7 @@ void FFmpegPresets::ImportPresets(wxString &filename) void FFmpegPresets::ExportPresets(wxString &filename) { XMLFileWriter writer; - // FIX-ME: Catch XMLFileWriterException + // FIXME: Catch XMLFileWriterException writer.Open(filename,wxT("wb")); WriteXMLHeader(writer); WriteXML(writer); diff --git a/src/ondemand/ODWaveTrackTaskQueue.cpp b/src/ondemand/ODWaveTrackTaskQueue.cpp index 5a09c88b8..f97359f76 100644 --- a/src/ondemand/ODWaveTrackTaskQueue.cpp +++ b/src/ondemand/ODWaveTrackTaskQueue.cpp @@ -225,7 +225,7 @@ WaveTrack* ODWaveTrackTaskQueue::GetWaveTrack(size_t x) { WaveTrack* ret = NULL; mTracksMutex.Lock(); - // FIX-ME: x is unsigned so there's no point in checking that it's >= 0. + // FIXME: x is unsigned so there's no point in checking that it's >= 0. if(x>=0&&x= 0. + // FIXME: x is unsigned so there's no point in checking that it's >= 0. if(x>=0&&x= mLength ) return; @@ -749,7 +749,7 @@ void Ruler::Tick(int pos, double d, bool major, bool minor) } - // FIX-ME: we shouldn't even get here if strPos < 0. + // FIXME: we shouldn't even get here if strPos < 0. // Ruler code currently does not handle very small or // negative sized windows (i.e. don't draw) properly. if( strPos < 0 ) @@ -801,7 +801,7 @@ void Ruler::TickCustom(int labelIdx, bool major, bool minor) wxCoord strW, strH, strD, strL; int strPos, strLen, strLeft, strTop; - // FIX-ME: We don't draw a tick if of end of our label arrays + // FIXME: We don't draw a tick if of end of our label arrays // But we shouldn't have an array of labels. if( mNumMinor >= mLength ) return; @@ -863,7 +863,7 @@ void Ruler::TickCustom(int labelIdx, bool major, bool minor) } - // FIX-ME: we shouldn't even get here if strPos < 0. + // FIXME: we shouldn't even get here if strPos < 0. // Ruler code currently does not handle very small or // negative sized windows (i.e. don't draw) properly. if( strPos < 0 ) @@ -978,7 +978,7 @@ void Ruler::Update(TimeTrack* timetrack)// Envelope *speedEnv, long minSpeed, lo mRect = wxRect(0,0, 0,mLength); } - // FIX-ME: Surely we do not need to allocate storage for the labels? + // FIXME: Surely we do not need to allocate storage for the labels? // We can just recompute them as we need them? Yes, but only if // mCustom is false!!!!