summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-09-07 19:56:18 -0700
committerPatrick Venture <venture@google.com>2018-09-25 10:06:52 -0700
commit586d35b40ec6ac667f19bee3d0258b2cdd3824c2 (patch)
tree0c770a604b6cf0feef34142a9035fc986023a8b7
parent46470a38d0a3b8f29cd8efc4af8a76adcace524a (diff)
downloadphosphor-host-ipmid-586d35b40ec6ac667f19bee3d0258b2cdd3824c2.zip
phosphor-host-ipmid-586d35b40ec6ac667f19bee3d0258b2cdd3824c2.tar.gz
replaced c headers with cpp where applicable
Change-Id: I23a70eb540ccde5d2aba467426769feffb07b516 Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--apphandler.cpp2
-rw-r--r--chassishandler.cpp4
-rw-r--r--dcmihandler.cpp3
-rw-r--r--globalhandler.cpp1
-rw-r--r--groupext.cpp2
-rw-r--r--ipmid.cpp3
-rw-r--r--ipmisensor.cpp3
-rw-r--r--sensordatahandler.hpp9
-rw-r--r--sensorhandler.cpp12
-rw-r--r--storageaddsel.cpp1
-rw-r--r--systemintfcmds.cpp1
-rw-r--r--testaddsel.cpp1
-rw-r--r--transporthandler.cpp7
13 files changed, 13 insertions, 36 deletions
diff --git a/apphandler.cpp b/apphandler.cpp
index c77f014..f3a1164 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -12,8 +12,6 @@
#include <host-ipmid/ipmid-api.h>
#include <limits.h>
#include <mapper.h>
-#include <stdint.h>
-#include <stdio.h>
#include <systemd/sd-bus.h>
#include <unistd.h>
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 5e86f17..80f4402 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -13,10 +13,6 @@
#include <limits.h>
#include <mapper.h>
#include <netinet/in.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <array>
#include <chrono>
diff --git a/dcmihandler.cpp b/dcmihandler.cpp
index 5f13ea2..d01787e 100644
--- a/dcmihandler.cpp
+++ b/dcmihandler.cpp
@@ -6,9 +6,6 @@
#include "utils.hpp"
#include <host-ipmid/ipmid-api.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
#include <bitset>
#include <cmath>
diff --git a/globalhandler.cpp b/globalhandler.cpp
index 61a2a80..f329fa9 100644
--- a/globalhandler.cpp
+++ b/globalhandler.cpp
@@ -3,7 +3,6 @@
#include "utils.hpp"
#include <host-ipmid/ipmid-api.h>
-#include <stdio.h>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
diff --git a/groupext.cpp b/groupext.cpp
index 616f366..c69d910 100644
--- a/groupext.cpp
+++ b/groupext.cpp
@@ -1,8 +1,6 @@
#include "ipmid.hpp"
#include <host-ipmid/ipmid-api.h>
-#include <stdint.h>
-#include <stdio.h>
#define GRPEXT_GET_GROUP_CMD 0
void register_netfn_groupext_functions() __attribute__((constructor));
diff --git a/ipmid.cpp b/ipmid.cpp
index c867e3c..207a5cf 100644
--- a/ipmid.cpp
+++ b/ipmid.cpp
@@ -11,9 +11,6 @@
#include <dlfcn.h>
#include <errno.h>
#include <mapper.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/time.h>
#include <systemd/sd-bus.h>
#include <unistd.h>
diff --git a/ipmisensor.cpp b/ipmisensor.cpp
index de8b844..8891cdb 100644
--- a/ipmisensor.cpp
+++ b/ipmisensor.cpp
@@ -1,9 +1,6 @@
#include "sensorhandler.hpp"
#include <malloc.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
extern uint8_t find_type_for_sensor_number(uint8_t);
diff --git a/sensordatahandler.hpp b/sensordatahandler.hpp
index 771303d..bcb55ff 100644
--- a/sensordatahandler.hpp
+++ b/sensordatahandler.hpp
@@ -5,7 +5,8 @@
#include "utils.hpp"
#include <host-ipmid/ipmid-api.h>
-#include <math.h>
+
+#include <cmath>
namespace ipmi
{
@@ -193,8 +194,8 @@ GetSensorResponse readingData(const Info& sensorInfo)
sensorInfo.propertyInterfaces.begin()->first,
sensorInfo.propertyInterfaces.begin()->second.begin()->first);
- double value =
- propValue.get<T>() * pow(10, sensorInfo.scale - sensorInfo.exponentR);
+ double value = propValue.get<T>() *
+ std::pow(10, sensorInfo.scale - sensorInfo.exponentR);
auto rawData = static_cast<uint8_t>((value - sensorInfo.scaledOffset) /
sensorInfo.coefficientM);
@@ -267,7 +268,7 @@ ipmi_ret_t readingData(const SetSensorReadingReq& cmdData,
T raw_value =
(sensorInfo.coefficientM * cmdData.reading) + sensorInfo.scaledOffset;
- raw_value *= pow(10, sensorInfo.exponentR - sensorInfo.scale);
+ raw_value *= std::pow(10, sensorInfo.exponentR - sensorInfo.scale);
auto msg =
makeDbusMsg("org.freedesktop.DBus.Properties", sensorInfo.sensorPath,
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 80f7c4b..369a1a7 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -7,12 +7,10 @@
#include <host-ipmid/ipmid-api.h>
#include <mapper.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
#include <systemd/sd-bus.h>
#include <bitset>
+#include <cmath>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <set>
@@ -455,7 +453,7 @@ void getSensorThresholds(uint8_t sensorNum,
if (warnLow != 0)
{
- warnLow *= pow(10, info.scale - info.exponentR);
+ warnLow *= std::pow(10, info.scale - info.exponentR);
response->lowerNonCritical = static_cast<uint8_t>(
(warnLow - info.scaledOffset) / info.coefficientM);
response->validMask |= static_cast<uint8_t>(
@@ -464,7 +462,7 @@ void getSensorThresholds(uint8_t sensorNum,
if (warnHigh != 0)
{
- warnHigh *= pow(10, info.scale - info.exponentR);
+ warnHigh *= std::pow(10, info.scale - info.exponentR);
response->upperNonCritical = static_cast<uint8_t>(
(warnHigh - info.scaledOffset) / info.coefficientM);
response->validMask |= static_cast<uint8_t>(
@@ -480,7 +478,7 @@ void getSensorThresholds(uint8_t sensorNum,
if (critLow != 0)
{
- critLow *= pow(10, info.scale - info.exponentR);
+ critLow *= std::pow(10, info.scale - info.exponentR);
response->lowerCritical = static_cast<uint8_t>(
(critLow - info.scaledOffset) / info.coefficientM);
response->validMask |= static_cast<uint8_t>(
@@ -489,7 +487,7 @@ void getSensorThresholds(uint8_t sensorNum,
if (critHigh != 0)
{
- critHigh *= pow(10, info.scale - info.exponentR);
+ critHigh *= std::pow(10, info.scale - info.exponentR);
response->upperCritical = static_cast<uint8_t>(
(critHigh - info.scaledOffset) / info.coefficientM);
response->validMask |= static_cast<uint8_t>(
diff --git a/storageaddsel.cpp b/storageaddsel.cpp
index 9213481..8a0dce5 100644
--- a/storageaddsel.cpp
+++ b/storageaddsel.cpp
@@ -6,7 +6,6 @@
#include <host-ipmid/ipmid-api.h>
#include <mapper.h>
-#include <stdint.h>
#include <systemd/sd-bus.h>
#include <algorithm>
diff --git a/systemintfcmds.cpp b/systemintfcmds.cpp
index af646d1..5f5ac03 100644
--- a/systemintfcmds.cpp
+++ b/systemintfcmds.cpp
@@ -7,7 +7,6 @@
#include <host-ipmid/ipmid-api.h>
#include <mapper.h>
-#include <stdio.h>
#include <host-ipmid/ipmid-host-cmd.hpp>
diff --git a/testaddsel.cpp b/testaddsel.cpp
index e44ecb7..424ecdd 100644
--- a/testaddsel.cpp
+++ b/testaddsel.cpp
@@ -4,7 +4,6 @@
#include <limits.h>
#include <mapper.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
#include <systemd/sd-bus.h>
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 92ada92..217468d 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -1,11 +1,11 @@
+#include "transporthandler.hpp"
+
#include <arpa/inet.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
#include <chrono>
#include <fstream>
#include <string>
+
#if __has_include(<filesystem>)
#include <filesystem>
#elif __has_include(<experimental/filesystem>)
@@ -23,7 +23,6 @@ namespace filesystem = std::experimental::filesystem;
#include "ipmid.hpp"
#include "net.hpp"
#include "timer.hpp"
-#include "transporthandler.hpp"
#include "utils.hpp"
#include <host-ipmid/ipmid-api.h>
OpenPOWER on IntegriCloud