summaryrefslogtreecommitdiffstats
path: root/storageaddsel.cpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-13 10:06:13 -0700
committerPatrick Venture <venture@google.com>2018-10-17 22:45:46 +0000
commitd99148b3a0e72775ec217ff4060e3021c50299c3 (patch)
tree56cd6ea977fdc7877d3beaf2c11b4a9e97898b0b /storageaddsel.cpp
parent4d1a5dd4a55b8886ce8fc7512578ba3438faf386 (diff)
downloadphosphor-host-ipmid-d99148b3a0e72775ec217ff4060e3021c50299c3.tar.gz
phosphor-host-ipmid-d99148b3a0e72775ec217ff4060e3021c50299c3.zip
cleanup: c-style casting
[ipmisensor.cpp:308]: (style) C-style pointer casting [sensorhandler.cpp:302]: (style) C-style pointer casting [sensorhandler.cpp:376]: (style) C-style pointer casting [sensorhandler.cpp:404]: (style) C-style pointer casting [sensorhandler.cpp:405]: (style) C-style pointer casting [storageaddsel.cpp:157]: (style) C-style pointer casting [storageaddsel.cpp:187]: (style) C-style pointer casting Added missing const in reportSensorEventAssert and reportSensorEventDeassert as the *pTable->func(...) take the const pointer and the casting then was using the proper const casting. Change-Id: I54a591b4e5e678b8ec3cae2633617a5f7aac7a66 Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'storageaddsel.cpp')
-rw-r--r--storageaddsel.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/storageaddsel.cpp b/storageaddsel.cpp
index 8a0dce5..41f813c 100644
--- a/storageaddsel.cpp
+++ b/storageaddsel.cpp
@@ -151,10 +151,9 @@ Entry::Level create_esel_severity(const uint8_t* buffer)
int create_esel_association(const uint8_t* buffer, std::string& inventoryPath)
{
- ipmi_add_sel_request_t* p;
uint8_t sensor;
- p = (ipmi_add_sel_request_t*)buffer;
+ auto p = reinterpret_cast<const ipmi_add_sel_request_t*>(buffer);
sensor = p->sensornumber;
@@ -179,12 +178,10 @@ int create_esel_association(const uint8_t* buffer, std::string& inventoryPath)
int create_esel_description(const uint8_t* buffer, Entry::Level level,
char** message)
{
-
- ipmi_add_sel_request_t* p;
char* m;
int r;
- p = (ipmi_add_sel_request_t*)buffer;
+ auto p = reinterpret_cast<const ipmi_add_sel_request_t*>(buffer);
find_sensor_type_string(p->sensornumber, &m);
OpenPOWER on IntegriCloud