Fix compilation warnings
Various small issues:
* Member initialization order
* Comparison of different signedness
* Unused parameters
* Unused variable
Change-Id: Ie59db239b4216ad089f7cf0f289e6ed3d6ac8e18
Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
diff --git a/include/mdrv2.hpp b/include/mdrv2.hpp
index e53545f..65890ed 100644
--- a/include/mdrv2.hpp
+++ b/include/mdrv2.hpp
@@ -75,7 +75,7 @@
boost::asio::io_context& io) :
sdbusplus::server::object_t<
sdbusplus::server::xyz::openbmc_project::smbios::MDRV2>(bus, path),
- bus(bus), timer(io), smbiosInterface(getObjectServer().add_interface(
+ timer(io), bus(bus), smbiosInterface(getObjectServer().add_interface(
smbiosPath, smbiosInterfaceName))
{
smbiosDir.agentVersion = smbiosAgentVersion;
@@ -143,9 +143,9 @@
inline uint8_t smbiosValidFlag(uint8_t index);
void systemInfoUpdate(void);
- int getTotalCpuSlot(void);
- int getTotalDimmSlot(void);
- int getTotalPcieSlot(void);
+ std::optional<size_t> getTotalCpuSlot(void);
+ std::optional<size_t> getTotalDimmSlot(void);
+ std::optional<size_t> getTotalPcieSlot(void);
std::vector<std::unique_ptr<Cpu>> cpus;
std::vector<std::unique_ptr<Dimm>> dimms;
std::vector<std::unique_ptr<Pcie>> pcies;
diff --git a/include/system.hpp b/include/system.hpp
index 992408e..4753a01 100644
--- a/include/system.hpp
+++ b/include/system.hpp
@@ -45,11 +45,10 @@
sdbusplus::server::object_t<
sdbusplus::server::xyz::openbmc_project::common::UUID>(
bus, objPath.c_str()),
- bus(bus),
sdbusplus::server::object_t<sdbusplus::server::xyz::openbmc_project::
inventory::decorator::Revision>(
bus, objPath.c_str()),
- path(objPath), storage(smbiosTableStorage)
+ bus(bus), path(objPath), storage(smbiosTableStorage)
{
std::string input = "0";
uuid(input);