diff mbox

resolve error for overloaded function call

Message ID 1382352925-19974-1-git-send-email-sanjay.rawat@linaro.org
State New
Headers show

Commit Message

Sanjay Singh Rawat Oct. 21, 2013, 10:55 a.m. UTC
- for android receiving compilation error
rapl_interface.cpp:195:40: error: call of overloaded 'pow(int, uint64_t)' is ambiguous

include/math.h:222:8: note: double pow(double, double).
stlport/stlport/stl/_cmath.h:453:24: note: float pow(float, float)

Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org>
---
 src/cpu/rapl/rapl_interface.cpp |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/src/cpu/rapl/rapl_interface.cpp b/src/cpu/rapl/rapl_interface.cpp
index 8f236eb..6dd7b26 100644
--- a/src/cpu/rapl/rapl_interface.cpp
+++ b/src/cpu/rapl/rapl_interface.cpp
@@ -192,7 +192,7 @@  double c_rapl_interface::get_power_unit()
 		return ret;
 	}
 
-	return (double) 1/pow(2, value & 0xf);
+	return (double) 1/pow((double)2, (double)(value & 0xf));
 }
 
 double c_rapl_interface::get_energy_status_unit()
@@ -206,7 +206,7 @@  double c_rapl_interface::get_energy_status_unit()
 		return ret;
 	}
 
-	return (double)1/ pow(2, (value & 0x1f00) >> 8);
+	return (double)1/ pow((double)2, (double)((value & 0x1f00) >> 8));
 }
 
 double c_rapl_interface::get_time_unit()
@@ -220,7 +220,7 @@  double c_rapl_interface::get_time_unit()
 		return ret;
 	}
 
-	return (double)1 / pow(2, (value & 0xf0000) >> 16);
+	return (double)1 / pow((double)2, (double)((value & 0xf0000) >> 16));
 }
 
 int c_rapl_interface::get_pkg_energy_status(double *status)