From 25e70570b5691b9ac65a3f0ef7ac94c63887c808 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 3 Mar 2017 14:06:14 -0500 Subject: [PATCH 1/2] NumericSettings: Initialize m_value to default_value in the constructor Ensures that all class state is initialized to valid values. --- .../Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp b/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp index 17a0fd11b1..a15dd13f2f 100644 --- a/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp +++ b/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.cpp @@ -9,7 +9,7 @@ namespace ControllerEmu NumericSetting::NumericSetting(const std::string& setting_name, const ControlState default_value, const u32 low, const u32 high, const SettingType setting_type) : m_type(setting_type), m_name(setting_name), m_default_value(default_value), m_low(low), - m_high(high) + m_high(high), m_value(default_value) { } From b592e4887ea638914d27215d4e6d3bd8df8b50ac Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 3 Mar 2017 14:08:33 -0500 Subject: [PATCH 2/2] BooleanSetting: Initialize m_value to default_value in the constructor Ensures all class state is initialized to valid values on construction. --- .../Core/InputCommon/ControllerEmu/Setting/BooleanSetting.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/InputCommon/ControllerEmu/Setting/BooleanSetting.cpp b/Source/Core/InputCommon/ControllerEmu/Setting/BooleanSetting.cpp index 2679ed46b1..b6e820b031 100644 --- a/Source/Core/InputCommon/ControllerEmu/Setting/BooleanSetting.cpp +++ b/Source/Core/InputCommon/ControllerEmu/Setting/BooleanSetting.cpp @@ -8,7 +8,8 @@ namespace ControllerEmu { BooleanSetting::BooleanSetting(const std::string& setting_name, const std::string& ui_name, const bool default_value, const SettingType setting_type) - : m_type(setting_type), m_name(setting_name), m_ui_name(ui_name), m_default_value(default_value) + : m_type(setting_type), m_name(setting_name), m_ui_name(ui_name), + m_default_value(default_value), m_value(default_value) { }