build: fix -Wmissing-prototype
This helps make the author's original intent clear. Tested by building
and running the unit tests with clang.
Change-Id: If0231ec5634adad0b61e7fcff8ec1e5bcbbb92c1
Signed-off-by: Brad Bishop <bradbish@qti.qualcomm.com>
diff --git a/src/associations.cpp b/src/associations.cpp
index 329f3d4..6400818 100644
--- a/src/associations.cpp
+++ b/src/associations.cpp
@@ -8,9 +8,9 @@
#include <iostream>
#include <string>
-void updateEndpointsOnDbus(sdbusplus::asio::object_server& objectServer,
- const std::string& assocPath,
- AssociationMaps& assocMaps)
+static void updateEndpointsOnDbus(sdbusplus::asio::object_server& objectServer,
+ const std::string& assocPath,
+ AssociationMaps& assocMaps)
{
// Don't create an entry in assocMaps.ifaces if not needed.
auto iface = assocMaps.ifaces.find(assocPath);
@@ -48,7 +48,7 @@
}
}
-void scheduleUpdateEndpointsOnDbus(
+static void scheduleUpdateEndpointsOnDbus(
boost::asio::io_context& io, sdbusplus::asio::object_server& objectServer,
const std::string& assocPath, AssociationMaps& assocMaps)
{
@@ -219,7 +219,7 @@
}
}
-void addEndpointsToAssocIfaces(
+static void addEndpointsToAssocIfaces(
boost::asio::io_context& io, sdbusplus::asio::object_server& objectServer,
const std::string& assocPath,
const boost::container::flat_set<std::string>& endpointPaths,
@@ -554,7 +554,7 @@
* @param[in,out] assocMaps - the association maps
* @param[in,out] server - sdbus system object
*/
-void removeAssociationIfacesEntry(
+static void removeAssociationIfacesEntry(
boost::asio::io_context& io, const std::string& assocPath,
const std::string& endpointPath, AssociationMaps& assocMaps,
sdbusplus::asio::object_server& server)
@@ -584,7 +584,7 @@
* @param[in] owner - the owner of the association
* @param[in,out] assocMaps - the association maps
*/
-void removeAssociationOwnersEntry(
+static void removeAssociationOwnersEntry(
const std::string& assocPath, const std::string& endpointPath,
const std::string& owner, AssociationMaps& assocMaps)
{
diff --git a/src/handler.cpp b/src/handler.cpp
index 89c9913..af8ef90 100644
--- a/src/handler.cpp
+++ b/src/handler.cpp
@@ -346,7 +346,7 @@
// This function works like getSubTreePaths() but only matching id with
// the leaf-name instead of full path.
-std::vector<std::string> getSubTreePathsById(
+static std::vector<std::string> getSubTreePathsById(
const InterfaceMapType& interfaceMap, const std::string& id,
const std::string& objectPath, std::vector<std::string>& interfaces)
{
diff --git a/src/main.cpp b/src/main.cpp
index 16493b1..b5dc37f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -22,9 +22,10 @@
static AssociationMaps associationMaps;
-void updateOwners(sdbusplus::asio::connection* conn,
- boost::container::flat_map<std::string, std::string>& owners,
- const std::string& newObject)
+static void updateOwners(
+ sdbusplus::asio::connection* conn,
+ boost::container::flat_map<std::string, std::string>& owners,
+ const std::string& newObject)
{
if (newObject.starts_with(":"))
{
@@ -45,8 +46,8 @@
newObject);
}
-void sendIntrospectionCompleteSignal(sdbusplus::asio::connection* systemBus,
- const std::string& processName)
+static void sendIntrospectionCompleteSignal(
+ sdbusplus::asio::connection* systemBus, const std::string& processName)
{
// TODO(ed) This signal doesn't get exposed properly in the
// introspect right now. Find out how to register signals in
@@ -129,12 +130,12 @@
#endif
};
-void doAssociations(boost::asio::io_context& io,
- sdbusplus::asio::connection* systemBus,
- InterfaceMapType& interfaceMap,
- sdbusplus::asio::object_server& objectServer,
- const std::string& processName, const std::string& path,
- int timeoutRetries = 0)
+static void doAssociations(
+ boost::asio::io_context& io, sdbusplus::asio::connection* systemBus,
+ InterfaceMapType& interfaceMap,
+ sdbusplus::asio::object_server& objectServer,
+ const std::string& processName, const std::string& path,
+ int timeoutRetries = 0)
{
constexpr int maxTimeoutRetries = 3;
systemBus->async_method_call(
@@ -162,12 +163,12 @@
assocDefsInterface, assocDefsProperty);
}
-void doIntrospect(boost::asio::io_context& io,
- sdbusplus::asio::connection* systemBus,
- const std::shared_ptr<InProgressIntrospect>& transaction,
- InterfaceMapType& interfaceMap,
- sdbusplus::asio::object_server& objectServer,
- const std::string& path, int timeoutRetries = 0)
+static void doIntrospect(
+ boost::asio::io_context& io, sdbusplus::asio::connection* systemBus,
+ const std::shared_ptr<InProgressIntrospect>& transaction,
+ InterfaceMapType& interfaceMap,
+ sdbusplus::asio::object_server& objectServer, const std::string& path,
+ int timeoutRetries = 0)
{
constexpr int maxTimeoutRetries = 3;
systemBus->async_method_call(
@@ -254,7 +255,7 @@
"Introspect");
}
-void startNewIntrospect(
+static void startNewIntrospect(
sdbusplus::asio::connection* systemBus, boost::asio::io_context& io,
InterfaceMapType& interfaceMap, const std::string& processName,
AssociationMaps& assocMaps,
@@ -280,7 +281,7 @@
}
}
-void doListNames(
+static void doListNames(
boost::asio::io_context& io, InterfaceMapType& interfaceMap,
sdbusplus::asio::connection* systemBus,
boost::container::flat_map<std::string, std::string>& nameOwners,
@@ -327,9 +328,9 @@
// - Means D-Bus created these, not application code,
// with the Properties, Introspectable, and Peer ifaces
// 2) Have no other child for this owner
-void removeUnneededParents(const std::string& objectPath,
- const std::string& owner,
- InterfaceMapType& interfaceMap)
+static void removeUnneededParents(const std::string& objectPath,
+ const std::string& owner,
+ InterfaceMapType& interfaceMap)
{
auto parent = objectPath;
diff --git a/src/test/handler.cpp b/src/test/handler.cpp
index a295fbc..b64b798 100644
--- a/src/test/handler.cpp
+++ b/src/test/handler.cpp
@@ -223,7 +223,7 @@
sdbusplus::xyz::openbmc_project::Common::Error::ResourceNotFound);
}
-void verifySubtree(std::span<InterfaceMapType::value_type> subtree)
+static void verifySubtree(std::span<InterfaceMapType::value_type> subtree)
{
ASSERT_EQ(subtree.size(), 2);
ConnectionNames connection = subtree[0].second;
diff --git a/src/test/interfaces_added.cpp b/src/test/interfaces_added.cpp
index 7117611..c60298e 100644
--- a/src/test/interfaces_added.cpp
+++ b/src/test/interfaces_added.cpp
@@ -15,8 +15,8 @@
// This is the data structure that comes in via the InterfacesAdded
// signal
-InterfacesAdded createInterfacesAdded(const std::string& interface,
- const std::string& property)
+static InterfacesAdded createInterfacesAdded(const std::string& interface,
+ const std::string& property)
{
std::vector<Association> associations = {
{"inventory", "error",
diff --git a/src/test/util/association_objects.hpp b/src/test/util/association_objects.hpp
index e9fd016..f7c17a2 100644
--- a/src/test/util/association_objects.hpp
+++ b/src/test/util/association_objects.hpp
@@ -10,7 +10,7 @@
const std::string extraEndpoint = "/xyz/openbmc_project/different/endpoint";
// Create a default AssociationOwnersType object
-AssociationOwnersType createDefaultOwnerAssociation()
+inline AssociationOwnersType createDefaultOwnerAssociation()
{
AssociationPaths assocPathMap = {{defaultFwdPath, {defaultEndpoint}},
{defaultRevPath, {defaultSourcePath}}};
@@ -21,7 +21,7 @@
}
// Create a default AssociationInterfaces object
-AssociationInterfaces createDefaultInterfaceAssociation(
+inline AssociationInterfaces createDefaultInterfaceAssociation(
sdbusplus::asio::object_server* server)
{
AssociationInterfaces interfaceAssoc;
@@ -40,7 +40,8 @@
}
// Just add an extra endpoint to the first association
-void addEndpointToInterfaceAssociation(AssociationInterfaces& interfaceAssoc)
+inline void addEndpointToInterfaceAssociation(
+ AssociationInterfaces& interfaceAssoc)
{
auto iface = interfaceAssoc[defaultFwdPath];
auto endpoints = std::get<endpointsPos>(iface);
@@ -48,9 +49,9 @@
}
// Create a default interfaceMapType with input values
-InterfaceMapType createInterfaceMap(const std::string& path,
- const std::string& connectionName,
- const InterfaceNames& interfaceNames)
+inline InterfaceMapType createInterfaceMap(const std::string& path,
+ const std::string& connectionName,
+ const InterfaceNames& interfaceNames)
{
ConnectionNames connectionMap{{connectionName, interfaceNames}};
InterfaceMapType interfaceMap{{path, connectionMap}};
@@ -60,7 +61,7 @@
// Create a default interfaceMapType with 2 entries with the same
// owner.
-InterfaceMapType createDefaultInterfaceMap()
+inline InterfaceMapType createDefaultInterfaceMap()
{
InterfaceMapType interfaceMap = {
{defaultSourcePath, {{defaultDbusSvc, {"a"}}}},
diff --git a/src/test/util/debug_output.hpp b/src/test/util/debug_output.hpp
index aff87d5..0532d55 100644
--- a/src/test/util/debug_output.hpp
+++ b/src/test/util/debug_output.hpp
@@ -4,7 +4,7 @@
// Some debug functions for dumping out the main data structures in objmgr
-void dumpAssociationOwnersType(AssociationOwnersType& assocOwners)
+inline void dumpAssociationOwnersType(AssociationOwnersType& assocOwners)
{
using namespace std;
cout << "##### AssociationOwnersType #####\n";
@@ -31,7 +31,7 @@
}
}
-void dumpAssociationInterfaces(AssociationInterfaces& assocInterfaces)
+inline void dumpAssociationInterfaces(AssociationInterfaces& assocInterfaces)
{
using namespace std;
cout << "##### AssociationInterfaces #####\n";
@@ -49,7 +49,7 @@
}
}
-void dumpInterfaceMapType(InterfaceMapType& intfMap)
+inline void dumpInterfaceMapType(InterfaceMapType& intfMap)
{
using namespace std;
cout << "##### interfaceMapType #####\n";