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.
This commit is contained in:
Lioncash
2021-05-16 01:46:30 -04:00
parent 06c410ee88
commit 9a07ed53eb
99 changed files with 304 additions and 279 deletions

View File

@ -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));
}

View File

@ -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<std::shared_ptr<Layer>> layers;