diff --git a/src/lte/test/lte-test-harq.cc b/src/lte/test/lte-test-harq.cc index abd809337..eed6dfef2 100644 --- a/src/lte/test/lte-test-harq.cc +++ b/src/lte/test/lte-test-harq.cc @@ -253,7 +253,7 @@ LenaHarqTestCase::DoRun (void) double rxed = rlcStats->GetDlRxData (imsi, lcId); double tolerance = 0.1; - NS_LOG_INFO (" User " << i << " imsi " << imsi << " bytes rxed/t " << rxed/statsDuration << " txed/t " << txed/statsDuration << " thr Ref " << m_throughputRef << " Err " << (abs (txed/statsDuration - m_throughputRef)) / m_throughputRef); + NS_LOG_INFO (" User " << i << " imsi " << imsi << " bytes rxed/t " << rxed/statsDuration << " txed/t " << txed/statsDuration << " thr Ref " << m_throughputRef << " Err " << (std::abs (txed/statsDuration - m_throughputRef)) / m_throughputRef); NS_TEST_ASSERT_MSG_EQ_TOL (txed/statsDuration, m_throughputRef, m_throughputRef * tolerance, " Unexpected Throughput!"); NS_TEST_ASSERT_MSG_EQ_TOL (rxed/statsDuration, m_throughputRef, m_throughputRef * tolerance, " Unexpected Throughput!"); diff --git a/src/lte/test/test-lte-antenna.cc b/src/lte/test/test-lte-antenna.cc index 3e91a3f30..b624c49dc 100644 --- a/src/lte/test/test-lte-antenna.cc +++ b/src/lte/test/test-lte-antenna.cc @@ -175,7 +175,7 @@ LteEnbAntennaTestCase::DoRun (void) const double noisePowerDbm = ktDbm + 10 * std::log10 (25 * 180000); // corresponds to kT*bandwidth in linear units const double ueNoiseFigureDb = 9.0; // default UE noise figure const double enbNoiseFigureDb = 5.0; // default eNB noise figure - double tolerance = (m_antennaGainDb != 0) ? abs (m_antennaGainDb)*0.001 : 0.001; + double tolerance = (m_antennaGainDb != 0) ? std::abs (m_antennaGainDb) * 0.001 : 0.001; // first test with SINR from LteTestSinrChunkProcessor // this can only be done for not-too-bad SINR otherwise the measurement won't be available diff --git a/src/wave/helper/wifi-80211p-helper.cc b/src/wave/helper/wifi-80211p-helper.cc index 015926cfe..f02f15482 100644 --- a/src/wave/helper/wifi-80211p-helper.cc +++ b/src/wave/helper/wifi-80211p-helper.cc @@ -26,6 +26,7 @@ #include #include "wave-mac-helper.h" #include "wifi-80211p-helper.h" +#include "ns3/unused.h" namespace ns3 { @@ -79,12 +80,7 @@ Wifi80211pHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper & { const QosWaveMacHelper& qosMac = dynamic_cast (macHelper); isWaveMacHelper = true; - // below check will never fail, just used for survive from - // gcc warn "-Wunused-but-set-variable" - if (&qosMac == 0) - { - NS_FATAL_ERROR ("it could never get here"); - } + NS_UNUSED (qosMac); } catch (const std::bad_cast &) { @@ -95,10 +91,7 @@ Wifi80211pHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper & { const NqosWaveMacHelper& nqosMac = dynamic_cast (macHelper); isWaveMacHelper = true; - if (&nqosMac == 0) - { - NS_FATAL_ERROR ("it could never get here"); - } + NS_UNUSED (nqosMac); } catch (const std::bad_cast &) {