Fix clang-tidy modernize-use-nullptr warnings
This commit is contained in:
@@ -88,7 +88,7 @@ int main (int argc, char *argv[])
|
||||
// DropTailQueue::MaxPackets affects the # of dropped packets, default value:100
|
||||
// Config::SetDefault ("ns3::DropTailQueue::MaxPackets", UintegerValue (1000));
|
||||
|
||||
srand ( (unsigned)time ( NULL ) ); // generate different seed each time
|
||||
srand ( (unsigned)time ( nullptr ) ); // generate different seed each time
|
||||
|
||||
std::string tr_name ("n-node-ppp.tr");
|
||||
std::string pcap_name ("n-node-ppp");
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
*/
|
||||
inline void PrintRoutingTable (Ptr<Node>& n)
|
||||
{
|
||||
Ptr<Ipv6StaticRouting> routing = 0;
|
||||
Ptr<Ipv6StaticRouting> routing = nullptr;
|
||||
Ipv6StaticRoutingHelper routingHelper;
|
||||
Ptr<Ipv6> ipv6 = n->GetObject<Ipv6> ();
|
||||
uint32_t nbRoutes = 0;
|
||||
|
||||
@@ -161,7 +161,7 @@ main (int argc, char *argv[])
|
||||
Simulator::Schedule (Seconds (2.0),&BindSock, srcSocket, SrcToRtr2);
|
||||
Simulator::Schedule (Seconds (2.1),&SendStuff, srcSocket, dstaddr, dstport);
|
||||
// Fourth again as normal (goes via Rtr1)
|
||||
Simulator::Schedule (Seconds (3.0),&BindSock, srcSocket, Ptr<NetDevice>(0));
|
||||
Simulator::Schedule (Seconds (3.0),&BindSock, srcSocket, Ptr<NetDevice>(nullptr));
|
||||
Simulator::Schedule (Seconds (3.1),&SendStuff, srcSocket, dstaddr, dstport);
|
||||
// If you uncomment what's below, it results in ASSERT failing since you can't
|
||||
// bind to a socket not existing on a node
|
||||
|
||||
@@ -178,7 +178,7 @@ main (int argc, char *argv[])
|
||||
Simulator::Schedule (Seconds (2.0),&BindSock, srcSocket3, SrcToRtr2);
|
||||
Simulator::Schedule (Seconds (2.1),&StartFlow, srcSocket3, dstaddr, dstport);
|
||||
// Fourth again as normal (goes via Rtr1)
|
||||
Simulator::Schedule (Seconds (3.0),&BindSock, srcSocket4, Ptr<NetDevice>(0));
|
||||
Simulator::Schedule (Seconds (3.0),&BindSock, srcSocket4, Ptr<NetDevice>(nullptr));
|
||||
Simulator::Schedule (Seconds (3.1),&StartFlow, srcSocket4, dstaddr, dstport);
|
||||
// If you uncomment what's below, it results in ASSERT failing since you can't
|
||||
// bind to a socket not existing on a node
|
||||
|
||||
@@ -77,7 +77,7 @@ Sender::Sender()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
m_interval = CreateObject<ConstantRandomVariable> ();
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
}
|
||||
|
||||
Sender::~Sender()
|
||||
@@ -90,7 +90,7 @@ Sender::DoDispose ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
// chain up
|
||||
Application::DoDispose ();
|
||||
}
|
||||
@@ -169,11 +169,11 @@ Receiver::GetTypeId ()
|
||||
}
|
||||
|
||||
Receiver::Receiver() :
|
||||
m_calc (0),
|
||||
m_delay (0)
|
||||
m_calc (nullptr),
|
||||
m_delay (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
}
|
||||
|
||||
Receiver::~Receiver()
|
||||
@@ -186,7 +186,7 @@ Receiver::DoDispose ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
// chain up
|
||||
Application::DoDispose ();
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ int main (int argc, char *argv[]) {
|
||||
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << "run-" << time (NULL);
|
||||
sstr << "run-" << time (nullptr);
|
||||
runID = sstr.str ();
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ int main (int argc, char *argv[]) {
|
||||
//--------------------------------------------
|
||||
|
||||
// Pick an output writer based in the requested format.
|
||||
Ptr<DataOutputInterface> output = 0;
|
||||
Ptr<DataOutputInterface> output = nullptr;
|
||||
if (format == "omnet") {
|
||||
NS_LOG_INFO ("Creating omnet formatted data output.");
|
||||
output = CreateObject<OmnetDataOutput>();
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
using namespace ns3;
|
||||
|
||||
TutorialApp::TutorialApp ()
|
||||
: m_socket (0),
|
||||
: m_socket (nullptr),
|
||||
m_peer (),
|
||||
m_packetSize (0),
|
||||
m_nPackets (0),
|
||||
@@ -33,7 +33,7 @@ TutorialApp::TutorialApp ()
|
||||
|
||||
TutorialApp::~TutorialApp ()
|
||||
{
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
||||
Reference in New Issue
Block a user