fix cppcheck warning
- Fix warnings:
[noExplicitConstructor]
ipmi/manualcmds.hpp:20:5: style: Class 'ZoneControlIpmiHandler' has a
constructor with 1 argument that is not explicit.
[redundantInitialization]
dbus/dbusutil.cpp:96:15: style: Redundant initialization for 'layer'.
The initialized value is overwritten before it is read.
[uninitMemberVar]
pid/pidcontroller.hpp:23:5: warning: Member variable
'PIDController::_pid_info' is not initialized in the constructor.
[memsetClassFloat]
pid/util.cpp:29:10: portability: Using memset() on struct which
contains a floating point number.
[constParameter]
ipmi/manualcmds.cpp:108:72: style: Parameter 'dataLen' can be
declared as pointer to const
Signed-off-by: Harvey Wu <Harvey.Wu@quantatw.com>
Change-Id: Ib368c6e3a609e446529573cd0b9fa03858232db1
diff --git a/ipmi/manualcmds.hpp b/ipmi/manualcmds.hpp
index 4e11662..057ffc9 100644
--- a/ipmi/manualcmds.hpp
+++ b/ipmi/manualcmds.hpp
@@ -17,7 +17,8 @@
class ZoneControlIpmiHandler
{
public:
- ZoneControlIpmiHandler(std::unique_ptr<ZoneControlInterface> control) :
+ explicit ZoneControlIpmiHandler(
+ std::unique_ptr<ZoneControlInterface> control) :
_control(std::move(control))
{}
@@ -28,7 +29,7 @@
size_t* dataLen);
ipmi_ret_t setManualModeState(const uint8_t* reqBuf, uint8_t* replyBuf,
- size_t* dataLen);
+ const size_t* dataLen);
private:
std::unique_ptr<ZoneControlInterface> _control;