mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 16:49:41 +02:00
Scanned for bad naked new; found none; changed comments, used safenew
This commit is contained in:
parent
7156479d11
commit
f0de38dec1
@ -679,7 +679,7 @@ void AliasBlockFile::WriteSummary()
|
||||
// To build the summary data, call ReadData (implemented by the
|
||||
// derived classes) to get the sample data
|
||||
// Call this first, so that in case of exceptions from ReadData, there is
|
||||
// no new output file
|
||||
// no NEW output file
|
||||
SampleBuffer sampleData(mLen, floatSample);
|
||||
this->ReadData(sampleData.ptr(), floatSample, 0, mLen);
|
||||
|
||||
|
@ -2623,7 +2623,7 @@ void AudacityProject::OnRecord()
|
||||
GetControlToolBar()->OnRecord(evt);
|
||||
}
|
||||
|
||||
// If first choice is record same track 2nd choice is record new track
|
||||
// If first choice is record same track 2nd choice is record NEW track
|
||||
// and vice versa.
|
||||
void AudacityProject::OnRecord2ndChoice()
|
||||
{
|
||||
|
@ -395,8 +395,8 @@ void OnImport();
|
||||
void OnImportLabels();
|
||||
void OnImportMIDI();
|
||||
|
||||
// return null on failure; if success, return the given project, or a new
|
||||
// one, if the given was null; create no new project if failure
|
||||
// return null on failure; if success, return the given project, or a NEW
|
||||
// one, if the given was null; create no NEW project if failure
|
||||
static AudacityProject *DoImportMIDI(
|
||||
AudacityProject *pProject, const wxString &fileName);
|
||||
|
||||
|
@ -175,7 +175,7 @@ Track::Holder NoteTrack::Duplicate() const
|
||||
wxASSERT(!mSeq);
|
||||
duplicate->mSerializationLength = this->mSerializationLength;
|
||||
duplicate->mSerializationBuffer.reset
|
||||
( new char[ this->mSerializationLength ] );
|
||||
( safenew char[ this->mSerializationLength ] );
|
||||
memcpy( duplicate->mSerializationBuffer.get(),
|
||||
this->mSerializationBuffer.get(), this->mSerializationLength );
|
||||
}
|
||||
|
@ -2067,7 +2067,7 @@ void AudacityProject::UpdateLayout()
|
||||
if (!mTrackPanel)
|
||||
return;
|
||||
|
||||
// Layout first to get our new width,
|
||||
// Layout first to get our NEW width,
|
||||
// Then and only then we can arrange the toolbars.
|
||||
Layout();
|
||||
mToolManager->LayoutToolBars();
|
||||
@ -4636,7 +4636,7 @@ void AudacityProject::RecreateMixerBoard( )
|
||||
mMixerBoard = NULL;
|
||||
mMixerBoard = safenew MixerBoard(this, mMixerBoardFrame, pos, siz);
|
||||
mMixerBoardFrame->mMixerBoard = mMixerBoard;
|
||||
//wxLogDebug("Created new board %p", mMixerBoard );
|
||||
//wxLogDebug("Created NEW board %p", mMixerBoard );
|
||||
mMixerBoard->UpdateTrackClusters();
|
||||
mMixerBoard->SetSize( siz );
|
||||
mMixerBoardFrame->SetSize( siz2 );
|
||||
@ -5470,8 +5470,8 @@ void AudacityProject::SetTrackPan(WaveTrack * wt, LWSlider * slider)
|
||||
/// Removes the specified track. Called from HandleClosing.
|
||||
void AudacityProject::RemoveTrack(Track * toRemove)
|
||||
{
|
||||
// If it was focused, then new focus is the next or, if
|
||||
// unavailable, the previous track. (The new focus is set
|
||||
// If it was focused, then NEW focus is the next or, if
|
||||
// unavailable, the previous track. (The NEW focus is set
|
||||
// after the track has been removed.)
|
||||
bool toRemoveWasFocused = mTrackPanel->GetFocusedTrack() == toRemove;
|
||||
Track* newFocus{};
|
||||
|
@ -249,7 +249,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
|
||||
|
||||
// Return the given project if that is not NULL, else create a project.
|
||||
// Then open the given project path.
|
||||
// But if an exception escapes this function, create no new project.
|
||||
// But if an exception escapes this function, create no NEW project.
|
||||
static AudacityProject *OpenProject(
|
||||
AudacityProject *pProject,
|
||||
const wxString &fileNameArg, bool addtohistory = true);
|
||||
|
@ -2172,7 +2172,7 @@ std::unique_ptr<wxSizer> CreateStdButtonSizer(wxWindow *parent, long buttons, wx
|
||||
{
|
||||
// Replace standard Help button with smaller icon button.
|
||||
// bs->AddButton(safenew wxButton(parent, wxID_HELP));
|
||||
b = new wxBitmapButton(parent, wxID_HELP, theTheme.Bitmap( bmpHelpIcon ));
|
||||
b = safenew wxBitmapButton(parent, wxID_HELP, theTheme.Bitmap( bmpHelpIcon ));
|
||||
b->SetToolTip( _("Help") );
|
||||
bs->AddButton( b );
|
||||
}
|
||||
|
@ -425,7 +425,7 @@ wxImage ThemeBase::MaskedImage( char const ** pXpm, char const ** pMask )
|
||||
|
||||
// unsigned char *src = Img1.GetData();
|
||||
unsigned char *mk = Img2.GetData();
|
||||
//wxImage::setAlpha requires memory allocated with malloc, not new
|
||||
//wxImage::setAlpha requires memory allocated with malloc, not NEW
|
||||
MallocString<unsigned char> alpha{
|
||||
static_cast<unsigned char*>(malloc( nBytes )) };
|
||||
|
||||
|
@ -946,7 +946,7 @@ void TrackPanel::HandleMotion
|
||||
|
||||
mTarget = 0;
|
||||
|
||||
// Find the old target's new place if we can
|
||||
// Find the old target's NEW place if we can
|
||||
if (oldHandle) {
|
||||
auto begin = mTargets.begin(), end = mTargets.end(),
|
||||
iter = std::find(begin, end, oldHandle);
|
||||
@ -954,7 +954,7 @@ void TrackPanel::HandleMotion
|
||||
auto newPosition = iter - begin;
|
||||
if (newPosition <= oldPosition)
|
||||
mTarget = newPosition;
|
||||
// else, some new hit and this position takes priority
|
||||
// else, some NEW hit and this position takes priority
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
UndoManager can also automatically consolidate actions into
|
||||
a single state change. If the "consolidate" argument to
|
||||
PushState is true, then new changes may accumulate into the most
|
||||
PushState is true, then NEW changes may accumulate into the most
|
||||
recent Undo state, if descriptions match and if no Undo or Redo or rollback
|
||||
operation intervened since that state was pushed.
|
||||
|
||||
|
@ -381,7 +381,7 @@ void ODPCMAliasBlockFile::WriteSummary()
|
||||
// To build the summary data, call ReadData (implemented by the
|
||||
// derived classes) to get the sample data
|
||||
// Call this first, so that in case of exceptions from ReadData, there is
|
||||
// no new output file
|
||||
// no NEW output file
|
||||
SampleBuffer sampleData(mLen, floatSample);
|
||||
this->ReadData(sampleData.ptr(), floatSample, 0, mLen, true);
|
||||
|
||||
|
@ -24,7 +24,7 @@ wxString KeyStringNormalize(const wxString & key)
|
||||
|
||||
// PRL: RawCtrl is the proper replacement for Control, when formatting
|
||||
// wxMenuItem, so that wxWidgets shows ^ in the menu. It is written into
|
||||
// new preference files (2.2.0 and later).
|
||||
// NEW preference files (2.2.0 and later).
|
||||
temp.Replace(wxT("RawCtrl+"), wxT("Control+"));
|
||||
temp.Replace(wxT("Ctrl+"), wxT("Command+"));
|
||||
|
||||
|
@ -3245,7 +3245,7 @@ void EffectUIHost::OnHelp(wxCommandEvent & WXUNUSED(event))
|
||||
HelpSystem::ShowHelpDialog(FindWindow(wxID_HELP), mEffect->HelpPage(), wxEmptyString, true, true);
|
||||
}
|
||||
else {
|
||||
// otherwise use the new ShowHelpDialog
|
||||
// otherwise use the NEW ShowHelpDialog
|
||||
HelpSystem::ShowHelpDialog(FindWindow(wxID_HELP), mEffect->ManualPage(), true);
|
||||
}
|
||||
}
|
||||
|
@ -2430,7 +2430,7 @@ NyquistOutputDialog::NyquistOutputDialog(wxWindow * parent, wxWindowID id,
|
||||
|
||||
// TODO: use ShowInfoDialog() instead.
|
||||
// Beware this dialog MUST work with screen readers.
|
||||
item = new wxTextCtrl(this, -1, message,
|
||||
item = safenew wxTextCtrl(this, -1, message,
|
||||
wxDefaultPosition, wxSize(480, 250),
|
||||
wxTE_MULTILINE | wxTE_READONLY);
|
||||
mainSizer->Add(item, 1, wxEXPAND | wxALL, 10);
|
||||
|
@ -231,10 +231,10 @@ ProgressResult LOFImportFileHandle::Import(TrackFactory * WXUNUSED(trackFactory)
|
||||
// back to the caller.
|
||||
// Instead, it recursively calls AudacityProject::Import for each file listed
|
||||
// in the .lof file.
|
||||
// Each importation creates a new undo state.
|
||||
// Each importation creates a NEW undo state.
|
||||
// If there is an error or exception during one of them, only that one's
|
||||
// side effects are rolled back, and the rest of the import list is skipped.
|
||||
// The file may have "window" directives that cause new AudacityProjects
|
||||
// The file may have "window" directives that cause NEW AudacityProjects
|
||||
// to be created, and the undo states are pushed onto the latest project.
|
||||
// If a project is created but the first file import into it fails, destroy
|
||||
// the project.
|
||||
@ -311,7 +311,7 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
|
||||
mProject = nullptr;
|
||||
else
|
||||
// Apply any offset and duration directives of the first "window" line
|
||||
// to the previously open project, not a new one.
|
||||
// to the previously open project, not a NEW one.
|
||||
;
|
||||
|
||||
windowCalledOnce = true;
|
||||
|
@ -71,7 +71,7 @@ void ODTask::DoSome(float amountWork)
|
||||
SetIsRunning(true);
|
||||
mBlockUntilTerminateMutex.Lock();
|
||||
|
||||
// printf("%s %i subtask starting on new thread with priority\n", GetTaskName(),GetTaskNumber());
|
||||
// printf("%s %i subtask starting on NEW thread with priority\n", GetTaskName(),GetTaskNumber());
|
||||
|
||||
mDoingTask=mTaskStarted=true;
|
||||
|
||||
|
@ -324,7 +324,7 @@ void KeyConfigPrefs::RefreshBindings(bool bSort)
|
||||
Labels,
|
||||
mKeys,
|
||||
bSort);
|
||||
//Not needed as new nodes are already shown expanded.
|
||||
//Not needed as NEW nodes are already shown expanded.
|
||||
//mView->ExpandAll();
|
||||
|
||||
mNewKeys = mKeys;
|
||||
|
@ -197,7 +197,7 @@ wxRadioButton * SelectionBar::AddRadioButton( const wxString & Name,
|
||||
|
||||
pSizer->Add(pBtn, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
||||
// Hacky code to return a second optional value via the variable mProxy.
|
||||
// If not NULL, we made a new proxy label
|
||||
// If not NULL, we made a NEW proxy label
|
||||
mProxy = NULL;
|
||||
if( !bUseNativeRadioButton )
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ protected:
|
||||
|
||||
virtual ~ButtonHandle();
|
||||
|
||||
// This new abstract virtual simplifies the duties of further subclasses.
|
||||
// This NEW abstract virtual simplifies the duties of further subclasses.
|
||||
// This class will decide whether to refresh the clicked cell for button state
|
||||
// change.
|
||||
// Subclass can decide to refresh other things and the results will be ORed.
|
||||
|
@ -421,7 +421,7 @@ UIHandle::Result SelectHandle::NeedChangeHighlight
|
||||
(const SelectHandle &oldState, const SelectHandle &newState)
|
||||
{
|
||||
auto useSnap = oldState.mUseSnap;
|
||||
// This is guaranteed when constructing the new handle:
|
||||
// This is guaranteed when constructing the NEW handle:
|
||||
wxASSERT( useSnap == newState.mUseSnap );
|
||||
if (!useSnap)
|
||||
return 0;
|
||||
@ -677,7 +677,7 @@ UIHandle::Result SelectHandle::Click
|
||||
return RefreshAll | UpdateSelection;
|
||||
}
|
||||
|
||||
// II. Unmodified click starts a new selection
|
||||
// II. Unmodified click starts a NEW selection
|
||||
|
||||
//Make sure you are within the selected track
|
||||
bool startNewSelection = true;
|
||||
@ -761,7 +761,7 @@ UIHandle::Result SelectHandle::Click
|
||||
} // bAdjustSelectionEdges
|
||||
}
|
||||
|
||||
// III. Common case for starting a new selection
|
||||
// III. Common case for starting a NEW selection
|
||||
|
||||
if (startNewSelection) {
|
||||
// If we didn't move a selection boundary, start a NEW selection
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
protected:
|
||||
virtual ~SliderHandle();
|
||||
|
||||
// These new abstract virtuals simplify the duties of further subclasses.
|
||||
// These NEW abstract virtuals simplify the duties of further subclasses.
|
||||
// This class will decide whether to refresh the clicked cell for slider state
|
||||
// change.
|
||||
// Subclass can decide to refresh other things and the results will be ORed.
|
||||
|
@ -314,12 +314,12 @@ Meter::Meter(AudacityProject *project,
|
||||
{
|
||||
if(mIsInput)
|
||||
{
|
||||
//mIcon = new wxBitmap(MicMenuNarrow_xpm);
|
||||
//mIcon = NEW wxBitmap(MicMenuNarrow_xpm);
|
||||
mIcon = std::make_unique<wxBitmap>(wxBitmap(theTheme.Bitmap(bmpMic)));
|
||||
}
|
||||
else
|
||||
{
|
||||
//mIcon = new wxBitmap(SpeakerMenuNarrow_xpm);
|
||||
//mIcon = NEW wxBitmap(SpeakerMenuNarrow_xpm);
|
||||
mIcon = std::make_unique<wxBitmap>(wxBitmap(theTheme.Bitmap(bmpSpeaker)));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user