From 7d07a9cf6c1fd60f654a27a5d29f5a0a7f1b1556 Mon Sep 17 00:00:00 2001 From: Nav Date: Tue, 6 Sep 2022 17:17:43 +0100 Subject: [PATCH] Tidying --- .../EDBG/AVR/EdbgAvr8Interface.cpp | 1 - .../EDBG/AVR/EdbgAvrIspInterface.hpp | 3 +- .../AVR8Generic/GetProgramCounter.hpp | 4 +- .../Events/DebugServerThreadStateChanged.hpp | 4 +- .../TargetControllerThreadStateChanged.hpp | 4 +- .../HexViewerWidget/AnnotationItem.cpp | 45 ++++++++++--------- .../HexViewerWidget/AnnotationItem.hpp | 3 +- .../Commands/SetTargetProgramCounter.hpp | 1 - src/Targets/TargetVariant.hpp | 4 +- 9 files changed, 38 insertions(+), 31 deletions(-) diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp index 53b4230d..796a65a1 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -1,6 +1,5 @@ #include "EdbgAvr8Interface.hpp" -#include #include #include diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvrIspInterface.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvrIspInterface.hpp index 43c36539..e45f67a9 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvrIspInterface.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvrIspInterface.hpp @@ -23,7 +23,8 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr { public: explicit EdbgAvrIspInterface(EdbgInterface& edbgInterface) - : edbgInterface(edbgInterface) {}; + : edbgInterface(edbgInterface) + {}; /** * The EdbgAvrIspInterface doesn't actually require any config from the user, at this point in time. So this diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AVR8Generic/GetProgramCounter.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AVR8Generic/GetProgramCounter.hpp index 5785914e..0a0690f9 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AVR8Generic/GetProgramCounter.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AVR8Generic/GetProgramCounter.hpp @@ -14,7 +14,9 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::ResponseFrame { public: GetProgramCounter() = default; - explicit GetProgramCounter(const std::vector& avrResponses): Avr8GenericResponseFrame(avrResponses) {} + explicit GetProgramCounter(const std::vector& avrResponses) + : Avr8GenericResponseFrame(avrResponses) + {} Targets::TargetProgramCounter extractProgramCounter() { /* diff --git a/src/EventManager/Events/DebugServerThreadStateChanged.hpp b/src/EventManager/Events/DebugServerThreadStateChanged.hpp index 31d91f97..0980e23e 100644 --- a/src/EventManager/Events/DebugServerThreadStateChanged.hpp +++ b/src/EventManager/Events/DebugServerThreadStateChanged.hpp @@ -13,7 +13,9 @@ namespace Bloom::Events static constexpr EventType type = EventType::DEBUG_SERVER_THREAD_STATE_CHANGED; static inline const std::string name = "DebugServerThreadStateChanged"; - explicit DebugServerThreadStateChanged(ThreadState state): state(state) {}; + explicit DebugServerThreadStateChanged(ThreadState state) + : state(state) + {}; [[nodiscard]] EventType getType() const override { return DebugServerThreadStateChanged::type; diff --git a/src/EventManager/Events/TargetControllerThreadStateChanged.hpp b/src/EventManager/Events/TargetControllerThreadStateChanged.hpp index eea7c373..10a62836 100644 --- a/src/EventManager/Events/TargetControllerThreadStateChanged.hpp +++ b/src/EventManager/Events/TargetControllerThreadStateChanged.hpp @@ -13,7 +13,9 @@ namespace Bloom::Events static constexpr EventType type = EventType::TARGET_CONTROLLER_THREAD_STATE_CHANGED; static inline const std::string name = "TargetControllerThreadStateChanged"; - explicit TargetControllerThreadStateChanged(ThreadState state): state(state) {}; + explicit TargetControllerThreadStateChanged(ThreadState state) + : state(state) + {}; [[nodiscard]] EventType getType() const override { return TargetControllerThreadStateChanged::type; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp index c594ef44..cd85ad18 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp @@ -11,16 +11,16 @@ namespace Bloom::Widgets Targets::TargetMemorySize size, QString labelText, AnnotationItemPosition position - ): - QGraphicsItem(nullptr), - startAddress(startAddress), - size(size), - endAddress(static_cast(startAddress + size - 1)), - labelText(std::move(labelText)), - position(position), - width(static_cast((ByteItem::WIDTH + ByteItem::RIGHT_MARGIN) * size - ByteItem::RIGHT_MARGIN)), - height(position == AnnotationItemPosition::TOP ? AnnotationItem::TOP_HEIGHT : AnnotationItem::BOTTOM_HEIGHT - ) { + ) + : QGraphicsItem(nullptr) + , startAddress(startAddress) + , size(size) + , endAddress(static_cast(startAddress + size - 1)) + , labelText(std::move(labelText)) + , position(position) + , width(static_cast((ByteItem::WIDTH + ByteItem::RIGHT_MARGIN) * size - ByteItem::RIGHT_MARGIN)) + , height(position == AnnotationItemPosition::TOP ? AnnotationItem::TOP_HEIGHT : AnnotationItem::BOTTOM_HEIGHT) + { this->setAcceptHoverEvents(true); this->setToolTip(this->labelText); } @@ -29,19 +29,22 @@ namespace Bloom::Widgets const Targets::TargetMemoryAddressRange& addressRange, const QString& labelText, AnnotationItemPosition position - ): AnnotationItem( - addressRange.startAddress, - addressRange.endAddress - addressRange.startAddress + 1, - labelText, - position - ) {} + ) + : AnnotationItem( + addressRange.startAddress, + addressRange.endAddress - addressRange.startAddress + 1, + labelText, + position + ) + {} AnnotationItem::AnnotationItem(const FocusedMemoryRegion& focusedMemoryRegion, AnnotationItemPosition position) - : AnnotationItem( - focusedMemoryRegion.addressRange, - focusedMemoryRegion.name, - position - ) {} + : AnnotationItem( + focusedMemoryRegion.addressRange, + focusedMemoryRegion.name, + position + ) + {} void AnnotationItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { auto lineColor = this->getLineColor(); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.hpp index b8cd9c3b..c4c9c96d 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.hpp @@ -37,8 +37,7 @@ namespace Bloom::Widgets ); AnnotationItem( - const Targets::TargetMemoryAddressRange& - addressRange, + const Targets::TargetMemoryAddressRange& addressRange, const QString& labelText, AnnotationItemPosition position ); diff --git a/src/TargetController/Commands/SetTargetProgramCounter.hpp b/src/TargetController/Commands/SetTargetProgramCounter.hpp index 1ab158df..4fedc972 100644 --- a/src/TargetController/Commands/SetTargetProgramCounter.hpp +++ b/src/TargetController/Commands/SetTargetProgramCounter.hpp @@ -4,7 +4,6 @@ #include "Command.hpp" -#include "src/Targets/TargetBreakpoint.hpp" #include "src/Targets/TargetMemory.hpp" namespace Bloom::TargetController::Commands diff --git a/src/Targets/TargetVariant.hpp b/src/Targets/TargetVariant.hpp index beae6195..62eb1ae1 100644 --- a/src/Targets/TargetVariant.hpp +++ b/src/Targets/TargetVariant.hpp @@ -1,14 +1,14 @@ #pragma once -#include #include +#include #include #include "TargetPinDescriptor.hpp" namespace Bloom::Targets { - enum class TargetPackage: int + enum class TargetPackage: std::uint8_t { UNKNOWN,