replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / service / resource-container / examples / BMISensorBundle / src / BMISensor.cpp
index 6bf73e1..53e96cf 100644 (file)
@@ -52,7 +52,7 @@ BMISensor::~BMISensor()
 int BMISensor::executeBMISensorLogic(std::map<std::string, std::string> *pInputData,
                                      std::string *pOutput)
 {
-    BMIResult result;
+    BMIResult result = ERROR;
 
     if (pInputData->find("weight") != pInputData->end())
     {
@@ -81,10 +81,12 @@ int BMISensor::executeBMISensorLogic(std::map<std::string, std::string> *pInputD
  */
 BMIResult BMISensor::makeBMI(void)
 {
-    double BMIvalue, timediffsecond;
-    double dWeight, dHeight;
+    double BMIvalue = 0.0;
+    double timediffsecond = 0.0;
+    double dWeight = 0.0;
+    double dHeight = 0.0;
 
-    int BMIResult;
+    int BMIResult = 0;
 
     if (!m_weight.empty() && !m_height.empty())
     {
@@ -147,4 +149,4 @@ BMIResult BMISensor::makeBMI(void)
     }
 
     return ERROR;
-}
\ No newline at end of file
+}