From 9a07ed53ebe4e27ef1a14e0469037cab9fb7b1e7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 16 May 2021 01:46:30 -0400 Subject: core: Make variable shadowing a compile-time error Now that we have most of core free of shadowing, we can enable the warning as an error to catch anything that may be remaining and also eliminate this class of logic bug entirely. --- src/core/hle/service/vi/display/vi_display.cpp | 4 ++-- src/core/hle/service/vi/display/vi_display.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/vi/display') diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp index becbd36c1..0dd342dbf 100644 --- a/src/core/hle/service/vi/display/vi_display.cpp +++ b/src/core/hle/service/vi/display/vi_display.cpp @@ -17,8 +17,8 @@ namespace Service::VI { -Display::Display(u64 id, std::string name, Core::System& system) - : id{id}, name{std::move(name)}, vsync_event{system.Kernel()} { +Display::Display(u64 id, std::string name_, Core::System& system) + : display_id{id}, name{std::move(name_)}, vsync_event{system.Kernel()} { Kernel::KAutoObject::Create(std::addressof(vsync_event)); vsync_event.Initialize(fmt::format("Display VSync Event {}", id)); } diff --git a/src/core/hle/service/vi/display/vi_display.h b/src/core/hle/service/vi/display/vi_display.h index 388ce6083..166f2a4cc 100644 --- a/src/core/hle/service/vi/display/vi_display.h +++ b/src/core/hle/service/vi/display/vi_display.h @@ -32,14 +32,14 @@ public: /// Constructs a display with a given unique ID and name. /// /// @param id The unique ID for this display. - /// @param name The name for this display. + /// @param name_ The name for this display. /// - Display(u64 id, std::string name, Core::System& system); + Display(u64 id, std::string name_, Core::System& system); ~Display(); /// Gets the unique ID assigned to this display. u64 GetID() const { - return id; + return display_id; } /// Gets the name of this display @@ -96,7 +96,7 @@ public: const Layer* FindLayer(u64 layer_id) const; private: - u64 id; + u64 display_id; std::string name; std::vector> layers; -- cgit v1.2.3