Fix clang-tidy modernize-use-nullptr warnings

This commit is contained in:
Eduardo Almeida
2022-10-06 21:45:05 +00:00
parent be07b6487a
commit 4af0fe4b85
469 changed files with 1864 additions and 1864 deletions

View File

@@ -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");

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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 ();
}

View File

@@ -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>();

View File

@@ -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 */