From 058f9d7630adc300f2550dae2d5ed9ea874109f5 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sun, 17 May 2026 21:26:36 +0200 Subject: [PATCH] justificacio NOLINTs i neteja obsolet a Title::~Title --- source/game/gameplay/room.hpp | 3 ++- source/game/scenes/title.cpp | 2 +- source/game/ui/console_commands.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/game/gameplay/room.hpp b/source/game/gameplay/room.hpp index b4820e3..eb9706f 100644 --- a/source/game/gameplay/room.hpp +++ b/source/game/gameplay/room.hpp @@ -61,7 +61,8 @@ class Room { // Constructor y destructor Room(const std::string& room_path, std::shared_ptr data); - ~Room(); // NOLINT(modernize-use-equals-default, performance-trivially-destructible) + // NOLINTNEXTLINE(modernize-use-equals-default,performance-trivially-destructible) -- destructor definit al .cpp perquè la classe té unique_ptr a tipus forward-declared; no es pot fer = default ni eliminar a l'header sense incloure tots els headers transitivament. + ~Room(); // --- Funciones --- [[nodiscard]] auto getNumber() const -> const std::string& { return number_; } diff --git a/source/game/scenes/title.cpp b/source/game/scenes/title.cpp index f9b6c6d..492b0ec 100644 --- a/source/game/scenes/title.cpp +++ b/source/game/scenes/title.cpp @@ -47,7 +47,7 @@ Title::Title() } // Destructor -Title::~Title() { // NOLINT(modernize-use-equals-default) +Title::~Title() { title_surface_->resetSubPalette(); } diff --git a/source/game/ui/console_commands.cpp b/source/game/ui/console_commands.cpp index 788bce0..fbd7ba8 100644 --- a/source/game/ui/console_commands.cpp +++ b/source/game/ui/console_commands.cpp @@ -69,8 +69,10 @@ static auto applyPreset(const std::vector& args) -> std::string { if (COUNT == 0) { return "No " + SHADER_LABEL + " presets available"; } const auto PRESET_NAME = [&]() -> std::string { - const auto& name = IS_CRTPI ? presets_crtpi[static_cast(current_idx)].name // NOLINT(clang-analyzer-core.CallAndMessage) - : presets_postfx[static_cast(current_idx)].name; // NOLINT(clang-analyzer-core.CallAndMessage) + // NOLINTBEGIN(clang-analyzer-core.CallAndMessage) -- fals positiu: la guard de la línia 69 garanteix COUNT > 0, així que current_idx és sempre dins de rang. + const auto& name = IS_CRTPI ? presets_crtpi[static_cast(current_idx)].name + : presets_postfx[static_cast(current_idx)].name; + // NOLINTEND(clang-analyzer-core.CallAndMessage) return prettyName(name); };