resource-container: Port to gcc6 using std namespaces
authorPhil Coval <philippe.coval@s-opensource.com>
Tue, 14 Jun 2016 21:43:37 +0000 (23:43 +0200)
committerZiran Sun <ziran.sun@samsung.com>
Wed, 15 Jun 2016 15:03:05 +0000 (15:03 +0000)
Bug: https://jira.iotivity.org/browse/IOT-1111
Change-Id: Ie64ae80bb5851a887dd6fd589f72c4e64198b227
Credit-to: Kevron Rees <tripzero.kev@gmail.com>
Signed-off-by: Phil Coval <philippe.coval@s-opensource.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8651
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
service/resource-container/examples/BMISensorBundle/src/BMISensor.cpp

index f56bc07..6bf73e1 100644 (file)
@@ -24,7 +24,8 @@
 #include "BMISensor.h"
 
 #include <iostream>
-#include <stdlib.h>
+#include <cmath>
+#include <cstdlib>
 #include "SysTimer.h"
 
 #ifdef __ANDROID__
@@ -90,7 +91,7 @@ BMIResult BMISensor::makeBMI(void)
         dWeight = std::stod(m_weight);
         dHeight = std::stod(m_height);
 
-        timediffsecond = abs(difftime(m_timepstampW, m_timepstampH));
+        timediffsecond = std::abs(difftime(m_timepstampW, m_timepstampH));
 
         // check if time difference between weight data and height data is valid
         if (timediffsecond > DIFFTIME)