A few more nullptr and unique_ptr fixes.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3037 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-11-03 17:36:28 +00:00
parent 3949101fb7
commit 03f760cceb
3 changed files with 8 additions and 10 deletions

View File

@ -24,10 +24,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SaveKey::SaveKey(Jack jack, const Event& event, const System& system, SaveKey::SaveKey(Jack jack, const Event& event, const System& system,
const string& eepromfile) const string& eepromfile)
: Controller(jack, event, system, Controller::SaveKey), : Controller(jack, event, system, Controller::SaveKey)
myEEPROM(NULL)
{ {
myEEPROM = new MT24LC256(eepromfile, system); myEEPROM = make_ptr<MT24LC256>(eepromfile, system);
myDigitalPinState[One] = myDigitalPinState[Two] = true; myDigitalPinState[One] = myDigitalPinState[Two] = true;
myAnalogPinValue[Five] = myAnalogPinValue[Nine] = maximumResistance; myAnalogPinValue[Five] = myAnalogPinValue[Nine] = maximumResistance;
@ -36,7 +35,6 @@ SaveKey::SaveKey(Jack jack, const Event& event, const System& system,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SaveKey::~SaveKey() SaveKey::~SaveKey()
{ {
delete myEEPROM;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -91,7 +91,7 @@ class SaveKey : public Controller
private: private:
// The EEPROM used in the SaveKey // The EEPROM used in the SaveKey
MT24LC256* myEEPROM; unique_ptr<MT24LC256> myEEPROM;
}; };
#endif #endif

View File

@ -31,15 +31,15 @@
TIASurface::TIASurface(OSystem& system) TIASurface::TIASurface(OSystem& system)
: myOSystem(system), : myOSystem(system),
myFB(system.frameBuffer()), myFB(system.frameBuffer()),
myTIA(NULL), myTIA(nullptr),
myTiaSurface(NULL), myTiaSurface(nullptr),
mySLineSurface(NULL), mySLineSurface(nullptr),
myBaseTiaSurface(NULL), myBaseTiaSurface(nullptr),
myFilterType(kNormal), myFilterType(kNormal),
myUsePhosphor(false), myUsePhosphor(false),
myPhosphorBlend(77), myPhosphorBlend(77),
myScanlinesEnabled(false), myScanlinesEnabled(false),
myPalette(NULL) myPalette(nullptr)
{ {
// Load NTSC filter settings // Load NTSC filter settings
myNTSCFilter.loadConfig(myOSystem.settings()); myNTSCFilter.loadConfig(myOSystem.settings());