Static code analysis scan issue fix
Fix the issues found during code static scan
Tested:
build okay.
Change-Id: I3709cfad9ba343073566c33e8186eac89acaa26b
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
diff --git a/src/sensorcommands.cpp b/src/sensorcommands.cpp
index d84d8b1..bf1f430 100644
--- a/src/sensorcommands.cpp
+++ b/src/sensorcommands.cpp
@@ -364,8 +364,8 @@
auto &valueVariant = sensorObject->second["Value"];
double reading = variant_ns::visit(VariantToDoubleVisitor(), valueVariant);
- double max;
- double min;
+ double max = 0;
+ double min = 0;
getSensorMaxMin(sensorMap, max, min);
int16_t mValue = 0;
@@ -1263,11 +1263,11 @@
min = variant_ns::visit(VariantToDoubleVisitor(), minObject->second);
}
- int16_t mValue;
- int8_t rExp;
- int16_t bValue;
- int8_t bExp;
- bool bSigned;
+ int16_t mValue = 0;
+ int8_t rExp = 0;
+ int16_t bValue = 0;
+ int8_t bExp = 0;
+ bool bSigned = false;
if (!getSensorAttributes(max, min, mValue, rExp, bValue, bExp, bSigned))
{