From ee32b177823b9b8499c9fd188a571884f00cf655 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Sun, 18 Jun 2023 03:52:41 -0400 Subject: common,yuzu-qt: GCC warning silences Fixes -Wshadow, -Wdeprecated, and catch by copy rather than by ref. --- src/common/settings_setting.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/common/settings_setting.h') diff --git a/src/common/settings_setting.h b/src/common/settings_setting.h index 658b6328d..f803e4e6e 100644 --- a/src/common/settings_setting.h +++ b/src/common/settings_setting.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -169,7 +170,7 @@ public: } else { this->SetValue(static_cast(std::stoll(input))); } - } catch (std::invalid_argument) { + } catch (std::invalid_argument& e) { this->SetValue(this->GetDefault()); } } @@ -229,9 +230,10 @@ public: * @param category_ Category of the setting AKA INI group */ explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name, - Category category, bool save = true, bool runtime_modifiable = false) + Category category_, bool save_ = true, + bool runtime_modifiable_ = false) requires(!ranged) - : Setting{linkage, default_val, name, category, save, runtime_modifiable} { + : Setting{linkage, default_val, name, category_, save_, runtime_modifiable_} { linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); } virtual ~SwitchableSetting() = default; @@ -247,11 +249,11 @@ public: * @param category_ Category of the setting AKA INI group */ explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val, - const Type& max_val, const std::string& name, Category category, - bool save = true, bool runtime_modifiable = false) + const Type& max_val, const std::string& name, Category category_, + bool save_ = true, bool runtime_modifiable_ = false) requires(ranged) : Setting{linkage, default_val, min_val, max_val, - name, category, save, runtime_modifiable} { + name, category_, save_, runtime_modifiable_} { linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); } -- cgit v1.2.3