Just when I thought there were no more cleanups to do ...

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3059 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-11-09 03:05:19 +00:00
parent 4f91fd96ed
commit 92aa5c2e36
39 changed files with 126 additions and 131 deletions

View File

@ -52,7 +52,7 @@ class CheatManager
@param enable Whether to enable this cheat right away
@param idx Index at which to insert the cheat
@return The cheat (if was created), else NULL.
@return The cheat (if was created), else nullptr.
*/
Cheat* add(const string& name, const string& code,
bool enable = true, int idx = -1);
@ -134,7 +134,7 @@ class CheatManager
@param name Name of the cheat (not absolutely required)
@param code The actual cheatcode (in hex)
@return The cheat (if was created), else NULL.
@return The cheat (if was created), else nullptr.
*/
Cheat* createCheat(const string& name, const string& code) const;

View File

@ -1256,7 +1256,6 @@ void CartDebug::getCompletions(const char* in, StringList& completions) const
completions.push_back(ourZPMnemonic[addr]);
// Now scan user-defined labels
LabelToAddr::const_iterator iter;
for(const auto& iter: myUserAddresses)
{
const char* l = iter.first.c_str();

View File

@ -302,7 +302,6 @@ class CartDebug : public DebuggerSystem
<< ", offset=$" << HEX4 << b.offset << ", size=" << dec << b.size
<< endl
<< "addrlist: ";
AddressList::const_iterator i;
for(const auto& i: addressList)
os << HEX4 << i << " ";
return os;

View File

@ -46,7 +46,7 @@ class CartDebugWidget : public Widget, public CommandSender
myFontHeight(lfont.getFontHeight()),
myLineHeight(lfont.getLineHeight()),
myButtonHeight(myLineHeight + 4),
myDesc(NULL) { }
myDesc(nullptr) { }
virtual ~CartDebugWidget() { };

View File

@ -24,13 +24,13 @@ DataGridOpsWidget::DataGridOpsWidget(GuiObject* boss, const GUI::Font& font,
int x, int y)
: Widget(boss, font, x, y, 16, 16),
CommandSender(boss),
_zeroButton(NULL),
_invButton(NULL),
_negButton(NULL),
_incButton(NULL),
_decButton(NULL),
_shiftLeftButton(NULL),
_shiftRightButton(NULL)
_zeroButton(nullptr),
_invButton(nullptr),
_negButton(nullptr),
_incButton(nullptr),
_decButton(nullptr),
_shiftLeftButton(nullptr),
_shiftRightButton(nullptr)
{
const int bwidth = _font.getMaxCharWidth() * 4,
bheight = _font.getFontHeight() + 3,

View File

@ -46,8 +46,8 @@ DataGridWidget::DataGridWidget(GuiObject* boss, const GUI::Font& font,
_base(base),
_selectedItem(0),
_currentKeyDown(KBDK_UNKNOWN),
_opsWidget(NULL),
_scrollBar(NULL)
_opsWidget(nullptr),
_scrollBar(nullptr)
{
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS |
WIDGET_WANTS_RAWDATA;

View File

@ -48,11 +48,11 @@
DebuggerDialog::DebuggerDialog(OSystem& osystem, DialogContainer& parent,
int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h),
myTab(NULL),
myRomTab(NULL),
myLFont(NULL),
myNFont(NULL),
myFatalError(NULL)
myTab(nullptr),
myRomTab(nullptr),
myLFont(nullptr),
myNFont(nullptr),
myFatalError(nullptr)
{
createFont(); // Font is sized according to available space

View File

@ -31,7 +31,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont,
int x, int y, int w, int h)
: EditableWidget(boss, nfont, x, y, 16, 16),
myMenu(NULL),
myMenu(nullptr),
_rows(0),
_cols(0),
_currentPos(0),
@ -77,7 +77,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont,
_rows = h / _fontHeight;
// Create a CheckboxWidget for each row in the list
CheckboxWidget* t = NULL;
CheckboxWidget* t = nullptr;
for(int i = 0; i < _rows; ++i)
{
t = new CheckboxWidget(boss, lfont, _x + 2, ypos, "", kCheckActionCmd);

View File

@ -38,8 +38,8 @@ TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: Widget(boss, font, x, y, w, h),
CommandSender(boss),
myMenu(NULL),
myZoom(NULL),
myMenu(nullptr),
myZoom(nullptr),
myClickX(0),
myClickY(0)
{

View File

@ -32,7 +32,7 @@ TiaZoomWidget::TiaZoomWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: Widget(boss, font, x, y, 16, 16),
CommandSender(boss),
myMenu(NULL)
myMenu(nullptr)
{
_flags = WIDGET_ENABLED | WIDGET_CLEARBG |
WIDGET_RETAIN_FOCUS | WIDGET_TRACK_MOUSE;

View File

@ -302,7 +302,7 @@ Cartridge::Cartridge(const Settings& settings)
: mySettings(settings),
myStartBank(0),
myBankChanged(true),
myCodeAccessBase(NULL),
myCodeAccessBase(nullptr),
myBankLocked(false)
{
}
@ -361,7 +361,7 @@ void Cartridge::createCodeAccessBase(uInt32 size)
myCodeAccessBase = new uInt8[size];
memset(myCodeAccessBase, CartDebug::ROW, size);
#else
myCodeAccessBase = NULL;
myCodeAccessBase = nullptr;
#endif
}

View File

@ -208,7 +208,7 @@ class Cartridge : public Device
of each cart type can be very different from each other.
*/
virtual CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, int x, int y, int w, int h) { return NULL; }
const GUI::Font& nfont, int x, int y, int w, int h) { return nullptr; }
// Info about the various bankswitch schemes, useful for displaying
// in GUI dropdown boxes, etc

View File

@ -57,7 +57,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventHandler::EventHandler(OSystem& osystem)
: myOSystem(osystem),
myOverlay(NULL),
myOverlay(nullptr),
myState(S_NONE),
myAllowAllDirectionsFlag(false),
myFryingFlag(false),
@ -248,7 +248,7 @@ void EventHandler::poll(uInt64 time)
void EventHandler::handleTextEvent(char text)
{
// Text events are only used in GUI mode
if(myOverlay != NULL)
if(myOverlay != nullptr)
myOverlay->handleTextEvent(text);
}
@ -546,7 +546,7 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, bool state)
// Otherwise, let the event handler deal with it
if(myState == S_EMULATE)
handleEvent(myKeyTable[key][kEmulationMode], state);
else if(myOverlay != NULL)
else if(myOverlay != nullptr)
myOverlay->handleKeyEvent(key, mod, state);
}
@ -612,7 +612,7 @@ void EventHandler::handleJoyEvent(int stick, int button, uInt8 state)
// Determine which mode we're in, then send the event to the appropriate place
if(myState == S_EMULATE)
handleEvent(joy->btnTable[button][kEmulationMode], state);
else if(myOverlay != NULL)
else if(myOverlay != nullptr)
myOverlay->handleJoyEvent(stick, button, state);
break; // Regular button
@ -715,7 +715,7 @@ void EventHandler::handleJoyAxisEvent(int stick, int axis, int value)
}
}
}
else if(myOverlay != NULL)
else if(myOverlay != nullptr)
{
// First, clamp the values to simulate digital input
// (the only thing that the underlying code understands)
@ -782,7 +782,7 @@ void EventHandler::handleJoyHatEvent(int stick, int hat, int value)
handleEvent(joy->hatTable[hat][EVENT_HATLEFT][kEmulationMode],
value & EVENT_HATLEFT_M);
}
else if(myOverlay != NULL)
else if(myOverlay != nullptr)
{
if(value == EVENT_HATCENTER_M)
myOverlay->handleJoyHatEvent(stick, hat, EVENT_HATCENTER);
@ -1030,7 +1030,7 @@ bool EventHandler::eventStateChange(Event::Type type)
void EventHandler::setActionMappings(EventMode mode)
{
int listsize = 0;
ActionList* list = NULL;
ActionList* list = nullptr;
switch(mode)
{
@ -1053,7 +1053,7 @@ void EventHandler::setActionMappings(EventMode mode)
for(int i = 0; i < listsize; ++i)
{
Event::Type event = list[i].event;
free(list[i].key); list[i].key = NULL;
free(list[i].key); list[i].key = nullptr;
list[i].key = strdup("None");
string key = "";
for(int j = 0; j < KBDK_LAST; ++j) // key mapping
@ -1161,7 +1161,7 @@ void EventHandler::setActionMappings(EventMode mode)
if(key != "")
{
free(list[i].key); list[i].key = NULL;
free(list[i].key); list[i].key = nullptr;
list[i].key = strdup(key.c_str());
}
}
@ -1913,7 +1913,7 @@ void EventHandler::setEventState(State state)
switch(myState)
{
case S_EMULATE:
myOverlay = NULL;
myOverlay = nullptr;
myOSystem.sound().mute(false);
enableTextEvents(false);
if(myOSystem.console().leftController().type() == Controller::CompuMate)
@ -1921,7 +1921,7 @@ void EventHandler::setEventState(State state)
break;
case S_PAUSE:
myOverlay = NULL;
myOverlay = nullptr;
myOSystem.sound().mute(true);
enableTextEvents(false);
break;
@ -1949,7 +1949,7 @@ void EventHandler::setEventState(State state)
#endif
default:
myOverlay = NULL;
myOverlay = nullptr;
break;
}

View File

@ -437,7 +437,7 @@ class EventHandler
void saveMapping();
const StellaJoystick* joy(int id) const {
return id < (int)mySticks.size() ? mySticks[id] : NULL;
return id < (int)mySticks.size() ? mySticks[id] : nullptr;
}
private:
@ -445,7 +445,7 @@ class EventHandler
struct StickInfo
{
StickInfo(const string& map = EmptyString, StellaJoystick* stick = NULL)
StickInfo(const string& map = EmptyString, StellaJoystick* stick = nullptr)
: mapping(map), joy(stick) {}
string mapping;

View File

@ -35,20 +35,20 @@ EventHandler::StellaJoystick::StellaJoystick()
numAxes(0),
numButtons(0),
numHats(0),
axisTable(NULL),
btnTable(NULL),
hatTable(NULL),
axisLastValue(NULL)
axisTable(nullptr),
btnTable(nullptr),
hatTable(nullptr),
axisLastValue(nullptr)
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventHandler::StellaJoystick::~StellaJoystick()
{
delete[] axisTable; axisTable = NULL;
delete[] btnTable; btnTable = NULL;
delete[] hatTable; hatTable = NULL;
delete[] axisLastValue; axisLastValue = NULL;
delete[] axisTable; axisTable = nullptr;
delete[] btnTable; btnTable = nullptr;
delete[] hatTable; hatTable = nullptr;
delete[] axisLastValue; axisLastValue = nullptr;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -358,7 +358,7 @@ int EventHandler::JoystickHandler::remove(int index)
// Sticks that are removed must have initially been added
// So we use the 'active' joystick list to access them
if(index >= 0 && index < (int)mySticks.size() && mySticks[index] != NULL)
if(index >= 0 && index < (int)mySticks.size() && mySticks[index] != nullptr)
{
StellaJoystick* stick = mySticks[index];
@ -372,8 +372,8 @@ int EventHandler::JoystickHandler::remove(int index)
// Remove joystick, but remember mapping
it->second.mapping = stick->getMap();
delete it->second.joy; it->second.joy = NULL;
mySticks[index] = NULL;
delete it->second.joy; it->second.joy = nullptr;
mySticks[index] = nullptr;
return index;
}

View File

@ -22,7 +22,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FBSurface::FBSurface()
: myPixels(NULL),
: myPixels(nullptr),
myPitch(0)
{
// NOTE: myPixels and myPitch MUST be set in child classes that inherit
@ -284,4 +284,4 @@ void FBSurface::drawString(const GUI::Font& font, const string& s,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const uInt32* FBSurface::myPalette = 0;
const uInt32* FBSurface::myPalette = nullptr;

View File

@ -933,7 +933,7 @@ FrameBuffer::VideoModeList::~VideoModeList()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::VideoModeList::add(const VideoMode& mode)
{
myModeList.push_back(mode);
myModeList.emplace_back(mode);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -213,7 +213,7 @@ class FrameBuffer
Retrieve the surface associated with the given ID.
@param id The ID for the surface to retrieve.
@return A pointer to a valid surface object, or NULL.
@return A pointer to a valid surface object, or nullptr.
*/
FBSurface* surface(uInt32 id) const;
@ -494,9 +494,8 @@ class FrameBuffer
friend ostream& operator<<(ostream& os, const VideoModeList& l)
{
for(vector<VideoMode>::const_iterator i = l.myModeList.begin();
i != l.myModeList.end(); ++i)
os << "-----\n" << *i << endl << "-----\n";
for(const auto& vm: l.myModeList)
os << "-----\n" << vm << endl << "-----\n";
return os;
}

View File

@ -65,10 +65,10 @@ M6502::M6502(const Settings& settings)
myDataAddressForPoke(0)
{
#ifdef DEBUGGER_SUPPORT
myDebugger = NULL;
myBreakPoints = NULL;
myReadTraps = NULL;
myWriteTraps = NULL;
myDebugger = nullptr;
myBreakPoints = nullptr;
myReadTraps = nullptr;
myWriteTraps = nullptr;
myJustHitTrapFlag = false;
#endif
@ -150,7 +150,7 @@ inline uInt8 M6502::peek(uInt16 address, uInt8 flags)
mySystem->incrementCycles(SYSTEM_CYCLES_PER_CPU);
#ifdef DEBUGGER_SUPPORT
if(myReadTraps != NULL && myReadTraps->isSet(address))
if(myReadTraps != nullptr && myReadTraps->isSet(address))
{
myJustHitTrapFlag = true;
myHitTrapInfo.message = "RTrap: ";
@ -179,7 +179,7 @@ inline void M6502::poke(uInt16 address, uInt8 value)
mySystem->incrementCycles(SYSTEM_CYCLES_PER_CPU);
#ifdef DEBUGGER_SUPPORT
if(myWriteTraps != NULL && myWriteTraps->isSet(address))
if(myWriteTraps != nullptr && myWriteTraps->isSet(address))
{
myJustHitTrapFlag = true;
myHitTrapInfo.message = "WTrap: ";
@ -213,7 +213,7 @@ bool M6502::execute(uInt32 number)
}
}
if(myBreakPoints != NULL)
if(myBreakPoints != nullptr)
{
if(myBreakPoints->isSet(PC))
{

View File

@ -194,7 +194,7 @@ void OSystem::saveConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void OSystem::createDebugger(Console& console)
{
delete myDebugger; myDebugger = NULL;
delete myDebugger; myDebugger = nullptr;
myDebugger = new Debugger(*this, console);
myDebugger->initialize();
}
@ -437,9 +437,9 @@ void OSystem::deleteConsole()
<< endl;
logMessage(buf.str(), 1);
delete myConsole; myConsole = NULL;
delete myConsole; myConsole = nullptr;
#ifdef DEBUGGER_SUPPORT
delete myDebugger; myDebugger = NULL;
delete myDebugger; myDebugger = nullptr;
#endif
}
}
@ -520,7 +520,7 @@ Console* OSystem::openConsole(const FilesystemNode& romfile, string& md5,
s = mySettings->getString(cl_name); \
if(s != "") props.set(prop_name, s);
Console* console = (Console*) NULL;
Console* console = nullptr;
// Open the cartridge image and read it in
uInt8* image = 0;

View File

@ -129,7 +129,7 @@ class OSystem
@return The console object
*/
Console& console() const { return *myConsole; }
bool hasConsole() const { return myConsole != NULL; }
bool hasConsole() const { return myConsole != nullptr; }
/**
Get the serial port of the system.
@ -564,7 +564,7 @@ class OSystem
@param type The bankswitch type of the ROM
@param id The additional id (if any) used by the ROM
@return The actual Console object, otherwise NULL
@return The actual Console object, otherwise nullptr
(calling method is responsible for deleting it)
*/
Console* openConsole(const FilesystemNode& romfile, string& md5,

View File

@ -25,7 +25,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Serializer::Serializer(const string& filename, bool readonly)
: myStream(NULL),
: myStream(nullptr),
myUseFilestream(true)
{
if(readonly)
@ -70,7 +70,7 @@ Serializer::Serializer(const string& filename, bool readonly)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Serializer::Serializer()
: myStream(NULL),
: myStream(nullptr),
myUseFilestream(false)
{
myStream = new stringstream(ios::in | ios::out | ios::binary);
@ -88,20 +88,20 @@ Serializer::Serializer()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Serializer::~Serializer()
{
if(myStream != NULL)
if(myStream != nullptr)
{
if(myUseFilestream)
((fstream*)myStream)->close();
delete myStream;
myStream = NULL;
myStream = nullptr;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Serializer::valid() const
{
return myStream != NULL;
return myStream != nullptr;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -33,7 +33,7 @@ CheckListWidget::CheckListWidget(GuiObject* boss, const GUI::Font& font,
_rows = h / _fontHeight;
// Create a CheckboxWidget for each row in the list
CheckboxWidget* t = NULL;
CheckboxWidget* t = nullptr;
for(int i = 0; i < _rows; ++i)
{
t = new CheckboxWidget(boss, font, _x + 2, ypos, "", kCheckActionCmd);

View File

@ -33,10 +33,10 @@ ConfigPathDialog::ConfigPathDialog(
OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss,
int max_w, int max_h)
: Dialog(osystem, parent, 0, 0, 0, 0),
: Dialog(osystem, parent),
CommandSender(boss),
myBrowser(NULL),
myIsGlobal(boss != 0)
myBrowser(nullptr),
myIsGlobal(boss != nullptr)
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),

View File

@ -59,7 +59,7 @@ Dialog::~Dialog()
_myTabList.clear();
delete _firstWidget;
_firstWidget = NULL;
_firstWidget = nullptr;
_buttonGroup.clear();
}
@ -70,7 +70,7 @@ void Dialog::open(bool refresh)
// Make sure we have a valid surface to draw into
// Technically, this shouldn't be needed until drawDialog(), but some
// dialogs cause drawing to occur within loadConfig()
if(_surface == NULL)
if(_surface == nullptr)
{
uInt32 surfaceID = instance().frameBuffer().allocateSurface(_w, _h);
_surface = instance().frameBuffer().surface(surfaceID);

View File

@ -48,7 +48,7 @@ class Dialog : public GuiObject
public:
Dialog(OSystem& instance, DialogContainer& parent,
int x, int y, int w, int h);
int x = 0, int y = 0, int w = 0, int h = 0);
virtual ~Dialog();

View File

@ -28,7 +28,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DialogContainer::DialogContainer(OSystem& osystem)
: myOSystem(osystem),
myBaseDialog(NULL),
myBaseDialog(nullptr),
myTime(0)
{
reset();
@ -37,8 +37,7 @@ DialogContainer::DialogContainer(OSystem& osystem)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DialogContainer::~DialogContainer()
{
if(myBaseDialog)
delete myBaseDialog;
delete myBaseDialog;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -98,7 +98,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
myComboDialog = new ComboDialog(boss, font, combolist);
}
else
myComboButton = NULL;
myComboButton = nullptr;
// Show message for currently selected event
xpos = 10; ypos = 5 + myActionsList->getHeight() + 5;

View File

@ -46,8 +46,8 @@ typedef struct
int size; /* font size in glyphs */
const uInt16* bits; /* 16-bit right-padded bitmap data */
const uInt32* offset; /* offsets into bitmap data*/
const uInt8* width; /* character widths or NULL if fixed */
const BBX* bbx; /* character bounding box or NULL if fixed */
const uInt8* width; /* character widths or nullptr if fixed */
const BBX* bbx; /* character bounding box or nullptr if fixed */
int defaultchar; /* default char (not glyph index) */
long bits_size; /* # words of bitmap_t bits */
} FontDesc;

View File

@ -48,18 +48,18 @@
LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h),
myStartButton(NULL),
myPrevDirButton(NULL),
myOptionsButton(NULL),
myQuitButton(NULL),
myList(NULL),
myGameList(NULL),
myRomInfoWidget(NULL),
myMenu(NULL),
myGlobalProps(NULL),
myFilters(NULL),
myFirstRunMsg(NULL),
myRomDir(NULL),
myStartButton(nullptr),
myPrevDirButton(nullptr),
myOptionsButton(nullptr),
myQuitButton(nullptr),
myList(nullptr),
myGameList(nullptr),
myRomInfoWidget(nullptr),
myMenu(nullptr),
myGlobalProps(nullptr),
myFilters(nullptr),
myFirstRunMsg(nullptr),
myRomDir(nullptr),
mySelectedItem(0)
{
const GUI::Font& font = instance().frameBuffer().launcherFont();

View File

@ -38,7 +38,7 @@
LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
: Dialog(osystem, parent, 0, 0, 0, 0),
myLogInfo(NULL)
myLogInfo(nullptr)
{
const int lineHeight = font.getLineHeight(),
buttonWidth = font.getStringWidth("Save log to disk") + 20,

View File

@ -48,18 +48,18 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
GuiObject* boss, int max_w, int max_h, bool global)
: Dialog(osystem, parent, 0, 0, 0, 0),
myVideoDialog(NULL),
myAudioDialog(NULL),
myInputDialog(NULL),
myUIDialog(NULL),
mySnapshotDialog(NULL),
myConfigPathDialog(NULL),
myGameInfoDialog(NULL),
myCheatCodeDialog(NULL),
myLoggerDialog(NULL),
myHelpDialog(NULL),
myAboutDialog(NULL),
: Dialog(osystem, parent),
myVideoDialog(nullptr),
myAudioDialog(nullptr),
myInputDialog(nullptr),
myUIDialog(nullptr),
mySnapshotDialog(nullptr),
myConfigPathDialog(nullptr),
myGameInfoDialog(nullptr),
myCheatCodeDialog(nullptr),
myLoggerDialog(nullptr),
myHelpDialog(nullptr),
myAboutDialog(nullptr),
myIsGlobal(global)
{
const GUI::Font& font = instance().frameBuffer().font();
@ -72,7 +72,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
int xoffset = 10, yoffset = 10;
WidgetArray wid;
ButtonWidget* b = NULL;
ButtonWidget* b = nullptr;
b = addODButton("Video Settings", kVidCmd);
wid.push_back(b);

View File

@ -29,8 +29,8 @@
ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font,
const string& message)
: Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16),
myMessage(NULL),
mySlider(NULL),
myMessage(nullptr),
mySlider(nullptr),
myStart(0),
myFinish(0),
myStep(0),

View File

@ -36,9 +36,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
: Dialog(osystem, parent, 0, 0, 0, 0),
myBrowser(NULL),
myConfirmMsg(NULL),
: Dialog(osystem, parent),
myBrowser(nullptr),
myConfirmMsg(nullptr),
myMaxWidth(max_w),
myMaxHeight(max_h)
{

View File

@ -28,7 +28,7 @@
RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: Widget(boss, font, x, y, w, h),
mySurface(NULL),
mySurface(nullptr),
mySurfaceIsValid(false),
myHaveProperties(false),
myAvail(w > 400 ? GUI::Size(640, 512) : GUI::Size(320, 256))
@ -90,7 +90,7 @@ void RomInfoWidget::parseProperties()
// Check if a surface has ever been created; if so, we use it
// The surface will always be the maximum size, but sometimes we'll
// only draw certain parts of it
if(mySurface == NULL)
if(mySurface == nullptr)
{
uInt32 ID = instance().frameBuffer().allocateSurface(320*2, 256*2);
mySurface = instance().frameBuffer().surface(ID);

View File

@ -33,8 +33,8 @@ SnapshotDialog::SnapshotDialog(
OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss,
int max_w, int max_h)
: Dialog(osystem, parent, 0, 0, 0, 0),
myBrowser(NULL)
: Dialog(osystem, parent),
myBrowser(nullptr)
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),
@ -128,13 +128,12 @@ SnapshotDialog::SnapshotDialog(
addToFocusList(wid);
// Create file browser dialog
myBrowser = new BrowserDialog(this, font, max_w, max_h);
myBrowser = make_ptr<BrowserDialog>(this, font, max_w, max_h);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SnapshotDialog::~SnapshotDialog()
{
delete myBrowser;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -56,7 +56,7 @@ class SnapshotDialog : public Dialog
kSnapLoadDirChosenCmd = 'snlc' // snap chosen (load files)
};
BrowserDialog* myBrowser;
unique_ptr<BrowserDialog> myBrowser;
// Config paths
EditTextWidget* mySnapSavePath;

View File

@ -59,7 +59,7 @@ Widget::Widget(GuiObject* boss, const GUI::Font& font,
Widget::~Widget()
{
delete _next;
_next = NULL;
_next = nullptr;
_focusList.clear();
}

View File

@ -24,7 +24,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SerialPortWINDOWS::SerialPortWINDOWS()
: SerialPort(),
myHandle(NULL)
myHandle(0)
{
}
@ -73,7 +73,7 @@ void SerialPortWINDOWS::closePort()
if(myHandle)
{
CloseHandle(myHandle);
myHandle = NULL;
myHandle = 0;
}
}