diff --git a/examples/tcp/tcp-linux-reno.cc b/examples/tcp/tcp-linux-reno.cc index 2a0dca74c..2029c2939 100644 --- a/examples/tcp/tcp-linux-reno.cc +++ b/examples/tcp/tcp-linux-reno.cc @@ -136,7 +136,7 @@ int main (int argc, char *argv[]) // Set recovery algorithm and TCP variant Config::SetDefault ("ns3::TcpL4Protocol::RecoveryType", TypeIdValue (TypeId::LookupByName (recovery))); - if (tcpTypeId.compare ("ns3::TcpWestwoodPlus") == 0) + if (tcpTypeId == "ns3::TcpWestwoodPlus") { // TcpWestwoodPlus is not an actual TypeId name; we need TcpWestwood here Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ())); diff --git a/examples/tcp/tcp-variants-comparison.cc b/examples/tcp/tcp-variants-comparison.cc index a209fcca3..bfdb9d112 100644 --- a/examples/tcp/tcp-variants-comparison.cc +++ b/examples/tcp/tcp-variants-comparison.cc @@ -407,7 +407,7 @@ int main (int argc, char *argv[]) Config::SetDefault ("ns3::TcpL4Protocol::RecoveryType", TypeIdValue (TypeId::LookupByName (recovery))); // Select TCP variant - if (transport_prot.compare ("ns3::TcpWestwoodPlus") == 0) + if (transport_prot == "ns3::TcpWestwoodPlus") { // TcpWestwoodPlus is not an actual TypeId name; we need TcpWestwood here Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ())); @@ -486,11 +486,11 @@ int main (int argc, char *argv[]) Ipv4InterfaceContainer interfaces = address.Assign (devices); devices = UnReLink.Install (gateways.Get (0), sinks.Get (i)); - if (queue_disc_type.compare ("ns3::PfifoFastQueueDisc") == 0) + if (queue_disc_type == "ns3::PfifoFastQueueDisc") { tchPfifo.Install (devices); } - else if (queue_disc_type.compare ("ns3::CoDelQueueDisc") == 0) + else if (queue_disc_type == "ns3::CoDelQueueDisc") { tchCoDel.Install (devices); } diff --git a/examples/traffic-control/queue-discs-benchmark.cc b/examples/traffic-control/queue-discs-benchmark.cc index caa9803db..4bb90a936 100644 --- a/examples/traffic-control/queue-discs-benchmark.cc +++ b/examples/traffic-control/queue-discs-benchmark.cc @@ -179,37 +179,37 @@ int main (int argc, char *argv[]) // Bottleneck link traffic control configuration TrafficControlHelper tchBottleneck; - if (queueDiscType.compare ("PfifoFast") == 0) + if (queueDiscType == "PfifoFast") { tchBottleneck.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "MaxSize", QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize))); } - else if (queueDiscType.compare ("ARED") == 0) + else if (queueDiscType == "ARED") { tchBottleneck.SetRootQueueDisc ("ns3::RedQueueDisc"); Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true)); Config::SetDefault ("ns3::RedQueueDisc::MaxSize", QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize))); } - else if (queueDiscType.compare ("CoDel") == 0) + else if (queueDiscType == "CoDel") { tchBottleneck.SetRootQueueDisc ("ns3::CoDelQueueDisc"); Config::SetDefault ("ns3::CoDelQueueDisc::MaxSize", QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize))); } - else if (queueDiscType.compare ("FqCoDel") == 0) + else if (queueDiscType == "FqCoDel") { tchBottleneck.SetRootQueueDisc ("ns3::FqCoDelQueueDisc"); Config::SetDefault ("ns3::FqCoDelQueueDisc::MaxSize", QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize))); } - else if (queueDiscType.compare ("PIE") == 0) + else if (queueDiscType == "PIE") { tchBottleneck.SetRootQueueDisc ("ns3::PieQueueDisc"); Config::SetDefault ("ns3::PieQueueDisc::MaxSize", QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, queueDiscSize))); } - else if (queueDiscType.compare ("prio") == 0) + else if (queueDiscType == "prio") { uint16_t handle = tchBottleneck.SetRootQueueDisc ("ns3::PrioQueueDisc", "Priomap", StringValue ("0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1")); diff --git a/examples/traffic-control/traffic-control.cc b/examples/traffic-control/traffic-control.cc index 85add7ff7..080abbbaf 100644 --- a/examples/traffic-control/traffic-control.cc +++ b/examples/traffic-control/traffic-control.cc @@ -112,7 +112,7 @@ main (int argc, char *argv[]) cmd.AddValue ("transportProt", "Transport protocol to use: Tcp, Udp", transportProt); cmd.Parse (argc, argv); - if (transportProt.compare ("Tcp") == 0) + if (transportProt == "Tcp") { socketType = "ns3::TcpSocketFactory"; } diff --git a/examples/wireless/wifi-power-adaptation-distance.cc b/examples/wireless/wifi-power-adaptation-distance.cc index d726b048a..050899fb4 100644 --- a/examples/wireless/wifi-power-adaptation-distance.cc +++ b/examples/wireless/wifi-power-adaptation-distance.cc @@ -538,9 +538,9 @@ int main (int argc, char *argv[]) gnuplot.AddDataset (statistics.GetDatafile ()); gnuplot.GenerateOutput (outfile); - if (manager.compare ("ns3::ParfWifiManager") == 0 - || manager.compare ("ns3::AparfWifiManager") == 0 - || manager.compare ("ns3::RrpaaWifiManager") == 0) + if (manager == "ns3::ParfWifiManager" + || manager == "ns3::AparfWifiManager" + || manager == "ns3::RrpaaWifiManager") { std::ofstream outfile2 (("power-" + outputFileName + ".plt").c_str ()); gnuplot = Gnuplot (("power-" + outputFileName + ".eps").c_str (), "Average Transmit Power"); diff --git a/examples/wireless/wifi-power-adaptation-interference.cc b/examples/wireless/wifi-power-adaptation-interference.cc index f7a76ad0d..3c11d4f40 100644 --- a/examples/wireless/wifi-power-adaptation-interference.cc +++ b/examples/wireless/wifi-power-adaptation-interference.cc @@ -676,9 +676,9 @@ int main (int argc, char *argv[]) gnuplot.AddDataset (statisticsAp0.GetDatafile ()); gnuplot.GenerateOutput (outfileTh0); - if (manager.compare ("ns3::ParfWifiManager") == 0 - || manager.compare ("ns3::AparfWifiManager") == 0 - || manager.compare ("ns3::RrpaaWifiManager") == 0) + if (manager == "ns3::ParfWifiManager" + || manager == "ns3::AparfWifiManager" + || manager == "ns3::RrpaaWifiManager") { std::ofstream outfilePower0 (("power-" + outputFileName + "-0.plt").c_str ()); gnuplot = Gnuplot (("power-" + outputFileName + "-0.eps").c_str (), "Average Transmit Power"); @@ -730,9 +730,9 @@ int main (int argc, char *argv[]) gnuplot.AddDataset (statisticsAp1.GetDatafile ()); gnuplot.GenerateOutput (outfileTh1); - if (manager.compare ("ns3::ParfWifiManager") == 0 - || manager.compare ("ns3::AparfWifiManager") == 0 - || manager.compare ("ns3::RrpaaWifiManager") == 0) + if (manager == "ns3::ParfWifiManager" + || manager == "ns3::AparfWifiManager" + || manager == "ns3::RrpaaWifiManager") { std::ofstream outfilePower1 (("power-" + outputFileName + "-1.plt").c_str ()); gnuplot = Gnuplot (("power-" + outputFileName + "-1.eps").c_str (), "Average Transmit Power"); diff --git a/examples/wireless/wifi-tcp.cc b/examples/wireless/wifi-tcp.cc index 1f75ab360..89e1873f6 100644 --- a/examples/wireless/wifi-tcp.cc +++ b/examples/wireless/wifi-tcp.cc @@ -93,7 +93,7 @@ main (int argc, char *argv[]) tcpVariant = std::string ("ns3::") + tcpVariant; // Select TCP variant - if (tcpVariant.compare ("ns3::TcpWestwoodPlus") == 0) + if (tcpVariant == "ns3::TcpWestwoodPlus") { // TcpWestwoodPlus is not an actual TypeId name; we need TcpWestwood here Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ())); diff --git a/src/core/model/log.cc b/src/core/model/log.cc index 460ecb987..3f4f372f2 100644 --- a/src/core/model/log.cc +++ b/src/core/model/log.cc @@ -366,7 +366,7 @@ LogComponentEnable (char const *name, enum LogLevel level) i != components->end (); i++) { - if (i->first.compare (name) == 0) + if (i->first == name) { i->second->Enable (level); return; @@ -401,7 +401,7 @@ LogComponentDisable (char const *name, enum LogLevel level) i != components->end (); i++) { - if (i->first.compare (name) == 0) + if (i->first == name) { i->second->Disable (level); break; @@ -510,7 +510,7 @@ static bool ComponentExists (std::string componentName) i != components->end (); i++) { - if (i->first.compare (name) == 0) + if (i->first == name) { return true; } diff --git a/src/energy/model/energy-source.cc b/src/energy/model/energy-source.cc index 5eb2b8191..e717f6552 100644 --- a/src/energy/model/energy-source.cc +++ b/src/energy/model/energy-source.cc @@ -98,7 +98,7 @@ EnergySource::FindDeviceEnergyModels (std::string name) DeviceEnergyModelContainer::Iterator i; for (i = m_models.Begin (); i != m_models.End (); i++) { - if ((*i)->GetInstanceTypeId ().GetName ().compare (name) == 0) + if ((*i)->GetInstanceTypeId ().GetName () == name) { container.Add (*i); } diff --git a/src/fd-net-device/examples/fd-emu-onoff.cc b/src/fd-net-device/examples/fd-emu-onoff.cc index ed119c4f6..3a770055e 100644 --- a/src/fd-net-device/examples/fd-emu-onoff.cc +++ b/src/fd-net-device/examples/fd-emu-onoff.cc @@ -156,7 +156,7 @@ main (int argc, char *argv[]) cmd.AddValue ("emuMode", "Emulation mode in {raw, netmap}", emuMode); cmd.Parse (argc, argv); - if (transportProt.compare ("Tcp") == 0) + if (transportProt == "Tcp") { socketType = "ns3::TcpSocketFactory"; } diff --git a/src/fd-net-device/examples/fd-emu-tc.cc b/src/fd-net-device/examples/fd-emu-tc.cc index 6f0bddea3..6782587a3 100644 --- a/src/fd-net-device/examples/fd-emu-tc.cc +++ b/src/fd-net-device/examples/fd-emu-tc.cc @@ -238,11 +238,11 @@ main (int argc, char *argv[]) // Bottleneck link side TrafficControlHelper tch1; - if (queueDiscType.compare ("PfifoFast") == 0) + if (queueDiscType == "PfifoFast") { tch1.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "MaxSize", StringValue ("1000p")); } - else if (queueDiscType.compare ("ARED") == 0) + else if (queueDiscType == "ARED") { tch1.SetRootQueueDisc ("ns3::RedQueueDisc"); Config::SetDefault ("ns3::RedQueueDisc::ARED", BooleanValue (true)); @@ -253,15 +253,15 @@ main (int argc, char *argv[]) Config::SetDefault ("ns3::RedQueueDisc::MinTh", DoubleValue (83333)); Config::SetDefault ("ns3::RedQueueDisc::MinTh", DoubleValue (250000)); } - else if (queueDiscType.compare ("CoDel") == 0) + else if (queueDiscType == "CoDel") { tch1.SetRootQueueDisc ("ns3::CoDelQueueDisc"); } - else if (queueDiscType.compare ("FqCoDel") == 0) + else if (queueDiscType == "FqCoDel") { tch1.SetRootQueueDisc ("ns3::FqCoDelQueueDisc"); } - else if (queueDiscType.compare ("PIE") == 0) + else if (queueDiscType == "PIE") { tch1.SetRootQueueDisc ("ns3::PieQueueDisc"); Config::SetDefault ("ns3::PieQueueDisc::MaxSize", diff --git a/src/internet/test/tcp-general-test.cc b/src/internet/test/tcp-general-test.cc index 7f510c969..31f664cae 100644 --- a/src/internet/test/tcp-general-test.cc +++ b/src/internet/test/tcp-general-test.cc @@ -335,11 +335,11 @@ TcpGeneralTest::CreateReceiverSocket (Ptr node) void TcpGeneralTest::QueueDropCb ( std::string context, Ptr p) { - if (context.compare ("SENDER") == 0) + if (context == "SENDER") { QueueDrop (SENDER); } - else if (context.compare ("RECEIVER") == 0) + else if (context == "RECEIVER") { QueueDrop (RECEIVER); } @@ -352,11 +352,11 @@ TcpGeneralTest::QueueDropCb ( std::string context, Ptr p) void TcpGeneralTest::PhyDropCb (std::string context, [[maybe_unused]] Ptr p) { - if (context.compare ("SENDER") == 0) + if (context == "SENDER") { PhyDrop (SENDER); } - else if (context.compare ("RECEIVER") == 0) + else if (context == "RECEIVER") { PhyDrop (RECEIVER); } diff --git a/src/lte/model/cqa-ff-mac-scheduler.cc b/src/lte/model/cqa-ff-mac-scheduler.cc index 87f84be44..342dca671 100644 --- a/src/lte/model/cqa-ff-mac-scheduler.cc +++ b/src/lte/model/cqa-ff-mac-scheduler.cc @@ -1439,11 +1439,11 @@ CqaFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sche hol = 1; } - if ( m_CqaMetric.compare ("CqaFf") == 0) + if ( m_CqaMetric == "CqaFf") { metric = coita_metric*tbr_weight*hol; } - else if (m_CqaMetric.compare ("CqaPf") == 0) + else if (m_CqaMetric == "CqaPf") { metric = tbr_weight*pf_weight*hol; } diff --git a/src/lte/model/pss-ff-mac-scheduler.cc b/src/lte/model/pss-ff-mac-scheduler.cc index 8b98c5331..f2f26af9a 100644 --- a/src/lte/model/pss-ff-mac-scheduler.cc +++ b/src/lte/model/pss-ff-mac-scheduler.cc @@ -1105,7 +1105,7 @@ PssFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sche } // end of m_flowStatsDl - if ( m_fdSchedulerType.compare("CoItA") == 0) + if ( m_fdSchedulerType == "CoItA") { // FD scheduler: Carrier over Interference to Average (CoItA) std::map < uint16_t, uint8_t > sbCqiSum; @@ -1270,7 +1270,7 @@ PssFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sche }// end of CoIta - if ( m_fdSchedulerType.compare("PFsch") == 0) + if ( m_fdSchedulerType == "PFsch") { // FD scheduler: Proportional Fair scheduled (PFsch) for (int i = 0; i < rbgNum; i++) diff --git a/src/lte/test/lte-test-mimo.cc b/src/lte/test/lte-test-mimo.cc index 345203bdf..7e6532222 100644 --- a/src/lte/test/lte-test-mimo.cc +++ b/src/lte/test/lte-test-mimo.cc @@ -202,7 +202,7 @@ LenaMimoTestCase::DoRun () enbNetDev->GetCcMap()[0]->GetAttribute ("FfMacScheduler", ptrval); Ptr pfsched; Ptr rrsched; - if (m_schedulerType.compare ("ns3::RrFfMacScheduler") == 0) + if (m_schedulerType == "ns3::RrFfMacScheduler") { rrsched = ptrval.Get (); if (!rrsched) @@ -212,7 +212,7 @@ LenaMimoTestCase::DoRun () Simulator::Schedule (Seconds (0.2), &RrFfMacScheduler::TransmissionModeConfigurationUpdate, rrsched, rnti, 1); Simulator::Schedule (Seconds (0.4), &RrFfMacScheduler::TransmissionModeConfigurationUpdate, rrsched, rnti, 2); } - else if (m_schedulerType.compare ("ns3::PfFfMacScheduler") == 0) + else if (m_schedulerType == "ns3::PfFfMacScheduler") { pfsched = ptrval.Get (); if (!pfsched) diff --git a/src/test/ns3tcp/ns3tcp-loss-test-suite.cc b/src/test/ns3tcp/ns3tcp-loss-test-suite.cc index ce9084d2e..9d663c42a 100644 --- a/src/test/ns3tcp/ns3tcp-loss-test-suite.cc +++ b/src/test/ns3tcp/ns3tcp-loss-test-suite.cc @@ -347,7 +347,7 @@ Ns3TcpLossTestCase::DoRun () std::ostringstream tcpModel; tcpModel << "ns3::Tcp" << m_tcpModel; - if (m_tcpModel.compare ("WestwoodPlus") == 0) + if (m_tcpModel == "WestwoodPlus") { Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ())); diff --git a/src/traffic-control/examples/codel-vs-pfifo-asymmetric.cc b/src/traffic-control/examples/codel-vs-pfifo-asymmetric.cc index 552f721ec..0c44ad6fa 100644 --- a/src/traffic-control/examples/codel-vs-pfifo-asymmetric.cc +++ b/src/traffic-control/examples/codel-vs-pfifo-asymmetric.cc @@ -91,7 +91,7 @@ static void TraceCwnd (std::string cwndTrFileName) { AsciiTraceHelper ascii; - if (cwndTrFileName.compare ("") == 0) + if (cwndTrFileName == "") { NS_LOG_DEBUG ("No trace file for cwnd provided"); return; @@ -124,7 +124,7 @@ static void TraceSojourn (std::string sojournTrFileName) { AsciiTraceHelper ascii; - if (sojournTrFileName.compare ("") == 0) + if (sojournTrFileName == "") { NS_LOG_DEBUG ("No trace file for sojourn provided"); return; @@ -158,7 +158,7 @@ static void TraceQueueLength (std::string queueLengthTrFileName) { AsciiTraceHelper ascii; - if (queueLengthTrFileName.compare ("") == 0) + if (queueLengthTrFileName == "") { NS_LOG_DEBUG ("No trace file for queue length provided"); return; @@ -191,7 +191,7 @@ static void TraceEveryDrop (std::string everyDropTrFileName) { AsciiTraceHelper ascii; - if (everyDropTrFileName.compare ("") == 0) + if (everyDropTrFileName == "") { NS_LOG_DEBUG ("No trace file for every drop event provided"); return; @@ -234,7 +234,7 @@ static void TraceDroppingState (std::string dropStateTrFileName) { AsciiTraceHelper ascii; - if (dropStateTrFileName.compare ("") == 0) + if (dropStateTrFileName == "") { NS_LOG_DEBUG ("No trace file for dropping state provided"); return; @@ -424,11 +424,11 @@ int main (int argc, char *argv[]) tchPfifo.Install (serverCmtsDev); tchPfifo.Install (cmtsWanDev); - if (routerWanQueueDiscType.compare ("PfifoFast") == 0) + if (routerWanQueueDiscType == "PfifoFast") { tchPfifo.Install (routerWanDev); } - else if (routerWanQueueDiscType.compare ("CoDel") == 0) + else if (routerWanQueueDiscType == "CoDel") { tchCoDel.Install (routerWanDev); } @@ -493,7 +493,7 @@ int main (int argc, char *argv[]) Simulator::Schedule (Seconds (0.00001), &TraceCwnd, cwndTrFileName); TraceEveryDrop (everyDropTrFileName); - if (routerWanQueueDiscType.compare ("CoDel") == 0) + if (routerWanQueueDiscType == "CoDel") { TraceSojourn (sojournTrFileName); TraceQueueLength (queueLengthTrFileName); diff --git a/src/traffic-control/examples/codel-vs-pfifo-basic-test.cc b/src/traffic-control/examples/codel-vs-pfifo-basic-test.cc index 9e5db67ba..cfa7bc28f 100644 --- a/src/traffic-control/examples/codel-vs-pfifo-basic-test.cc +++ b/src/traffic-control/examples/codel-vs-pfifo-basic-test.cc @@ -78,7 +78,7 @@ static void TraceCwnd (std::string cwndTrFileName) { AsciiTraceHelper ascii; - if (cwndTrFileName.compare ("") == 0) + if (cwndTrFileName == "") { NS_LOG_DEBUG ("No trace file for cwnd provided"); return; @@ -196,11 +196,11 @@ int main (int argc, char *argv[]) devicesBottleneckLink = bottleneckLink.Install (gateway.Get (0), sink.Get (0)); address.NewNetwork (); - if (queueDiscType.compare ("PfifoFast") == 0) + if (queueDiscType == "PfifoFast") { tchPfifo.Install (devicesBottleneckLink); } - else if (queueDiscType.compare ("CoDel") == 0) + else if (queueDiscType == "CoDel") { tchCoDel.Install (devicesBottleneckLink); } diff --git a/src/traffic-control/model/queue-disc.cc b/src/traffic-control/model/queue-disc.cc index af3197436..1578db7e9 100644 --- a/src/traffic-control/model/queue-disc.cc +++ b/src/traffic-control/model/queue-disc.cc @@ -204,7 +204,7 @@ QueueDisc::Stats::Print (std::ostream &os) const while (itp != nDroppedPacketsBeforeEnqueue.end () && itb != nDroppedBytesBeforeEnqueue.end ()) { - NS_ASSERT (itp->first.compare (itb->first) == 0); + NS_ASSERT (itp->first == itb->first); os << std::endl << " " << itp->first << ": " << itp->second << " / " << itb->second; itp++; @@ -221,7 +221,7 @@ QueueDisc::Stats::Print (std::ostream &os) const while (itp != nDroppedPacketsAfterDequeue.end () && itb != nDroppedBytesAfterDequeue.end ()) { - NS_ASSERT (itp->first.compare (itb->first) == 0); + NS_ASSERT (itp->first == itb->first); os << std::endl << " " << itp->first << ": " << itp->second << " / " << itb->second; itp++; @@ -241,7 +241,7 @@ QueueDisc::Stats::Print (std::ostream &os) const while (itp != nMarkedPackets.end () && itb != nMarkedBytes.end ()) { - NS_ASSERT (itp->first.compare (itb->first) == 0); + NS_ASSERT (itp->first == itb->first); os << std::endl << " " << itp->first << ": " << itp->second << " / " << itb->second; itp++; diff --git a/src/uan/helper/acoustic-modem-energy-model-helper.cc b/src/uan/helper/acoustic-modem-energy-model-helper.cc index 4156fde40..c087c9bc6 100644 --- a/src/uan/helper/acoustic-modem-energy-model-helper.cc +++ b/src/uan/helper/acoustic-modem-energy-model-helper.cc @@ -62,7 +62,7 @@ AcousticModemEnergyModelHelper::DoInstall (Ptr device, NS_ASSERT (source); // check if device is UanNetDevice std::string deviceName = device->GetInstanceTypeId ().GetName (); - if (deviceName.compare ("ns3::UanNetDevice") != 0) + if (deviceName != "ns3::UanNetDevice") { NS_FATAL_ERROR ("NetDevice type is not UanNetDevice!"); } diff --git a/src/wave/examples/vanet-routing-compare.cc b/src/wave/examples/vanet-routing-compare.cc index 059b4aeec..5fee15acd 100644 --- a/src/wave/examples/vanet-routing-compare.cc +++ b/src/wave/examples/vanet-routing-compare.cc @@ -1028,7 +1028,7 @@ void ConfigStoreHelper::SaveConfig (std::string configFilename) { // only save if a non-empty filename has been specified - if (configFilename.compare ("") != 0) + if (configFilename != "") { // Output config store to txt format Config::SetDefault ("ns3::ConfigStore::Filename", StringValue (configFilename)); diff --git a/src/wave/helper/wave-mac-helper.h b/src/wave/helper/wave-mac-helper.h index 823863f55..5a44cf12e 100644 --- a/src/wave/helper/wave-mac-helper.h +++ b/src/wave/helper/wave-mac-helper.h @@ -113,7 +113,7 @@ public: template void NqosWaveMacHelper::SetType (std::string type, Ts&&... args) { - if (type.compare ("ns3::OcbWifiMac") != 0) + if (type != "ns3::OcbWifiMac") { NS_FATAL_ERROR ("QosWaveMacHelper shall set OcbWifiMac"); } @@ -123,7 +123,7 @@ template template void QosWaveMacHelper::SetType (std::string type, Ts&&... args) { - if (type.compare ("ns3::OcbWifiMac") != 0) + if (type != "ns3::OcbWifiMac") { NS_FATAL_ERROR ("QosWaveMacHelper shall set OcbWifiMac"); } diff --git a/src/wifi/helper/wifi-radio-energy-model-helper.cc b/src/wifi/helper/wifi-radio-energy-model-helper.cc index 4cb5bf015..2b77459ed 100644 --- a/src/wifi/helper/wifi-radio-energy-model-helper.cc +++ b/src/wifi/helper/wifi-radio-energy-model-helper.cc @@ -69,7 +69,7 @@ WifiRadioEnergyModelHelper::DoInstall (Ptr device, NS_ASSERT (source); // check if device is WifiNetDevice std::string deviceName = device->GetInstanceTypeId ().GetName (); - if (deviceName.compare ("ns3::WifiNetDevice") != 0) + if (deviceName != "ns3::WifiNetDevice") { NS_FATAL_ERROR ("NetDevice type is not WifiNetDevice!"); }