diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx index f7b27af0c..729a8805d 100644 --- a/src/common/bspf.hxx +++ b/src/common/bspf.hxx @@ -83,7 +83,7 @@ using BoolArray = std::vector; using ByteArray = std::vector; using ShortArray = std::vector; using StringList = std::vector; -using ByteBuffer = std::unique_ptr; +using ByteBuffer = std::unique_ptr; // NOLINT // We use KB a lot; let's make a literal for it constexpr uInt32 operator "" _KB(unsigned long long size) diff --git a/src/emucore/tia/DelayQueue.hxx b/src/emucore/tia/DelayQueue.hxx index 5cf2dfb32..063e7c0d9 100644 --- a/src/emucore/tia/DelayQueue.hxx +++ b/src/emucore/tia/DelayQueue.hxx @@ -50,7 +50,7 @@ class DelayQueue : public Serializable bool load(Serializer& in) override; private: - DelayQueueMember myMembers[length]; + std::array, length> myMembers; uInt8 myIndex; std::array myIndices; diff --git a/src/gui/CheckListWidget.cxx b/src/gui/CheckListWidget.cxx index e8a4faf16..c8b46abcc 100644 --- a/src/gui/CheckListWidget.cxx +++ b/src/gui/CheckListWidget.cxx @@ -168,37 +168,29 @@ bool CheckListWidget::getState(int line) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool CheckListWidget::handleEvent(Event::Type e) { - switch(e) + if(e == Event::UISelect) { - case Event::UISelect: - // Simulate a mouse button click - _checkList[ListWidget::getSelected()]->handleMouseUp(0, 0, MouseButton::LEFT, 0); - return true; - - default: - return ListWidget::handleEvent(e); + // Simulate a mouse button click + _checkList[ListWidget::getSelected()]->handleMouseUp(0, 0, MouseButton::LEFT, 0); + return true; } + else + return ListWidget::handleEvent(e); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CheckListWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) { - switch(cmd) + if(cmd == CheckboxWidget::kCheckActionCmd) { - case CheckboxWidget::kCheckActionCmd: - { - // Figure out which line has been checked - int line = _currentPos + id; - _stateList[line] = bool(data); + // Figure out which line has been checked + int line = _currentPos + id; + _stateList[line] = bool(data); - // Let the boss know about it - sendCommand(CheckListWidget::kListItemChecked, line, _id); - break; - } - - default: - ListWidget::handleCommand(sender, cmd, data, id); - break; + // Let the boss know about it + sendCommand(CheckListWidget::kListItemChecked, line, _id); } + else + ListWidget::handleCommand(sender, cmd, data, id); } diff --git a/src/gui/CommandDialog.cxx b/src/gui/CommandDialog.cxx index 33f70dc2e..379c3668d 100644 --- a/src/gui/CommandDialog.cxx +++ b/src/gui/CommandDialog.cxx @@ -221,6 +221,9 @@ void CommandDialog::handleCommand(CommandSender* sender, int cmd, instance().eventHandler().leaveMenuMode(); instance().reloadConsole(); break; + + default: + return; } // Console commands should be performed right away, after leaving the menu diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx index 81d2d226a..8c88f85b2 100644 --- a/src/gui/ContextMenu.cxx +++ b/src/gui/ContextMenu.cxx @@ -521,7 +521,7 @@ void ContextMenu::scrollDown(int distance) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void ContextMenu::drawDialog() { - static constexpr uInt32 up_arrow[8] = { + static constexpr std::array up_arrow = { 0b00011000, 0b00011000, 0b00111100, @@ -531,7 +531,7 @@ void ContextMenu::drawDialog() 0b11111111, 0b11111111 }; - static constexpr uInt32 down_arrow[8] = { + static constexpr std::array down_arrow = { 0b11111111, 0b11111111, 0b01111110, @@ -559,7 +559,7 @@ void ContextMenu::drawDialog() if(_showScroll) { s.hLine(x, y+_rowHeight-1, w+2, kColor); - s.drawBitmap(up_arrow, ((_w-_x)>>1)-4, (_rowHeight>>1)+y-4, _scrollUpColor, 8); + s.drawBitmap(up_arrow.data(), ((_w-_x)>>1)-4, (_rowHeight>>1)+y-4, _scrollUpColor, 8); y += _rowHeight; offset--; } @@ -577,7 +577,7 @@ void ContextMenu::drawDialog() if(_showScroll) { s.hLine(x, y, w+2, kColor); - s.drawBitmap(down_arrow, ((_w-_x)>>1)-4, (_rowHeight>>1)+y-4, _scrollDnColor, 8); + s.drawBitmap(down_arrow.data(), ((_w-_x)>>1)-4, (_rowHeight>>1)+y-4, _scrollDnColor, 8); } setDirty();