diff --git a/src/common/StaggeredLogger.cxx b/src/common/StaggeredLogger.cxx index 5de05e923..44b9186ff 100644 --- a/src/common/StaggeredLogger.cxx +++ b/src/common/StaggeredLogger.cxx @@ -45,7 +45,7 @@ StaggeredLogger::StaggeredLogger(const string& message, Logger::Level level) myMaxIntervalFactor(9), myCurrentIntervalFactor(1), myCooldownTime(1000), - myTimer(new TimerManager()), + myTimer(make_unique()), myTimerId(0), myTimerCallbackId(0) { @@ -57,7 +57,7 @@ StaggeredLogger::~StaggeredLogger() myTimer->clear(myTimerId); // make sure that the worker thread joins before continuing with the destruction - delete myTimer; + myTimer.reset(); // the worker thread has joined and there will be no more reentrant calls -> // continue with destruction diff --git a/src/common/StaggeredLogger.hxx b/src/common/StaggeredLogger.hxx index 2a69e2d82..afb19d888 100644 --- a/src/common/StaggeredLogger.hxx +++ b/src/common/StaggeredLogger.hxx @@ -76,7 +76,7 @@ class StaggeredLogger // We need control over the destruction porcess and over the exact point where // the worker thread joins -> allocate on the heap end delete explicitly in // our destructor. - TimerManager *myTimer; + unique_ptr myTimer; TimerManager::TimerId myTimerId; // It is possible that the timer callback is running even after TimerManager::clear diff --git a/src/common/sdl_blitter/BlitterFactory.cxx b/src/common/sdl_blitter/BlitterFactory.cxx index 636af8fb3..07cde3e29 100644 --- a/src/common/sdl_blitter/BlitterFactory.cxx +++ b/src/common/sdl_blitter/BlitterFactory.cxx @@ -29,14 +29,16 @@ unique_ptr BlitterFactory::createBlitter(FrameBufferSDL2& fb, ScalingAl switch (scaling) { case ScalingAlgorithm::nearestNeighbour: - return unique_ptr(new BilinearBlitter(fb, false)); + return make_unique(fb, false); case ScalingAlgorithm::bilinear: - return unique_ptr(new BilinearBlitter(fb, true)); + return make_unique(fb, true); case ScalingAlgorithm::quasiInteger: - return HqBlitter::isSupported(fb) ? - unique_ptr(new HqBlitter(fb)) : unique_ptr(new BilinearBlitter(fb, true)); + if (HqBlitter::isSupported(fb)) + return make_unique(fb); + else + return make_unique(fb, true); default: throw runtime_error("unreachable"); diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index 73026a213..8958a5796 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -2106,8 +2106,7 @@ void DebuggerParser::executeTraps(bool read, bool write, const string& command, YaccParser::getResult(), hasCond ? argStrings[0] : ""); commandResult << "added trap " << Base::toString(ret); - // @sa666666: please check this: - myTraps.emplace_back(new Trap{ read, write, begin, end, condition }); + myTraps.emplace_back(make_unique(read, write, begin, end, condition)); } for(uInt32 addr = begin; addr <= end; ++addr) diff --git a/src/debugger/DebuggerParser.hxx b/src/debugger/DebuggerParser.hxx index 26ea6acac..874b3c0ea 100644 --- a/src/debugger/DebuggerParser.hxx +++ b/src/debugger/DebuggerParser.hxx @@ -106,6 +106,9 @@ class DebuggerParser uInt32 begin; uInt32 end; string condition; + + Trap(bool r, bool w, uInt32 b, uInt32 e, const string& c) + : read(r), write(w), begin(b), end(e), condition(c) {} }; // Reference to our debugger object diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index 18c702eba..92c4f3073 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -1147,8 +1147,8 @@ void TIA::setJitterRecoveryFactor(Int32 factor) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - shared_ptr TIA::delayQueueIterator() const { - return shared_ptr( - new DelayQueueIteratorImpl(myDelayQueue) + return make_shared>( + myDelayQueue ); } diff --git a/src/emucore/tia/frame-manager/FrameLayoutDetector.cxx b/src/emucore/tia/frame-manager/FrameLayoutDetector.cxx index b1f1f573e..c5855c837 100644 --- a/src/emucore/tia/frame-manager/FrameLayoutDetector.cxx +++ b/src/emucore/tia/frame-manager/FrameLayoutDetector.cxx @@ -113,7 +113,7 @@ void FrameLayoutDetector::setState(State state) break; default: - throw new runtime_error("cannot happen"); + throw runtime_error("cannot happen"); } }