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 */
|
||||
|
||||
@@ -166,7 +166,7 @@ Neighbors::LookupMacAddress (Ipv4Address addr)
|
||||
i != m_arp.end (); ++i)
|
||||
{
|
||||
ArpCache::Entry * entry = (*i)->Lookup (addr);
|
||||
if (entry != 0 && (entry->IsAlive () || entry->IsPermanent ()) && !entry->IsExpired ())
|
||||
if (entry != nullptr && (entry->IsAlive () || entry->IsPermanent ()) && !entry->IsExpired ())
|
||||
{
|
||||
hwaddr = Mac48Address::ConvertFrom (entry->GetMacAddress ());
|
||||
break;
|
||||
|
||||
@@ -320,7 +320,7 @@ RoutingProtocol::~RoutingProtocol ()
|
||||
void
|
||||
RoutingProtocol::DoDispose ()
|
||||
{
|
||||
m_ipv4 = 0;
|
||||
m_ipv4 = nullptr;
|
||||
for (std::map<Ptr<Socket>, Ipv4InterfaceAddress>::iterator iter =
|
||||
m_socketAddresses.begin (); iter != m_socketAddresses.end (); iter++)
|
||||
{
|
||||
@@ -1040,7 +1040,7 @@ RoutingProtocol::SendRequest (Ipv4Address dst)
|
||||
else
|
||||
{
|
||||
rreqHeader.SetUnknownSeqno (true);
|
||||
Ptr<NetDevice> dev = 0;
|
||||
Ptr<NetDevice> dev = nullptr;
|
||||
RoutingTableEntry newEntry (/*dev=*/ dev,
|
||||
/*dst=*/ dst,
|
||||
/*vSeqNo=*/ false,
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
* \param ecb the ErrorCallback function
|
||||
* \param exp the expiration time
|
||||
*/
|
||||
QueueEntry (Ptr<const Packet> pa = 0, Ipv4Header const & h = Ipv4Header (),
|
||||
QueueEntry (Ptr<const Packet> pa = nullptr, Ipv4Header const & h = Ipv4Header (),
|
||||
UnicastForwardCallback ucb = UnicastForwardCallback (),
|
||||
ErrorCallback ecb = ErrorCallback (), Time exp = Simulator::Now ())
|
||||
: m_packet (pa),
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
* \param nextHop the IP address of the next hop
|
||||
* \param lifetime the lifetime of the entry
|
||||
*/
|
||||
RoutingTableEntry (Ptr<NetDevice> dev = 0,Ipv4Address dst = Ipv4Address (), bool vSeqNo = false, uint32_t seqNo = 0,
|
||||
RoutingTableEntry (Ptr<NetDevice> dev = nullptr,Ipv4Address dst = Ipv4Address (), bool vSeqNo = false, uint32_t seqNo = 0,
|
||||
Ipv4InterfaceAddress iface = Ipv4InterfaceAddress (), uint16_t hops = 0,
|
||||
Ipv4Address nextHop = Ipv4Address (), Time lifetime = Simulator::Now ());
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
*/
|
||||
ChainRegressionTest::ChainRegressionTest (const char * const prefix, Time t, uint32_t size, Time arpAliveTimeout)
|
||||
: TestCase ("AODV chain regression test"),
|
||||
m_nodes (0),
|
||||
m_nodes (nullptr),
|
||||
m_prefix (prefix),
|
||||
m_time (t),
|
||||
m_size (size),
|
||||
@@ -137,7 +137,7 @@ ChainRegressionTest::DoRun ()
|
||||
|
||||
CheckResults ();
|
||||
|
||||
delete m_nodes, m_nodes = 0;
|
||||
delete m_nodes, m_nodes = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace aodv {
|
||||
struct NeighborTest : public TestCase
|
||||
{
|
||||
NeighborTest () : TestCase ("Neighbor"),
|
||||
neighbor (0)
|
||||
neighbor (nullptr)
|
||||
{
|
||||
}
|
||||
void DoRun () override;
|
||||
|
||||
@@ -48,7 +48,7 @@ using namespace ns3;
|
||||
//-----------------------------------------------------------------------------
|
||||
Bug772ChainTest::Bug772ChainTest (const char * const prefix, const char * const proto, Time t, uint32_t size)
|
||||
: TestCase ("Bug 772 UDP and TCP chain regression test"),
|
||||
m_nodes (0),
|
||||
m_nodes (nullptr),
|
||||
m_prefix (prefix),
|
||||
m_proto (proto),
|
||||
m_time (t),
|
||||
@@ -99,7 +99,7 @@ Bug772ChainTest::DoRun ()
|
||||
|
||||
CheckResults ();
|
||||
|
||||
delete m_nodes, m_nodes = 0;
|
||||
delete m_nodes, m_nodes = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -57,7 +57,7 @@ ApplicationPacketProbe::GetTypeId ()
|
||||
ApplicationPacketProbe::ApplicationPacketProbe ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_packet = 0;
|
||||
m_packet = nullptr;
|
||||
}
|
||||
|
||||
ApplicationPacketProbe::~ApplicationPacketProbe ()
|
||||
|
||||
@@ -87,10 +87,10 @@ BulkSendApplication::GetTypeId ()
|
||||
|
||||
|
||||
BulkSendApplication::BulkSendApplication ()
|
||||
: m_socket (0),
|
||||
: m_socket (nullptr),
|
||||
m_connected (false),
|
||||
m_totBytes (0),
|
||||
m_unsentPacket (0)
|
||||
m_unsentPacket (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
@@ -119,8 +119,8 @@ BulkSendApplication::DoDispose ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
m_socket = 0;
|
||||
m_unsentPacket = 0;
|
||||
m_socket = nullptr;
|
||||
m_unsentPacket = nullptr;
|
||||
// chain up
|
||||
Application::DoDispose ();
|
||||
}
|
||||
@@ -249,7 +249,7 @@ void BulkSendApplication::SendData (const Address &from, const Address &to)
|
||||
{
|
||||
m_totBytes += actual;
|
||||
m_txTrace (packet);
|
||||
m_unsentPacket = 0;
|
||||
m_unsentPacket = nullptr;
|
||||
}
|
||||
else if (actual == -1)
|
||||
{
|
||||
|
||||
@@ -114,12 +114,12 @@ OnOffApplication::GetTypeId ()
|
||||
|
||||
|
||||
OnOffApplication::OnOffApplication ()
|
||||
: m_socket (0),
|
||||
: m_socket (nullptr),
|
||||
m_connected (false),
|
||||
m_residualBits (0),
|
||||
m_lastStartTime (Seconds (0)),
|
||||
m_totBytes (0),
|
||||
m_unsentPacket (0)
|
||||
m_unsentPacket (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
@@ -158,8 +158,8 @@ OnOffApplication::DoDispose ()
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
CancelEvents ();
|
||||
m_socket = 0;
|
||||
m_unsentPacket = 0;
|
||||
m_socket = nullptr;
|
||||
m_unsentPacket = nullptr;
|
||||
// chain up
|
||||
Application::DoDispose ();
|
||||
}
|
||||
@@ -258,7 +258,7 @@ void OnOffApplication::CancelEvents ()
|
||||
{
|
||||
NS_LOG_DEBUG ("Discarding cached packet upon CancelEvents ()");
|
||||
}
|
||||
m_unsentPacket = 0;
|
||||
m_unsentPacket = nullptr;
|
||||
}
|
||||
|
||||
// Event handlers
|
||||
@@ -354,7 +354,7 @@ void OnOffApplication::SendPacket ()
|
||||
{
|
||||
m_txTrace (packet);
|
||||
m_totBytes += m_pktSize;
|
||||
m_unsentPacket = 0;
|
||||
m_unsentPacket = nullptr;
|
||||
Address localAddress;
|
||||
m_socket->GetSockName (localAddress);
|
||||
if (InetSocketAddress::IsMatchingType (m_peer))
|
||||
|
||||
@@ -32,7 +32,7 @@ PacketLossCounter::PacketLossCounter (uint8_t bitmapSize)
|
||||
: m_lost (0),
|
||||
m_bitMapSize (0),
|
||||
m_lastMaxSeqNum (0),
|
||||
m_receiveBitMap (0)
|
||||
m_receiveBitMap (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << bitmapSize);
|
||||
SetBitMapSize (bitmapSize);
|
||||
@@ -58,7 +58,7 @@ PacketLossCounter::SetBitMapSize (uint16_t winSize)
|
||||
|
||||
NS_ASSERT_MSG (winSize%8==0,"The packet window size should be a multiple of 8");
|
||||
m_bitMapSize = winSize/8;
|
||||
if (m_receiveBitMap!=0)
|
||||
if (m_receiveBitMap!=nullptr)
|
||||
{
|
||||
delete [] m_receiveBitMap;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ PacketSink::GetTypeId ()
|
||||
PacketSink::PacketSink ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
m_totalRx = 0;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ PacketSink::GetAcceptedSockets () const
|
||||
void PacketSink::DoDispose ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
m_socketList.clear ();
|
||||
|
||||
// chain up
|
||||
|
||||
@@ -45,7 +45,7 @@ NS_OBJECT_ENSURE_REGISTERED (ThreeGppHttpClient);
|
||||
|
||||
ThreeGppHttpClient::ThreeGppHttpClient ()
|
||||
: m_state (NOT_STARTED),
|
||||
m_socket (0),
|
||||
m_socket (nullptr),
|
||||
m_objectBytesToBeReceived (0),
|
||||
m_objectClientTs (MilliSeconds (0)),
|
||||
m_objectServerTs (MilliSeconds (0)),
|
||||
@@ -714,7 +714,7 @@ ThreeGppHttpClient::Receive (Ptr<Packet> packet)
|
||||
<< " (" << m_objectBytesToBeReceived << " bytes).");
|
||||
// Stop expecting any more packet of this object.
|
||||
m_objectBytesToBeReceived = 0;
|
||||
m_constructedPacket = NULL;
|
||||
m_constructedPacket = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ NS_OBJECT_ENSURE_REGISTERED (ThreeGppHttpServer);
|
||||
|
||||
ThreeGppHttpServer::ThreeGppHttpServer ()
|
||||
: m_state (NOT_STARTED),
|
||||
m_initialSocket (0),
|
||||
m_initialSocket (nullptr),
|
||||
m_txBuffer (Create<ThreeGppHttpServerTxBuffer> ()),
|
||||
m_httpVariables (CreateObject<ThreeGppHttpVariables> ())
|
||||
{
|
||||
|
||||
@@ -78,7 +78,7 @@ UdpClient::UdpClient ()
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_sent = 0;
|
||||
m_totalTx = 0;
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
m_sendEvent = EventId ();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,19 +87,19 @@ UdpEchoClient::UdpEchoClient ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_sent = 0;
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
m_sendEvent = EventId ();
|
||||
m_data = 0;
|
||||
m_data = nullptr;
|
||||
m_dataSize = 0;
|
||||
}
|
||||
|
||||
UdpEchoClient::~UdpEchoClient()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
|
||||
delete [] m_data;
|
||||
m_data = 0;
|
||||
m_data = nullptr;
|
||||
m_dataSize = 0;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ UdpEchoClient::StopApplication ()
|
||||
{
|
||||
m_socket->Close ();
|
||||
m_socket->SetRecvCallback (MakeNullCallback<void, Ptr<Socket> > ());
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
}
|
||||
|
||||
Simulator::Cancel (m_sendEvent);
|
||||
@@ -203,7 +203,7 @@ UdpEchoClient::SetDataSize (uint32_t dataSize)
|
||||
// neither will we.
|
||||
//
|
||||
delete [] m_data;
|
||||
m_data = 0;
|
||||
m_data = nullptr;
|
||||
m_dataSize = 0;
|
||||
m_size = dataSize;
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ UdpEchoServer::UdpEchoServer ()
|
||||
UdpEchoServer::~UdpEchoServer()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_socket = 0;
|
||||
m_socket6 = 0;
|
||||
m_socket = nullptr;
|
||||
m_socket6 = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -99,7 +99,7 @@ UdpTraceClient::UdpTraceClient ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_sent = 0;
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
m_sendEvent = EventId ();
|
||||
m_maxPacketSize = 1400;
|
||||
}
|
||||
@@ -109,13 +109,13 @@ UdpTraceClient::UdpTraceClient (Ipv4Address ip, uint16_t port,
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_sent = 0;
|
||||
m_socket = 0;
|
||||
m_socket = nullptr;
|
||||
m_sendEvent = EventId ();
|
||||
m_peerAddress = ip;
|
||||
m_peerPort = port;
|
||||
m_currentEntry = 0;
|
||||
m_maxPacketSize = 1400;
|
||||
if (traceFile != NULL)
|
||||
if (traceFile != nullptr)
|
||||
{
|
||||
SetTraceFile (traceFile);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ BridgeChannel::~BridgeChannel ()
|
||||
for (std::vector< Ptr<Channel> >::iterator iter = m_bridgedChannels.begin ();
|
||||
iter != m_bridgedChannels.end (); iter++)
|
||||
{
|
||||
*iter = 0;
|
||||
*iter = nullptr;
|
||||
}
|
||||
m_bridgedChannels.clear ();
|
||||
}
|
||||
@@ -93,7 +93,7 @@ BridgeChannel::GetDevice (std::size_t i) const
|
||||
}
|
||||
ndevices += (*iter)->GetNDevices ();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ BridgeNetDevice::GetTypeId ()
|
||||
|
||||
|
||||
BridgeNetDevice::BridgeNetDevice ()
|
||||
: m_node (0),
|
||||
: m_node (nullptr),
|
||||
m_ifIndex (0)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
@@ -83,11 +83,11 @@ BridgeNetDevice::DoDispose ()
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin (); iter != m_ports.end (); iter++)
|
||||
{
|
||||
*iter = 0;
|
||||
*iter = nullptr;
|
||||
}
|
||||
m_ports.clear ();
|
||||
m_channel = 0;
|
||||
m_node = 0;
|
||||
m_channel = nullptr;
|
||||
m_node = nullptr;
|
||||
NetDevice::DoDispose ();
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ Ptr<NetDevice> BridgeNetDevice::GetLearnedState (Mac48Address source)
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
||||
@@ -124,7 +124,7 @@ BuildingListPriv::Get ()
|
||||
Ptr<BuildingListPriv> *
|
||||
BuildingListPriv::DoGet ()
|
||||
{
|
||||
static Ptr<BuildingListPriv> ptr = 0;
|
||||
static Ptr<BuildingListPriv> ptr = nullptr;
|
||||
if (!ptr)
|
||||
{
|
||||
ptr = CreateObject<BuildingListPriv> ();
|
||||
@@ -138,7 +138,7 @@ BuildingListPriv::Delete ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
Config::UnregisterRootNamespaceObject (Get ());
|
||||
(*DoGet ()) = 0;
|
||||
(*DoGet ()) = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ BuildingListPriv::DoDispose ()
|
||||
{
|
||||
Ptr<Building> building = *i;
|
||||
building->Dispose ();
|
||||
*i = 0;
|
||||
*i = nullptr;
|
||||
}
|
||||
m_buildings.erase (m_buildings.begin (), m_buildings.end ());
|
||||
Object::DoDispose ();
|
||||
|
||||
@@ -258,7 +258,7 @@ BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
|
||||
break;
|
||||
|
||||
default:
|
||||
mm = 0;
|
||||
mm = nullptr;
|
||||
break;
|
||||
}
|
||||
Ptr<MobilityBuildingInfo> buildingInfo = CreateObject<MobilityBuildingInfo> ();
|
||||
|
||||
@@ -218,7 +218,7 @@ BuildingsShadowingTestCase::CreateMobilityModel (uint16_t index)
|
||||
break;
|
||||
|
||||
default:
|
||||
mm = 0;
|
||||
mm = nullptr;
|
||||
break;
|
||||
}
|
||||
Ptr<MobilityBuildingInfo> buildingInfo = CreateObject<MobilityBuildingInfo> ();
|
||||
|
||||
@@ -204,7 +204,7 @@ AttributeIterator::DoIterate (Ptr<Object> object)
|
||||
{
|
||||
struct TypeId::AttributeInformation info = tid.GetAttribute(i);
|
||||
const PointerChecker *ptrChecker = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
|
||||
if (ptrChecker != 0)
|
||||
if (ptrChecker != nullptr)
|
||||
{
|
||||
NS_LOG_DEBUG ("pointer attribute " << info.name);
|
||||
PointerValue ptr;
|
||||
@@ -223,7 +223,7 @@ AttributeIterator::DoIterate (Ptr<Object> object)
|
||||
}
|
||||
// attempt to cast to an object container
|
||||
const ObjectPtrContainerChecker *vectorChecker = dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
|
||||
if (vectorChecker != 0)
|
||||
if (vectorChecker != nullptr)
|
||||
{
|
||||
NS_LOG_DEBUG ("ObjectPtrContainer attribute " << info.name);
|
||||
ObjectPtrContainerValue vector;
|
||||
|
||||
@@ -146,7 +146,7 @@ ConfigStore::~ConfigStore ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
delete m_file;
|
||||
m_file = 0;
|
||||
m_file = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -36,19 +36,19 @@ namespace ns3 {
|
||||
NS_LOG_COMPONENT_DEFINE ("RawTextConfig");
|
||||
|
||||
RawTextConfigSave::RawTextConfigSave ()
|
||||
: m_os (0)
|
||||
: m_os (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
RawTextConfigSave::~RawTextConfigSave ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
if (m_os != 0)
|
||||
if (m_os != nullptr)
|
||||
{
|
||||
m_os->close ();
|
||||
}
|
||||
delete m_os;
|
||||
m_os = 0;
|
||||
m_os = nullptr;
|
||||
}
|
||||
void
|
||||
RawTextConfigSave::SetFilename (std::string filename)
|
||||
@@ -183,18 +183,18 @@ private:
|
||||
}
|
||||
|
||||
RawTextConfigLoad::RawTextConfigLoad ()
|
||||
: m_is (0)
|
||||
: m_is (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
RawTextConfigLoad::~RawTextConfigLoad ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
if (m_is != 0)
|
||||
if (m_is != nullptr)
|
||||
{
|
||||
m_is->close ();
|
||||
delete m_is;
|
||||
m_is = 0;
|
||||
m_is = nullptr;
|
||||
}
|
||||
}
|
||||
void
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace ns3 {
|
||||
NS_LOG_COMPONENT_DEFINE ("XmlConfig");
|
||||
|
||||
XmlConfigSave::XmlConfigSave ()
|
||||
: m_writer (0)
|
||||
: m_writer (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ XmlConfigSave::SetFilename (std::string filename)
|
||||
|
||||
/* Create a new XmlWriter for uri, with no compression. */
|
||||
m_writer = xmlNewTextWriterFilename (filename.c_str (), 0);
|
||||
if (m_writer == NULL)
|
||||
if (m_writer == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error creating the XML writer");
|
||||
}
|
||||
@@ -62,7 +62,7 @@ XmlConfigSave::SetFilename (std::string filename)
|
||||
/* Start the document with the XML default for the version,
|
||||
* encoding utf-8 and the default for the standalone
|
||||
* declaration. */
|
||||
rc = xmlTextWriterStartDocument (m_writer, NULL, "utf-8", NULL);
|
||||
rc = xmlTextWriterStartDocument (m_writer, nullptr, "utf-8", nullptr);
|
||||
if (rc < 0)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error at xmlTextWriterStartDocument");
|
||||
@@ -79,7 +79,7 @@ XmlConfigSave::SetFilename (std::string filename)
|
||||
XmlConfigSave::~XmlConfigSave ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
if (m_writer == 0)
|
||||
if (m_writer == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ XmlConfigSave::~XmlConfigSave ()
|
||||
}
|
||||
|
||||
xmlFreeTextWriter (m_writer);
|
||||
m_writer = 0;
|
||||
m_writer = nullptr;
|
||||
}
|
||||
void
|
||||
XmlConfigSave::Default ()
|
||||
@@ -303,7 +303,7 @@ void
|
||||
XmlConfigLoad::Default ()
|
||||
{
|
||||
xmlTextReaderPtr reader = xmlNewTextReaderFilename (m_filename.c_str ());
|
||||
if (reader == NULL)
|
||||
if (reader == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error at xmlReaderForFile");
|
||||
}
|
||||
@@ -312,19 +312,19 @@ XmlConfigLoad::Default ()
|
||||
while (rc > 0)
|
||||
{
|
||||
const xmlChar *type = xmlTextReaderConstName (reader);
|
||||
if (type == 0)
|
||||
if (type == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Invalid value");
|
||||
}
|
||||
if (std::string ((char*)type) == "default")
|
||||
{
|
||||
xmlChar *name = xmlTextReaderGetAttribute (reader, BAD_CAST "name");
|
||||
if (name == 0)
|
||||
if (name == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error getting attribute 'name'");
|
||||
}
|
||||
xmlChar *value = xmlTextReaderGetAttribute (reader, BAD_CAST "value");
|
||||
if (value == 0)
|
||||
if (value == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error getting attribute 'value'");
|
||||
}
|
||||
@@ -341,7 +341,7 @@ void
|
||||
XmlConfigLoad::Global ()
|
||||
{
|
||||
xmlTextReaderPtr reader = xmlNewTextReaderFilename (m_filename.c_str ());
|
||||
if (reader == NULL)
|
||||
if (reader == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error at xmlReaderForFile");
|
||||
}
|
||||
@@ -350,19 +350,19 @@ XmlConfigLoad::Global ()
|
||||
while (rc > 0)
|
||||
{
|
||||
const xmlChar *type = xmlTextReaderConstName (reader);
|
||||
if (type == 0)
|
||||
if (type == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Invalid value");
|
||||
}
|
||||
if (std::string ((char*)type) == "global")
|
||||
{
|
||||
xmlChar *name = xmlTextReaderGetAttribute (reader, BAD_CAST "name");
|
||||
if (name == 0)
|
||||
if (name == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error getting attribute 'name'");
|
||||
}
|
||||
xmlChar *value = xmlTextReaderGetAttribute (reader, BAD_CAST "value");
|
||||
if (value == 0)
|
||||
if (value == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error getting attribute 'value'");
|
||||
}
|
||||
@@ -379,7 +379,7 @@ void
|
||||
XmlConfigLoad::Attributes ()
|
||||
{
|
||||
xmlTextReaderPtr reader = xmlNewTextReaderFilename (m_filename.c_str ());
|
||||
if (reader == NULL)
|
||||
if (reader == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error at xmlReaderForFile");
|
||||
}
|
||||
@@ -388,19 +388,19 @@ XmlConfigLoad::Attributes ()
|
||||
while (rc > 0)
|
||||
{
|
||||
const xmlChar *type = xmlTextReaderConstName (reader);
|
||||
if (type == 0)
|
||||
if (type == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Invalid value");
|
||||
}
|
||||
if (std::string ((char*)type) == "value")
|
||||
{
|
||||
xmlChar *path = xmlTextReaderGetAttribute (reader, BAD_CAST "path");
|
||||
if (path == 0)
|
||||
if (path == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error getting attribute 'path'");
|
||||
}
|
||||
xmlChar *value = xmlTextReaderGetAttribute (reader, BAD_CAST "value");
|
||||
if (value == 0)
|
||||
if (value == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Error getting attribute 'value'");
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ PtrExample::Method ()
|
||||
/**
|
||||
* Example Ptr global variable.
|
||||
*/
|
||||
static Ptr<PtrExample> g_ptr = 0;
|
||||
static Ptr<PtrExample> g_ptr = nullptr;
|
||||
|
||||
/**
|
||||
* Example Ptr manipulations.
|
||||
@@ -86,7 +86,7 @@ StorePtr (Ptr<PtrExample> p)
|
||||
static void
|
||||
ClearPtr ()
|
||||
{
|
||||
g_ptr = 0;
|
||||
g_ptr = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ int main (int argc, char *argv[])
|
||||
ClearPtr ();
|
||||
// get the raw pointer and release it.
|
||||
PtrExample *raw = GetPointer (prev);
|
||||
prev = 0;
|
||||
prev = nullptr;
|
||||
raw->Method ();
|
||||
raw->Unref ();
|
||||
}
|
||||
|
||||
@@ -178,12 +178,12 @@ public:
|
||||
bool Set (ObjectBase * object, const AttributeValue & val) const override
|
||||
{
|
||||
const U *value = dynamic_cast<const U *> (&val);
|
||||
if (value == 0)
|
||||
if (value == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
T *obj = dynamic_cast<T *> (object);
|
||||
if (obj == 0)
|
||||
if (obj == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -205,12 +205,12 @@ public:
|
||||
bool Get (const ObjectBase * object, AttributeValue &val) const override
|
||||
{
|
||||
U *value = dynamic_cast<U *> (&val);
|
||||
if (value == 0)
|
||||
if (value == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
const T *obj = dynamic_cast<const T *> (object);
|
||||
if (obj == 0)
|
||||
if (obj == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ AttributeConstructionList::Find (Ptr<const AttributeChecker> checker) const
|
||||
return k->value;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AttributeConstructionList::CIterator
|
||||
|
||||
@@ -303,7 +303,7 @@ private:
|
||||
|
||||
template <class A, template <class...> class C>
|
||||
AttributeContainerChecker<A, C>::AttributeContainerChecker ()
|
||||
: m_itemchecker (0)
|
||||
: m_itemchecker (nullptr)
|
||||
{}
|
||||
|
||||
template <class A, template <class...> class C>
|
||||
|
||||
@@ -105,7 +105,7 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying)
|
||||
{
|
||||
bool Check (const AttributeValue &value) const override
|
||||
{
|
||||
return dynamic_cast<const T *> (&value) != 0;
|
||||
return dynamic_cast<const T *> (&value) != nullptr;
|
||||
}
|
||||
std::string GetValueTypeName () const override
|
||||
{
|
||||
@@ -127,7 +127,7 @@ MakeSimpleAttributeChecker (std::string name, std::string underlying)
|
||||
{
|
||||
const T *src = dynamic_cast<const T *> (&source);
|
||||
T *dst = dynamic_cast<T *> (&destination);
|
||||
if (src == 0 || dst == 0)
|
||||
if (src == nullptr || dst == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -60,21 +60,21 @@ AttributeChecker::CreateValidValue (const AttributeValue &value) const
|
||||
}
|
||||
// attempt to convert to string.
|
||||
const StringValue *str = dynamic_cast<const StringValue *> (&value);
|
||||
if (str == 0)
|
||||
if (str == nullptr)
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
// attempt to convert back to value.
|
||||
Ptr<AttributeValue> v = Create ();
|
||||
bool ok = v->DeserializeFromString (str->Get (), this);
|
||||
if (!ok)
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
ok = Check (*v);
|
||||
if (!ok)
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ CalendarScheduler::~CalendarScheduler ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
delete [] m_buckets;
|
||||
m_buckets = 0;
|
||||
m_buckets = nullptr;
|
||||
}
|
||||
void
|
||||
CalendarScheduler::SetReverse (bool reverse)
|
||||
@@ -185,7 +185,7 @@ CalendarScheduler::PeekNext () const
|
||||
uint32_t i = m_lastBucket;
|
||||
uint64_t bucketTop = m_bucketTop;
|
||||
Scheduler::Event minEvent;
|
||||
minEvent.impl = 0;
|
||||
minEvent.impl = nullptr;
|
||||
minEvent.key.m_ts = UINT64_MAX;
|
||||
minEvent.key.m_uid = UINT32_MAX;
|
||||
minEvent.key.m_context = 0;
|
||||
|
||||
@@ -90,7 +90,7 @@ CallbackImplBase::Demangle (const std::string& mangled)
|
||||
|
||||
int status;
|
||||
char* demangled = abi::__cxa_demangle (mangled.c_str (),
|
||||
NULL, NULL, &status);
|
||||
nullptr, nullptr, &status);
|
||||
|
||||
std::string ret;
|
||||
if (status == 0)
|
||||
|
||||
@@ -278,7 +278,7 @@ public:
|
||||
CallbackImpl<R,UArgs...> const *otherDerived =
|
||||
dynamic_cast<CallbackImpl<R,UArgs...> const *> (PeekPointer (other));
|
||||
|
||||
if (otherDerived == 0)
|
||||
if (otherDerived == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -531,12 +531,12 @@ public:
|
||||
*/
|
||||
bool IsNull () const
|
||||
{
|
||||
return (DoPeekImpl () == 0);
|
||||
return (DoPeekImpl () == nullptr);
|
||||
}
|
||||
/** Discard the implementation, set it to null */
|
||||
void Nullify ()
|
||||
{
|
||||
m_impl = 0;
|
||||
m_impl = nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -606,7 +606,7 @@ private:
|
||||
bool DoCheckType (Ptr<const CallbackImplBase> other) const
|
||||
{
|
||||
if (other &&
|
||||
dynamic_cast<const CallbackImpl<R,UArgs...> *> (PeekPointer (other)) != 0)
|
||||
dynamic_cast<const CallbackImpl<R,UArgs...> *> (PeekPointer (other)) != nullptr)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ CommandLine::PrintDoxygenUsage () const
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
const char * envVar = std::getenv ("NS_COMMANDLINE_INTROSPECTION");
|
||||
if (envVar == 0 || std::strlen (envVar) == 0)
|
||||
if (envVar == nullptr || std::strlen (envVar) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -796,7 +796,7 @@ CommandLine::GetExtraNonOption (std::size_t i) const
|
||||
if (m_nonOptions.size () >= i + m_NNonOptions)
|
||||
{
|
||||
auto ip = dynamic_cast<StringItem *> (m_nonOptions[i + m_NNonOptions]);
|
||||
if (ip != NULL)
|
||||
if (ip != nullptr)
|
||||
{
|
||||
value = ip->m_value;
|
||||
}
|
||||
|
||||
@@ -534,7 +534,7 @@ Resolver::DoResolve (std::string path, Ptr<Object> root)
|
||||
}
|
||||
// attempt to cast to a pointer checker.
|
||||
const PointerChecker *pChecker = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
|
||||
if (pChecker != 0)
|
||||
if (pChecker != nullptr)
|
||||
{
|
||||
NS_LOG_DEBUG ("GetAttribute(ptr)=" << info.name << " on path=" << GetResolvedPath ());
|
||||
PointerValue pValue;
|
||||
@@ -555,7 +555,7 @@ Resolver::DoResolve (std::string path, Ptr<Object> root)
|
||||
// attempt to cast to an object vector.
|
||||
const ObjectPtrContainerChecker *vectorChecker =
|
||||
dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
|
||||
if (vectorChecker != 0)
|
||||
if (vectorChecker != nullptr)
|
||||
{
|
||||
NS_LOG_DEBUG ("GetAttribute(vector)=" << info.name << " on path=" << GetResolvedPath () << pathLeft);
|
||||
foundMatch = true;
|
||||
@@ -776,7 +776,7 @@ public:
|
||||
// the root pointer zeroed indicates to the resolver that it should start
|
||||
// looking at the root of the "/Names" namespace during this go.
|
||||
//
|
||||
resolver.Resolve (0);
|
||||
resolver.Resolve (nullptr);
|
||||
|
||||
return MatchContainer (resolver.m_objects, resolver.m_contexts, path);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ DefaultSimulatorImpl::DoDispose ()
|
||||
Scheduler::Event next = m_events->RemoveNext ();
|
||||
next.impl->Unref ();
|
||||
}
|
||||
m_events = 0;
|
||||
m_events = nullptr;
|
||||
SimulatorImpl::DoDispose ();
|
||||
}
|
||||
void
|
||||
@@ -362,7 +362,7 @@ DefaultSimulatorImpl::IsExpired (const EventId &id) const
|
||||
{
|
||||
if (id.GetUid () == EventId::UID::DESTROY)
|
||||
{
|
||||
if (id.PeekEventImpl () == 0
|
||||
if (id.PeekEventImpl () == nullptr
|
||||
|| id.PeekEventImpl ()->IsCancelled ())
|
||||
{
|
||||
return true;
|
||||
@@ -377,7 +377,7 @@ DefaultSimulatorImpl::IsExpired (const EventId &id) const
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (id.PeekEventImpl () == 0
|
||||
if (id.PeekEventImpl () == nullptr
|
||||
|| id.GetTs () < m_currentTs
|
||||
|| (id.GetTs () == m_currentTs && id.GetUid () <= m_currentUid)
|
||||
|| id.PeekEventImpl ()->IsCancelled ())
|
||||
|
||||
@@ -61,7 +61,7 @@ Ptr<const AttributeChecker> MakeDoubleChecker (double min, double max, std::stri
|
||||
{
|
||||
NS_LOG_FUNCTION (&value);
|
||||
const DoubleValue *v = dynamic_cast<const DoubleValue *> (&value);
|
||||
if (v == 0)
|
||||
if (v == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ Ptr<const AttributeChecker> MakeDoubleChecker (double min, double max, std::stri
|
||||
NS_LOG_FUNCTION (&source << &destination);
|
||||
const DoubleValue *src = dynamic_cast<const DoubleValue *> (&source);
|
||||
DoubleValue *dst = dynamic_cast<DoubleValue *> (&destination);
|
||||
if (src == 0 || dst == 0)
|
||||
if (src == nullptr || dst == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ EnumValue::SerializeToString (Ptr<const AttributeChecker> checker) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this << checker);
|
||||
const EnumChecker *p = dynamic_cast<const EnumChecker *> (PeekPointer (checker));
|
||||
NS_ASSERT (p != 0);
|
||||
NS_ASSERT (p != nullptr);
|
||||
std::string name = p->GetName (m_value);
|
||||
return name;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ EnumValue::DeserializeFromString (std::string value, Ptr<const AttributeChecker>
|
||||
{
|
||||
NS_LOG_FUNCTION (this << value << checker);
|
||||
const EnumChecker *p = dynamic_cast<const EnumChecker *> (PeekPointer (checker));
|
||||
NS_ASSERT (p != 0);
|
||||
NS_ASSERT (p != nullptr);
|
||||
m_value = p->GetValue (value);
|
||||
return true;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ EnumChecker::Check (const AttributeValue &value) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this << &value);
|
||||
const EnumValue *p = dynamic_cast<const EnumValue *> (&value);
|
||||
if (p == 0)
|
||||
if (p == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ EnumChecker::Copy (const AttributeValue &source, AttributeValue &destination) co
|
||||
NS_LOG_FUNCTION (this << &source << &destination);
|
||||
const EnumValue *src = dynamic_cast<const EnumValue *> (&source);
|
||||
EnumValue *dst = dynamic_cast<EnumValue *> (&destination);
|
||||
if (src == 0 || dst == 0)
|
||||
if (src == nullptr || dst == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ns3 {
|
||||
NS_LOG_COMPONENT_DEFINE ("EventId");
|
||||
|
||||
EventId::EventId ()
|
||||
: m_eventImpl (0),
|
||||
: m_eventImpl (nullptr),
|
||||
m_ts (0),
|
||||
m_context (0),
|
||||
m_uid (0)
|
||||
|
||||
@@ -125,7 +125,7 @@ ExampleAsTestCase::DoRun ()
|
||||
|
||||
// Check that we're not just introspecting the command-line
|
||||
const char * envVar = std::getenv ("NS_COMMANDLINE_INTROSPECTION");
|
||||
if (envVar != 0 && std::strlen (envVar) != 0)
|
||||
if (envVar != nullptr && std::strlen (envVar) != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace {
|
||||
std::list<std::ostream*> ** PeekStreamList ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
static std::list<std::ostream*> *streams = 0;
|
||||
static std::list<std::ostream*> *streams = nullptr;
|
||||
return &streams;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ std::list<std::ostream*> * GetStreamList ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
std::list<std::ostream*> **pstreams = PeekStreamList ();
|
||||
if (*pstreams == 0)
|
||||
if (*pstreams == nullptr)
|
||||
{
|
||||
*pstreams = new std::list<std::ostream*> ();
|
||||
}
|
||||
@@ -108,7 +108,7 @@ UnregisterStream (std::ostream* stream)
|
||||
{
|
||||
NS_LOG_FUNCTION (stream);
|
||||
std::list<std::ostream*> **pl = PeekStreamList ();
|
||||
if (*pl == 0)
|
||||
if (*pl == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ UnregisterStream (std::ostream* stream)
|
||||
if ((*pl)->empty ())
|
||||
{
|
||||
delete *pl;
|
||||
*pl = 0;
|
||||
*pl = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ FlushStreams ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
std::list<std::ostream*> **pl = PeekStreamList ();
|
||||
if (*pl == 0)
|
||||
if (*pl == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ FlushStreams ()
|
||||
* duration of this function. */
|
||||
struct sigaction hdl;
|
||||
hdl.sa_handler = sigHandler;
|
||||
sigaction (SIGSEGV, &hdl, 0);
|
||||
sigaction (SIGSEGV, &hdl, nullptr);
|
||||
|
||||
std::list<std::ostream*> *l = *pl;
|
||||
|
||||
@@ -176,10 +176,10 @@ FlushStreams ()
|
||||
|
||||
/* Restore default SIGSEGV handler (Not that it matters anyway) */
|
||||
hdl.sa_handler = SIG_DFL;
|
||||
sigaction (SIGSEGV, &hdl, 0);
|
||||
sigaction (SIGSEGV, &hdl, nullptr);
|
||||
|
||||
/* Flush all opened FILE* */
|
||||
std::fflush (0);
|
||||
std::fflush (nullptr);
|
||||
|
||||
/* Flush stdandard streams - shouldn't be required (except for clog) */
|
||||
std::cout.flush ();
|
||||
@@ -187,7 +187,7 @@ FlushStreams ()
|
||||
std::clog.flush ();
|
||||
|
||||
delete l;
|
||||
*pl = 0;
|
||||
*pl = nullptr;
|
||||
}
|
||||
|
||||
} // namespace FatalImpl
|
||||
|
||||
@@ -45,8 +45,8 @@ GlobalValue::GlobalValue (std::string name, std::string help,
|
||||
Ptr<const AttributeChecker> checker)
|
||||
: m_name (name),
|
||||
m_help (help),
|
||||
m_initialValue (0),
|
||||
m_currentValue (0),
|
||||
m_initialValue (nullptr),
|
||||
m_currentValue (nullptr),
|
||||
m_checker (checker)
|
||||
{
|
||||
NS_LOG_FUNCTION (name << help << &initialValue << checker);
|
||||
@@ -70,7 +70,7 @@ GlobalValue::InitializeFromEnv ()
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
const char *envVar = getenv ("NS_GLOBAL_VALUE");
|
||||
if (envVar == 0 || std::strlen (envVar) == 0)
|
||||
if (envVar == nullptr || std::strlen (envVar) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ GlobalValue::GetValue (AttributeValue &value) const
|
||||
return;
|
||||
}
|
||||
StringValue *str = dynamic_cast<StringValue *> (&value);
|
||||
if (str == 0)
|
||||
if (str == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("GlobalValue name=" << m_name << ": input value is not a string");
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ HeapScheduler::HeapScheduler ()
|
||||
// we purposely waste an item at the start of
|
||||
// the array to make sure the indexes in the
|
||||
// array start at one.
|
||||
Scheduler::Event empty = { 0,{ 0,0}};
|
||||
Scheduler::Event empty = { nullptr,{ 0,0}};
|
||||
m_heap.push_back (empty);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ MakeIntegerChecker (int64_t min, int64_t max, std::string name)
|
||||
{
|
||||
NS_LOG_FUNCTION (&value);
|
||||
const IntegerValue *v = dynamic_cast<const IntegerValue *> (&value);
|
||||
if (v == 0)
|
||||
if (v == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ MakeIntegerChecker (int64_t min, int64_t max, std::string name)
|
||||
NS_LOG_FUNCTION (&src << &dst);
|
||||
const IntegerValue *source = dynamic_cast<const IntegerValue *> (&src);
|
||||
IntegerValue *destination = dynamic_cast<IntegerValue *> (&dst);
|
||||
if (source == 0 || destination == 0)
|
||||
if (source == nullptr || destination == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -44,12 +44,12 @@ namespace ns3 {
|
||||
* The Log TimePrinter.
|
||||
* This is private to the logging implementation.
|
||||
*/
|
||||
static TimePrinter g_logTimePrinter = 0;
|
||||
static TimePrinter g_logTimePrinter = nullptr;
|
||||
/**
|
||||
* \ingroup logging
|
||||
* The Log NodePrinter.
|
||||
*/
|
||||
static NodePrinter g_logNodePrinter = 0;
|
||||
static NodePrinter g_logNodePrinter = nullptr;
|
||||
|
||||
/**
|
||||
* \ingroup logging
|
||||
@@ -82,7 +82,7 @@ LogComponent::GetComponentList ()
|
||||
PrintList::PrintList ()
|
||||
{
|
||||
const char *envVar = std::getenv ("NS_LOG");
|
||||
if (envVar == 0 || std::strlen (envVar) == 0)
|
||||
if (envVar == nullptr || std::strlen (envVar) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ void
|
||||
LogComponent::EnvVarCheck ()
|
||||
{
|
||||
const char *envVar = std::getenv ("NS_LOG");
|
||||
if (envVar == 0 || std::strlen (envVar) == 0)
|
||||
if (envVar == nullptr || std::strlen (envVar) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -528,7 +528,7 @@ static bool ComponentExists (std::string componentName)
|
||||
static void CheckEnvironmentVariables ()
|
||||
{
|
||||
const char *envVar = std::getenv ("NS_LOG");
|
||||
if (envVar == 0 || std::strlen (envVar) == 0)
|
||||
if (envVar == nullptr || std::strlen (envVar) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
};
|
||||
|
||||
NameNode::NameNode ()
|
||||
: m_parent (0), m_name (""), m_object (0)
|
||||
: m_parent (nullptr), m_name (""), m_object (nullptr)
|
||||
{}
|
||||
|
||||
NameNode::NameNode (const NameNode &nameNode)
|
||||
@@ -277,9 +277,9 @@ NamesPriv::NamesPriv ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
m_root.m_parent = 0;
|
||||
m_root.m_parent = nullptr;
|
||||
m_root.m_name = "Names";
|
||||
m_root.m_object = 0;
|
||||
m_root.m_object = nullptr;
|
||||
}
|
||||
|
||||
NamesPriv::~NamesPriv ()
|
||||
@@ -305,9 +305,9 @@ NamesPriv::Clear ()
|
||||
|
||||
m_objectMap.clear ();
|
||||
|
||||
m_root.m_parent = 0;
|
||||
m_root.m_parent = nullptr;
|
||||
m_root.m_name = "Names";
|
||||
m_root.m_object = 0;
|
||||
m_root.m_object = nullptr;
|
||||
m_root.m_nameMap.clear ();
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ NamesPriv::Add (std::string path, std::string name, Ptr<Object> object)
|
||||
NS_LOG_FUNCTION (this << path << name << object);
|
||||
if (path == "/Names")
|
||||
{
|
||||
return Add (Ptr<Object> (0, false), name, object);
|
||||
return Add (Ptr<Object> (nullptr, false), name, object);
|
||||
}
|
||||
return Add (Find (path), name, object);
|
||||
}
|
||||
@@ -395,7 +395,7 @@ NamesPriv::Add (Ptr<Object> context, std::string name, Ptr<Object> object)
|
||||
return false;
|
||||
}
|
||||
|
||||
NameNode *node = 0;
|
||||
NameNode *node = nullptr;
|
||||
if (context)
|
||||
{
|
||||
node = IsNamed (context);
|
||||
@@ -489,7 +489,7 @@ NamesPriv::Rename (std::string path, std::string oldname, std::string newname)
|
||||
NS_LOG_FUNCTION (this << path << oldname << newname);
|
||||
if (path == "/Names")
|
||||
{
|
||||
return Rename (Ptr<Object> (0, false), oldname, newname);
|
||||
return Rename (Ptr<Object> (nullptr, false), oldname, newname);
|
||||
}
|
||||
return Rename (Find (path), oldname, newname);
|
||||
}
|
||||
@@ -499,7 +499,7 @@ NamesPriv::Rename (Ptr<Object> context, std::string oldname, std::string newname
|
||||
{
|
||||
NS_LOG_FUNCTION (this << context << oldname << newname);
|
||||
|
||||
NameNode *node = 0;
|
||||
NameNode *node = nullptr;
|
||||
if (context)
|
||||
{
|
||||
node = IsNamed (context);
|
||||
@@ -581,7 +581,7 @@ NamesPriv::FindPath (Ptr<Object> object)
|
||||
path = "/" + p->m_name + path;
|
||||
NS_LOG_LOGIC ("path is " << path);
|
||||
}
|
||||
while ((p = p->m_parent) != 0);
|
||||
while ((p = p->m_parent) != nullptr);
|
||||
|
||||
return path;
|
||||
}
|
||||
@@ -644,7 +644,7 @@ NamesPriv::Find (std::string path)
|
||||
if (i == node->m_nameMap.end ())
|
||||
{
|
||||
NS_LOG_LOGIC ("Name does not exist in name map");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -665,7 +665,7 @@ NamesPriv::Find (std::string path)
|
||||
if (i == node->m_nameMap.end ())
|
||||
{
|
||||
NS_LOG_LOGIC ("Name does not exist in name map");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -678,7 +678,7 @@ NamesPriv::Find (std::string path)
|
||||
}
|
||||
|
||||
NS_ASSERT_MSG (node, "NamesPriv::Find(): Internal error: this can't happen");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Ptr<Object>
|
||||
@@ -688,7 +688,7 @@ NamesPriv::Find (std::string path, std::string name)
|
||||
|
||||
if (path == "/Names")
|
||||
{
|
||||
return Find (Ptr<Object> (0, false), name);
|
||||
return Find (Ptr<Object> (nullptr, false), name);
|
||||
}
|
||||
return Find (Find (path), name);
|
||||
}
|
||||
@@ -698,7 +698,7 @@ NamesPriv::Find (Ptr<Object> context, std::string name)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << context << name);
|
||||
|
||||
NameNode *node = 0;
|
||||
NameNode *node = nullptr;
|
||||
|
||||
if (!context)
|
||||
{
|
||||
@@ -708,10 +708,10 @@ NamesPriv::Find (Ptr<Object> context, std::string name)
|
||||
else
|
||||
{
|
||||
node = IsNamed (context);
|
||||
if (node == 0)
|
||||
if (node == nullptr)
|
||||
{
|
||||
NS_LOG_LOGIC ("Context does not point to a previously named node");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,7 +719,7 @@ NamesPriv::Find (Ptr<Object> context, std::string name)
|
||||
if (i == node->m_nameMap.end ())
|
||||
{
|
||||
NS_LOG_LOGIC ("Name does not exist in name map");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -737,7 +737,7 @@ NamesPriv::IsNamed (Ptr<Object> object)
|
||||
if (i == m_objectMap.end ())
|
||||
{
|
||||
NS_LOG_LOGIC ("Object does not exist in object map, returning NameNode 0");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -462,7 +462,7 @@ Names::Find (std::string path)
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ Names::Find (std::string path, std::string name)
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,7 +494,7 @@ Names::Find (Ptr<Object> context, std::string name)
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ EnvDictionary (std::string key)
|
||||
if (dict.size () == 0)
|
||||
{
|
||||
const char *envVar = getenv ("NS_ATTRIBUTE_DEFAULT");
|
||||
if (envVar != 0 && std::strlen (envVar) > 0)
|
||||
if (envVar != nullptr && std::strlen (envVar) > 0)
|
||||
{
|
||||
std::string env = envVar;
|
||||
std::string::size_type cur = 0;
|
||||
@@ -311,7 +311,7 @@ ObjectBase::GetAttribute (std::string name, AttributeValue &value) const
|
||||
return;
|
||||
}
|
||||
StringValue *str = dynamic_cast<StringValue *> (&value);
|
||||
if (str == 0)
|
||||
if (str == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("Attribute name=" << name << " tid=" << tid.GetName () << ": input value is not a string");
|
||||
}
|
||||
@@ -346,7 +346,7 @@ ObjectBase::GetAttributeFailSafe (std::string name, AttributeValue &value) const
|
||||
return true;
|
||||
}
|
||||
StringValue *str = dynamic_cast<StringValue *> (&value);
|
||||
if (str == 0)
|
||||
if (str == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ ObjectFactory::Create () const
|
||||
Callback<ObjectBase *> cb = m_tid.GetConstructor ();
|
||||
ObjectBase *base = cb ();
|
||||
Object *derived = dynamic_cast<Object *> (base);
|
||||
NS_ASSERT (derived != 0);
|
||||
NS_ASSERT (derived != nullptr);
|
||||
derived->SetTypeId (m_tid);
|
||||
derived->Construct (m_parameters);
|
||||
Ptr<Object> object = Ptr<Object> (derived, false);
|
||||
|
||||
@@ -84,7 +84,7 @@ MakeObjectMapAccessor (U T::*memberVector)
|
||||
bool DoGetN (const ObjectBase *object, std::size_t *n) const override
|
||||
{
|
||||
const T *obj = dynamic_cast<const T *> (object);
|
||||
if (obj == 0)
|
||||
if (obj == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ MakeObjectMapAccessor (U T::*memberVector)
|
||||
}
|
||||
NS_ASSERT (false);
|
||||
// quiet compiler.
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
U T::*m_memberVector;
|
||||
} *spec = new MemberStdContainer ();
|
||||
|
||||
@@ -58,7 +58,7 @@ ObjectPtrContainerValue::Get (std::size_t i) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this << i);
|
||||
Iterator it = m_objects.find (i);
|
||||
Ptr<Object> value = 0;
|
||||
Ptr<Object> value = nullptr;
|
||||
if ( it != m_objects.end () )
|
||||
{
|
||||
value = m_objects.find (i)->second;
|
||||
@@ -108,7 +108,7 @@ ObjectPtrContainerAccessor::Get (const ObjectBase * object, AttributeValue &valu
|
||||
{
|
||||
NS_LOG_FUNCTION (this << object << &value);
|
||||
ObjectPtrContainerValue *v = dynamic_cast<ObjectPtrContainerValue *> (&value);
|
||||
if (v == 0)
|
||||
if (v == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
}
|
||||
bool Check (const AttributeValue &value) const override
|
||||
{
|
||||
return dynamic_cast<const ObjectPtrContainerValue *> (&value) != 0;
|
||||
return dynamic_cast<const ObjectPtrContainerValue *> (&value) != nullptr;
|
||||
}
|
||||
std::string GetValueTypeName () const override
|
||||
{
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
{
|
||||
const ObjectPtrContainerValue *src = dynamic_cast<const ObjectPtrContainerValue *> (&source);
|
||||
ObjectPtrContainerValue *dst = dynamic_cast<ObjectPtrContainerValue *> (&destination);
|
||||
if (src == 0 || dst == 0)
|
||||
if (src == nullptr || dst == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -259,7 +259,7 @@ MakeObjectPtrContainerAccessor (Ptr<U> (T::*get)(INDEX) const,
|
||||
bool DoGetN (const ObjectBase *object, std::size_t *n) const override
|
||||
{
|
||||
const T *obj = dynamic_cast<const T *> (object);
|
||||
if (obj == 0)
|
||||
if (obj == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ MakeObjectVectorAccessor (U T::*memberVector)
|
||||
bool DoGetN (const ObjectBase *object, std::size_t *n) const override
|
||||
{
|
||||
const T *obj = dynamic_cast<const T *> (object);
|
||||
if (obj == 0)
|
||||
if (obj == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ MakeObjectVectorAccessor (U T::*memberVector)
|
||||
}
|
||||
NS_ASSERT (false);
|
||||
// quiet compiler.
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
U T::*m_memberVector;
|
||||
} *spec = new MemberStdContainer ();
|
||||
|
||||
@@ -47,7 +47,7 @@ NS_LOG_COMPONENT_DEFINE ("Object");
|
||||
NS_OBJECT_ENSURE_REGISTERED (Object);
|
||||
|
||||
Object::AggregateIterator::AggregateIterator ()
|
||||
: m_object (0),
|
||||
: m_object (nullptr),
|
||||
m_current (0)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
@@ -126,7 +126,7 @@ Object::~Object ()
|
||||
{
|
||||
std::free (m_aggregates);
|
||||
}
|
||||
m_aggregates = 0;
|
||||
m_aggregates = nullptr;
|
||||
}
|
||||
Object::Object (const Object &o)
|
||||
: m_tid (o.m_tid),
|
||||
@@ -177,7 +177,7 @@ Object::DoGetObject (TypeId tid) const
|
||||
return const_cast<Object *> (current);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
void
|
||||
Object::Initialize ()
|
||||
|
||||
@@ -472,7 +472,7 @@ Object::GetObject () const
|
||||
// This is an optimization: if the cast works (which is likely),
|
||||
// things will be pretty fast.
|
||||
T *result = dynamic_cast<T *> (m_aggregates->buffer[0]);
|
||||
if (result != 0)
|
||||
if (result != nullptr)
|
||||
{
|
||||
return Ptr<T> (result);
|
||||
}
|
||||
@@ -482,7 +482,7 @@ Object::GetObject () const
|
||||
{
|
||||
return Ptr<T> (static_cast<T *> (PeekPointer (found)));
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -508,7 +508,7 @@ Object::GetObject (TypeId tid) const
|
||||
{
|
||||
return Ptr<T> (static_cast<T *> (PeekPointer (found)));
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -196,8 +196,8 @@ private:
|
||||
|
||||
template <class A, class B>
|
||||
PairChecker<A, B>::PairChecker ()
|
||||
: m_firstchecker (0),
|
||||
m_secondchecker (0)
|
||||
: m_firstchecker (nullptr),
|
||||
m_secondchecker (nullptr)
|
||||
{}
|
||||
|
||||
template <class A, class B>
|
||||
|
||||
@@ -132,7 +132,7 @@ class PointerChecker : public ns3::PointerChecker
|
||||
bool Check (const AttributeValue &val) const override
|
||||
{
|
||||
const PointerValue *value = dynamic_cast<const PointerValue *> (&val);
|
||||
if (value == 0)
|
||||
if (value == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ class PointerChecker : public ns3::PointerChecker
|
||||
return true;
|
||||
}
|
||||
T *ptr = dynamic_cast<T*> (PeekPointer (value->GetObject ()));
|
||||
if (ptr == 0)
|
||||
if (ptr == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ class PointerChecker : public ns3::PointerChecker
|
||||
{
|
||||
const PointerValue *src = dynamic_cast<const PointerValue *> (&source);
|
||||
PointerValue *dst = dynamic_cast<PointerValue *> (&destination);
|
||||
if (src == 0 || dst == 0)
|
||||
if (src == nullptr || dst == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -662,7 +662,7 @@ template <typename T>
|
||||
void
|
||||
Ptr<T>::Acquire () const
|
||||
{
|
||||
if (m_ptr != 0)
|
||||
if (m_ptr != nullptr)
|
||||
{
|
||||
m_ptr->Ref ();
|
||||
}
|
||||
@@ -670,7 +670,7 @@ Ptr<T>::Acquire () const
|
||||
|
||||
template <typename T>
|
||||
Ptr<T>::Ptr ()
|
||||
: m_ptr (0)
|
||||
: m_ptr (nullptr)
|
||||
{}
|
||||
|
||||
template <typename T>
|
||||
@@ -695,7 +695,7 @@ Ptr<T>::Ptr (Ptr const&o)
|
||||
: m_ptr (nullptr)
|
||||
{
|
||||
T* ptr = PeekPointer (o);
|
||||
if (ptr != 0)
|
||||
if (ptr != nullptr)
|
||||
{
|
||||
m_ptr = ptr;
|
||||
Acquire ();
|
||||
@@ -712,7 +712,7 @@ Ptr<T>::Ptr (Ptr<U> const &o)
|
||||
template <typename T>
|
||||
Ptr<T>::~Ptr ()
|
||||
{
|
||||
if (m_ptr != 0)
|
||||
if (m_ptr != nullptr)
|
||||
{
|
||||
m_ptr->Unref ();
|
||||
}
|
||||
@@ -726,7 +726,7 @@ Ptr<T>::operator = (Ptr const& o)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
if (m_ptr != 0)
|
||||
if (m_ptr != nullptr)
|
||||
{
|
||||
m_ptr->Unref ();
|
||||
}
|
||||
@@ -781,7 +781,7 @@ Ptr<T>::operator Tester * () const // NS_DEPRECATED_3_37
|
||||
template <typename T>
|
||||
Ptr<T>::operator bool() const
|
||||
{
|
||||
return m_ptr != 0;
|
||||
return m_ptr != nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ RandomVariableStream::GetTypeId ()
|
||||
}
|
||||
|
||||
RandomVariableStream::RandomVariableStream ()
|
||||
: m_rng (0)
|
||||
: m_rng (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
@@ -1460,7 +1460,7 @@ DeterministicRandomVariable::DeterministicRandomVariable ()
|
||||
:
|
||||
m_count (0),
|
||||
m_next (0),
|
||||
m_data (0)
|
||||
m_data (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
@@ -1468,7 +1468,7 @@ DeterministicRandomVariable::~DeterministicRandomVariable ()
|
||||
{
|
||||
// Delete any values currently set.
|
||||
NS_LOG_FUNCTION (this);
|
||||
if (m_data != 0)
|
||||
if (m_data != nullptr)
|
||||
{
|
||||
delete[] m_data;
|
||||
}
|
||||
@@ -1479,7 +1479,7 @@ DeterministicRandomVariable::SetValueArray (double* values, std::size_t length)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << values << length);
|
||||
// Delete any values currently set.
|
||||
if (m_data != 0)
|
||||
if (m_data != nullptr)
|
||||
{
|
||||
delete[] m_data;
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ RealtimeSimulatorImpl::DoDispose ()
|
||||
Scheduler::Event next = m_events->RemoveNext ();
|
||||
next.impl->Unref ();
|
||||
}
|
||||
m_events = 0;
|
||||
m_synchronizer = 0;
|
||||
m_events = nullptr;
|
||||
m_synchronizer = nullptr;
|
||||
SimulatorImpl::DoDispose ();
|
||||
}
|
||||
|
||||
@@ -747,7 +747,7 @@ RealtimeSimulatorImpl::IsExpired (const EventId &id) const
|
||||
{
|
||||
if (id.GetUid () == EventId::UID::DESTROY)
|
||||
{
|
||||
if (id.PeekEventImpl () == 0
|
||||
if (id.PeekEventImpl () == nullptr
|
||||
|| id.PeekEventImpl ()->IsCancelled ())
|
||||
{
|
||||
return true;
|
||||
@@ -772,7 +772,7 @@ RealtimeSimulatorImpl::IsExpired (const EventId &id) const
|
||||
//
|
||||
// The same is true for the next line involving the m_currentUid.
|
||||
//
|
||||
if (id.PeekEventImpl () == 0
|
||||
if (id.PeekEventImpl () == nullptr
|
||||
|| id.GetTs () < m_currentTs
|
||||
|| (id.GetTs () == m_currentTs && id.GetUid () <= m_currentUid)
|
||||
|| id.PeekEventImpl ()->IsCancelled ())
|
||||
|
||||
@@ -98,8 +98,8 @@ template <typename T>
|
||||
T **
|
||||
SimulationSingleton<T>::GetObject ()
|
||||
{
|
||||
static T *pobject = 0;
|
||||
if (pobject == 0)
|
||||
static T *pobject = nullptr;
|
||||
if (pobject == nullptr)
|
||||
{
|
||||
pobject = new T ();
|
||||
Simulator::ScheduleDestroy (&SimulationSingleton<T>::DeleteObject);
|
||||
@@ -113,7 +113,7 @@ SimulationSingleton<T>::DeleteObject ()
|
||||
{
|
||||
T **ppobject = GetObject ();
|
||||
delete (*ppobject);
|
||||
*ppobject = 0;
|
||||
*ppobject = nullptr;
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -85,7 +85,7 @@ static GlobalValue g_schedTypeImpl = GlobalValue ("SchedulerType",
|
||||
*/
|
||||
static SimulatorImpl ** PeekImpl ()
|
||||
{
|
||||
static SimulatorImpl *impl = 0;
|
||||
static SimulatorImpl *impl = nullptr;
|
||||
return &impl;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ static SimulatorImpl * GetImpl ()
|
||||
/* Please, don't include any calls to logging macros in this function
|
||||
* or pay the price, that is, stack explosions.
|
||||
*/
|
||||
if (*pimpl == 0)
|
||||
if (*pimpl == nullptr)
|
||||
{
|
||||
{
|
||||
ObjectFactory factory;
|
||||
@@ -138,7 +138,7 @@ Simulator::Destroy ()
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
|
||||
SimulatorImpl **pimpl = PeekImpl ();
|
||||
if (*pimpl == 0)
|
||||
if (*pimpl == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -147,11 +147,11 @@ Simulator::Destroy ()
|
||||
* legal), Simulator::GetImpl will trigger again an infinite recursion until
|
||||
* the stack explodes.
|
||||
*/
|
||||
LogSetTimePrinter (0);
|
||||
LogSetNodePrinter (0);
|
||||
LogSetTimePrinter (nullptr);
|
||||
LogSetNodePrinter (nullptr);
|
||||
(*pimpl)->Destroy ();
|
||||
(*pimpl)->Unref ();
|
||||
*pimpl = 0;
|
||||
*pimpl = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -257,7 +257,7 @@ Simulator::DoScheduleDestroy (EventImpl *impl)
|
||||
void
|
||||
Simulator::Remove (const EventId &id)
|
||||
{
|
||||
if (*PeekImpl () == 0)
|
||||
if (*PeekImpl () == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ Simulator::Remove (const EventId &id)
|
||||
void
|
||||
Simulator::Cancel (const EventId &id)
|
||||
{
|
||||
if (*PeekImpl () == 0)
|
||||
if (*PeekImpl () == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -277,7 +277,7 @@ Simulator::Cancel (const EventId &id)
|
||||
bool
|
||||
Simulator::IsExpired (const EventId &id)
|
||||
{
|
||||
if (*PeekImpl () == 0)
|
||||
if (*PeekImpl () == nullptr)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ Simulator::GetSystemId ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
|
||||
if (*PeekImpl () != 0)
|
||||
if (*PeekImpl () != nullptr)
|
||||
{
|
||||
return GetImpl ()->GetSystemId ();
|
||||
}
|
||||
@@ -327,7 +327,7 @@ void
|
||||
Simulator::SetImplementation (Ptr<SimulatorImpl> impl)
|
||||
{
|
||||
NS_LOG_FUNCTION (impl);
|
||||
if (*PeekImpl () != 0)
|
||||
if (*PeekImpl () != nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("It is not possible to set the implementation after calling any Simulator:: function. Call Simulator::SetImplementation earlier or after Simulator::Destroy.");
|
||||
}
|
||||
|
||||
@@ -307,13 +307,13 @@ std::string
|
||||
MakeTemporaryDirectoryName ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
char *path = NULL;
|
||||
char *path = nullptr;
|
||||
|
||||
path = std::getenv ("TMP");
|
||||
if (path == NULL || std::strlen (path) == 0)
|
||||
if (path == nullptr || std::strlen (path) == 0)
|
||||
{
|
||||
path = std::getenv ("TEMP");
|
||||
if (path == NULL || std::strlen (path) == 0)
|
||||
if (path == nullptr || std::strlen (path) == 0)
|
||||
{
|
||||
path = const_cast<char *> ("/tmp");
|
||||
}
|
||||
@@ -323,13 +323,13 @@ MakeTemporaryDirectoryName ()
|
||||
// Just in case the user wants to go back and find the output, we give
|
||||
// a hint as to which dir we created by including a time hint.
|
||||
//
|
||||
time_t now = time (NULL);
|
||||
time_t now = time (nullptr);
|
||||
struct tm *tm_now = localtime (&now);
|
||||
//
|
||||
// But we also randomize the name in case there are multiple users doing
|
||||
// this at the same time
|
||||
//
|
||||
srand (time (0));
|
||||
srand (time (nullptr));
|
||||
long int n = rand ();
|
||||
|
||||
//
|
||||
|
||||
@@ -141,7 +141,7 @@ SystemWallClockMs::~SystemWallClockMs ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
delete m_priv;
|
||||
m_priv = 0;
|
||||
m_priv = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -38,7 +38,7 @@ SystemWallClockTimestamp::SystemWallClockTimestamp ()
|
||||
void
|
||||
SystemWallClockTimestamp::Stamp ()
|
||||
{
|
||||
std::time_t seconds = std::time (NULL);
|
||||
std::time_t seconds = std::time (nullptr);
|
||||
m_diff = seconds - m_last;
|
||||
m_last = seconds;
|
||||
}
|
||||
|
||||
@@ -272,10 +272,10 @@ TestCase::Result::Result ()
|
||||
|
||||
|
||||
TestCase::TestCase (std::string name)
|
||||
: m_parent (0),
|
||||
: m_parent (nullptr),
|
||||
m_dataDir (""),
|
||||
m_runner (0),
|
||||
m_result (0),
|
||||
m_runner (nullptr),
|
||||
m_result (nullptr),
|
||||
m_name (name),
|
||||
m_duration (TestCase::QUICK)
|
||||
{
|
||||
@@ -285,8 +285,8 @@ TestCase::TestCase (std::string name)
|
||||
TestCase::~TestCase ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
NS_ASSERT (m_runner == 0);
|
||||
m_parent = 0;
|
||||
NS_ASSERT (m_runner == nullptr);
|
||||
m_parent = nullptr;
|
||||
delete m_result;
|
||||
for (std::vector<TestCase *>::const_iterator i = m_children.begin (); i != m_children.end (); ++i)
|
||||
{
|
||||
@@ -364,7 +364,7 @@ TestCase::Run (TestRunnerImpl *runner)
|
||||
out:
|
||||
m_result->clock.End ();
|
||||
DoTeardown ();
|
||||
m_runner = 0;
|
||||
m_runner = nullptr;
|
||||
}
|
||||
std::string
|
||||
TestCase::GetName () const
|
||||
@@ -388,7 +388,7 @@ TestCase::ReportTestFailure (std::string cond, std::string actual,
|
||||
message, file, line));
|
||||
// set childrenFailed flag on parents.
|
||||
TestCase *current = m_parent;
|
||||
while (current != 0)
|
||||
while (current != nullptr)
|
||||
{
|
||||
current->m_result->childrenFailed = true;
|
||||
current = current->m_parent;
|
||||
@@ -413,11 +413,11 @@ TestCase::CreateDataDirFilename (std::string filename)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << filename);
|
||||
const TestCase *current = this;
|
||||
while (current != 0 && current->m_dataDir == "")
|
||||
while (current != nullptr && current->m_dataDir == "")
|
||||
{
|
||||
current = current->m_parent;
|
||||
}
|
||||
if (current == 0)
|
||||
if (current == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("No one called SetDataDir prior to calling this function");
|
||||
}
|
||||
@@ -438,7 +438,7 @@ TestCase::CreateTempDirFilename (std::string filename)
|
||||
{
|
||||
std::list<std::string> names;
|
||||
const TestCase *current = this;
|
||||
while (current != 0)
|
||||
while (current != nullptr)
|
||||
{
|
||||
names.push_front (current->m_name);
|
||||
current = current->m_parent;
|
||||
@@ -665,7 +665,7 @@ void
|
||||
TestRunnerImpl::PrintReport (TestCase *test, std::ostream *os, bool xml, int level)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << test << os << xml << level);
|
||||
if (test->m_result == 0)
|
||||
if (test->m_result == nullptr)
|
||||
{
|
||||
// Do not print reports for tests that were not run.
|
||||
return;
|
||||
@@ -788,7 +788,7 @@ TestRunnerImpl::PrintTestNameList (std::list<TestCase *>::const_iterator begin,
|
||||
for (std::list<TestCase *>::const_iterator i = begin; i != end; ++i)
|
||||
{
|
||||
TestSuite * test = dynamic_cast<TestSuite *> (*i);
|
||||
NS_ASSERT (test != 0);
|
||||
NS_ASSERT (test != nullptr);
|
||||
if (printTestType)
|
||||
{
|
||||
std::cout << label[test->GetTestType ()];
|
||||
@@ -881,7 +881,7 @@ TestRunnerImpl::Run (int argc, char *argv[])
|
||||
char ** argi = argv;
|
||||
++argi;
|
||||
|
||||
while (*argi != 0)
|
||||
while (*argi != nullptr)
|
||||
{
|
||||
char *arg = *argi;
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace {
|
||||
|
||||
// The set of marked times
|
||||
// static
|
||||
Time::MarkedTimes * Time::g_markingTimes = 0;
|
||||
Time::MarkedTimes * Time::g_markingTimes = nullptr;
|
||||
|
||||
/// The static mutex for critical sections around modification of Time::g_markingTimes.
|
||||
static std::mutex g_markingMutex;
|
||||
@@ -307,7 +307,7 @@ Time::ClearMarkedTimes ()
|
||||
{
|
||||
NS_LOG_LOGIC ("clearing MarkedTimes");
|
||||
g_markingTimes->erase (g_markingTimes->begin (), g_markingTimes->end ());
|
||||
g_markingTimes = 0;
|
||||
g_markingTimes = nullptr;
|
||||
}
|
||||
} // Time::ClearMarkedTimes
|
||||
|
||||
@@ -319,7 +319,7 @@ Time::Mark (Time * const time)
|
||||
std::unique_lock lock {g_markingMutex};
|
||||
|
||||
NS_LOG_FUNCTION (time);
|
||||
NS_ASSERT (time != 0);
|
||||
NS_ASSERT (time != nullptr);
|
||||
|
||||
// Repeat the g_markingTimes test here inside the CriticalSection,
|
||||
// since earlier test was outside and might be stale.
|
||||
@@ -345,7 +345,7 @@ Time::Clear (Time * const time)
|
||||
std::unique_lock lock {g_markingMutex};
|
||||
|
||||
NS_LOG_FUNCTION (time);
|
||||
NS_ASSERT (time != 0);
|
||||
NS_ASSERT (time != nullptr);
|
||||
|
||||
if (g_markingTimes)
|
||||
{
|
||||
@@ -376,7 +376,7 @@ Time::ConvertTimes (const enum Unit unit)
|
||||
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
|
||||
NS_ASSERT_MSG (g_markingTimes != 0,
|
||||
NS_ASSERT_MSG (g_markingTimes != nullptr,
|
||||
"No MarkedTimes registry. "
|
||||
"Time::SetResolution () called more than once?");
|
||||
|
||||
@@ -400,7 +400,7 @@ Time::ConvertTimes (const enum Unit unit)
|
||||
// Assert above already guarantees g_markingTimes != 0
|
||||
NS_LOG_LOGIC ("clearing MarkedTimes");
|
||||
g_markingTimes->erase (g_markingTimes->begin (), g_markingTimes->end ());
|
||||
g_markingTimes = 0;
|
||||
g_markingTimes = nullptr;
|
||||
|
||||
} // Time::ConvertTimes ()
|
||||
|
||||
@@ -531,7 +531,7 @@ MakeTimeChecker (const Time min, const Time max)
|
||||
{
|
||||
NS_LOG_FUNCTION (&value);
|
||||
const TimeValue *v = dynamic_cast<const TimeValue *> (&value);
|
||||
if (v == 0)
|
||||
if (v == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -564,7 +564,7 @@ MakeTimeChecker (const Time min, const Time max)
|
||||
NS_LOG_FUNCTION (&source << &destination);
|
||||
const TimeValue *src = dynamic_cast<const TimeValue *> (&source);
|
||||
TimeValue *dst = dynamic_cast<TimeValue *> (&destination);
|
||||
if (src == 0 || dst == 0)
|
||||
if (src == nullptr || dst == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -962,7 +962,7 @@ TimerImpl::SetArgs (T1 a1)
|
||||
typename TimerTraits<T1>::ParameterType
|
||||
> TimerImplBase;
|
||||
TimerImplBase *impl = dynamic_cast<TimerImplBase *> (this);
|
||||
if (impl == 0)
|
||||
if (impl == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("You tried to set Timer arguments incompatible with its function.");
|
||||
return;
|
||||
@@ -979,7 +979,7 @@ TimerImpl::SetArgs (T1 a1, T2 a2)
|
||||
typename TimerTraits<T2>::ParameterType
|
||||
> TimerImplBase;
|
||||
TimerImplBase *impl = dynamic_cast<TimerImplBase *> (this);
|
||||
if (impl == 0)
|
||||
if (impl == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("You tried to set Timer arguments incompatible with its function.");
|
||||
return;
|
||||
@@ -997,7 +997,7 @@ TimerImpl::SetArgs (T1 a1, T2 a2, T3 a3)
|
||||
typename TimerTraits<T3>::ParameterType
|
||||
> TimerImplBase;
|
||||
TimerImplBase *impl = dynamic_cast<TimerImplBase *> (this);
|
||||
if (impl == 0)
|
||||
if (impl == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("You tried to set Timer arguments incompatible with its function.");
|
||||
return;
|
||||
@@ -1016,7 +1016,7 @@ TimerImpl::SetArgs (T1 a1, T2 a2, T3 a3, T4 a4)
|
||||
typename TimerTraits<T4>::ParameterType
|
||||
> TimerImplBase;
|
||||
TimerImplBase *impl = dynamic_cast<TimerImplBase *> (this);
|
||||
if (impl == 0)
|
||||
if (impl == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("You tried to set Timer arguments incompatible with its function.");
|
||||
return;
|
||||
@@ -1036,7 +1036,7 @@ TimerImpl::SetArgs (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
|
||||
typename TimerTraits<T5>::ParameterType
|
||||
> TimerImplBase;
|
||||
TimerImplBase *impl = dynamic_cast<TimerImplBase *> (this);
|
||||
if (impl == 0)
|
||||
if (impl == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("You tried to set Timer arguments incompatible with its function.");
|
||||
return;
|
||||
|
||||
@@ -36,7 +36,7 @@ Timer::Timer ()
|
||||
: m_flags (CHECK_ON_DESTROY),
|
||||
m_delay (FemtoSeconds (0)),
|
||||
m_event (),
|
||||
m_impl (0)
|
||||
m_impl (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
@@ -45,7 +45,7 @@ Timer::Timer (enum DestroyPolicy destroyPolicy)
|
||||
: m_flags (destroyPolicy),
|
||||
m_delay (FemtoSeconds (0)),
|
||||
m_event (),
|
||||
m_impl (0)
|
||||
m_impl (nullptr)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << destroyPolicy);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ void
|
||||
Timer::Schedule (Time delay)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << delay);
|
||||
NS_ASSERT (m_impl != 0);
|
||||
NS_ASSERT (m_impl != nullptr);
|
||||
if (m_event.IsRunning ())
|
||||
{
|
||||
NS_FATAL_ERROR ("Event is still running while re-scheduling.");
|
||||
|
||||
@@ -292,7 +292,7 @@ template <typename... Ts>
|
||||
void
|
||||
Timer::SetArguments (Ts... args)
|
||||
{
|
||||
if (m_impl == 0)
|
||||
if (m_impl == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("You cannot set the arguments of a Timer before setting its function.");
|
||||
return;
|
||||
|
||||
@@ -125,7 +125,7 @@ Ptr<const TraceSourceAccessor> MakeTraceSourceAccessor (T a);
|
||||
static inline
|
||||
Ptr<const TraceSourceAccessor> MakeEmptyTraceSourceAccessor ()
|
||||
{
|
||||
return Ptr<const TraceSourceAccessor> (0);
|
||||
return Ptr<const TraceSourceAccessor> (nullptr);
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
@@ -155,7 +155,7 @@ DoMakeTraceSourceAccessor (SOURCE T::*a)
|
||||
bool ConnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const override
|
||||
{
|
||||
T *p = dynamic_cast<T*> (obj);
|
||||
if (p == 0)
|
||||
if (p == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ DoMakeTraceSourceAccessor (SOURCE T::*a)
|
||||
bool Connect (ObjectBase *obj, std::string context, const CallbackBase &cb) const override
|
||||
{
|
||||
T *p = dynamic_cast<T*> (obj);
|
||||
if (p == 0)
|
||||
if (p == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ DoMakeTraceSourceAccessor (SOURCE T::*a)
|
||||
bool DisconnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const override
|
||||
{
|
||||
T *p = dynamic_cast<T*> (obj);
|
||||
if (p == 0)
|
||||
if (p == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ DoMakeTraceSourceAccessor (SOURCE T::*a)
|
||||
bool Disconnect (ObjectBase *obj, std::string context, const CallbackBase &cb) const override
|
||||
{
|
||||
T *p = dynamic_cast<T*> (obj);
|
||||
if (p == 0)
|
||||
if (p == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace ns3 {
|
||||
NS_LOG_COMPONENT_DEFINE ("TrickleTimer");
|
||||
|
||||
TrickleTimer::TrickleTimer ()
|
||||
: m_impl (0),
|
||||
: m_impl (nullptr),
|
||||
m_timerExpiration (),
|
||||
m_intervalExpiration (),
|
||||
m_currentInterval (Time(0)),
|
||||
@@ -44,7 +44,7 @@ TrickleTimer::TrickleTimer ()
|
||||
}
|
||||
|
||||
TrickleTimer::TrickleTimer (Time minInterval, uint8_t doublings, uint16_t redundancy)
|
||||
: m_impl (0),
|
||||
: m_impl (nullptr),
|
||||
m_timerExpiration (),
|
||||
m_intervalExpiration (),
|
||||
m_currentInterval (Time(0)),
|
||||
|
||||
@@ -282,7 +282,7 @@ template <typename... Ts>
|
||||
void
|
||||
TrickleTimer::SetArguments (Ts&&... args)
|
||||
{
|
||||
if (m_impl == 0)
|
||||
if (m_impl == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("You cannot set the arguments of a TrickleTimer before setting its function.");
|
||||
return;
|
||||
|
||||
@@ -411,7 +411,7 @@ public:
|
||||
{
|
||||
const TupleValue<Args...> *src = dynamic_cast<const TupleValue<Args...> *> (&source);
|
||||
TupleValue<Args...> *dst = dynamic_cast<TupleValue<Args...> *> (&destination);
|
||||
if (src == 0 || dst == 0)
|
||||
if (src == nullptr || dst == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1170,7 +1170,7 @@ TypeId::LookupTraceSourceByName (std::string name,
|
||||
nextTid = tid.GetParent ();
|
||||
}
|
||||
while (nextTid != tid);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Ptr<const TraceSourceAccessor>
|
||||
|
||||
@@ -59,7 +59,7 @@ Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max, std
|
||||
{
|
||||
NS_LOG_FUNCTION (&value);
|
||||
const UintegerValue *v = dynamic_cast<const UintegerValue *> (&value);
|
||||
if (v == 0)
|
||||
if (v == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max, std
|
||||
NS_LOG_FUNCTION (&source << &destination);
|
||||
const UintegerValue *src = dynamic_cast<const UintegerValue *> (&source);
|
||||
UintegerValue *dst = dynamic_cast<UintegerValue *> (&destination);
|
||||
if (src == 0 || dst == 0)
|
||||
if (src == nullptr || dst == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ void FdReader::Run ()
|
||||
int r;
|
||||
fd_set readfds = rfds;
|
||||
|
||||
r = select (nfds, &readfds, NULL, NULL, NULL);
|
||||
r = select (nfds, &readfds, nullptr, nullptr, nullptr);
|
||||
if (r == -1 && errno != EINTR)
|
||||
{
|
||||
NS_FATAL_ERROR ("select() failed: " << std::strerror (errno));
|
||||
|
||||
@@ -76,7 +76,7 @@ protected:
|
||||
struct Data
|
||||
{
|
||||
/** Default constructor, with null buffer and zero length. */
|
||||
Data () : m_buf (0), m_len (0)
|
||||
Data () : m_buf (nullptr), m_len (0)
|
||||
{}
|
||||
/**
|
||||
* Construct from a buffer of a given length.
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace ns3 {
|
||||
NS_LOG_COMPONENT_DEFINE ("Watchdog");
|
||||
|
||||
Watchdog::Watchdog ()
|
||||
: m_impl (0),
|
||||
: m_impl (nullptr),
|
||||
m_event (),
|
||||
m_end (MicroSeconds (0))
|
||||
{
|
||||
|
||||
@@ -154,7 +154,7 @@ template <typename... Ts>
|
||||
void
|
||||
Watchdog::SetArguments (Ts&&... args)
|
||||
{
|
||||
if (m_impl == 0)
|
||||
if (m_impl == nullptr)
|
||||
{
|
||||
NS_FATAL_ERROR ("You cannot set the arguments of a Watchdog before setting its function.");
|
||||
return;
|
||||
|
||||
@@ -590,8 +590,8 @@ void
|
||||
MakeBoundCallbackTestCase::DoSetup ()
|
||||
{
|
||||
gMakeBoundCallbackTest1 = 0;
|
||||
gMakeBoundCallbackTest2 = 0;
|
||||
gMakeBoundCallbackTest3a = 0;
|
||||
gMakeBoundCallbackTest2 = nullptr;
|
||||
gMakeBoundCallbackTest3a = nullptr;
|
||||
gMakeBoundCallbackTest3b = 0;
|
||||
gMakeBoundCallbackTest4a = 0;
|
||||
gMakeBoundCallbackTest4b = 0;
|
||||
|
||||
@@ -91,7 +91,7 @@ CommandLineTestCaseBase::Parse (CommandLine &cmd, int n, ...)
|
||||
|
||||
int argc = n + 1; // test name will go in argv[0], other n to follow
|
||||
char ** argv = new char* [argc + 1]; // extra entry for final null
|
||||
argv[argc] = 0;
|
||||
argv[argc] = nullptr;
|
||||
|
||||
argv[0] = new char [strlen (ss.str ().c_str ()) + 1];
|
||||
strcpy (argv[0], ss.str ().c_str ());
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
};
|
||||
|
||||
EventGarbageCollectorTestCase::EventGarbageCollectorTestCase ()
|
||||
: TestCase ("EventGarbageCollector"), m_counter (0), m_events (0)
|
||||
: TestCase ("EventGarbageCollector"), m_counter (0), m_events (nullptr)
|
||||
{}
|
||||
|
||||
EventGarbageCollectorTestCase::~EventGarbageCollectorTestCase ()
|
||||
@@ -75,7 +75,7 @@ EventGarbageCollectorTestCase::EventGarbageCollectorCallback ()
|
||||
{
|
||||
// this should cause the remaining (50) events to be cancelled
|
||||
delete m_events;
|
||||
m_events = 0;
|
||||
m_events = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,10 +130,10 @@ BasicAddTestCase::DoRun ()
|
||||
std::string found;
|
||||
|
||||
Ptr<TestObject> objectOne = CreateObject<TestObject> ();
|
||||
Names::Add (Ptr<Object> (0, false), "Name One", objectOne);
|
||||
Names::Add (Ptr<Object> (nullptr, false), "Name One", objectOne);
|
||||
|
||||
Ptr<TestObject> objectTwo = CreateObject<TestObject> ();
|
||||
Names::Add (Ptr<Object> (0, false), "Name Two", objectTwo);
|
||||
Names::Add (Ptr<Object> (nullptr, false), "Name Two", objectTwo);
|
||||
|
||||
Ptr<TestObject> childOfObjectOne = CreateObject<TestObject> ();
|
||||
Names::Add (objectOne, "Child", childOfObjectOne);
|
||||
@@ -395,7 +395,7 @@ BasicRenameTestCase::DoRun ()
|
||||
std::string found;
|
||||
|
||||
Ptr<TestObject> objectOne = CreateObject<TestObject> ();
|
||||
Names::Add (Ptr<Object> (0, false), "Name", objectOne);
|
||||
Names::Add (Ptr<Object> (nullptr, false), "Name", objectOne);
|
||||
|
||||
Ptr<TestObject> childOfObjectOne = CreateObject<TestObject> ();
|
||||
Names::Add (objectOne, "Child", childOfObjectOne);
|
||||
@@ -403,7 +403,7 @@ BasicRenameTestCase::DoRun ()
|
||||
found = Names::FindName (objectOne);
|
||||
NS_TEST_ASSERT_MSG_EQ (found, "Name", "Could not Names::Add and Names::FindName an Object");
|
||||
|
||||
Names::Rename (Ptr<Object> (0, false), "Name", "New Name");
|
||||
Names::Rename (Ptr<Object> (nullptr, false), "Name", "New Name");
|
||||
|
||||
found = Names::FindName (objectOne);
|
||||
NS_TEST_ASSERT_MSG_EQ (found, "New Name", "Could not Names::Rename an Object");
|
||||
@@ -709,10 +709,10 @@ BasicFindTestCase::DoRun ()
|
||||
Ptr<TestObject> childOfObjectTwo = CreateObject<TestObject> ();
|
||||
Names::Add ("Name Two/Child", childOfObjectTwo);
|
||||
|
||||
found = Names::Find<TestObject> (Ptr<Object> (0, false), "Name One");
|
||||
found = Names::Find<TestObject> (Ptr<Object> (nullptr, false), "Name One");
|
||||
NS_TEST_ASSERT_MSG_EQ (found, objectOne, "Could not find a previously named Object via object context");
|
||||
|
||||
found = Names::Find<TestObject> (Ptr<Object> (0, false), "Name Two");
|
||||
found = Names::Find<TestObject> (Ptr<Object> (nullptr, false), "Name Two");
|
||||
NS_TEST_ASSERT_MSG_EQ (found, objectTwo, "Could not find a previously named Object via object context");
|
||||
|
||||
found = Names::Find<TestObject> (objectOne, "Child");
|
||||
|
||||
@@ -396,7 +396,7 @@ AggregateObjectTestCase::DoRun ()
|
||||
NS_TEST_ASSERT_MSG_NE (baseB, nullptr, "Unable to CreateObject<BaseA>");
|
||||
|
||||
baseA->AggregateObject (baseB);
|
||||
baseA = 0;
|
||||
baseA = nullptr;
|
||||
|
||||
baseA = baseB->GetObject<BaseA> ();
|
||||
NS_TEST_ASSERT_MSG_NE (baseA, nullptr, "Unable to GetObject on released object");
|
||||
|
||||
@@ -300,7 +300,7 @@ PtrTestCase::DoRun ()
|
||||
Ptr<NoCount const> p1 = p;
|
||||
}
|
||||
raw = GetPointer (p);
|
||||
p = 0;
|
||||
p = nullptr;
|
||||
}
|
||||
NS_TEST_EXPECT_MSG_EQ (m_nDestroyed, 0, "012");
|
||||
delete raw;
|
||||
|
||||
@@ -189,7 +189,7 @@ CsmaNetDevice::CsmaNetDevice ()
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_txMachineState = READY;
|
||||
m_tInterframeGap = Seconds (0);
|
||||
m_channel = 0;
|
||||
m_channel = nullptr;
|
||||
|
||||
//
|
||||
// We would like to let the attribute system take care of initializing the
|
||||
@@ -208,16 +208,16 @@ CsmaNetDevice::CsmaNetDevice ()
|
||||
CsmaNetDevice::~CsmaNetDevice()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
m_queue = 0;
|
||||
m_queue = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
CsmaNetDevice::DoDispose ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
m_channel = 0;
|
||||
m_node = 0;
|
||||
m_queue = 0;
|
||||
m_channel = nullptr;
|
||||
m_node = nullptr;
|
||||
m_queue = nullptr;
|
||||
NetDevice::DoDispose ();
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ CsmaNetDevice::TransmitStart ()
|
||||
if (IsSendEnabled () == false)
|
||||
{
|
||||
m_phyTxDropTrace (m_currentPkt);
|
||||
m_currentPkt = 0;
|
||||
m_currentPkt = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ CsmaNetDevice::TransmitStart ()
|
||||
{
|
||||
NS_LOG_WARN ("Channel TransmitStart returns an error");
|
||||
m_phyTxDropTrace (m_currentPkt);
|
||||
m_currentPkt = 0;
|
||||
m_currentPkt = nullptr;
|
||||
m_txMachineState = READY;
|
||||
}
|
||||
else
|
||||
@@ -543,7 +543,7 @@ CsmaNetDevice::TransmitAbort ()
|
||||
NS_LOG_LOGIC ("Pkt UID is " << m_currentPkt->GetUid () << ")");
|
||||
|
||||
m_phyTxDropTrace (m_currentPkt);
|
||||
m_currentPkt = 0;
|
||||
m_currentPkt = nullptr;
|
||||
|
||||
NS_ASSERT_MSG (m_txMachineState == BACKOFF, "Must be in BACKOFF state to abort. Tx state is: " << m_txMachineState);
|
||||
|
||||
@@ -599,7 +599,7 @@ CsmaNetDevice::TransmitCompleteEvent ()
|
||||
|
||||
m_channel->TransmitEnd ();
|
||||
m_phyTxEndTrace (m_currentPkt);
|
||||
m_currentPkt = 0;
|
||||
m_currentPkt = nullptr;
|
||||
|
||||
NS_LOG_LOGIC ("Schedule TransmitReadyEvent in " << m_tInterframeGap.As (Time::S));
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
* \param ucb the UnicastForwardCallback function
|
||||
* \param ecb the ErrorCallback function
|
||||
*/
|
||||
QueueEntry (Ptr<const Packet> pa = 0, Ipv4Header const & h = Ipv4Header (),
|
||||
QueueEntry (Ptr<const Packet> pa = nullptr, Ipv4Header const & h = Ipv4Header (),
|
||||
UnicastForwardCallback ucb = UnicastForwardCallback (),
|
||||
ErrorCallback ecb = ErrorCallback ())
|
||||
: m_packet (pa),
|
||||
|
||||
@@ -237,7 +237,7 @@ RoutingProtocol::~RoutingProtocol ()
|
||||
void
|
||||
RoutingProtocol::DoDispose ()
|
||||
{
|
||||
m_ipv4 = 0;
|
||||
m_ipv4 = nullptr;
|
||||
for (std::map<Ptr<Socket>, Ipv4InterfaceAddress>::iterator iter = m_socketAddresses.begin (); iter
|
||||
!= m_socketAddresses.end (); iter++)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
* \param settlingTime the settling time
|
||||
* \param changedEntries flag for changed entries
|
||||
*/
|
||||
RoutingTableEntry (Ptr<NetDevice> dev = 0, Ipv4Address dst = Ipv4Address (), uint32_t seqNo = 0,
|
||||
RoutingTableEntry (Ptr<NetDevice> dev = nullptr, Ipv4Address dst = Ipv4Address (), uint32_t seqNo = 0,
|
||||
Ipv4InterfaceAddress iface = Ipv4InterfaceAddress (), uint32_t hops = 0, Ipv4Address nextHop = Ipv4Address (),
|
||||
Time lifetime = Simulator::Now (), Time settlingTime = Simulator::Now (), bool changedEntries = false);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user