Fix some gcc warnings and style suggestions
Building against gcc-10 produced warnings and style suggestions.
Fixed all the warnings, but only select style suggestions due to
readability and others appeared to be compiler confusion.
Tested: Compiled
No functional impacts appear to have been made with these changes
Change-Id: I1adcce355b831ae8b178bfba9b89cc18fe4f3cf7
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/functor.hpp b/control/functor.hpp
index f631311..658c76a 100644
--- a/control/functor.hpp
+++ b/control/functor.hpp
@@ -87,7 +87,8 @@
Properties& operator=(const Properties&) = default;
Properties(Properties&&) = default;
Properties& operator=(Properties&&) = default;
- explicit Properties(U&& handler) : _handler(std::forward<U>(handler))
+ explicit Properties(U&& handler) :
+ _path(""), _intf(""), _prop(""), _handler(std::forward<U>(handler))
{}
Properties(const char* path, const char* intf, const char* prop,
U&& handler) :
@@ -404,10 +405,11 @@
void operator()(sdbusplus::bus::bus& bus, sdbusplus::message::message& msg,
Zone& zone) const
{
- std::string name;
- bool hasOwner = false;
if (msg)
{
+ std::string name;
+ bool hasOwner = false;
+
// Handle NameOwnerChanged signals
msg.read(name);