mirror of https://github.com/PCSX2/pcsx2.git
modernize: use std::make_unique instead of std::unique_ptr
I didn't update GSdx and cdvdGigaherz because we need to pull common include files
This commit is contained in:
parent
756176118b
commit
b9e62be3c1
|
@ -576,7 +576,7 @@ void ScopedBusyCursor::SetManualBusyCursor(BusyCursorType busytype)
|
||||||
const wxCursor &MoreStockCursors::GetArrowWait()
|
const wxCursor &MoreStockCursors::GetArrowWait()
|
||||||
{
|
{
|
||||||
if (!m_arrowWait)
|
if (!m_arrowWait)
|
||||||
m_arrowWait = std::unique_ptr<wxCursor>(new wxCursor(wxCURSOR_ARROWWAIT));
|
m_arrowWait = std::make_unique<wxCursor>(wxCURSOR_ARROWWAIT);
|
||||||
return *m_arrowWait;
|
return *m_arrowWait;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ void OutputIsoFile::Create(const wxString& filename, int version)
|
||||||
m_blockofs = 24;
|
m_blockofs = 24;
|
||||||
m_blocksize = 2048;
|
m_blocksize = 2048;
|
||||||
|
|
||||||
m_outstream = std::unique_ptr<wxFileOutputStream>(new wxFileOutputStream(m_filename));
|
m_outstream = std::make_unique<wxFileOutputStream>(m_filename);
|
||||||
pxStream_OpenCheck( *m_outstream, m_filename, L"writing" );
|
pxStream_OpenCheck( *m_outstream, m_filename, L"writing" );
|
||||||
|
|
||||||
Console.WriteLn("isoFile create ok: %s ", WX_STR(m_filename));
|
Console.WriteLn("isoFile create ok: %s ", WX_STR(m_filename));
|
||||||
|
|
|
@ -1127,7 +1127,7 @@ void SysCorePlugins::Load( PluginsEnum_t pid, const wxString& srcfile )
|
||||||
ScopedLock lock( m_mtx_PluginStatus );
|
ScopedLock lock( m_mtx_PluginStatus );
|
||||||
pxAssert( (uint)pid < PluginId_Count );
|
pxAssert( (uint)pid < PluginId_Count );
|
||||||
|
|
||||||
m_info[pid] = std::unique_ptr<PluginStatus_t>(new PluginStatus_t(pid, srcfile));
|
m_info[pid] = std::make_unique<PluginStatus_t>(pid, srcfile);
|
||||||
|
|
||||||
Console.Indent().WriteLn(L"Bound %4s: %s [%s %s]", WX_STR(tbl_PluginInfo[pid].GetShortname()),
|
Console.Indent().WriteLn(L"Bound %4s: %s [%s %s]", WX_STR(tbl_PluginInfo[pid].GetShortname()),
|
||||||
WX_STR(wxFileName(srcfile).GetFullName()), WX_STR(m_info[pid]->Name), WX_STR(m_info[pid]->Version));
|
WX_STR(wxFileName(srcfile).GetFullName()), WX_STR(m_info[pid]->Name), WX_STR(m_info[pid]->Version));
|
||||||
|
|
|
@ -297,7 +297,7 @@ template< typename CpuType >
|
||||||
CpuInitializer< CpuType >::CpuInitializer()
|
CpuInitializer< CpuType >::CpuInitializer()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
MyCpu = std::unique_ptr<CpuType>(new CpuType());
|
MyCpu = std::make_unique<CpuType>();
|
||||||
MyCpu->Reserve();
|
MyCpu->Reserve();
|
||||||
}
|
}
|
||||||
catch( Exception::RuntimeError& ex )
|
catch( Exception::RuntimeError& ex )
|
||||||
|
@ -461,7 +461,7 @@ SysCpuProviderPack::SysCpuProviderPack()
|
||||||
Console.WriteLn( Color_StrongBlue, "Reserving memory for recompilers..." );
|
Console.WriteLn( Color_StrongBlue, "Reserving memory for recompilers..." );
|
||||||
ConsoleIndentScope indent(1);
|
ConsoleIndentScope indent(1);
|
||||||
|
|
||||||
CpuProviders = std::unique_ptr<CpuInitializerSet>(new CpuInitializerSet());
|
CpuProviders = std::make_unique<CpuInitializerSet>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
recCpu.Reserve();
|
recCpu.Reserve();
|
||||||
|
|
|
@ -1248,7 +1248,7 @@ static void LoadUiSettings()
|
||||||
ConLog_LoadSaveSettings( loader );
|
ConLog_LoadSaveSettings( loader );
|
||||||
SysTraceLog_LoadSaveSettings( loader );
|
SysTraceLog_LoadSaveSettings( loader );
|
||||||
|
|
||||||
g_Conf = std::unique_ptr<AppConfig>(new AppConfig());
|
g_Conf = std::make_unique<AppConfig>();
|
||||||
g_Conf->LoadSave( loader );
|
g_Conf->LoadSave( loader );
|
||||||
|
|
||||||
if( !wxFile::Exists( g_Conf->CurrentIso ) )
|
if( !wxFile::Exists( g_Conf->CurrentIso ) )
|
||||||
|
|
|
@ -424,7 +424,7 @@ int EnumeratePluginsInFolder(const wxDirName& searchpath, wxArrayString* dest)
|
||||||
wxArrayString* realdest = dest;
|
wxArrayString* realdest = dest;
|
||||||
if (realdest == NULL)
|
if (realdest == NULL)
|
||||||
{
|
{
|
||||||
placebo = std::unique_ptr<wxArrayString>(new wxArrayString());
|
placebo = std::make_unique<wxArrayString>();
|
||||||
realdest = placebo.get();
|
realdest = placebo.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -562,7 +562,7 @@ void SysExecEvent_SaveSinglePlugin::InvokeEvent()
|
||||||
if( CoreThread.HasActiveMachine() )
|
if( CoreThread.HasActiveMachine() )
|
||||||
{
|
{
|
||||||
Console.WriteLn( Color_Green, L"Suspending single plugin: " + tbl_PluginInfo[m_pid].GetShortname() );
|
Console.WriteLn( Color_Green, L"Suspending single plugin: " + tbl_PluginInfo[m_pid].GetShortname() );
|
||||||
plugstore = std::unique_ptr<VmStateBuffer>(new VmStateBuffer(L"StateCopy_SinglePlugin"));
|
plugstore = std::make_unique<VmStateBuffer>(L"StateCopy_SinglePlugin");
|
||||||
memSavingState save( plugstore.get() );
|
memSavingState save( plugstore.get() );
|
||||||
GetCorePlugins().Freeze( m_pid, save );
|
GetCorePlugins().Freeze( m_pid, save );
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,7 +229,7 @@ AppGameDatabase* Pcsx2App::GetGameDatabase()
|
||||||
ScopedLock lock( m_mtx_LoadingGameDB );
|
ScopedLock lock( m_mtx_LoadingGameDB );
|
||||||
if( !res.GameDB )
|
if( !res.GameDB )
|
||||||
{
|
{
|
||||||
res.GameDB = std::unique_ptr<AppGameDatabase>(new AppGameDatabase());
|
res.GameDB = std::make_unique<AppGameDatabase>();
|
||||||
res.GameDB->LoadFromFile();
|
res.GameDB->LoadFromFile();
|
||||||
}
|
}
|
||||||
return res.GameDB.get();
|
return res.GameDB.get();
|
||||||
|
|
|
@ -129,7 +129,7 @@ void Pcsx2App::AllocateCoreStuffs()
|
||||||
// FIXME : Some or all of SysCpuProviderPack should be run from the SysExecutor thread,
|
// FIXME : Some or all of SysCpuProviderPack should be run from the SysExecutor thread,
|
||||||
// so that the thread is safely blocked from being able to start emulation.
|
// so that the thread is safely blocked from being able to start emulation.
|
||||||
|
|
||||||
m_CpuProviders = std::unique_ptr<SysCpuProviderPack>(new SysCpuProviderPack());
|
m_CpuProviders = std::make_unique<SysCpuProviderPack>();
|
||||||
|
|
||||||
if( m_CpuProviders->HadSomeFailures( g_Conf->EmuOptions.Cpu.Recompiler ) )
|
if( m_CpuProviders->HadSomeFailures( g_Conf->EmuOptions.Cpu.Recompiler ) )
|
||||||
{
|
{
|
||||||
|
@ -434,7 +434,7 @@ bool Pcsx2App::OnInit()
|
||||||
pxDoAssert = AppDoAssert;
|
pxDoAssert = AppDoAssert;
|
||||||
pxDoOutOfMemory = SysOutOfMemory_EmergencyResponse;
|
pxDoOutOfMemory = SysOutOfMemory_EmergencyResponse;
|
||||||
|
|
||||||
g_Conf = std::unique_ptr<AppConfig>(new AppConfig());
|
g_Conf = std::make_unique<AppConfig>();
|
||||||
wxInitAllImageHandlers();
|
wxInitAllImageHandlers();
|
||||||
|
|
||||||
Console.WriteLn("Applying operating system default language...");
|
Console.WriteLn("Applying operating system default language...");
|
||||||
|
@ -481,7 +481,7 @@ bool Pcsx2App::OnInit()
|
||||||
// PCSX2 has a lot of event handling logistics, so we *cannot* depend on wxWidgets automatic event
|
// PCSX2 has a lot of event handling logistics, so we *cannot* depend on wxWidgets automatic event
|
||||||
// loop termination code. We have a much safer system in place that continues to process messages
|
// loop termination code. We have a much safer system in place that continues to process messages
|
||||||
// until all "important" threads are closed out -- not just until the main frame is closed(-ish).
|
// until all "important" threads are closed out -- not just until the main frame is closed(-ish).
|
||||||
m_timer_Termination = std::unique_ptr<wxTimer>(new wxTimer( this, wxID_ANY ));
|
m_timer_Termination = std::make_unique<wxTimer>( this, wxID_ANY );
|
||||||
Bind(wxEVT_TIMER, &Pcsx2App::OnScheduledTermination, this, m_timer_Termination->GetId());
|
Bind(wxEVT_TIMER, &Pcsx2App::OnScheduledTermination, this, m_timer_Termination->GetId());
|
||||||
SetExitOnFrameDelete( false );
|
SetExitOnFrameDelete( false );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue