From 2da548660dcb44b3aa70c6ed2bd30db3e32e6b56 Mon Sep 17 00:00:00 2001 From: Robert Ammon Date: Thu, 29 Mar 2018 21:26:57 +0200 Subject: [PATCH] wifi: Eliminate some more Visual Studio compiler warnings --- src/wifi/model/ap-wifi-mac.cc | 2 +- src/wifi/model/dcf-manager.cc | 6 +++--- src/wifi/model/ideal-wifi-manager.cc | 6 +++--- src/wifi/model/mac-low.cc | 7 ++++--- src/wifi/model/minstrel-wifi-manager.cc | 4 ++-- src/wifi/model/sta-wifi-mac.cc | 4 ++-- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index bae047746..481195e79 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -732,7 +732,7 @@ ApWifiMac::SendAssocResp (Mac48Address to, bool success, bool isReassoc) if (success) { code.SetSuccess (); - uint16_t aid; + uint16_t aid = 0; bool found = false; if (isReassoc) { diff --git a/src/wifi/model/dcf-manager.cc b/src/wifi/model/dcf-manager.cc index ef4e7937c..821f091eb 100644 --- a/src/wifi/model/dcf-manager.cc +++ b/src/wifi/model/dcf-manager.cc @@ -356,10 +356,10 @@ DcfManager::DoGrantAccess (void) * the result of the calculations. */ state->NotifyAccessGranted (); - for (std::vector >::iterator k = internalCollisionStates.begin (); - k != internalCollisionStates.end (); k++) + for (std::vector >::iterator l = internalCollisionStates.begin (); + l != internalCollisionStates.end (); l++) { - (*k)->NotifyInternalCollision (); + (*l)->NotifyInternalCollision (); } break; } diff --git a/src/wifi/model/ideal-wifi-manager.cc b/src/wifi/model/ideal-wifi-manager.cc index 8e20754c6..87a16752c 100644 --- a/src/wifi/model/ideal-wifi-manager.cc +++ b/src/wifi/model/ideal-wifi-manager.cc @@ -154,14 +154,14 @@ IdealWifiManager::DoInitialize () guardInterval = GetPhy ()->GetGuardInterval ().GetNanoSeconds (); } txVector.SetGuardInterval (guardInterval); - for (uint8_t i = 1; i <= GetPhy ()->GetMaxSupportedTxSpatialStreams (); i++) + for (uint8_t k = 1; k <= GetPhy ()->GetMaxSupportedTxSpatialStreams (); k++) { NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () << " channel width " << +j << - " nss " << +i << + " nss " << +k << " GI " << guardInterval); NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ()); - txVector.SetNss (i); + txVector.SetNss (k); txVector.SetMode (mode); AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber)); } diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index 2f69533a3..69cd6f3ec 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -2352,6 +2352,7 @@ MacLow::AggregateToAmpdu (Ptr packet, const WifiMacHeader hdr) Time tstamp; uint8_t tid = GetTid (packet, hdr); Ptr queue; + Ptr aggPacket; AcIndex ac = QosUtilsMapTidToAc (tid); std::map >::const_iterator edcaIt = m_edca.find (ac); NS_ASSERT (edcaIt != m_edca.end ()); @@ -2372,7 +2373,7 @@ MacLow::AggregateToAmpdu (Ptr packet, const WifiMacHeader hdr) uint16_t blockAckSize = 0; bool aggregated = false; int i = 0; - Ptr aggPacket = newPacket->Copy (); + aggPacket = newPacket->Copy (); if (!hdr.IsBlockAckReq ()) { @@ -2455,7 +2456,7 @@ MacLow::AggregateToAmpdu (Ptr packet, const WifiMacHeader hdr) } newPacket = peekedPacket->Copy (); - Ptr aggPacket = newPacket->Copy (); + aggPacket = newPacket->Copy (); newPacket->AddHeader (peekedHdr); AddWifiMacTrailer (newPacket); @@ -2566,7 +2567,7 @@ MacLow::AggregateToAmpdu (Ptr packet, const WifiMacHeader hdr) { newPacket = packet->Copy (); peekedHdr = hdr; - Ptr aggPacket = newPacket->Copy (); + aggPacket = newPacket->Copy (); m_aggregateQueue[tid]->Enqueue (Create (aggPacket, peekedHdr)); newPacket->AddHeader (peekedHdr); AddWifiMacTrailer (newPacket); diff --git a/src/wifi/model/minstrel-wifi-manager.cc b/src/wifi/model/minstrel-wifi-manager.cc index ef003529d..ca6161e93 100644 --- a/src/wifi/model/minstrel-wifi-manager.cc +++ b/src/wifi/model/minstrel-wifi-manager.cc @@ -486,7 +486,7 @@ MinstrelWifiManager::FindRate (MinstrelWifiRemoteStation *station) // if samplieLimit is zero, then don't sample this rate if (!station->m_minstrelTable[idx].sampleLimit) { - idx = station->m_maxTpRate; + idx = station->m_maxTpRate; station->m_isSampling = false; } else @@ -504,7 +504,7 @@ MinstrelWifiManager::FindRate (MinstrelWifiRemoteStation *station) if (station->m_sampleDeferred) { NS_LOG_DEBUG ("The next look around rate is slower than the maximum throughput rate, continue with the maximum throughput rate: " << station->m_maxTpRate << "(" << GetSupported (station, station->m_maxTpRate) << ")"); - idx = station->m_maxTpRate; + idx = station->m_maxTpRate; } } //continue using the best rate diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index 089ae9dad..32df2b051 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -530,7 +530,7 @@ StaWifiMac::Receive (Ptr packet, const WifiMacHeader *hdr) Time delay = MicroSeconds (beacon.GetBeaconIntervalUs () * m_maxMissedBeacons); RestartBeaconWatchdog (delay); SetBssid (hdr->GetAddr3 ()); - SupportedRates rates = beacon.GetSupportedRates (); + rates = beacon.GetSupportedRates (); for (uint8_t i = 0; i < m_phy->GetNModes (); i++) { WifiMode mode = m_phy->GetMode (i); @@ -544,7 +544,7 @@ StaWifiMac::Receive (Ptr packet, const WifiMacHeader *hdr) { ErpInformation erpInformation = beacon.GetErpInformation (); isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode (); - if (erpInformation.GetUseProtection () == true) + if (erpInformation.GetUseProtection () != 0) { m_stationManager->SetUseNonErpProtection (true); }