diff options
| author | 2023-06-18 03:52:41 -0400 | |
|---|---|---|
| committer | 2023-07-21 10:56:55 -0400 | |
| commit | ee32b177823b9b8499c9fd188a571884f00cf655 (patch) | |
| tree | 32cf65e205a685672a109c4d4bd7edfd75353a34 /src/common | |
| parent | configure_graphics: Simplify UpdateAPILayout (diff) | |
| download | yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.tar.gz yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.tar.xz yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.zip | |
common,yuzu-qt: GCC warning silences
Fixes -Wshadow, -Wdeprecated, and catch by copy rather than by ref.
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/settings_common.h | 2 | ||||
| -rw-r--r-- | src/common/settings_setting.h | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/common/settings_common.h b/src/common/settings_common.h index 4d6d3021e..2b5c72f41 100644 --- a/src/common/settings_common.h +++ b/src/common/settings_common.h | |||
| @@ -178,7 +178,7 @@ public: | |||
| 178 | * | 178 | * |
| 179 | * @returns The setting's category | 179 | * @returns The setting's category |
| 180 | */ | 180 | */ |
| 181 | [[nodiscard]] Category Category() const; | 181 | [[nodiscard]] enum Category Category() const; |
| 182 | 182 | ||
| 183 | /** | 183 | /** |
| 184 | * Returns the label this setting was created with. | 184 | * Returns the label this setting was created with. |
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 @@ | |||
| 5 | 5 | ||
| 6 | #include <map> | 6 | #include <map> |
| 7 | #include <optional> | 7 | #include <optional> |
| 8 | #include <stdexcept> | ||
| 8 | #include <string> | 9 | #include <string> |
| 9 | #include <typeindex> | 10 | #include <typeindex> |
| 10 | #include <typeinfo> | 11 | #include <typeinfo> |
| @@ -169,7 +170,7 @@ public: | |||
| 169 | } else { | 170 | } else { |
| 170 | this->SetValue(static_cast<Type>(std::stoll(input))); | 171 | this->SetValue(static_cast<Type>(std::stoll(input))); |
| 171 | } | 172 | } |
| 172 | } catch (std::invalid_argument) { | 173 | } catch (std::invalid_argument& e) { |
| 173 | this->SetValue(this->GetDefault()); | 174 | this->SetValue(this->GetDefault()); |
| 174 | } | 175 | } |
| 175 | } | 176 | } |
| @@ -229,9 +230,10 @@ public: | |||
| 229 | * @param category_ Category of the setting AKA INI group | 230 | * @param category_ Category of the setting AKA INI group |
| 230 | */ | 231 | */ |
| 231 | explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name, | 232 | explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name, |
| 232 | Category category, bool save = true, bool runtime_modifiable = false) | 233 | Category category_, bool save_ = true, |
| 234 | bool runtime_modifiable_ = false) | ||
| 233 | requires(!ranged) | 235 | requires(!ranged) |
| 234 | : Setting<Type, false>{linkage, default_val, name, category, save, runtime_modifiable} { | 236 | : Setting<Type, false>{linkage, default_val, name, category_, save_, runtime_modifiable_} { |
| 235 | linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); | 237 | linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); |
| 236 | } | 238 | } |
| 237 | virtual ~SwitchableSetting() = default; | 239 | virtual ~SwitchableSetting() = default; |
| @@ -247,11 +249,11 @@ public: | |||
| 247 | * @param category_ Category of the setting AKA INI group | 249 | * @param category_ Category of the setting AKA INI group |
| 248 | */ | 250 | */ |
| 249 | explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val, | 251 | explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val, |
| 250 | const Type& max_val, const std::string& name, Category category, | 252 | const Type& max_val, const std::string& name, Category category_, |
| 251 | bool save = true, bool runtime_modifiable = false) | 253 | bool save_ = true, bool runtime_modifiable_ = false) |
| 252 | requires(ranged) | 254 | requires(ranged) |
| 253 | : Setting<Type, true>{linkage, default_val, min_val, max_val, | 255 | : Setting<Type, true>{linkage, default_val, min_val, max_val, |
| 254 | name, category, save, runtime_modifiable} { | 256 | name, category_, save_, runtime_modifiable_} { |
| 255 | linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); | 257 | linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); |
| 256 | } | 258 | } |
| 257 | 259 | ||