make non-static global debugging-only functions static inline (bug 1170).
Compilers shouldn't warn on unused static inline function and just don't emit code for
them in optimized builds.
Also debugging-only functions don't pollute symbol tables.
--- a/examples/energy/energy-model-example.cc Fri Jan 25 19:05:30 2013 +0100
+++ b/examples/energy/energy-model-example.cc Mon Jan 21 17:19:00 2013 +0400
@@ -35,7 +35,7 @@
using namespace ns3;
-std::string
+static inline std::string
PrintReceivedPacket (Address& from)
{
InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (from);
--- a/examples/routing/manet-routing-compare.cc Fri Jan 25 19:05:30 2013 +0100
+++ b/examples/routing/manet-routing-compare.cc Mon Jan 21 17:19:00 2013 +0400
@@ -119,7 +119,7 @@
{
}
-std::string
+static inline std::string
PrintReceivedPacket (Ptr<Socket> socket, Ptr<Packet> packet)
{
SocketAddressTag tag;
--- a/examples/wireless/multirate.cc Fri Jan 25 19:05:30 2013 +0100
+++ b/examples/wireless/multirate.cc Mon Jan 21 17:19:00 2013 +0400
@@ -309,14 +309,14 @@
}
}
-Vector
+static inline Vector
GetPosition (Ptr<Node> node)
{
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
return mobility->GetPosition ();
}
-std::string
+static inline std::string
PrintPosition (Ptr<Node> client, Ptr<Node> server)
{
Vector serverPos = GetPosition (server);
--- a/examples/wireless/wifi-simple-interference.cc Fri Jan 25 19:05:30 2013 +0100
+++ b/examples/wireless/wifi-simple-interference.cc Mon Jan 21 17:19:00 2013 +0400
@@ -96,7 +96,7 @@
using namespace ns3;
-std::string PrintReceivedPacket (Ptr<Socket> socket)
+static inline std::string PrintReceivedPacket (Ptr<Socket> socket)
{
Address addr;
socket->GetSockName (addr);
@@ -108,7 +108,7 @@
return oss.str ();
}
-void ReceivePacket (Ptr<Socket> socket)
+static void ReceivePacket (Ptr<Socket> socket)
{
NS_LOG_UNCOND (PrintReceivedPacket (socket));
}
--- a/src/test/ns3wifi/wifi-interference-test-suite.cc Fri Jan 25 19:05:30 2013 +0100
+++ b/src/test/ns3wifi/wifi-interference-test-suite.cc Mon Jan 21 17:19:00 2013 +0400
@@ -77,7 +77,7 @@
{
}
-std::string
+static inline std::string
PrintReceivedPacket (Ptr<Socket> socket)
{
Address addr;
--- a/src/topology-read/model/rocketfuel-topology-reader.cc Fri Jan 25 19:05:30 2013 +0100
+++ b/src/topology-read/model/rocketfuel-topology-reader.cc Mon Jan 21 17:19:00 2013 +0400
@@ -77,7 +77,7 @@
int nodesNumber = 0;
std::map<std::string, Ptr<Node> > nodeMap;
-void
+static inline void
PrintNodeInfo (std::string & uid, std::string & loc, bool dns, bool bb,
std::vector <std::string>::size_type neighListSize,
std::string & name, int radius)