Skip to content

Commit f3dd2cd

Browse files
committed
removed dynamic_cast
removed unused method in Debugger
1 parent d7eba0b commit f3dd2cd

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

src/debugger/Debugger.hxx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,6 @@ class Debugger : public DialogContainer
125125
*/
126126
void getCompletions(string_view in, StringList& list) const;
127127

128-
/**
129-
The dialog/GUI associated with the debugger
130-
*/
131-
Dialog& dialog() const { return *myDialog; }
132-
133128
/**
134129
The debugger subsystem responsible for all CPU state
135130
*/

src/debugger/gui/CartELFStateWidget.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void CartridgeELFStateWidget::initialize()
123123

124124
y += myQueueSize->getHeight() + lineHeight / 2;
125125

126-
myNextTransaction = new StaticTextWidget(_boss, _font, x0, y, describeTransaction(0xffff, 0xffff, ~0LL));
126+
myNextTransaction = new StaticTextWidget(_boss, _font, x0, y, describeTransaction(0xffff, 0xffff, ~0LLu));
127127
}
128128

129129
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

src/debugger/gui/CartELFWidget.cxx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@
2525
#include "BrowserDialog.hxx"
2626
#include "OSystem.hxx"
2727
#include "FrameBuffer.hxx"
28+
#include "Debugger.hxx"
2829
#include "bspf.hxx"
2930

30-
namespace {
31-
constexpr int SAVE_ARM_IMAGE_CMD = 'sarm';
32-
} // namespace
33-
3431
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3532
CartridgeELFWidget::CartridgeELFWidget(GuiObject* boss,
3633
const GUI::Font& lfont, const GUI::Font& nfont,
@@ -74,7 +71,7 @@ void CartridgeELFWidget::initialize()
7471

7572
WidgetArray wid;
7673

77-
auto* saveImageButton = new ButtonWidget(_boss, _font, x, y, "Save ARM image" + ELLIPSIS, SAVE_ARM_IMAGE_CMD);
74+
auto* saveImageButton = new ButtonWidget(_boss, _font, x, y, "Save ARM image" + ELLIPSIS, kSaveArmImageCmd);
7875
saveImageButton->setTarget(this);
7976

8077
wid.push_back(saveImageButton);
@@ -91,19 +88,19 @@ void CartridgeELFWidget::saveArmImage(const FSNode& node)
9188
const size_t sizeWritten = node.write(buffer, size);
9289
if (sizeWritten != size) throw runtime_error("failed to write arm image");
9390

94-
instance().frameBuffer().showTextMessage("Successfully exported ARM executable image", MessagePosition::MiddleCenter, true);
91+
instance().frameBuffer().showTextMessage("Successfully exported ARM executable image", MessagePosition::BottomCenter, true);
9592
}
9693
catch (...) {
97-
instance().frameBuffer().showTextMessage("Failed to export ARM executable image", MessagePosition::MiddleCenter, true);
94+
instance().frameBuffer().showTextMessage("Failed to export ARM executable image", MessagePosition::BottomCenter, true);
9895
}
9996
}
10097

10198
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
10299
void CartridgeELFWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
103100
{
104-
if (cmd == SAVE_ARM_IMAGE_CMD)
101+
if (cmd == kSaveArmImageCmd)
105102
BrowserDialog::show(
106-
_boss,
103+
instance().debugger().baseDialog(),
107104
"Save ARM image",
108105
instance().userDir().getPath() + "arm_image.bin",
109106
BrowserDialog::Mode::FileSave,

src/gui/BrowserDialog.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void BrowserDialog::show(GuiObject* parent, const GUI::Font& font,
119119
{
120120
uInt32 w = 0, h = 0;
121121

122-
const auto* parentDialog = dynamic_cast<Dialog*>(parent);
122+
const auto* parentDialog = static_cast<Dialog*>(parent);
123123
if (parentDialog) {
124124
parentDialog->getDynamicBounds(w, h);
125125
} else {

0 commit comments

Comments
 (0)