From ffd57c94fa78bb2ced00dbc3d4611e16c34c2584 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 3 Apr 2022 17:00:40 +0100 Subject: [PATCH] Tidying --- src/DebugServer/Gdb/TargetDescriptor.hpp | 3 +++ src/DebugServer/ServerInterface.hpp | 5 +++++ src/Helpers/Paths.hpp | 8 ++++---- .../HexViewerWidget/ByteAddressContainer.cpp | 2 -- .../HexViewerWidget/ByteAddressItem.hpp | 6 +++--- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/DebugServer/Gdb/TargetDescriptor.hpp b/src/DebugServer/Gdb/TargetDescriptor.hpp index 75fac5a2..390a053e 100644 --- a/src/DebugServer/Gdb/TargetDescriptor.hpp +++ b/src/DebugServer/Gdb/TargetDescriptor.hpp @@ -11,6 +11,9 @@ namespace Bloom::DebugServer::Gdb { + /** + * GDB target descriptor. + */ struct TargetDescriptor { Targets::TargetDescriptor targetDescriptor; diff --git a/src/DebugServer/ServerInterface.hpp b/src/DebugServer/ServerInterface.hpp index b030e8a6..0921349c 100644 --- a/src/DebugServer/ServerInterface.hpp +++ b/src/DebugServer/ServerInterface.hpp @@ -4,6 +4,11 @@ namespace Bloom::DebugServer { + /** + * Every debug server must implement this interface. + * + * See documentation in src/DebugServer/README.md for more. + */ class ServerInterface { public: diff --git a/src/Helpers/Paths.hpp b/src/Helpers/Paths.hpp index a6c9156b..bf0cc3da 100644 --- a/src/Helpers/Paths.hpp +++ b/src/Helpers/Paths.hpp @@ -71,9 +71,9 @@ namespace Bloom */ static inline std::string compiledResourcesPath() { #ifdef BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE - return std::string(BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE); + return {BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE}; #else - return std::string(":/compiled"); + return {":/compiled"}; #endif } @@ -87,9 +87,9 @@ namespace Bloom */ static inline std::string homeDomainName() { #ifdef BLOOM_HOME_DOMAIN_NAME_OVERRIDE - return std::string(BLOOM_HOME_DOMAIN_NAME_OVERRIDE); + return {BLOOM_HOME_DOMAIN_NAME_OVERRIDE}; #else - return std::string("https://bloom.oscillate.io"); + return {"https://bloom.oscillate.io"}; #endif } }; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressContainer.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressContainer.cpp index 82b2ed72..495d33ce 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressContainer.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressContainer.cpp @@ -6,8 +6,6 @@ namespace Bloom::Widgets const std::map>& byteItemsByRowIndex ) { static constexpr int leftMargin = 10; - static const auto margins = QMargins(0, 10, 0, 0); - const auto newRowCount = byteItemsByRowIndex.size(); const auto layoutItemMaxIndex = static_cast(this->addressItemsByRowIndex.size() - 1); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressItem.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressItem.hpp index d5a6b523..aff7d55d 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressItem.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressItem.hpp @@ -15,17 +15,17 @@ namespace Bloom::Widgets static constexpr int WIDTH = 75; static constexpr int HEIGHT = ByteItem::HEIGHT; - ByteAddressItem(QGraphicsItem* parent): QGraphicsItem(parent) {}; + explicit ByteAddressItem(QGraphicsItem* parent): QGraphicsItem(parent) {}; void setAddressHex(const QString& address); [[nodiscard]] QRectF boundingRect() const override { - return QRectF( + return { 0, 0, ByteAddressItem::WIDTH, ByteAddressItem::HEIGHT - ); + }; } void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;