diff --git a/examples/csma-star.cc b/examples/csma-star.cc index 210b478da..4d6b10e20 100644 --- a/examples/csma-star.cc +++ b/examples/csma-star.cc @@ -19,6 +19,7 @@ #include "ns3/simulator-module.h" #include "ns3/node-module.h" #include "ns3/helper-module.h" +#include "ns3/csma-module.h" #include "ns3/global-route-manager.h" // Network topology (default) diff --git a/examples/emu-udp-echo.cc b/examples/emu-udp-echo.cc index 7a003ab8b..44e38e60c 100644 --- a/examples/emu-udp-echo.cc +++ b/examples/emu-udp-echo.cc @@ -65,6 +65,7 @@ #include "ns3/core-module.h" #include "ns3/simulator-module.h" #include "ns3/helper-module.h" +#include "ns3/emu-helper.h" using namespace ns3; diff --git a/src/common/packet-metadata-test.cc b/src/common/packet-metadata-test.cc index f8300c697..4e44c4205 100644 --- a/src/common/packet-metadata-test.cc +++ b/src/common/packet-metadata-test.cc @@ -178,7 +178,6 @@ class HistoryTrailer : public HistoryTrailerBase { public: HistoryTrailer (); - bool IsOk (void) const; static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; diff --git a/src/core/object.h b/src/core/object.h index 225ef652a..e746d7940 100644 --- a/src/core/object.h +++ b/src/core/object.h @@ -403,15 +403,15 @@ Ptr CreateObject (const AttributeList &attributes) template Ptr -CreateObject (std::string n1 = "", const AttributeValue & v1 = EmptyAttributeValue (), - std::string n2 = "", const AttributeValue & v2 = EmptyAttributeValue (), - std::string n3 = "", const AttributeValue & v3 = EmptyAttributeValue (), - std::string n4 = "", const AttributeValue & v4 = EmptyAttributeValue (), - std::string n5 = "", const AttributeValue & v5 = EmptyAttributeValue (), - std::string n6 = "", const AttributeValue & v6 = EmptyAttributeValue (), - std::string n7 = "", const AttributeValue & v7 = EmptyAttributeValue (), - std::string n8 = "", const AttributeValue & v8 = EmptyAttributeValue (), - std::string n9 = "", const AttributeValue & v9 = EmptyAttributeValue ()) +CreateObject (std::string n1 , const AttributeValue & v1, + std::string n2 , const AttributeValue & v2, + std::string n3 , const AttributeValue & v3, + std::string n4 , const AttributeValue & v4, + std::string n5 , const AttributeValue & v5, + std::string n6 , const AttributeValue & v6, + std::string n7 , const AttributeValue & v7, + std::string n8 , const AttributeValue & v8, + std::string n9 , const AttributeValue & v9) { AttributeList attributes; if (n1 == "") diff --git a/src/devices/point-to-point/point-to-point-channel.cc b/src/devices/point-to-point/point-to-point-channel.cc index b8697a208..b94add35c 100644 --- a/src/devices/point-to-point/point-to-point-channel.cc +++ b/src/devices/point-to-point/point-to-point-channel.cc @@ -58,7 +58,7 @@ void PointToPointChannel::Attach(Ptr device) { NS_LOG_FUNCTION (this << device); - NS_ASSERT(m_nDevices < N_DEVICES && "Only two devices permitted"); + NS_ASSERT_MSG(m_nDevices < N_DEVICES, "Only two devices permitted"); NS_ASSERT(device != 0); m_link[m_nDevices++].m_src = device; diff --git a/src/devices/wifi/rraa-wifi-manager.cc b/src/devices/wifi/rraa-wifi-manager.cc index dba6b51f2..85e9a6c0d 100644 --- a/src/devices/wifi/rraa-wifi-manager.cc +++ b/src/devices/wifi/rraa-wifi-manager.cc @@ -400,7 +400,7 @@ RraaWifiManager::GetThresholds (WifiMode mode) const return mode6; } break; } - NS_ASSERT("Thresholds for an unknown mode are asked"); + NS_ASSERT_MSG(false, "Thresholds for an unknown mode are asked"); return ThresholdsItem (); } diff --git a/src/internet-stack/ipv4-l3-protocol.cc b/src/internet-stack/ipv4-l3-protocol.cc index 771dd2683..5970701f8 100644 --- a/src/internet-stack/ipv4-l3-protocol.cc +++ b/src/internet-stack/ipv4-l3-protocol.cc @@ -1068,7 +1068,7 @@ Ipv4L3Protocol::SetUp (uint32_t i) // If interface address and network mask have been set, add a route // to the network of the interface (like e.g. ifconfig does on a // Linux box) - if ((interface->GetAddress ()) != (Ipv4Address ()) + if (((interface->GetAddress ()) != (Ipv4Address ())) && (interface->GetNetworkMask ()) != (Ipv4Mask ())) { AddNetworkRouteTo (interface->GetAddress ().CombineMask (interface->GetNetworkMask ()), diff --git a/src/node/queue.cc b/src/node/queue.cc index 6ec837914..f6fe4873b 100644 --- a/src/node/queue.cc +++ b/src/node/queue.cc @@ -84,12 +84,12 @@ Queue::Dequeue (void) if (packet != 0) { + NS_ASSERT (m_nBytes >= packet->GetSize ()); + NS_ASSERT (m_nPackets > 0); + m_nBytes -= packet->GetSize (); m_nPackets--; - NS_ASSERT (m_nBytes >= 0); - NS_ASSERT (m_nPackets >= 0); - NS_LOG_LOGIC("m_traceDequeue (packet)"); m_traceDequeue (packet); diff --git a/src/routing/olsr/olsr-header.cc b/src/routing/olsr/olsr-header.cc index c5649bdbb..205011e14 100644 --- a/src/routing/olsr/olsr-header.cc +++ b/src/routing/olsr/olsr-header.cc @@ -303,7 +303,6 @@ MessageHeader::Mid::Deserialize (Buffer::Iterator start, uint32_t messageSize) Buffer::Iterator i = start; this->interfaceAddresses.clear (); - NS_ASSERT (messageSize >= 0); NS_ASSERT (messageSize % IPV4_ADDRESS_SIZE == 0); int numAddresses = messageSize / IPV4_ADDRESS_SIZE; diff --git a/src/simulator/time.cc b/src/simulator/time.cc index 10e9a067f..66d3317ad 100644 --- a/src/simulator/time.cc +++ b/src/simulator/time.cc @@ -32,11 +32,11 @@ namespace ns3 { namespace TimeStepPrecision { -static const uint64_t MS_FACTOR = (uint64_t)pow(10,3); -static const uint64_t US_FACTOR = (uint64_t)pow(10,6); -static const uint64_t NS_FACTOR = (uint64_t)pow(10,9); -static const uint64_t PS_FACTOR = (uint64_t)pow(10,12); -static const uint64_t FS_FACTOR = (uint64_t)pow(10,15); +static const uint64_t MS_FACTOR = (uint64_t)1000; +static const uint64_t US_FACTOR = (uint64_t)1000000; +static const uint64_t NS_FACTOR = (uint64_t)1000000 * (uint64_t)1000; +static const uint64_t PS_FACTOR = (uint64_t)1000000 * (uint64_t)1000000; +static const uint64_t FS_FACTOR = (uint64_t)1000000 * (uint64_t)1000000 * (uint64_t)1000; static uint64_t g_tsPrecFactor = NS_FACTOR; static GlobalValue g_precisionDefaultValue ("TimeStepPrecision",