Enable cppcoreguidelines-init-variables
We try to enforce this rule, but clearly the robot can do a better job.
Enable the rule, and for init of all variables that clang-tidy finds in
error.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Icf64bc51b3180de29f7e92fa5c5f636e6b1462a6
diff --git a/include/ExitAirTempSensor.hpp b/include/ExitAirTempSensor.hpp
index 55da203..2008291 100644
--- a/include/ExitAirTempSensor.hpp
+++ b/include/ExitAirTempSensor.hpp
@@ -13,11 +13,11 @@
struct CFMSensor : public Sensor, std::enable_shared_from_this<CFMSensor>
{
std::vector<std::string> tachs;
- double c1;
- double c2;
- double maxCFM;
- double tachMinPercent;
- double tachMaxPercent;
+ double c1 = 0.0;
+ double c2 = 0.0;
+ double maxCFM = 0.0;
+ double tachMinPercent = 0.0;
+ double tachMaxPercent = 0.0;
std::shared_ptr<ExitAirTempSensor> parent;
@@ -51,13 +51,13 @@
std::enable_shared_from_this<ExitAirTempSensor>
{
- double powerFactorMin;
- double powerFactorMax;
- double qMin;
- double qMax;
- double alphaS;
- double alphaF;
- double pOffset = 0;
+ double powerFactorMin = 0.0;
+ double powerFactorMax = 0.0;
+ double qMin = 0.0;
+ double qMax = 0.0;
+ double alphaS = 0.0;
+ double alphaF = 0.0;
+ double pOffset = 0.0;
ExitAirTempSensor(std::shared_ptr<sdbusplus::asio::connection>& conn,
const std::string& name,
@@ -71,7 +71,7 @@
void setupMatches(void);
private:
- double lastReading;
+ double lastReading = 0.0;
std::vector<sdbusplus::bus::match::match> matches;
double inletTemp = std::numeric_limits<double>::quiet_NaN();