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>
diff --git a/ipmisensor.cpp b/ipmisensor.cpp
index 9e88987..5a629a8 100644
--- a/ipmisensor.cpp
+++ b/ipmisensor.cpp
@@ -249,12 +249,12 @@
{0xCA, 0x01, set_sensor_dbus_state_simple, "setValue", "Enabled", ""},
{0xFF, 0xFF, NULL, "", "", ""}};
-void reportSensorEventAssert(sensorRES_t* pRec, int index)
+void reportSensorEventAssert(const sensorRES_t* pRec, int index)
{
lookup_t* pTable = &g_ipmidbuslookup[index];
(*pTable->func)(pRec, pTable, pTable->assertion);
}
-void reportSensorEventDeassert(sensorRES_t* pRec, int index)
+void reportSensorEventDeassert(const sensorRES_t* pRec, int index)
{
lookup_t* pTable = &g_ipmidbuslookup[index];
(*pTable->func)(pRec, pTable, pTable->deassertion);
@@ -305,7 +305,7 @@
int updateSensorRecordFromSSRAESC(const void* record)
{
- sensorRES_t* pRec = (sensorRES_t*)record;
+ auto pRec = static_cast<const sensorRES_t*>(record);
uint8_t stype;
int index, i = 0;