diff --git a/src/gui/CheckListWidget.cxx b/src/gui/CheckListWidget.cxx index 13afb335a..a42744657 100644 --- a/src/gui/CheckListWidget.cxx +++ b/src/gui/CheckListWidget.cxx @@ -143,7 +143,7 @@ Common::Rect CheckListWidget::getEditRect() const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool CheckListWidget::getState(int line) +bool CheckListWidget::getState(int line) const { if(line >= 0 && line < int(_stateList.size())) return _stateList[line]; diff --git a/src/gui/CheckListWidget.hxx b/src/gui/CheckListWidget.hxx index 2ebec0d5d..30ccba814 100644 --- a/src/gui/CheckListWidget.hxx +++ b/src/gui/CheckListWidget.hxx @@ -39,8 +39,8 @@ class CheckListWidget : public ListWidget void setList(const StringList& list, const BoolArray& state); void setLine(int line, const string& str, const bool& state); - bool getState(int line); - bool getSelectedState() { return getState(_selectedItem); } + bool getState(int line) const; + bool getSelectedState() const { return getState(_selectedItem); } private: bool handleEvent(Event::Type e) override; diff --git a/src/gui/ColorWidget.cxx b/src/gui/ColorWidget.cxx index 94ef4bbf4..8320c9a88 100644 --- a/src/gui/ColorWidget.cxx +++ b/src/gui/ColorWidget.cxx @@ -28,8 +28,8 @@ ColorWidget::ColorWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, int cmd, bool framed) : Widget(boss, font, x, y, w, h), CommandSender(boss), - _framed(framed), - _cmd(cmd) + _framed{framed}, + _cmd{cmd} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS; } diff --git a/src/gui/Command.hxx b/src/gui/Command.hxx index 64fab2151..0178670f8 100644 --- a/src/gui/Command.hxx +++ b/src/gui/Command.hxx @@ -48,7 +48,7 @@ class CommandSender // and add methods addTarget/removeTarget. public: explicit CommandSender(CommandReceiver* target) - : _target(target) { } + : _target{target} { } virtual ~CommandSender() = default; diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx index 2ecf50302..bcf87ca0e 100644 --- a/src/gui/ContextMenu.cxx +++ b/src/gui/ContextMenu.cxx @@ -31,9 +31,9 @@ ContextMenu::ContextMenu(GuiObject* boss, const GUI::Font& font, const VariantList& items, int cmd, int width) : Dialog(boss->instance(), boss->parent(), font), CommandSender(boss), - _rowHeight(font.getLineHeight()), - _cmd(cmd), - _maxWidth(width) + _rowHeight{font.getLineHeight()}, + _cmd{cmd}, + _maxWidth{width} { setArrows(); addItems(items); diff --git a/src/gui/ContextMenu.hxx b/src/gui/ContextMenu.hxx index 6807635ba..ab6a0f6ff 100644 --- a/src/gui/ContextMenu.hxx +++ b/src/gui/ContextMenu.hxx @@ -130,7 +130,7 @@ class ContextMenu : public Dialog, public CommandSender int _id{-1}; uInt32 _xorig{0}, _yorig{0}; - uInt32 _maxWidth{0}; + int _maxWidth{0}; int _textOfs{0}; int _arrowSize{0}; diff --git a/src/gui/DeveloperDialog.hxx b/src/gui/DeveloperDialog.hxx index fc16e302e..65d057e38 100644 --- a/src/gui/DeveloperDialog.hxx +++ b/src/gui/DeveloperDialog.hxx @@ -148,7 +148,7 @@ class DeveloperDialog : public Dialog CheckboxWidget* myGhostReadsTrapWidget{nullptr}; #endif - bool mySettings; + bool mySettings{false}; // Emulator sets std::array myFrameStats; std::array myDetectedInfo; diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 8b052b032..72bdc398a 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -49,8 +49,8 @@ Dialog::Dialog(OSystem& instance, DialogContainer& parent, const GUI::Font& font, const string& title, int x, int y, int w, int h) : GuiObject(instance, parent, *this, x, y, w, h), - _font(font), - _title(title) + _font{font}, + _title{title} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_BORDER | Widget::FLAG_CLEARBG; setTitle(title); diff --git a/src/gui/Dialog.hxx b/src/gui/Dialog.hxx index 0cc145d55..022334e47 100644 --- a/src/gui/Dialog.hxx +++ b/src/gui/Dialog.hxx @@ -213,7 +213,7 @@ class Dialog : public GuiObject Widget* widget{nullptr}; WidgetArray list; - explicit Focus(Widget* w = nullptr) : widget(w) { } + explicit Focus(Widget* w = nullptr) : widget{w} { } }; using FocusList = vector; @@ -222,7 +222,7 @@ class Dialog : public GuiObject FocusList focus; uInt32 currentTab{0}; - explicit TabFocus(TabWidget* w = nullptr) : widget(w) { } + explicit TabFocus(TabWidget* w = nullptr) : widget{w} { } void appendFocusList(WidgetArray& list); void saveCurrentFocus(Widget* w); diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index 16f32536a..c421cb430 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -28,7 +28,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DialogContainer::DialogContainer(OSystem& osystem) - : myOSystem(osystem) + : myOSystem{osystem} { _DOUBLE_CLICK_DELAY = osystem.settings().getInt("mdouble"); _REPEAT_INITIAL_DELAY = osystem.settings().getInt("ctrldelay"); diff --git a/src/gui/EventMappingWidget.cxx b/src/gui/EventMappingWidget.cxx index 0336e4c51..4755c7789 100644 --- a/src/gui/EventMappingWidget.cxx +++ b/src/gui/EventMappingWidget.cxx @@ -40,7 +40,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font, EventMode mode) : Widget(boss, font, x, y, w, h), CommandSender(boss), - myEventMode(mode) + myEventMode{mode} { const int fontHeight = font.getFontHeight(), lineHeight = font.getLineHeight(), diff --git a/src/gui/FileListWidget.cxx b/src/gui/FileListWidget.cxx index 169b9cddb..519c097fa 100644 --- a/src/gui/FileListWidget.cxx +++ b/src/gui/FileListWidget.cxx @@ -28,7 +28,7 @@ FileListWidget::FileListWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : StringListWidget(boss, font, x, y, w, h), - _filter([](const FilesystemNode& node) { return true; }) + _filter{[](const FilesystemNode& node) { return true; }} { // This widget is special, in that it catches signals and redirects them setTarget(this); diff --git a/src/gui/FileListWidget.hxx b/src/gui/FileListWidget.hxx index 32f6517f7..f60dd97d4 100644 --- a/src/gui/FileListWidget.hxx +++ b/src/gui/FileListWidget.hxx @@ -89,7 +89,7 @@ class FileListWidget : public StringListWidget const FilesystemNode& currentDir() const { return _node; } static void setQuickSelectDelay(uInt64 time) { _QUICK_SELECT_DELAY = time; } - uInt64 getQuickSelectDelay() { return _QUICK_SELECT_DELAY; } + uInt64 getQuickSelectDelay() const { return _QUICK_SELECT_DELAY; } ProgressDialog& progress(); void incProgress(); diff --git a/src/gui/Font.cxx b/src/gui/Font.cxx index e327fa8af..53797d031 100644 --- a/src/gui/Font.cxx +++ b/src/gui/Font.cxx @@ -26,7 +26,7 @@ namespace GUI { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Font::Font(const FontDesc& desc) - : myFontDesc(desc) + : myFontDesc{desc} { } diff --git a/src/gui/GuiObject.hxx b/src/gui/GuiObject.hxx index dd95d62cc..6d69cd04b 100644 --- a/src/gui/GuiObject.hxx +++ b/src/gui/GuiObject.hxx @@ -70,10 +70,10 @@ class GuiObject : public CommandReceiver public: GuiObject(OSystem& osystem, DialogContainer& parent, Dialog& dialog, int x, int y, int w, int h) - : myOSystem(osystem), - myParent(parent), - myDialog(dialog), - _x(x), _y(y), _w(w), _h(h) { } + : myOSystem{osystem}, + myParent{parent}, + myDialog{dialog}, + _x{x}, _y{y}, _w{w}, _h{h} { } ~GuiObject() override = default; diff --git a/src/gui/HighScoresDialog.hxx b/src/gui/HighScoresDialog.hxx index c15105f6f..39ccca335 100644 --- a/src/gui/HighScoresDialog.hxx +++ b/src/gui/HighScoresDialog.hxx @@ -35,7 +35,6 @@ class Serializer; using json = nlohmann::json; - /** The dialog for displaying high scores in Stella. diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index e9bb315c3..2345e3570 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -41,8 +41,8 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, int max_w, int max_h) : Dialog(osystem, parent, font, "Input settings"), - myMaxWidth(max_w), - myMaxHeight(max_h) + myMaxWidth{max_w}, + myMaxHeight{max_h} { const int lineHeight = _font.getLineHeight(), fontWidth = _font.getMaxCharWidth(), diff --git a/src/gui/Launcher.cxx b/src/gui/Launcher.cxx index 91868282c..81605a703 100644 --- a/src/gui/Launcher.cxx +++ b/src/gui/Launcher.cxx @@ -28,7 +28,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Launcher::Launcher(OSystem& osystem) : DialogContainer(osystem), - mySize(myOSystem.settings().getSize("launcherres")) + mySize{myOSystem.settings().getSize("launcherres")} { const Common::Size& d = myOSystem.frameBuffer().desktopSize(); double overscan = 1 - myOSystem.settings().getInt("tia.fs_overscan") / 100.0; diff --git a/src/gui/ListWidget.cxx b/src/gui/ListWidget.cxx index 1cf6c7e0d..a8c0c37da 100644 --- a/src/gui/ListWidget.cxx +++ b/src/gui/ListWidget.cxx @@ -28,7 +28,7 @@ ListWidget::ListWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, bool useScrollbar) : EditableWidget(boss, font, x, y, 16, 16), - _useScrollbar(useScrollbar) + _useScrollbar{useScrollbar} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS; _bgcolor = kWidColor; diff --git a/src/gui/MessageBox.cxx b/src/gui/MessageBox.cxx index d5b5cf11b..ca3913543 100644 --- a/src/gui/MessageBox.cxx +++ b/src/gui/MessageBox.cxx @@ -33,8 +33,8 @@ MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font, bool focusOKButton) : Dialog(boss->instance(), boss->parent(), font, title, 0, 0, max_w, max_h), CommandSender(boss), - myOkCmd(okCmd), - myCancelCmd(cancelCmd) + myOkCmd{okCmd}, + myCancelCmd{cancelCmd} { addText(font, text); diff --git a/src/gui/MessageDialog.cxx b/src/gui/MessageDialog.cxx index ca52c99e6..2c2b19c7d 100644 --- a/src/gui/MessageDialog.cxx +++ b/src/gui/MessageDialog.cxx @@ -82,6 +82,7 @@ void MessageDialog::setMessage(const string& title, const string& text, bool yes setMessage(title, StringParser(text).stringList(), yesNo); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string MessageDialog::myTitle = ""; StringList MessageDialog::myText; bool MessageDialog::myYesNo = false; diff --git a/src/gui/MessageDialog.hxx b/src/gui/MessageDialog.hxx index d3c8a8228..6399abafb 100644 --- a/src/gui/MessageDialog.hxx +++ b/src/gui/MessageDialog.hxx @@ -26,36 +26,36 @@ class OSystem; class MessageDialog : public Dialog { -public: - MessageDialog(OSystem& osystem, DialogContainer& parent, - const GUI::Font& font, int max_w, int max_h); - ~MessageDialog() override; + public: + MessageDialog(OSystem& osystem, DialogContainer& parent, + const GUI::Font& font, int max_w, int max_h); + ~MessageDialog() override; - // Define the message displayed - void setMessage(const string& title, const string& text, bool yesNo = false); - void setMessage(const string& title, const StringList& text, bool yesNo = false); - bool confirmed() { return myConfirmed; } + // Define the message displayed + void setMessage(const string& title, const string& text, bool yesNo = false); + void setMessage(const string& title, const StringList& text, bool yesNo = false); + bool confirmed() { return myConfirmed; } -protected: - void loadConfig() override; - void handleCommand(CommandSender* sender, int cmd, int data, int id) override; + protected: + void loadConfig() override; + void handleCommand(CommandSender* sender, int cmd, int data, int id) override; -private: - static string myTitle; - static StringList myText; - static bool myYesNo; - static bool myConfirmed; + private: + static string myTitle; + static StringList myText; + static bool myYesNo; + static bool myConfirmed; - // Show a message - GUI::MessageBox* myMsg{nullptr}; + // Show a message + GUI::MessageBox* myMsg{nullptr}; -private: - // Following constructors and assignment operators not supported - MessageDialog() = delete; - MessageDialog(const MessageDialog&) = delete; - MessageDialog(MessageDialog&&) = delete; - MessageDialog& operator=(const MessageDialog&) = delete; - MessageDialog& operator=(MessageDialog&&) = delete; + private: + // Following constructors and assignment operators not supported + MessageDialog() = delete; + MessageDialog(const MessageDialog&) = delete; + MessageDialog(MessageDialog&&) = delete; + MessageDialog& operator=(const MessageDialog&) = delete; + MessageDialog& operator=(MessageDialog&&) = delete; }; #endif diff --git a/src/gui/OptionsDialog.cxx b/src/gui/OptionsDialog.cxx index 865103822..b2dc3b083 100644 --- a/src/gui/OptionsDialog.cxx +++ b/src/gui/OptionsDialog.cxx @@ -49,8 +49,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent, GuiObject* boss, int max_w, int max_h, Menu::AppMode mode) : Dialog(osystem, parent, osystem.frameBuffer().font(), "Options"), - myBoss(boss), - myMode(mode) + myBoss{boss}, + myMode{mode} { // do not show basic settings options in debugger bool minSettings = osystem.settings().getBool("minimal_ui") && mode != Menu::AppMode::debugger; diff --git a/src/gui/OptionsDialog.hxx b/src/gui/OptionsDialog.hxx index bd13c3f37..ea0f38935 100644 --- a/src/gui/OptionsDialog.hxx +++ b/src/gui/OptionsDialog.hxx @@ -71,7 +71,7 @@ class OptionsDialog : public Dialog ButtonWidget* myGameInfoButton{nullptr}; ButtonWidget* myCheatCodeButton{nullptr}; - GuiObject* myBoss; + GuiObject* myBoss{nullptr}; // Indicates if this dialog is used for global (vs. in-game) settings Menu::AppMode myMode{Menu::AppMode::emulator}; diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx index ab9560ed8..762ce3bf8 100644 --- a/src/gui/PopUpWidget.cxx +++ b/src/gui/PopUpWidget.cxx @@ -29,8 +29,8 @@ PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const VariantList& list, const string& label, int labelWidth, int cmd) : EditableWidget(boss, font, x, y - 1, w, h + 2), - _label(label), - _labelWidth(labelWidth) + _label{label}, + _labelWidth{labelWidth} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS | Widget::FLAG_TRACK_MOUSE; diff --git a/src/gui/ProgressDialog.cxx b/src/gui/ProgressDialog.cxx index 80aafc8c4..235e24f6c 100644 --- a/src/gui/ProgressDialog.cxx +++ b/src/gui/ProgressDialog.cxx @@ -30,7 +30,7 @@ ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font, const string& message) : Dialog(boss->instance(), boss->parent()), - myFont(font) + myFont{font} { const int fontWidth = font.getMaxCharWidth(), fontHeight = font.getFontHeight(), diff --git a/src/gui/QuadTariDialog.cxx b/src/gui/QuadTariDialog.cxx index b4d1891ef..4b0ef8ead 100644 --- a/src/gui/QuadTariDialog.cxx +++ b/src/gui/QuadTariDialog.cxx @@ -29,7 +29,7 @@ QuadTariDialog::QuadTariDialog(GuiObject* boss, const GUI::Font& font, int max_w, int max_h, Properties& properties) : Dialog(boss->instance(), boss->parent(), font, "QuadTari controllers", 0, 0, max_w, max_h), - myGameProperties(properties) + myGameProperties{properties} { const int lineHeight = font.getLineHeight(), fontHeight = font.getFontHeight(), diff --git a/src/gui/RadioButtonWidget.cxx b/src/gui/RadioButtonWidget.cxx index 658859b97..7c3b8b16d 100644 --- a/src/gui/RadioButtonWidget.cxx +++ b/src/gui/RadioButtonWidget.cxx @@ -221,8 +221,8 @@ RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font, int x, int y, const string& label, RadioButtonGroup* group, int cmd) : CheckboxWidget(boss, font, x, y, label, cmd), - myGroup(group), - _buttonSize(buttonSize(font)) // 14 | 22 + myGroup{group}, + _buttonSize{buttonSize(font)} // 14 | 22 { _flags = Widget::FLAG_ENABLED; _bgcolor = _bgcolorhi = kWidColor; diff --git a/src/gui/RadioButtonWidget.hxx b/src/gui/RadioButtonWidget.hxx index 8003a8627..52a81bb99 100644 --- a/src/gui/RadioButtonWidget.hxx +++ b/src/gui/RadioButtonWidget.hxx @@ -40,7 +40,7 @@ class RadioButtonWidget : public CheckboxWidget protected: void setFill(FillType type); void drawWidget(bool hilite) override; - static int buttonSize(const GUI::Font& font) + static uInt32 buttonSize(const GUI::Font& font) { return font.getFontHeight() < 24 ? 14 : 22; // box is square } diff --git a/src/gui/RomAuditDialog.cxx b/src/gui/RomAuditDialog.cxx index a95e4fce5..65b4d0c33 100644 --- a/src/gui/RomAuditDialog.cxx +++ b/src/gui/RomAuditDialog.cxx @@ -37,9 +37,9 @@ RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, int max_w, int max_h) : Dialog(osystem, parent, font, "Audit ROMs"), - myFont(font), - myMaxWidth(max_w), - myMaxHeight(max_h) + myFont{font}, + myMaxWidth{max_w}, + myMaxHeight{max_h} { const int lineHeight = font.getLineHeight(), fontWidth = font.getMaxCharWidth(), diff --git a/src/gui/RomInfoWidget.cxx b/src/gui/RomInfoWidget.cxx index 4cf7f4d33..11eddc6e5 100644 --- a/src/gui/RomInfoWidget.cxx +++ b/src/gui/RomInfoWidget.cxx @@ -37,7 +37,7 @@ RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const Common::Size& imgSize) : Widget(boss, font, x, y, w, h), - myAvail(imgSize) + myAvail{imgSize} { _flags = Widget::FLAG_ENABLED; _bgcolor = kDlgColor; diff --git a/src/gui/SnapshotDialog.cxx b/src/gui/SnapshotDialog.cxx index 792d7af7f..80af8ec1d 100644 --- a/src/gui/SnapshotDialog.cxx +++ b/src/gui/SnapshotDialog.cxx @@ -29,7 +29,7 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, int max_w, int max_h) : Dialog(osystem, parent, font, "Snapshot settings"), - myFont(font) + myFont{font} { const int lineHeight = font.getLineHeight(), fontHeight = _font.getFontHeight(), diff --git a/src/gui/StellaSettingsDialog.cxx b/src/gui/StellaSettingsDialog.cxx index 06ff03b3e..5236735f0 100644 --- a/src/gui/StellaSettingsDialog.cxx +++ b/src/gui/StellaSettingsDialog.cxx @@ -32,7 +32,7 @@ StellaSettingsDialog::StellaSettingsDialog(OSystem& osystem, DialogContainer& parent, int max_w, int max_h, Menu::AppMode mode) : Dialog(osystem, parent, osystem.frameBuffer().font(), "Basic settings"), - myMode(mode) + myMode{mode} { const int buttonHeight = _font.getLineHeight() + _font.getLineHeight() / 5, lineHeight = _font.getLineHeight(), diff --git a/src/gui/StringListWidget.cxx b/src/gui/StringListWidget.cxx index b94d1b5c4..5371947c5 100644 --- a/src/gui/StringListWidget.cxx +++ b/src/gui/StringListWidget.cxx @@ -27,7 +27,7 @@ StringListWidget::StringListWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, bool hilite, bool useScrollbar) : ListWidget(boss, font, x, y, w, h, useScrollbar), - _hilite(hilite) + _hilite{hilite} { _bgcolorlo = kDlgColor; diff --git a/src/gui/TabWidget.hxx b/src/gui/TabWidget.hxx index d2ca4305c..fa33c06c1 100644 --- a/src/gui/TabWidget.hxx +++ b/src/gui/TabWidget.hxx @@ -83,7 +83,7 @@ class TabWidget : public Widget, public CommandSender explicit Tab(const string& t, int tw = NO_WIDTH, Widget* first = nullptr, Widget* parent = nullptr, bool e = true) - : title(t), firstWidget(first), parentWidget(parent), enabled(e), tabWidth(tw) { } + : title{t}, firstWidget{first}, parentWidget{parent}, enabled{e}, tabWidth{tw} { } }; using TabList = vector; diff --git a/src/gui/TimeLineWidget.cxx b/src/gui/TimeLineWidget.cxx index 5f6e0e687..3018bb40c 100644 --- a/src/gui/TimeLineWidget.cxx +++ b/src/gui/TimeLineWidget.cxx @@ -33,7 +33,7 @@ TimeLineWidget::TimeLineWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& label, uInt32 labelWidth, int cmd) : ButtonWidget(boss, font, x, y, w, h, label, cmd), - _labelWidth(labelWidth) + _labelWidth{labelWidth} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE | Widget::FLAG_CLEARBG | Widget::FLAG_NOBG; @@ -205,13 +205,13 @@ void TimeLineWidget::drawWidget(bool hilite) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt32 TimeLineWidget::valueToPos(uInt32 value) +uInt32 TimeLineWidget::valueToPos(uInt32 value) const { return _stepValue[BSPF::clamp(value, _valueMin, _valueMax)]; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt32 TimeLineWidget::posToValue(uInt32 pos) +uInt32 TimeLineWidget::posToValue(uInt32 pos) const { // Find the interval in which 'pos' falls, and then the endpoint which // it is closest to diff --git a/src/gui/TimeLineWidget.hxx b/src/gui/TimeLineWidget.hxx index 5518fac20..e0cdd8980 100644 --- a/src/gui/TimeLineWidget.hxx +++ b/src/gui/TimeLineWidget.hxx @@ -49,8 +49,8 @@ class TimeLineWidget : public ButtonWidget void drawWidget(bool hilite) override; - uInt32 valueToPos(uInt32 value); - uInt32 posToValue(uInt32 pos); + uInt32 valueToPos(uInt32 value) const; + uInt32 posToValue(uInt32 pos) const; protected: uInt32 _value{0}; diff --git a/src/gui/TimeMachine.cxx b/src/gui/TimeMachine.cxx index 1dad57152..033aed076 100644 --- a/src/gui/TimeMachine.cxx +++ b/src/gui/TimeMachine.cxx @@ -23,7 +23,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TimeMachine::TimeMachine(OSystem& osystem) : DialogContainer(osystem), - myWidth(FBMinimum::Width) + myWidth{FBMinimum::Width} { myBaseDialog = new TimeMachineDialog(myOSystem, *this, myWidth); } diff --git a/src/gui/TimeMachineDialog.cxx b/src/gui/TimeMachineDialog.cxx index 594ed5036..c0ca3d299 100644 --- a/src/gui/TimeMachineDialog.cxx +++ b/src/gui/TimeMachineDialog.cxx @@ -495,7 +495,7 @@ void TimeMachineDialog::initBar() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -string TimeMachineDialog::getTimeString(uInt64 cycles) +string TimeMachineDialog::getTimeString(uInt64 cycles) const { const Int32 scanlines = std::max(instance().console().tia().scanlinesLastFrame(), 240); const bool isNTSC = scanlines <= 287; diff --git a/src/gui/TimeMachineDialog.hxx b/src/gui/TimeMachineDialog.hxx index 1d15d6b15..b9fe118fd 100644 --- a/src/gui/TimeMachineDialog.hxx +++ b/src/gui/TimeMachineDialog.hxx @@ -33,7 +33,7 @@ class TimeMachineDialog : public Dialog /** set/get number of winds when entering the dialog */ void setEnterWinds(Int32 numWinds) { _enterWinds = numWinds; } - Int32 getEnterWinds() { return _enterWinds; } + Int32 getEnterWinds() const { return _enterWinds; } private: void loadConfig() override; @@ -48,7 +48,7 @@ class TimeMachineDialog : public Dialog void setPosition() override; /** convert cycles into time */ - string getTimeString(uInt64 cycles); + string getTimeString(uInt64 cycles) const; /** re/unwind and update display */ void handleWinds(Int32 numWinds = 0); /** toggle Time Machine mode */ diff --git a/src/gui/ToolTip.cxx b/src/gui/ToolTip.cxx index c2f7b7656..88e5915bd 100644 --- a/src/gui/ToolTip.cxx +++ b/src/gui/ToolTip.cxx @@ -27,7 +27,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ToolTip::ToolTip(Dialog& dialog, const GUI::Font& font) - : myDialog(dialog) + : myDialog{dialog} { myScale = myDialog.instance().frameBuffer().hidpiScaleFactor(); @@ -179,5 +179,5 @@ void ToolTip::show(const string& tip) void ToolTip::render() { if(myTipShown) - mySurface->render(); + mySurface->render(); } diff --git a/src/gui/UIDialog.cxx b/src/gui/UIDialog.cxx index 11a9e0308..beb6f576d 100644 --- a/src/gui/UIDialog.cxx +++ b/src/gui/UIDialog.cxx @@ -42,8 +42,8 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, GuiObject* boss, int max_w, int max_h) : Dialog(osystem, parent, font, "User interface settings"), CommandSender(boss), - myFont(font), - myIsGlobal(boss != nullptr) + myFont{font}, + myIsGlobal{boss != nullptr} { const GUI::Font& ifont = instance().frameBuffer().infoFont(); const int lineHeight = font.getLineHeight(), diff --git a/src/gui/UndoHandler.cxx b/src/gui/UndoHandler.cxx index f8eeb0c48..4246d2f7f 100644 --- a/src/gui/UndoHandler.cxx +++ b/src/gui/UndoHandler.cxx @@ -19,7 +19,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UndoHandler::UndoHandler(size_t size) - : mySize(size) + : mySize{size} { reset(); } diff --git a/src/gui/VideoAudioDialog.hxx b/src/gui/VideoAudioDialog.hxx index f0d376140..25a78baa5 100644 --- a/src/gui/VideoAudioDialog.hxx +++ b/src/gui/VideoAudioDialog.hxx @@ -66,7 +66,7 @@ class VideoAudioDialog : public Dialog void updateSettingsWithPreset(AudioSettings&); private: - TabWidget* myTab; + TabWidget* myTab{nullptr}; // General options PopUpWidget* myRenderer{nullptr}; diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 7f605a6ea..4e11b59ff 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -32,8 +32,8 @@ Widget::Widget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : GuiObject(boss->instance(), boss->parent(), boss->dialog(), x, y, w, h), - _boss(boss), - _font(font) + _boss{boss}, + _font{font} { // Insert into the widget list of the boss _next = _boss->_firstWidget; @@ -395,8 +395,8 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font, const string& text, TextAlign align, ColorId shadowColor) : Widget(boss, font, x, y, w, h), - _label(text), - _align(align) + _label{text}, + _align{align} { _flags = Widget::FLAG_ENABLED | FLAG_CLEARBG; @@ -464,8 +464,8 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font, const string& label, int cmd, bool repeat) : StaticTextWidget(boss, font, x, y, w, h, label, TextAlign::Center), CommandSender(boss), - _cmd(cmd), - _repeat(repeat) + _cmd{cmd}, + _repeat{repeat} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG; _bgcolor = kBtnColor; @@ -739,11 +739,11 @@ SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font, int valueLabelWidth, const string& valueUnit, int valueLabelGap, bool forceLabelSign) : ButtonWidget(boss, font, x, y, w, h, label, cmd), - _labelWidth(labelWidth), - _valueUnit(valueUnit), - _valueLabelGap(valueLabelGap), - _valueLabelWidth(valueLabelWidth), - _forceLabelSign(forceLabelSign) + _labelWidth{labelWidth}, + _valueUnit{valueUnit}, + _valueLabelGap{valueLabelGap}, + _valueLabelWidth{valueLabelWidth}, + _forceLabelSign{forceLabelSign} { _flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE | Widget::FLAG_CLEARBG; _bgcolor = kDlgColor; diff --git a/src/libretro/FBSurfaceLIBRETRO.hxx b/src/libretro/FBSurfaceLIBRETRO.hxx index 7578ca658..b00fea94d 100644 --- a/src/libretro/FBSurfaceLIBRETRO.hxx +++ b/src/libretro/FBSurfaceLIBRETRO.hxx @@ -64,7 +64,7 @@ class FBSurfaceLIBRETRO : public FBSurface void applyAttributes() override { } private: - uInt32 myWidth, myHeight; + uInt32 myWidth{0}, myHeight{0}; unique_ptr myPixelData; Common::Rect mySrcGUIR, myDstGUIR; diff --git a/src/libretro/StellaLIBRETRO.hxx b/src/libretro/StellaLIBRETRO.hxx index d4ae39c87..3b76a93e3 100644 --- a/src/libretro/StellaLIBRETRO.hxx +++ b/src/libretro/StellaLIBRETRO.hxx @@ -43,7 +43,7 @@ class StellaLIBRETRO StellaLIBRETRO(); public: - OSystemLIBRETRO& osystem() { return *myOSystem; } + OSystemLIBRETRO& osystem() const { return *myOSystem; } bool create(bool logging); void destroy(); diff --git a/src/unix/FSNodePOSIX.cxx b/src/unix/FSNodePOSIX.cxx index c49d7d1ce..1ef2b684b 100644 --- a/src/unix/FSNodePOSIX.cxx +++ b/src/unix/FSNodePOSIX.cxx @@ -25,8 +25,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FilesystemNodePOSIX::FilesystemNodePOSIX() - : _path(ROOT_DIR), - _displayName(_path) + : _path{ROOT_DIR}, + _displayName{_path} { } diff --git a/src/windows/FSNodeWINDOWS.cxx b/src/windows/FSNodeWINDOWS.cxx index 82182fe83..179476b27 100644 --- a/src/windows/FSNodeWINDOWS.cxx +++ b/src/windows/FSNodeWINDOWS.cxx @@ -175,7 +175,7 @@ FilesystemNodeWINDOWS::FilesystemNodeWINDOWS() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FilesystemNodeWINDOWS::FilesystemNodeWINDOWS(const string& p) - : _path(p.length() > 0 ? p : "~") // Default to home directory + : _path{p.length() > 0 ? p : "~"} // Default to home directory { // Expand '~' to the users 'home' directory if(_path[0] == '~')