From 673667d2f7d9be19e8d69918683922b618c5fca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Mon, 26 Feb 2018 23:18:47 +0100 Subject: [PATCH] wifi: Remove casts in logging outputs --- src/wifi/model/ampdu-subframe-header.cc | 2 +- src/wifi/model/amrr-wifi-manager.cc | 4 +- src/wifi/model/ap-wifi-mac.cc | 2 +- src/wifi/model/aparf-wifi-manager.cc | 6 +-- src/wifi/model/block-ack-agreement.cc | 2 +- src/wifi/model/block-ack-manager.cc | 30 ++++++------ src/wifi/model/cara-wifi-manager.cc | 2 +- src/wifi/model/edca-txop-n.cc | 12 ++--- src/wifi/model/he-capabilities.cc | 4 +- src/wifi/model/ideal-wifi-manager.cc | 34 +++++++------- src/wifi/model/interference-helper.cc | 6 +-- src/wifi/model/mac-low.cc | 2 +- src/wifi/model/minstrel-ht-wifi-manager.cc | 32 ++++++------- src/wifi/model/minstrel-wifi-manager.cc | 2 +- src/wifi/model/parf-wifi-manager.cc | 6 +-- src/wifi/model/qos-utils.cc | 2 +- src/wifi/model/regular-wifi-mac.cc | 8 ++-- src/wifi/model/rraa-wifi-manager.cc | 2 +- src/wifi/model/rrpaa-wifi-manager.cc | 10 ++-- src/wifi/model/spectrum-wifi-phy.cc | 12 ++--- src/wifi/model/supported-rates.cc | 4 +- src/wifi/model/vht-operation.cc | 6 +-- .../model/wifi-information-element-vector.cc | 2 +- src/wifi/model/wifi-mode.cc | 6 +-- src/wifi/model/wifi-phy.cc | 46 +++++++++---------- src/wifi/model/wifi-remote-station-manager.cc | 8 ++-- src/wifi/model/wifi-tx-vector.cc | 12 ++--- src/wifi/test/tx-duration-test.cc | 4 +- 28 files changed, 134 insertions(+), 134 deletions(-) diff --git a/src/wifi/model/ampdu-subframe-header.cc b/src/wifi/model/ampdu-subframe-header.cc index bd7a5d88e..1d07823a8 100644 --- a/src/wifi/model/ampdu-subframe-header.cc +++ b/src/wifi/model/ampdu-subframe-header.cc @@ -83,7 +83,7 @@ AmpduSubframeHeader::Print (std::ostream &os) const { os << "EOF = " << m_eof << ", length = " << m_length; char previousFillChar = os.fill ('0'); - os << ", CRC = 0x" << std::hex << std::setw (2) << static_cast (m_crc) << ", Signature = 0x" << static_cast (m_sig) << std::dec; + os << ", CRC = 0x" << std::hex << std::setw (2) << +m_crc << ", Signature = 0x" << +m_sig << std::dec; os.fill (previousFillChar); } diff --git a/src/wifi/model/amrr-wifi-manager.cc b/src/wifi/model/amrr-wifi-manager.cc index fad3623f6..d0345f1c5 100644 --- a/src/wifi/model/amrr-wifi-manager.cc +++ b/src/wifi/model/amrr-wifi-manager.cc @@ -253,7 +253,7 @@ AmrrWifiManager::UpdateMode (AmrrWifiRemoteStation *station) station->m_success++; NS_LOG_DEBUG ("++ success=" << station->m_success << " successThreshold=" << station->m_successThreshold << " tx_ok=" << station->m_tx_ok << " tx_err=" << station->m_tx_err << " tx_retr=" << station->m_tx_retr << - " rate=" << static_cast(station->m_txrate) << " n-supported-rates=" << static_cast(GetNSupported (station))); + " rate=" << +station->m_txrate << " n-supported-rates=" << +GetNSupported (station)); if (station->m_success >= station->m_successThreshold && !IsMaxRate (station)) { @@ -272,7 +272,7 @@ AmrrWifiManager::UpdateMode (AmrrWifiRemoteStation *station) station->m_success = 0; NS_LOG_DEBUG ("-- success=" << station->m_success << " successThreshold=" << station->m_successThreshold << " tx_ok=" << station->m_tx_ok << " tx_err=" << station->m_tx_err << " tx_retr=" << station->m_tx_retr << - " rate=" << static_cast(station->m_txrate) << " n-supported-rates=" << static_cast(GetNSupported (station))); + " rate=" << +station->m_txrate << " n-supported-rates=" << +GetNSupported (station)); if (!IsMinRate (station)) { if (station->m_recovery) diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index f846b8649..bb45e9835 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -292,7 +292,7 @@ void ApWifiMac::ForwardDown (Ptr packet, Mac48Address from, Mac48Address to, uint8_t tid) { - NS_LOG_FUNCTION (this << packet << from << to << static_cast (tid)); + NS_LOG_FUNCTION (this << packet << from << to << +tid); WifiMacHeader hdr; //For now, an AP that supports QoS does not support non-QoS diff --git a/src/wifi/model/aparf-wifi-manager.cc b/src/wifi/model/aparf-wifi-manager.cc index 0c0e0747a..34508b087 100644 --- a/src/wifi/model/aparf-wifi-manager.cc +++ b/src/wifi/model/aparf-wifi-manager.cc @@ -147,8 +147,8 @@ AparfWifiManager::DoCreateStation (void) const station->m_aparfState = AparfWifiManager::High; station->m_initialized = false; - NS_LOG_DEBUG ("create station=" << station << ", rate=" << static_cast(station->m_rateIndex) - << ", power=" << static_cast(station->m_powerLevel)); + NS_LOG_DEBUG ("create station=" << station << ", rate=" << +station->m_rateIndex + << ", power=" << +station->m_powerLevel); return station; } @@ -244,7 +244,7 @@ AparfWifiManager::DoReportDataOk (WifiRemoteStation *st, double ackSnr, CheckInit (station); station->m_nSuccess++; station->m_nFailed = 0; - NS_LOG_DEBUG ("station=" << station << " data ok success=" << station->m_nSuccess << ", rate=" << static_cast(station->m_rateIndex) << ", power=" << static_cast(station->m_powerLevel)); + NS_LOG_DEBUG ("station=" << station << " data ok success=" << station->m_nSuccess << ", rate=" << +station->m_rateIndex << ", power=" << +station->m_powerLevel); if ((station->m_aparfState == AparfWifiManager::High) && (station->m_nSuccess >= station->m_successThreshold)) { diff --git a/src/wifi/model/block-ack-agreement.cc b/src/wifi/model/block-ack-agreement.cc index 206331664..feeb5f405 100644 --- a/src/wifi/model/block-ack-agreement.cc +++ b/src/wifi/model/block-ack-agreement.cc @@ -31,7 +31,7 @@ BlockAckAgreement::BlockAckAgreement (Mac48Address peer, uint8_t tid) m_htSupported (0), m_inactivityEvent () { - NS_LOG_FUNCTION (this << peer << static_cast (tid)); + NS_LOG_FUNCTION (this << peer << +tid); m_tid = tid; m_peer = peer; } diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index 5f83fb02d..2eb84ea97 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -48,7 +48,7 @@ Bar::Bar (Ptr bar, Mac48Address recipient, uint8_t tid, bool immed tid (tid), immediate (immediate) { - NS_LOG_FUNCTION (this << bar << recipient << static_cast (tid) << immediate); + NS_LOG_FUNCTION (this << bar << recipient << +tid << immediate); } NS_OBJECT_ENSURE_REGISTERED (BlockAckManager); @@ -80,7 +80,7 @@ BlockAckManager::~BlockAckManager () bool BlockAckManager::ExistsAgreement (Mac48Address recipient, uint8_t tid) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << +tid); return (m_agreements.find (std::make_pair (recipient, tid)) != m_agreements.end ()); } @@ -88,7 +88,7 @@ bool BlockAckManager::ExistsAgreementInState (Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid) << state); + NS_LOG_FUNCTION (this << recipient << +tid << state); AgreementsCI it; it = m_agreements.find (std::make_pair (recipient, tid)); if (it != m_agreements.end ()) @@ -142,7 +142,7 @@ BlockAckManager::CreateAgreement (const MgtAddBaRequestHeader *reqHdr, Mac48Addr void BlockAckManager::DestroyAgreement (Mac48Address recipient, uint8_t tid) { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << +tid); AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); if (it != m_agreements.end ()) { @@ -413,7 +413,7 @@ BlockAckManager::RemovePacket (uint8_t tid, Mac48Address recipient, uint16_t seq i->second.second.erase ((*it)); m_retryPackets.erase (it); - NS_LOG_DEBUG ("Removed Packet from retry queue = " << hdr.GetSequenceNumber () << " " << static_cast (tid) << " " << recipient << " Buffer Size = " << m_retryPackets.size ()); + NS_LOG_DEBUG ("Removed Packet from retry queue = " << hdr.GetSequenceNumber () << " " << +tid << " " << recipient << " Buffer Size = " << m_retryPackets.size ()); return true; } } @@ -443,7 +443,7 @@ BlockAckManager::HasPackets (void) const uint32_t BlockAckManager::GetNBufferedPackets (Mac48Address recipient, uint8_t tid) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << +tid); uint32_t nPackets = 0; if (ExistsAgreement (recipient, tid)) { @@ -468,7 +468,7 @@ BlockAckManager::GetNBufferedPackets (Mac48Address recipient, uint8_t tid) const uint32_t BlockAckManager::GetNRetryNeededPackets (Mac48Address recipient, uint8_t tid) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << +tid); uint32_t nPackets = 0; uint16_t currentSeq = 0; if (ExistsAgreement (recipient, tid)) @@ -503,7 +503,7 @@ BlockAckManager::GetNRetryNeededPackets (Mac48Address recipient, uint8_t tid) co void BlockAckManager::SetBlockAckThreshold (uint8_t nPackets) { - NS_LOG_FUNCTION (this << static_cast (nPackets)); + NS_LOG_FUNCTION (this << +nPackets); m_blockAckThreshold = nPackets; } @@ -661,7 +661,7 @@ BlockAckManager::ScheduleBlockAckReqIfNeeded (Mac48Address recipient, uint8_t ti this number could be incorrect. In fact is possible that a block ack agreement exists for n packets but some of these packets are dropped due to MSDU lifetime expiration. */ - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << +tid); AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); NS_ASSERT (it != m_agreements.end ()); @@ -697,14 +697,14 @@ BlockAckManager::ScheduleBlockAckReqIfNeeded (Mac48Address recipient, uint8_t ti void BlockAckManager::InactivityTimeout (Mac48Address recipient, uint8_t tid) { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << +tid); m_blockAckInactivityTimeout (recipient, tid, true); } void BlockAckManager::NotifyAgreementEstablished (Mac48Address recipient, uint8_t tid, uint16_t startingSeq) { - NS_LOG_FUNCTION (this << recipient << static_cast (tid) << startingSeq); + NS_LOG_FUNCTION (this << recipient << +tid << startingSeq); AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); NS_ASSERT (it != m_agreements.end ()); it->second.first.SetState (OriginatorBlockAckAgreement::ESTABLISHED); @@ -714,7 +714,7 @@ BlockAckManager::NotifyAgreementEstablished (Mac48Address recipient, uint8_t tid void BlockAckManager::NotifyAgreementUnsuccessful (Mac48Address recipient, uint8_t tid) { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << +tid); AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); NS_ASSERT (it != m_agreements.end ()); if (it != m_agreements.end ()) @@ -726,7 +726,7 @@ BlockAckManager::NotifyAgreementUnsuccessful (Mac48Address recipient, uint8_t ti void BlockAckManager::NotifyMpduTransmission (Mac48Address recipient, uint8_t tid, uint16_t nextSeqNumber, WifiMacHeader::QosAckPolicy policy) { - NS_LOG_FUNCTION (this << recipient << static_cast (tid) << nextSeqNumber); + NS_LOG_FUNCTION (this << recipient << +tid << nextSeqNumber); Ptr bar = 0; AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); NS_ASSERT (it != m_agreements.end ()); @@ -761,7 +761,7 @@ BlockAckManager::SetQueue (const Ptr queue) bool BlockAckManager::SwitchToBlockAckIfNeeded (Mac48Address recipient, uint8_t tid, uint16_t startingSeq) { - NS_LOG_FUNCTION (this << recipient << static_cast (tid) << startingSeq); + NS_LOG_FUNCTION (this << recipient << +tid << startingSeq); NS_ASSERT (!ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::PENDING)); if (!ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::UNSUCCESSFUL) && ExistsAgreement (recipient, tid)) { @@ -881,7 +881,7 @@ BlockAckManager::SetTxMiddle (const Ptr txMiddle) uint16_t BlockAckManager::GetSeqNumOfNextRetryPacket (Mac48Address recipient, uint8_t tid) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << +tid); std::list::const_iterator it = m_retryPackets.begin (); while (it != m_retryPackets.end ()) { diff --git a/src/wifi/model/cara-wifi-manager.cc b/src/wifi/model/cara-wifi-manager.cc index 0480eecee..995cf4444 100644 --- a/src/wifi/model/cara-wifi-manager.cc +++ b/src/wifi/model/cara-wifi-manager.cc @@ -160,7 +160,7 @@ CaraWifiManager::DoReportDataOk (WifiRemoteStation *st, { station->m_rate++; } - NS_LOG_DEBUG ("self=" << station << " inc rate=" << static_cast(station->m_rate)); + NS_LOG_DEBUG ("self=" << station << " inc rate=" << +station->m_rate); station->m_timer = 0; station->m_success = 0; } diff --git a/src/wifi/model/edca-txop-n.cc b/src/wifi/model/edca-txop-n.cc index 116a8b9df..3dc2e638e 100644 --- a/src/wifi/model/edca-txop-n.cc +++ b/src/wifi/model/edca-txop-n.cc @@ -123,7 +123,7 @@ EdcaTxopN::SetWifiRemoteStationManager (const Ptr remo void EdcaTxopN::SetTypeOfStation (TypeOfStation type) { - NS_LOG_FUNCTION (this << static_cast (type)); + NS_LOG_FUNCTION (this << +type); m_typeOfStation = type; } @@ -613,7 +613,7 @@ EdcaTxopN::MissedAck (void) void EdcaTxopN::MissedBlockAck (uint8_t nMpdus) { - NS_LOG_FUNCTION (this << static_cast (nMpdus)); + NS_LOG_FUNCTION (this << +nMpdus); uint8_t tid = GetTid (m_currentPacket, m_currentHdr); if (GetAmpduExist (m_currentHdr.GetAddr1 ())) { @@ -1162,7 +1162,7 @@ EdcaTxopN::GetFragmentPacket (WifiMacHeader *hdr) void EdcaTxopN::SetAccessCategory (AcIndex ac) { - NS_LOG_FUNCTION (this << static_cast (ac)); + NS_LOG_FUNCTION (this << +ac); m_ac = ac; } @@ -1418,7 +1418,7 @@ EdcaTxopN::CompleteConfig (void) void EdcaTxopN::SetBlockAckThreshold (uint8_t threshold) { - NS_LOG_FUNCTION (this << static_cast (threshold)); + NS_LOG_FUNCTION (this << +threshold); m_blockAckThreshold = threshold; m_baManager->SetBlockAckThreshold (threshold); } @@ -1441,7 +1441,7 @@ void EdcaTxopN::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16_t startSeq, uint16_t timeout, bool immediateBAck) { - NS_LOG_FUNCTION (this << dest << static_cast (tid) << startSeq << timeout << immediateBAck); + NS_LOG_FUNCTION (this << dest << +tid << startSeq << timeout << immediateBAck); NS_LOG_DEBUG ("sent ADDBA request to " << dest); WifiMacHeader hdr; hdr.SetType (WIFI_MAC_MGT_ACTION); @@ -1501,7 +1501,7 @@ EdcaTxopN::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16_t startSeq, void EdcaTxopN::SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator) { - NS_LOG_FUNCTION (this << addr << static_cast (tid) << byOriginator); + NS_LOG_FUNCTION (this << addr << +tid << byOriginator); WifiMacHeader hdr; hdr.SetType (WIFI_MAC_MGT_ACTION); hdr.SetAddr1 (addr); diff --git a/src/wifi/model/he-capabilities.cc b/src/wifi/model/he-capabilities.cc index bf8c96081..53f607d56 100644 --- a/src/wifi/model/he-capabilities.cc +++ b/src/wifi/model/he-capabilities.cc @@ -481,9 +481,9 @@ std::ostream & operator << (std::ostream &os, const HeCapabilities &HeCapabilities) { os << HeCapabilities.GetHeMacCapabilitiesInfo1 () << "|" - << static_cast (HeCapabilities.GetHeMacCapabilitiesInfo2 ()) << "|" + << +HeCapabilities.GetHeMacCapabilitiesInfo2 () << "|" << HeCapabilities.GetHePhyCapabilitiesInfo1 () << "|" - << static_cast (HeCapabilities.GetHePhyCapabilitiesInfo2 ()) << "|" + << +HeCapabilities.GetHePhyCapabilitiesInfo2 () << "|" << HeCapabilities.GetSupportedMcsAndNss (); return os; } diff --git a/src/wifi/model/ideal-wifi-manager.cc b/src/wifi/model/ideal-wifi-manager.cc index 0de2dc521..674e1a0e4 100644 --- a/src/wifi/model/ideal-wifi-manager.cc +++ b/src/wifi/model/ideal-wifi-manager.cc @@ -134,8 +134,8 @@ IdealWifiManager::DoInitialize () //derive NSS from the MCS index nss = (mode.GetMcsValue () / 8) + 1; NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () << - " channel width " << static_cast (j) << - " nss " << static_cast (nss) << + " channel width " << +j << + " nss " << +nss << " GI " << guardInterval); NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ()); txVector.SetNss (nss); @@ -157,8 +157,8 @@ IdealWifiManager::DoInitialize () for (uint8_t i = 1; i <= GetPhy ()->GetMaxSupportedTxSpatialStreams (); i++) { NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () << - " channel width " << static_cast (j) << - " nss " << static_cast (i) << + " channel width " << +j << + " nss " << +i << " GI " << guardInterval); NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ()); txVector.SetNss (i); @@ -178,13 +178,13 @@ IdealWifiManager::GetSnrThreshold (WifiTxVector txVector) const for (Thresholds::const_iterator i = m_thresholds.begin (); i != m_thresholds.end (); i++) { NS_LOG_DEBUG ("Checking " << i->second.GetMode ().GetUniqueName () << - " nss " << static_cast (i->second.GetNss ()) << + " nss " << +i->second.GetNss () << " GI " << i->second.GetGuardInterval () << - " width " << static_cast (i->second.GetChannelWidth ())); + " width " << +i->second.GetChannelWidth ()); NS_LOG_DEBUG ("against TxVector " << txVector.GetMode ().GetUniqueName () << - " nss " << static_cast (txVector.GetNss ()) << + " nss " << +txVector.GetNss () << " GI " << txVector.GetGuardInterval () << - " width " << static_cast (txVector.GetChannelWidth ())); + " width " << +txVector.GetChannelWidth ()); if (txVector.GetMode () == i->second.GetMode () && txVector.GetNss () == i->second.GetNss () && txVector.GetChannelWidth () == i->second.GetChannelWidth ()) @@ -260,7 +260,7 @@ IdealWifiManager::DoReportDataOk (WifiRemoteStation *st, void IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) { - NS_LOG_FUNCTION (this << st << static_cast (nSuccessfulMpdus) << static_cast (nFailedMpdus) << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr); IdealWifiRemoteStation *station = (IdealWifiRemoteStation *)st; if (dataSnr == 0) { @@ -308,7 +308,7 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) NS_LOG_DEBUG ("Using cached mode = " << maxMode.GetUniqueName () << " last snr observed " << station->m_lastSnrObserved << " cached " << station->m_lastSnrCached << - " nss " << static_cast (selectedNss)); + " nss " << +selectedNss); } else { @@ -340,8 +340,8 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) || nss > std::min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (st))) { NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () << - " nss " << static_cast (nss) << - " width " << static_cast (txVector.GetChannelWidth ())); + " nss " << +nss << + " width " << +txVector.GetChannelWidth ()); continue; } double threshold = GetSnrThreshold (txVector); @@ -383,8 +383,8 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) if (!txVector.IsValid ()) { NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () << - " nss " << static_cast (nss) << - " width " << static_cast (txVector.GetChannelWidth ())); + " nss " << +nss << + " width " << +txVector.GetChannelWidth ()); continue; } double threshold = GetSnrThreshold (txVector); @@ -422,8 +422,8 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) if (!txVector.IsValid ()) { NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () << - " nss " << static_cast (nss) << - " width " << static_cast (txVector.GetChannelWidth ())); + " nss " << +nss << + " width " << +txVector.GetChannelWidth ()); continue; } double threshold = GetSnrThreshold (txVector); @@ -481,7 +481,7 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) station->m_lastMode = maxMode; station->m_nss = selectedNss; } - NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << static_cast (channelWidth)); + NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << +channelWidth); if (maxMode.GetModulationClass () == WIFI_MOD_CLASS_HE) { guardInterval = std::max (GetGuardInterval (station), static_cast (GetPhy ()->GetGuardInterval ().GetNanoSeconds ())); diff --git a/src/wifi/model/interference-helper.cc b/src/wifi/model/interference-helper.cc index 0660e8b4a..146a2cb74 100644 --- a/src/wifi/model/interference-helper.cc +++ b/src/wifi/model/interference-helper.cc @@ -234,7 +234,7 @@ InterferenceHelper::CalculateSnr (double signal, double noiseInterference, uint8 double noiseFloor = m_noiseFigure * Nt; double noise = noiseFloor + noiseInterference; double snr = signal / noise; //linear scale - NS_LOG_DEBUG ("bandwidth(MHz)=" << static_cast (channelWidth) << ", signal(W)= " << signal << ", noise(W)=" << noiseFloor << ", interference(W)=" << noiseInterference << ", snr(linear)=" << snr); + NS_LOG_DEBUG ("bandwidth(MHz)=" << +channelWidth << ", signal(W)= " << signal << ", noise(W)=" << noiseFloor << ", interference(W)=" << noiseInterference << ", snr(linear)=" << snr); return snr; } @@ -271,8 +271,8 @@ InterferenceHelper::CalculateChunkSuccessRate (double snir, Time duration, WifiM { nbits /= txVector.GetNss (); //divide effective number of bits by NSS to achieve same chunk error rate as SISO for AWGN double gain = (txVector.GetNTx () * m_numRxAntennas); //compute gain offered by MIMO, SIMO or MISO compared to SISO for AWGN - NS_LOG_DEBUG ("TX=" << static_cast (txVector.GetNTx ()) << - ", RX=" << static_cast (m_numRxAntennas) << + NS_LOG_DEBUG ("TX=" << +txVector.GetNTx () << + ", RX=" << +m_numRxAntennas << ", SNIR improvement=+" << 10 * std::log10 (gain) << "dB"); snir *= gain; } diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index 9839a373b..67bde3948 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -2190,7 +2190,7 @@ MacLow::SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time durat NS_LOG_FUNCTION (this); if (!m_phy->IsStateTx () && !m_phy->IsStateRx ()) { - NS_LOG_FUNCTION (this << static_cast (tid) << originator << duration.As (Time::S) << blockAckReqTxVector << rxSnr); + NS_LOG_FUNCTION (this << +tid << originator << duration.As (Time::S) << blockAckReqTxVector << rxSnr); CtrlBAckResponseHeader blockAck; uint16_t seqNumber = 0; BlockAckCachesI i = m_bAckCaches.find (std::make_pair (originator, tid)); diff --git a/src/wifi/model/minstrel-ht-wifi-manager.cc b/src/wifi/model/minstrel-ht-wifi-manager.cc index 146c9e337..94bc0d5cf 100644 --- a/src/wifi/model/minstrel-ht-wifi-manager.cc +++ b/src/wifi/model/minstrel-ht-wifi-manager.cc @@ -253,7 +253,7 @@ MinstrelHtWifiManager::DoInitialize () AddFirstMpduTxTime (groupId, mode, CalculateFirstMpduTxDuration (GetPhy (), streams, sgi, chWidth, mode)); AddMpduTxTime (groupId, mode, CalculateMpduTxDuration (GetPhy (), streams, sgi, chWidth, mode)); } - NS_LOG_DEBUG ("Initialized group " << groupId << ": (" << static_cast (streams) << "," << static_cast (sgi) << "," << static_cast (chWidth) << ")"); + NS_LOG_DEBUG ("Initialized group " << groupId << ": (" << +streams << "," << +sgi << "," << +chWidth << ")"); } } } @@ -295,7 +295,7 @@ MinstrelHtWifiManager::DoInitialize () AddMpduTxTime (groupId, mode, CalculateMpduTxDuration (GetPhy (), streams, sgi, chWidth, mode)); } } - NS_LOG_DEBUG ("Initialized group " << groupId << ": (" << static_cast (streams) << "," << static_cast (sgi) << "," << static_cast (chWidth) << ")"); + NS_LOG_DEBUG ("Initialized group " << groupId << ": (" << +streams << "," << +sgi << "," << +chWidth << ")"); } } } @@ -315,7 +315,7 @@ MinstrelHtWifiManager::SetupMac (const Ptr mac) bool MinstrelHtWifiManager::IsValidMcs (Ptr phy, uint8_t streams, uint8_t chWidth, WifiMode mode) { - NS_LOG_FUNCTION (this << phy << static_cast (streams) << static_cast (chWidth) << mode); + NS_LOG_FUNCTION (this << phy << +streams << +chWidth << mode); WifiTxVector txvector; txvector.SetNss (streams); txvector.SetChannelWidth (chWidth); @@ -326,7 +326,7 @@ MinstrelHtWifiManager::IsValidMcs (Ptr phy, uint8_t streams, uint8_t ch Time MinstrelHtWifiManager::CalculateFirstMpduTxDuration (Ptr phy, uint8_t streams, uint8_t sgi, uint8_t chWidth, WifiMode mode) { - NS_LOG_FUNCTION (this << phy << static_cast (streams) << static_cast (sgi) << static_cast (chWidth) << mode); + NS_LOG_FUNCTION (this << phy << +streams << +sgi << +chWidth << mode); WifiTxVector txvector; txvector.SetNss (streams); txvector.SetGuardInterval (sgi ? 400 : 800); @@ -341,7 +341,7 @@ MinstrelHtWifiManager::CalculateFirstMpduTxDuration (Ptr phy, uint8_t s Time MinstrelHtWifiManager::CalculateMpduTxDuration (Ptr phy, uint8_t streams, uint8_t sgi, uint8_t chWidth, WifiMode mode) { - NS_LOG_FUNCTION (this << phy << static_cast (streams) << static_cast (sgi) << static_cast (chWidth) << mode); + NS_LOG_FUNCTION (this << phy << +streams << +sgi << +chWidth << mode); WifiTxVector txvector; txvector.SetNss (streams); txvector.SetGuardInterval (sgi ? 400 : 800); @@ -672,7 +672,7 @@ MinstrelHtWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) void MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) { - NS_LOG_FUNCTION (this << st << static_cast (nSuccessfulMpdus) << static_cast (nFailedMpdus) << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr); MinstrelHtWifiRemoteStation *station = (MinstrelHtWifiRemoteStation *) st; CheckInit (station); @@ -687,7 +687,7 @@ MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSu } NS_LOG_DEBUG ("DoReportAmpduTxStatus. TxRate=" << station->m_txrate << " SuccMpdus= " << - static_cast (nSuccessfulMpdus) << " FailedMpdus= " << static_cast (nFailedMpdus)); + +nSuccessfulMpdus << " FailedMpdus= " << +nFailedMpdus); station->m_ampduPacketCount++; station->m_ampduLen += nSuccessfulMpdus + nFailedMpdus; @@ -835,7 +835,7 @@ MinstrelHtWifiManager::UpdateRetry (MinstrelHtWifiRemoteStation *station) void MinstrelHtWifiManager::UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus) { - NS_LOG_FUNCTION (this << station << static_cast (nSuccessfulMpdus) << static_cast (nFailedMpdus)); + NS_LOG_FUNCTION (this << station << +nSuccessfulMpdus << +nFailedMpdus); station->m_totalPacketsCount += nSuccessfulMpdus + nFailedMpdus; if (station->m_isSampling) @@ -902,8 +902,8 @@ MinstrelHtWifiManager::DoGetDataTxVector (WifiRemoteStation *st) // Check consistency of rate selected. if ((group.sgi && !GetShortGuardInterval (station)) || group.chWidth > GetChannelWidth (station) || group.streams > GetNumberOfSupportedStreams (station)) { - NS_ASSERT_MSG (false, "Inconsistent group selected. Group: (" << static_cast (group.streams) << - "," << static_cast (group.sgi) << "," << static_cast (group.chWidth) << ")" << + NS_ASSERT_MSG (false, "Inconsistent group selected. Group: (" << +group.streams << + "," << +group.sgi << "," << +group.chWidth << ")" << " Station capabilities: (" << GetNumberOfSupportedStreams (station) << "," << GetShortGuardInterval (station) << "," << GetChannelWidth (station) << ")"); } @@ -1173,8 +1173,8 @@ MinstrelHtWifiManager::FindRate (MinstrelHtWifiRemoteStation *station) Time maxProbDuration = station->m_groupsTable[maxProbGroupId].m_ratesTable[maxProbRateId].perfectTxTime; NS_LOG_DEBUG ("Use sample rate? SampleDuration= " << sampleDuration << " maxTp2Duration= " << maxTp2Duration << - " maxProbDuration= " << maxProbDuration << " sampleStreams= " << static_cast (sampleStreams) << - " maxTpStreams= " << static_cast (maxTpStreams)); + " maxProbDuration= " << maxProbDuration << " sampleStreams= " << +sampleStreams << + " maxTpStreams= " << +maxTpStreams); if (sampleDuration < maxTp2Duration || (sampleStreams < maxTpStreams && sampleDuration < maxProbDuration)) { /// Set flag that we are currently sampling. @@ -1504,8 +1504,8 @@ MinstrelHtWifiManager::RateInit (MinstrelHtWifiRemoteStation *station) && (GetChannelWidth (station) >= m_minstrelGroups[groupId].chWidth) ///Is channel width supported by the receiver? && (GetNumberOfSupportedStreams (station) >= m_minstrelGroups[groupId].streams)) ///Are streams supported by the receiver? { - NS_LOG_DEBUG ("Group " << groupId << ": (" << static_cast (m_minstrelGroups[groupId].streams) << - "," << static_cast (m_minstrelGroups[groupId].sgi) << "," << static_cast (m_minstrelGroups[groupId].chWidth) << ")"); + NS_LOG_DEBUG ("Group " << groupId << ": (" << +m_minstrelGroups[groupId].streams << + "," << +m_minstrelGroups[groupId].sgi << "," << +m_minstrelGroups[groupId].chWidth << ")"); station->m_groupsTable[groupId].m_supported = true; ///Group supported. station->m_groupsTable[groupId].m_col = 0; @@ -1805,14 +1805,14 @@ MinstrelHtWifiManager::GetGroupId (uint32_t index) uint32_t MinstrelHtWifiManager::GetHtGroupId (uint8_t txstreams, uint8_t sgi, uint8_t chWidth) { - NS_LOG_FUNCTION (this << static_cast (txstreams) << static_cast (sgi) << static_cast (chWidth)); + NS_LOG_FUNCTION (this << +txstreams << +sgi << +chWidth); return MAX_SUPPORTED_STREAMS * 2 * (chWidth == 40 ? 1 : 0) + MAX_SUPPORTED_STREAMS * sgi + txstreams - 1; } uint32_t MinstrelHtWifiManager::GetVhtGroupId (uint8_t txstreams, uint8_t sgi, uint8_t chWidth) { - NS_LOG_FUNCTION (this << static_cast (txstreams) << static_cast (sgi) << static_cast (chWidth)); + NS_LOG_FUNCTION (this << +txstreams << +sgi << +chWidth); return MAX_HT_STREAM_GROUPS * MAX_SUPPORTED_STREAMS + MAX_SUPPORTED_STREAMS * 2 * (chWidth == 160 ? 3 : chWidth == 80 ? 2 : chWidth == 40 ? 1 : 0) + MAX_SUPPORTED_STREAMS * sgi + txstreams - 1; } diff --git a/src/wifi/model/minstrel-wifi-manager.cc b/src/wifi/model/minstrel-wifi-manager.cc index 5f16941d6..2f7640a3d 100644 --- a/src/wifi/model/minstrel-wifi-manager.cc +++ b/src/wifi/model/minstrel-wifi-manager.cc @@ -907,7 +907,7 @@ MinstrelWifiManager::RateInit (MinstrelWifiRemoteStation *station) NS_LOG_FUNCTION (this << station); for (uint8_t i = 0; i < station->m_nModes; i++) { - NS_LOG_DEBUG ("Initializing rate index " << static_cast(i) << " " << GetSupported (station, i)); + NS_LOG_DEBUG ("Initializing rate index " << +i << " " << GetSupported (station, i)); station->m_minstrelTable[i].numRateAttempt = 0; station->m_minstrelTable[i].numRateSuccess = 0; station->m_minstrelTable[i].prevNumRateSuccess = 0; diff --git a/src/wifi/model/parf-wifi-manager.cc b/src/wifi/model/parf-wifi-manager.cc index 0c0e40a8f..81cad96a8 100644 --- a/src/wifi/model/parf-wifi-manager.cc +++ b/src/wifi/model/parf-wifi-manager.cc @@ -116,7 +116,7 @@ ParfWifiManager::DoCreateStation (void) const station->m_nAttempt = 0; NS_LOG_DEBUG ("create station=" << station << ", timer=" << station->m_nAttempt - << ", rate=" << static_cast(station->m_rateIndex) << ", power=" << static_cast(station->m_powerLevel)); + << ", rate=" << +station->m_rateIndex << ", power=" << +station->m_powerLevel); return station; } @@ -168,7 +168,7 @@ ParfWifiManager::DoReportDataFailed (WifiRemoteStation *st) station->m_nSuccess = 0; NS_LOG_DEBUG ("station=" << station << " data fail retry=" << station->m_nRetry << ", timer=" << station->m_nAttempt - << ", rate=" << static_cast(station->m_rateIndex) << ", power=" << static_cast(station->m_powerLevel)); + << ", rate=" << +station->m_rateIndex << ", power=" << +station->m_powerLevel); if (station->m_usingRecoveryRate) { NS_ASSERT (station->m_nRetry >= 1); @@ -251,7 +251,7 @@ void ParfWifiManager::DoReportDataOk (WifiRemoteStation *st, station->m_usingRecoveryRate = false; station->m_usingRecoveryPower = false; station->m_nRetry = 0; - NS_LOG_DEBUG ("station=" << station << " data ok success=" << station->m_nSuccess << ", timer=" << station->m_nAttempt << ", rate=" << static_cast(station->m_rateIndex) << ", power=" << static_cast(station->m_powerLevel)); + NS_LOG_DEBUG ("station=" << station << " data ok success=" << station->m_nSuccess << ", timer=" << station->m_nAttempt << ", rate=" << +station->m_rateIndex << ", power=" << +station->m_powerLevel); if ((station->m_nSuccess == m_successThreshold || station->m_nAttempt == m_attemptThreshold) && (station->m_rateIndex < (station->m_state->m_operationalRateSet.size () - 1))) diff --git a/src/wifi/model/qos-utils.cc b/src/wifi/model/qos-utils.cc index deb5ca188..3d9dd954c 100644 --- a/src/wifi/model/qos-utils.cc +++ b/src/wifi/model/qos-utils.cc @@ -27,7 +27,7 @@ namespace ns3 { AcIndex QosUtilsMapTidToAc (uint8_t tid) { - NS_ASSERT_MSG (tid < 8, "Tid " << static_cast (tid) << " out of range"); + NS_ASSERT_MSG (tid < 8, "Tid " << +tid << " out of range"); switch (tid) { case 0: diff --git a/src/wifi/model/regular-wifi-mac.cc b/src/wifi/model/regular-wifi-mac.cc index 0b3f6fe2e..57c8a06b3 100644 --- a/src/wifi/model/regular-wifi-mac.cc +++ b/src/wifi/model/regular-wifi-mac.cc @@ -398,28 +398,28 @@ RegularWifiMac::SetBkMaxAmpduSize (uint16_t size) void RegularWifiMac::SetVoBlockAckThreshold (uint8_t threshold) { - NS_LOG_FUNCTION (this << static_cast (threshold)); + NS_LOG_FUNCTION (this << +threshold); GetVOQueue ()->SetBlockAckThreshold (threshold); } void RegularWifiMac::SetViBlockAckThreshold (uint8_t threshold) { - NS_LOG_FUNCTION (this << static_cast (threshold)); + NS_LOG_FUNCTION (this << +threshold); GetVIQueue ()->SetBlockAckThreshold (threshold); } void RegularWifiMac::SetBeBlockAckThreshold (uint8_t threshold) { - NS_LOG_FUNCTION (this << static_cast (threshold)); + NS_LOG_FUNCTION (this << +threshold); GetBEQueue ()->SetBlockAckThreshold (threshold); } void RegularWifiMac::SetBkBlockAckThreshold (uint8_t threshold) { - NS_LOG_FUNCTION (this << static_cast (threshold)); + NS_LOG_FUNCTION (this << +threshold); GetBKQueue ()->SetBlockAckThreshold (threshold); } diff --git a/src/wifi/model/rraa-wifi-manager.cc b/src/wifi/model/rraa-wifi-manager.cc index 38d4a8a9c..974ad1338 100644 --- a/src/wifi/model/rraa-wifi-manager.cc +++ b/src/wifi/model/rraa-wifi-manager.cc @@ -453,7 +453,7 @@ RraaWifiManager::ARts (RraaWifiRemoteStation *station) WifiRraaThresholds RraaWifiManager::GetThresholds (RraaWifiRemoteStation *station, uint8_t rate) const { - NS_LOG_FUNCTION (this << station << static_cast(rate)); + NS_LOG_FUNCTION (this << station << +rate); WifiMode mode = GetSupported (station, rate); return GetThresholds (station, mode); } diff --git a/src/wifi/model/rrpaa-wifi-manager.cc b/src/wifi/model/rrpaa-wifi-manager.cc index 7ef3a5c00..01efed053 100644 --- a/src/wifi/model/rrpaa-wifi-manager.cc +++ b/src/wifi/model/rrpaa-wifi-manager.cc @@ -466,7 +466,7 @@ RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station) { NS_LOG_DEBUG ("bploss >= MTL and power < maxPower => Increase Power"); station->m_pdTable[station->m_rateIndex][station->m_powerLevel] /= m_gamma; - NS_LOG_DEBUG ("pdTable[" << static_cast (station->m_rateIndex) << "][" << station->m_powerLevel << "] = " << station->m_pdTable[station->m_rateIndex][station->m_powerLevel]); + NS_LOG_DEBUG ("pdTable[" << +station->m_rateIndex << "][" << station->m_powerLevel << "] = " << station->m_pdTable[station->m_rateIndex][station->m_powerLevel]); station->m_powerLevel++; ResetCountersBasic (station); } @@ -474,7 +474,7 @@ RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station) { NS_LOG_DEBUG ("bploss >= MTL and power = maxPower => Decrease Rate"); station->m_pdTable[station->m_rateIndex][station->m_powerLevel] /= m_gamma; - NS_LOG_DEBUG ("pdTable[" << static_cast (station->m_rateIndex) << "][" << station->m_powerLevel << "] = " << station->m_pdTable[station->m_rateIndex][station->m_powerLevel]); + NS_LOG_DEBUG ("pdTable[" << +station->m_rateIndex << "][" << station->m_powerLevel << "] = " << station->m_pdTable[station->m_rateIndex][station->m_powerLevel]); station->m_rateIndex--; ResetCountersBasic (station); } @@ -518,7 +518,7 @@ RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station) { station->m_pdTable[station->m_rateIndex][i] = 1; } - NS_LOG_DEBUG ("pdTable[" << static_cast (station->m_rateIndex) << "][" << i << "] = " << station->m_pdTable[station->m_rateIndex][i]); + NS_LOG_DEBUG ("pdTable[" << +station->m_rateIndex << "][" << i << "] = " << station->m_pdTable[station->m_rateIndex][i]); } double rand = m_uniformRandomVariable->GetValue (0,1); if (rand < station->m_pdTable[station->m_rateIndex][station->m_powerLevel - 1]) @@ -543,7 +543,7 @@ RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station) { station->m_pdTable[station->m_rateIndex][i] = 1; } - NS_LOG_DEBUG ("pdTable[" << static_cast (station->m_rateIndex) << "][" << i << "] = " << station->m_pdTable[station->m_rateIndex][i]); + NS_LOG_DEBUG ("pdTable[" << +station->m_rateIndex << "][" << i << "] = " << station->m_pdTable[station->m_rateIndex][i]); } double rand = m_uniformRandomVariable->GetValue (0,1); if (rand < station->m_pdTable[station->m_rateIndex][station->m_powerLevel - 1]) @@ -590,7 +590,7 @@ RrpaaWifiManager::RunAdaptiveRtsAlgorithm (RrpaaWifiRemoteStation *station) WifiRrpaaThresholds RrpaaWifiManager::GetThresholds (RrpaaWifiRemoteStation *station, uint8_t rate) const { - NS_LOG_FUNCTION (this << station << static_cast(rate)); + NS_LOG_FUNCTION (this << station << +rate); WifiMode mode = GetSupported (station, rate); return GetThresholds (station, mode); } diff --git a/src/wifi/model/spectrum-wifi-phy.cc b/src/wifi/model/spectrum-wifi-phy.cc index a7ab3afc3..93c793819 100644 --- a/src/wifi/model/spectrum-wifi-phy.cc +++ b/src/wifi/model/spectrum-wifi-phy.cc @@ -107,7 +107,7 @@ SpectrumWifiPhy::GetRxSpectrumModel () const } else { - NS_LOG_DEBUG ("Creating spectrum model from frequency/width pair of (" << GetFrequency () << ", " << static_cast (GetChannelWidth ()) << ")"); + NS_LOG_DEBUG ("Creating spectrum model from frequency/width pair of (" << GetFrequency () << ", " << +GetChannelWidth () << ")"); m_rxSpectrumModel = WifiSpectrumValueHelper::GetSpectrumModel (GetFrequency (), GetChannelWidth (), GetBandBandwidth (), GetGuardBandwidth ()); } } @@ -131,7 +131,7 @@ SpectrumWifiPhy::ResetSpectrumModel (void) { NS_LOG_FUNCTION (this); NS_ASSERT_MSG (IsInitialized (), "Executing method before run-time"); - NS_LOG_DEBUG ("Run-time change of spectrum model from frequency/width pair of (" << GetFrequency () << ", " << static_cast (GetChannelWidth ()) << ")"); + NS_LOG_DEBUG ("Run-time change of spectrum model from frequency/width pair of (" << GetFrequency () << ", " << +GetChannelWidth () << ")"); // Replace existing spectrum model with new one, and must call AddRx () // on the SpectrumChannel to provide this new spectrum model to it m_rxSpectrumModel = WifiSpectrumValueHelper::GetSpectrumModel (GetFrequency (), GetChannelWidth (), GetBandBandwidth (), GetGuardBandwidth ()); @@ -141,7 +141,7 @@ SpectrumWifiPhy::ResetSpectrumModel (void) void SpectrumWifiPhy::SetChannelNumber (uint8_t nch) { - NS_LOG_FUNCTION (this << static_cast (nch)); + NS_LOG_FUNCTION (this << +nch); WifiPhy::SetChannelNumber (nch); if (IsInitialized ()) { @@ -163,7 +163,7 @@ SpectrumWifiPhy::SetFrequency (uint16_t freq) void SpectrumWifiPhy::SetChannelWidth (uint8_t channelwidth) { - NS_LOG_FUNCTION (this << static_cast (channelwidth)); + NS_LOG_FUNCTION (this << +channelwidth); WifiPhy::SetChannelWidth (channelwidth); if (IsInitialized ()) { @@ -287,7 +287,7 @@ SpectrumWifiPhy::CreateWifiSpectrumPhyInterface (Ptr device) Ptr SpectrumWifiPhy::GetTxPowerSpectralDensity (uint16_t centerFrequency, uint8_t channelWidth, double txPowerW, WifiModulationClass modulationClass) const { - NS_LOG_FUNCTION (centerFrequency << static_cast (channelWidth) << txPowerW); + NS_LOG_FUNCTION (centerFrequency << +channelWidth << txPowerW); Ptr v; switch (modulationClass) { @@ -342,7 +342,7 @@ SpectrumWifiPhy::StartTx (Ptr packet, WifiTxVector txVector, Time txDura txParams->txPhy = m_wifiSpectrumPhyInterface->GetObject (); txParams->txAntenna = m_antenna; txParams->packet = packet; - NS_LOG_DEBUG ("Starting transmission with power " << WToDbm (txPowerWatts) << " dBm on channel " << static_cast (GetChannelNumber ())); + NS_LOG_DEBUG ("Starting transmission with power " << WToDbm (txPowerWatts) << " dBm on channel " << +GetChannelNumber ()); NS_LOG_DEBUG ("Starting transmission with integrated spectrum power " << WToDbm (Integral (*txPowerSpectrum)) << " dBm; spectrum model Uid: " << txPowerSpectrum->GetSpectrumModel ()->GetUid ()); m_channel->StartTx (txParams); } diff --git a/src/wifi/model/supported-rates.cc b/src/wifi/model/supported-rates.cc index 140c4e305..61d1efa17 100644 --- a/src/wifi/model/supported-rates.cc +++ b/src/wifi/model/supported-rates.cc @@ -90,7 +90,7 @@ SupportedRates::AddSupportedRate (uint32_t bs) } m_rates[m_nRates] = bs / 500000; m_nRates++; - NS_LOG_DEBUG ("add rate=" << bs << ", n rates=" << static_cast (m_nRates)); + NS_LOG_DEBUG ("add rate=" << bs << ", n rates=" << +m_nRates); } } @@ -108,7 +108,7 @@ SupportedRates::SetBasicRate (uint32_t bs) } if (rate == m_rates[i]) { - NS_LOG_DEBUG ("set basic rate=" << bs << ", n rates=" << static_cast (m_nRates)); + NS_LOG_DEBUG ("set basic rate=" << bs << ", n rates=" << +m_nRates); m_rates[i] |= 0x80; return; } diff --git a/src/wifi/model/vht-operation.cc b/src/wifi/model/vht-operation.cc index 7ba4104ae..425da4cea 100644 --- a/src/wifi/model/vht-operation.cc +++ b/src/wifi/model/vht-operation.cc @@ -174,9 +174,9 @@ ATTRIBUTE_HELPER_CPP (VhtOperation); std::ostream & operator << (std::ostream &os, const VhtOperation &VhtOperation) { - os << static_cast (VhtOperation.GetChannelWidth ()) << "|" - << static_cast (VhtOperation.GetChannelCenterFrequencySegment0 ()) << "|" - << static_cast (VhtOperation.GetChannelCenterFrequencySegment1 ()) << "|" + os << +VhtOperation.GetChannelWidth () << "|" + << +VhtOperation.GetChannelCenterFrequencySegment0 () << "|" + << +VhtOperation.GetChannelCenterFrequencySegment1 () << "|" << VhtOperation.GetBasicVhtMcsAndNssSet (); return os; } diff --git a/src/wifi/model/wifi-information-element-vector.cc b/src/wifi/model/wifi-information-element-vector.cc index 51f9db3cb..8081dac68 100644 --- a/src/wifi/model/wifi-information-element-vector.cc +++ b/src/wifi/model/wifi-information-element-vector.cc @@ -105,7 +105,7 @@ WifiInformationElementVector::DeserializeSingleIe (Buffer::Iterator start) { case 0: // eliminate compiler warning default: - NS_FATAL_ERROR ("Information element " << static_cast (id) << " is not implemented"); + NS_FATAL_ERROR ("Information element " << +id << " is not implemented"); return 0; } /* unreachable: b/c switch is guaranteed to return from this function diff --git a/src/wifi/model/wifi-mode.cc b/src/wifi/model/wifi-mode.cc index 24227379c..17b905533 100644 --- a/src/wifi/model/wifi-mode.cc +++ b/src/wifi/model/wifi-mode.cc @@ -198,7 +198,7 @@ WifiMode::GetDataRate (uint8_t channelWidth, uint16_t guardInterval, uint8_t nss { if (item->modClass == WIFI_MOD_CLASS_VHT) { - NS_ASSERT_MSG (IsAllowed (channelWidth, nss), "VHT MCS " << static_cast (item->mcsValue) << " forbidden at " << static_cast (channelWidth) << " MHz when NSS is " << static_cast (nss)); + NS_ASSERT_MSG (IsAllowed (channelWidth, nss), "VHT MCS " << +item->mcsValue << " forbidden at " << +channelWidth << " MHz when NSS is " << +nss); } NS_ASSERT (guardInterval == 800 || guardInterval == 400); @@ -255,7 +255,7 @@ WifiMode::GetDataRate (uint8_t channelWidth, uint16_t guardInterval, uint8_t nss break; case WIFI_CODE_RATE_UNDEFINED: default: - NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined with nss: " << static_cast (nss)); + NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined with nss: " << +nss); break; } @@ -299,7 +299,7 @@ WifiMode::GetDataRate (uint8_t channelWidth, uint16_t guardInterval, uint8_t nss break; case WIFI_CODE_RATE_UNDEFINED: default: - NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined with nss: " << static_cast (nss)); + NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined with nss: " << +nss); break; } diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 3074f9d40..559689dd7 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -463,7 +463,7 @@ WifiPhy::InitializeFrequencyChannelNumber (void) } else if (m_initialChannelNumber != 0 && GetStandard () == WIFI_PHY_STANDARD_UNSPECIFIED) { - NS_FATAL_ERROR ("Error, ChannelNumber " << static_cast (GetChannelNumber ()) << " was set by user, but neither a standard nor a frequency"); + NS_FATAL_ERROR ("Error, ChannelNumber " << +GetChannelNumber () << " was set by user, but neither a standard nor a frequency"); } m_frequencyChannelNumberInitialized = true; } @@ -543,7 +543,7 @@ WifiPhy::GetTxPowerEnd (void) const void WifiPhy::SetNTxPower (uint8_t n) { - NS_LOG_FUNCTION (this << static_cast (n)); + NS_LOG_FUNCTION (this << +n); m_nTxPower = n; } @@ -1049,7 +1049,7 @@ WifiPhy::Configure80211ax (void) bool WifiPhy::DefineChannelNumber (uint8_t channelNumber, WifiPhyStandard standard, uint16_t frequency, uint8_t channelWidth) { - NS_LOG_FUNCTION (this << static_cast (channelNumber) << standard << frequency << static_cast (channelWidth)); + NS_LOG_FUNCTION (this << +channelNumber << standard << frequency << +channelWidth); ChannelNumberStandardPair p = std::make_pair (channelNumber, standard); ChannelToFrequencyWidthMap::const_iterator it; it = m_channelToFrequencyWidth.find (p); @@ -1066,7 +1066,7 @@ WifiPhy::DefineChannelNumber (uint8_t channelNumber, WifiPhyStandard standard, u uint8_t WifiPhy::FindChannelNumberForFrequencyWidth (uint16_t frequency, uint8_t width) const { - NS_LOG_FUNCTION (this << frequency << static_cast (width)); + NS_LOG_FUNCTION (this << frequency << +width); bool found = false; FrequencyWidthPair f = std::make_pair (frequency, width); ChannelToFrequencyWidthMap::const_iterator it = m_channelToFrequencyWidth.begin (); @@ -1081,7 +1081,7 @@ WifiPhy::FindChannelNumberForFrequencyWidth (uint16_t frequency, uint8_t width) } if (found) { - NS_LOG_DEBUG ("Found, returning " << static_cast (it->first.first)); + NS_LOG_DEBUG ("Found, returning " << +it->first.first); return (it->first.first); } else @@ -1106,7 +1106,7 @@ WifiPhy::ConfigureChannelForStandard (WifiPhyStandard standard) uint8_t channelNumberSearched = FindChannelNumberForFrequencyWidth (GetFrequency (), GetChannelWidth ()); if (channelNumberSearched) { - NS_LOG_DEBUG ("Channel number found; setting to " << static_cast (channelNumberSearched)); + NS_LOG_DEBUG ("Channel number found; setting to " << +channelNumberSearched); SetChannelNumber (channelNumberSearched); } else @@ -1120,7 +1120,7 @@ WifiPhy::ConfigureChannelForStandard (WifiPhyStandard standard) // If the channel number is known for this particular standard or for // the unspecified standard, configure using the known values; // otherwise, this is a configuration error - NS_LOG_DEBUG ("Configuring for channel number " << static_cast (GetChannelNumber ())); + NS_LOG_DEBUG ("Configuring for channel number " << +GetChannelNumber ()); FrequencyWidthPair f = GetFrequencyWidthForChannelNumberStandard (GetChannelNumber (), standard); if (f.first == 0) { @@ -1130,11 +1130,11 @@ WifiPhy::ConfigureChannelForStandard (WifiPhyStandard standard) } if (f.first == 0) { - NS_FATAL_ERROR ("Error, ChannelNumber " << static_cast (GetChannelNumber ()) << " is unknown for this standard"); + NS_FATAL_ERROR ("Error, ChannelNumber " << +GetChannelNumber () << " is unknown for this standard"); } else { - NS_LOG_DEBUG ("Setting frequency to " << f.first << "; width to " << static_cast (f.second)); + NS_LOG_DEBUG ("Setting frequency to " << f.first << "; width to " << +f.second); SetFrequency (f.first); SetChannelWidth (f.second); } @@ -1236,10 +1236,10 @@ WifiPhy::SetFrequency (uint16_t frequency) uint8_t nch = FindChannelNumberForFrequencyWidth (frequency, GetChannelWidth ()); if (nch != 0) { - NS_LOG_DEBUG ("Setting frequency " << frequency << " corresponds to channel " << static_cast (nch)); + NS_LOG_DEBUG ("Setting frequency " << frequency << " corresponds to channel " << +nch); if (DoFrequencySwitch (frequency)) { - NS_LOG_DEBUG ("Channel frequency switched to " << frequency << "; channel number to " << static_cast (nch)); + NS_LOG_DEBUG ("Channel frequency switched to " << frequency << "; channel number to " << +nch); m_channelCenterFrequency = frequency; m_channelNumber = nch; } @@ -1273,7 +1273,7 @@ WifiPhy::GetFrequency (void) const void WifiPhy::SetChannelWidth (uint8_t channelwidth) { - NS_LOG_FUNCTION (this << static_cast (channelwidth)); + NS_LOG_FUNCTION (this << +channelwidth); NS_ASSERT_MSG (channelwidth == 5 || channelwidth == 10 || channelwidth == 20 || channelwidth == 22 || channelwidth == 40 || channelwidth == 80 || channelwidth == 160, "wrong channel width value"); bool changed = (m_channelWidth == channelwidth); m_channelWidth = channelwidth; @@ -1406,7 +1406,7 @@ WifiPhy::GetMembershipSelectorModes (uint32_t selector) void WifiPhy::AddSupportedChannelWidth (uint8_t width) { - NS_LOG_FUNCTION (this << static_cast (width)); + NS_LOG_FUNCTION (this << +width); for (std::vector::size_type i = 0; i != m_supportedChannelWidthSet.size (); i++) { if (m_supportedChannelWidthSet[i] == width) @@ -1414,7 +1414,7 @@ WifiPhy::AddSupportedChannelWidth (uint8_t width) return; } } - NS_LOG_FUNCTION ("Adding " << static_cast (width) << " to supported channel width set"); + NS_LOG_FUNCTION ("Adding " << +width << " to supported channel width set"); m_supportedChannelWidthSet.push_back (width); } @@ -1435,7 +1435,7 @@ WifiPhy::GetFrequencyWidthForChannelNumberStandard (uint8_t channelNumber, WifiP void WifiPhy::SetChannelNumber (uint8_t nch) { - NS_LOG_FUNCTION (this << static_cast (nch)); + NS_LOG_FUNCTION (this << +nch); if (m_isConstructed == false) { NS_LOG_DEBUG ("Saving channel number configuration for initialization"); @@ -1469,7 +1469,7 @@ WifiPhy::SetChannelNumber (uint8_t nch) { if (DoChannelSwitch (nch)) { - NS_LOG_DEBUG ("Setting frequency to " << f.first << "; width to " << static_cast (f.second)); + NS_LOG_DEBUG ("Setting frequency to " << f.first << "; width to " << +f.second); m_channelCenterFrequency = f.first; SetChannelWidth (f.second); m_channelNumber = nch; @@ -1498,7 +1498,7 @@ WifiPhy::DoChannelSwitch (uint8_t nch) if (!IsInitialized ()) { //this is not channel switch, this is initialization - NS_LOG_DEBUG ("initialize to channel " << static_cast (nch)); + NS_LOG_DEBUG ("initialize to channel " << +nch); return true; } @@ -1531,7 +1531,7 @@ WifiPhy::DoChannelSwitch (uint8_t nch) switchChannel: - NS_LOG_DEBUG ("switching channel " << static_cast (GetChannelNumber ()) << " -> " << static_cast (nch)); + NS_LOG_DEBUG ("switching channel " << +GetChannelNumber () << " -> " << +nch); m_state->SwitchToChannelSwitching (GetChannelSwitchDelay ()); m_interference.EraseEvents (); /* @@ -2365,8 +2365,8 @@ WifiPhy::SendPacket (Ptr packet, WifiTxVector txVector, MpduType m NS_LOG_FUNCTION (this << packet << txVector.GetMode () << txVector.GetMode ().GetDataRate (txVector) << txVector.GetPreambleType () - << static_cast (txVector.GetTxPowerLevel ()) - << static_cast (mpdutype)); + << +txVector.GetTxPowerLevel () + << +mpdutype); /* Transmission can happen if: * - we are syncing on a packet. It is the responsability of the * MAC layer to avoid doing this but the PHY does nothing to @@ -2466,7 +2466,7 @@ WifiPhy::StartReceivePreambleAndHeader (Ptr packet, double rxPowerW, Tim if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT && (txVector.GetNss () != (1 + (txVector.GetMode ().GetMcsValue () / 8)))) { - NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << static_cast (txVector.GetMode ().GetMcsValue ()) << ", NSS = " << static_cast (txVector.GetNss ())); + NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << +txVector.GetMode ().GetMcsValue () << ", NSS = " << +txVector.GetNss ()); } Time endRx = Simulator::Now () + rxDuration; @@ -2578,7 +2578,7 @@ WifiPhy::StartReceivePacket (Ptr packet, MpduType mpdutype, Ptr event) { - NS_LOG_FUNCTION (this << packet << txVector.GetMode () << txVector.GetPreambleType () << static_cast (mpdutype)); + NS_LOG_FUNCTION (this << packet << txVector.GetMode () << txVector.GetPreambleType () << +mpdutype); NS_ASSERT (IsStateRx ()); NS_ASSERT (m_endPlcpRxEvent.IsExpired ()); WifiMode txMode = txVector.GetMode (); @@ -3702,7 +3702,7 @@ WifiPhy::AbortCurrentReception () void WifiPhy::StartRx (Ptr packet, WifiTxVector txVector, MpduType mpdutype, double rxPowerW, Time rxDuration, Ptr event) { - NS_LOG_FUNCTION (this << packet << txVector << static_cast (mpdutype) << rxPowerW << rxDuration); + NS_LOG_FUNCTION (this << packet << txVector << +mpdutype << rxPowerW << rxDuration); if (rxPowerW > GetEdThresholdW ()) //checked here, no need to check in the payload reception (current implementation assumes constant rx power over the packet duration) { AmpduTag ampduTag; diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 0e310ab72..1bb5dc96f 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -818,7 +818,7 @@ WifiRemoteStationManager::PrepareForQueue (Mac48Address address, const WifiMacHe uint8_t WifiRemoteStationManager::GetChannelWidthForTransmission (WifiMode mode, uint8_t maxSupportedChannelWidth) { - NS_LOG_FUNCTION (mode << static_cast (maxSupportedChannelWidth)); + NS_LOG_FUNCTION (mode << +maxSupportedChannelWidth); WifiModulationClass modulationClass = mode.GetModulationClass (); if (maxSupportedChannelWidth > 20 && (modulationClass == WifiModulationClass::WIFI_MOD_CLASS_OFDM // all non-HT OFDM control and management frames @@ -1024,7 +1024,7 @@ WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address, uint8_t tid uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) { - NS_LOG_FUNCTION (this << address << static_cast (tid) << static_cast (nSuccessfulMpdus) << static_cast (nFailedMpdus) << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << address << +tid << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr); NS_ASSERT (!address.IsGroup ()); WifiRemoteStation *station = Lookup (address, tid); for (uint8_t i = 0; i < nFailedMpdus; i++) @@ -1678,7 +1678,7 @@ WifiRemoteStationManager::Lookup (Mac48Address address, const WifiMacHeader *hea WifiRemoteStation * WifiRemoteStationManager::Lookup (Mac48Address address, uint8_t tid) const { - NS_LOG_FUNCTION (this << address << static_cast (tid)); + NS_LOG_FUNCTION (this << address << +tid); for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++) { if ((*i)->m_tid == tid @@ -1930,7 +1930,7 @@ WifiRemoteStationManager::GetNonErpBasicMode (uint8_t i) const void WifiRemoteStationManager::AddBasicMcs (WifiMode mcs) { - NS_LOG_FUNCTION (this << static_cast (mcs.GetMcsValue ())); + NS_LOG_FUNCTION (this << +mcs.GetMcsValue ()); for (uint8_t i = 0; i < GetNBasicMcs (); i++) { if (GetBasicMcs (i) == mcs) diff --git a/src/wifi/model/wifi-tx-vector.cc b/src/wifi/model/wifi-tx-vector.cc index 3326c6514..035975396 100644 --- a/src/wifi/model/wifi-tx-vector.cc +++ b/src/wifi/model/wifi-tx-vector.cc @@ -242,14 +242,14 @@ WifiTxVector::IsValid (void) const std::ostream & operator << ( std::ostream &os, const WifiTxVector &v) { os << "mode: " << v.GetMode () << - " txpwrlvl: " << static_cast (v.GetTxPowerLevel ()) << - " retries: " << static_cast (v.GetRetries ()) << + " txpwrlvl: " << +v.GetTxPowerLevel () << + " retries: " << +v.GetRetries () << " preamble: " << v.GetPreambleType () << - " channel width: " << static_cast (v.GetChannelWidth ()) << + " channel width: " << +v.GetChannelWidth () << " GI: " << v.GetGuardInterval () << - " NTx: " << static_cast (v.GetNTx ()) << - " Nss: " << static_cast (v.GetNss ()) << - " Ness: " << static_cast (v.GetNess ()) << + " NTx: " << +v.GetNTx () << + " Nss: " << +v.GetNss () << + " Ness: " << +v.GetNess () << " MPDU aggregation: " << v.IsAggregation () << " STBC: " << v.IsStbc (); return os; diff --git a/src/wifi/test/tx-duration-test.cc b/src/wifi/test/tx-duration-test.cc index b16bf428d..6aa7c4f62 100644 --- a/src/wifi/test/tx-duration-test.cc +++ b/src/wifi/test/tx-duration-test.cc @@ -129,7 +129,7 @@ TxDurationTest::CheckPayloadDuration (uint32_t size, WifiMode payloadMode, uint8 { std::cerr << "size=" << size << " mode=" << payloadMode - << " channelWidth=" << static_cast (channelWidth) + << " channelWidth=" << +channelWidth << " guardInterval=" << guardInterval << " datarate=" << payloadMode.GetDataRate (channelWidth, guardInterval, 1) << " known=" << knownDuration @@ -166,7 +166,7 @@ TxDurationTest::CheckTxDuration (uint32_t size, WifiMode payloadMode, uint8_t ch { std::cerr << "size=" << size << " mode=" << payloadMode - << " channelWidth=" << static_cast (channelWidth) + << " channelWidth=" << +channelWidth << " guardInterval=" << guardInterval << " datarate=" << payloadMode.GetDataRate (channelWidth, guardInterval, 1) << " preamble=" << preamble