From f8fe53e7114ab10c9059377541277739ace5c1ff Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Thu, 30 Jun 2022 15:55:45 -0700 Subject: Change variable scopes cppcheck correctly notes that a lot of our variables can be declared at more specific scopes, and in every case, it seems to be correct. Tested: Redfish service validator passes. Unit test coverage on others. Signed-off-by: Ed Tanous Change-Id: Ia4414410d0e8f74a3bd40fdc0e0232450d1a6416 --- include/dbus_monitor.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include/dbus_monitor.hpp') diff --git a/include/dbus_monitor.hpp b/include/dbus_monitor.hpp index 5f409d7d70..0838f0ae6c 100644 --- a/include/dbus_monitor.hpp +++ b/include/dbus_monitor.hpp @@ -167,9 +167,7 @@ inline void requestRoutes(App& app) // PropertiesChanged thisSession.matches.reserve(thisSession.matches.size() + paths->size() * (1U + interfaceCount)); - std::string objectManagerMatchString; - std::string propertiesMatchString; - std::string objectManagerInterfacesMatchString; + // These regexes derived on the rules here: // https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names std::regex validPath("^/([A-Za-z0-9_]+/?)*$"); @@ -192,7 +190,7 @@ inline void requestRoutes(App& app) conn.close(); return; } - propertiesMatchString = + std::string propertiesMatchString = ("type='signal'," "interface='org.freedesktop.DBus.Properties'," "path_namespace='" + @@ -234,7 +232,7 @@ inline void requestRoutes(App& app) onPropertyUpdate, &conn)); } } - objectManagerMatchString = + std::string objectManagerMatchString = ("type='signal'," "interface='org.freedesktop.DBus.ObjectManager'," "path_namespace='" + -- cgit v1.2.3