diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-07-10 02:24:22 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-10-11 02:25:26 +0300 |
commit | 271584ab78b4c1926f766aa26ddfde7da329059f (patch) | |
tree | 08001912ea542de88b9c31f5d53f195dedd56988 /redfish-core/lib/update_service.hpp | |
parent | 70ee8cbd4f3ec5b3e3c18967de221a9f3a70cd38 (diff) | |
download | bmcweb-271584ab78b4c1926f766aa26ddfde7da329059f.tar.xz |
Fix a bunch of warnings
using the list of warnings from here:
https://github.com/lefticus/cppbestpractices/blob/e73393f25a85f83fed7399d8b65cb117d00b2231/02-Use_the_Tools_Available.md#L100
Seems like a good place to start, and would improve things a bit
type-wise. This patchset attempts to correct all the issues in one
shot.
Tested:
It builds. Will test various subsystems that have been touched
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Change-Id: I588c26440e5a97f718a0f0ea74cc84107d53aa1e
Diffstat (limited to 'redfish-core/lib/update_service.hpp')
-rw-r--r-- | redfish-core/lib/update_service.hpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp index a3d7196162..da88271985 100644 --- a/redfish-core/lib/update_service.hpp +++ b/redfish-core/lib/update_service.hpp @@ -29,7 +29,7 @@ static std::unique_ptr<sdbusplus::bus::match::match> fwUpdateMatcher; // Only allow one update at a time static bool fwUpdateInProgress = false; // Timer for software available -static std::unique_ptr<boost::asio::deadline_timer> fwAvailableTimer; +static std::unique_ptr<boost::asio::steady_timer> fwAvailableTimer; static void cleanUp() { @@ -148,10 +148,9 @@ static void monitorForSoftwareAvailable(std::shared_ptr<AsyncResp> asyncResp, } fwAvailableTimer = - std::make_unique<boost::asio::deadline_timer>(*req.ioService); + std::make_unique<boost::asio::steady_timer>(*req.ioService); - fwAvailableTimer->expires_from_now( - boost::posix_time::seconds(timeoutTimeSeconds)); + fwAvailableTimer->expires_after(std::chrono::seconds(timeoutTimeSeconds)); fwAvailableTimer->async_wait( [asyncResp](const boost::system::error_code &ec) { @@ -485,10 +484,6 @@ class SoftwareInventoryCollection : public Node for (auto &obj : subtree) { - const std::vector< - std::pair<std::string, std::vector<std::string>>> - &connections = obj.second; - // if can't parse fw id then return std::size_t idPos; if ((idPos = obj.first.rfind("/")) == std::string::npos) @@ -511,7 +506,8 @@ class SoftwareInventoryCollection : public Node }, "xyz.openbmc_project.ObjectMapper", "/xyz/openbmc_project/object_mapper", - "xyz.openbmc_project.ObjectMapper", "GetSubTree", "/", int32_t(0), + "xyz.openbmc_project.ObjectMapper", "GetSubTree", "/", + static_cast<int32_t>(0), std::array<const char *, 1>{ "xyz.openbmc_project.Software.Version"}); } @@ -719,7 +715,8 @@ class SoftwareInventory : public Node }, "xyz.openbmc_project.ObjectMapper", "/xyz/openbmc_project/object_mapper", - "xyz.openbmc_project.ObjectMapper", "GetSubTree", "/", int32_t(0), + "xyz.openbmc_project.ObjectMapper", "GetSubTree", "/", + static_cast<int32_t>(0), std::array<const char *, 1>{ "xyz.openbmc_project.Software.Version"}); } |