diff --git a/src/wifi/model/dsss-parameter-set.cc b/src/wifi/model/dsss-parameter-set.cc index aa6fc5aaa..5d9f4987c 100644 --- a/src/wifi/model/dsss-parameter-set.cc +++ b/src/wifi/model/dsss-parameter-set.cc @@ -49,14 +49,14 @@ DsssParameterSet::SetCurrentChannel (uint8_t currentChannel) uint8_t DsssParameterSet::GetInformationFieldSize () const { - NS_ASSERT (m_dsssSupported > 0); + NS_ASSERT (m_dsssSupported); return 1; } Buffer::Iterator DsssParameterSet::Serialize (Buffer::Iterator i) const { - if (m_dsssSupported < 1) + if (!m_dsssSupported) { return i; } @@ -66,7 +66,7 @@ DsssParameterSet::Serialize (Buffer::Iterator i) const uint16_t DsssParameterSet::GetSerializedSize () const { - if (m_dsssSupported < 1) + if (!m_dsssSupported) { return 0; } @@ -76,7 +76,7 @@ DsssParameterSet::GetSerializedSize () const void DsssParameterSet::SerializeInformationField (Buffer::Iterator start) const { - if (m_dsssSupported == 1) + if (m_dsssSupported) { start.WriteU8 (m_currentChannel); } diff --git a/src/wifi/model/edca-parameter-set.cc b/src/wifi/model/edca-parameter-set.cc index d010ae9f6..a81a994a8 100644 --- a/src/wifi/model/edca-parameter-set.cc +++ b/src/wifi/model/edca-parameter-set.cc @@ -371,14 +371,14 @@ EdcaParameterSet::GetVoTXOPLimit (void) const uint8_t EdcaParameterSet::GetInformationFieldSize () const { - NS_ASSERT (m_qosSupported > 0); + NS_ASSERT (m_qosSupported); return 18; } Buffer::Iterator EdcaParameterSet::Serialize (Buffer::Iterator i) const { - if (m_qosSupported < 1) + if (!m_qosSupported) { return i; } @@ -388,7 +388,7 @@ EdcaParameterSet::Serialize (Buffer::Iterator i) const uint16_t EdcaParameterSet::GetSerializedSize () const { - if (m_qosSupported < 1) + if (!m_qosSupported) { return 0; } @@ -398,7 +398,7 @@ EdcaParameterSet::GetSerializedSize () const void EdcaParameterSet::SerializeInformationField (Buffer::Iterator start) const { - if (m_qosSupported == 1) + if (m_qosSupported) { start.WriteU8 (m_qosInfo); start.WriteU8 (m_reserved); diff --git a/src/wifi/model/erp-information.cc b/src/wifi/model/erp-information.cc index 2008d3d21..42ea962c5 100644 --- a/src/wifi/model/erp-information.cc +++ b/src/wifi/model/erp-information.cc @@ -79,14 +79,14 @@ ErpInformation::GetNonErpPresent (void) const uint8_t ErpInformation::GetInformationFieldSize () const { - NS_ASSERT (m_erpSupported > 0); + NS_ASSERT (m_erpSupported); return 1; } Buffer::Iterator ErpInformation::Serialize (Buffer::Iterator i) const { - if (m_erpSupported < 1) + if (!m_erpSupported) { return i; } @@ -96,7 +96,7 @@ ErpInformation::Serialize (Buffer::Iterator i) const uint16_t ErpInformation::GetSerializedSize () const { - if (m_erpSupported < 1) + if (!m_erpSupported) { return 0; } @@ -106,7 +106,7 @@ ErpInformation::GetSerializedSize () const void ErpInformation::SerializeInformationField (Buffer::Iterator start) const { - if (m_erpSupported == 1) + if (m_erpSupported) { start.WriteU8 (m_erpInformation); } diff --git a/src/wifi/model/ht-operation.cc b/src/wifi/model/ht-operation.cc index e09401951..c9202c789 100644 --- a/src/wifi/model/ht-operation.cc +++ b/src/wifi/model/ht-operation.cc @@ -332,7 +332,7 @@ HtOperation::GetSerializedSize () const uint8_t HtOperation::GetInformationSubset1 (void) const { - uint16_t val = 0; + uint8_t val = 0; val |= m_secondaryChannelOffset & 0x03; val |= (m_staChannelWidth & 0x01) << 2; val |= (m_rifsMode & 0x01) << 3; @@ -368,7 +368,7 @@ HtOperation::SetInformationSubset2 (uint16_t ctrl) m_nonGfHtStasPresent = (ctrl >> 2) & 0x01; m_reservedInformationSubset2_1 = (ctrl >> 3) & 0x01; m_obssNonHtStasPresent = (ctrl >> 4) & 0x01; - m_reservedInformationSubset2_1 = (ctrl >> 5) & 0x07ff; + m_reservedInformationSubset2_1 = static_cast((ctrl >> 5) & 0x07ff); } uint16_t @@ -477,8 +477,8 @@ HtOperation::DeserializeInformationField (Buffer::Iterator start, Buffer::Iterator i = start; uint8_t primarychannel = i.ReadU8 (); uint8_t informationsubset1 = i.ReadU8 (); - uint8_t informationsubset2 = i.ReadU16 (); - uint8_t informationsubset3 = i.ReadU16 (); + uint16_t informationsubset2 = i.ReadU16 (); + uint16_t informationsubset3 = i.ReadU16 (); uint64_t mcsset1 = i.ReadLsbtohU64 (); uint64_t mcsset2 = i.ReadLsbtohU64 (); SetPrimaryChannel (primarychannel); diff --git a/src/wifi/model/ideal-wifi-manager.cc b/src/wifi/model/ideal-wifi-manager.cc index 2efc53fba..5409ae68f 100644 --- a/src/wifi/model/ideal-wifi-manager.cc +++ b/src/wifi/model/ideal-wifi-manager.cc @@ -34,7 +34,7 @@ struct IdealWifiRemoteStation : public WifiRemoteStation { double m_lastSnrObserved; //!< SNR of most recently reported packet sent to the remote station double m_lastSnrCached; //!< SNR most recently used to select a rate - uint8_t m_nss; //!< SNR most recently used to select a rate + uint8_t m_nss; //!< Number of spacial streams WifiMode m_lastMode; //!< Mode most recently used to the remote station }; diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index 9932aa103..90854c871 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -731,7 +731,6 @@ MacLow::ReceiveOk (Ptr packet, double rxSnr, WifiTxVector txVector, bool NS_ASSERT (m_sendDataEvent.IsExpired ()); m_sendDataEvent = Simulator::Schedule (GetSifs (), &MacLow::SendDataAfterCts, this, - hdr.GetAddr1 (), hdr.GetDuration ()); } else if (hdr.IsAck () @@ -1712,7 +1711,6 @@ MacLow::SendCtsToSelf (void) m_sendDataEvent = Simulator::Schedule (txDuration, &MacLow::SendDataAfterCts, this, - cts.GetAddr1 (), duration); } @@ -1749,7 +1747,7 @@ MacLow::SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxV } void -MacLow::SendDataAfterCts (Mac48Address source, Time duration) +MacLow::SendDataAfterCts (Time duration) { NS_LOG_FUNCTION (this); /* send the third step in a diff --git a/src/wifi/model/mac-low.h b/src/wifi/model/mac-low.h index 41f909c25..7ba2825db 100644 --- a/src/wifi/model/mac-low.h +++ b/src/wifi/model/mac-low.h @@ -656,10 +656,9 @@ private: /** * Send DATA after receiving CTS. * - * \param source * \param duration */ - void SendDataAfterCts (Mac48Address source, Time duration); + void SendDataAfterCts (Time duration); /** * Event handler that is usually scheduled to fired at the appropriate time diff --git a/src/wifi/model/spectrum-wifi-phy.cc b/src/wifi/model/spectrum-wifi-phy.cc index ecced6ad8..a77708afb 100644 --- a/src/wifi/model/spectrum-wifi-phy.cc +++ b/src/wifi/model/spectrum-wifi-phy.cc @@ -378,7 +378,7 @@ SpectrumWifiPhy::GetBandBandwidth (void) const uint32_t SpectrumWifiPhy::GetGuardBandwidth (void) const { - double guardBandwidth = 0; + uint32_t guardBandwidth = 0; switch (GetStandard ()) { case WIFI_PHY_STANDARD_80211a: diff --git a/src/wifi/model/vht-capabilities.cc b/src/wifi/model/vht-capabilities.cc index 6c8401dff..73ee66c26 100644 --- a/src/wifi/model/vht-capabilities.cc +++ b/src/wifi/model/vht-capabilities.cc @@ -112,7 +112,7 @@ VhtCapabilities::DeserializeInformationField (Buffer::Iterator start, uint8_t length) { Buffer::Iterator i = start; - uint16_t vhtinfo = i.ReadLsbtohU32 (); + uint32_t vhtinfo = i.ReadLsbtohU32 (); uint64_t mcsset = i.ReadLsbtohU64 (); SetVhtCapabilitiesInfo (vhtinfo); SetSupportedMcsAndNssSet (mcsset); @@ -181,7 +181,7 @@ VhtCapabilities::SetSupportedMcsAndNssSet (uint64_t ctrl) m_rxHighestSupportedLongGuardIntervalDataRate = (ctrl >> 16) & 0x1fff; for (uint8_t i = 0; i < 8; i++) { - uint16_t n = (i * 2) + 32; + n = (i * 2) + 32; m_txMcsMap[i] = (ctrl >> n) & 0x03; } m_txHighestSupportedLongGuardIntervalDataRate = (ctrl >> 48) & 0x1fff; diff --git a/src/wifi/model/vht-capabilities.h b/src/wifi/model/vht-capabilities.h index 890129d96..cd6ea73aa 100644 --- a/src/wifi/model/vht-capabilities.h +++ b/src/wifi/model/vht-capabilities.h @@ -286,8 +286,8 @@ public: private: //Capabilities Info fields - uint16_t m_maxMpduLength; ///< maximum MPDU length - uint16_t m_supportedChannelWidthSet; ///< supported channel width set + uint8_t m_maxMpduLength; ///< maximum MPDU length + uint8_t m_supportedChannelWidthSet; ///< supported channel width set uint8_t m_rxLdpc; ///< receive LDPC uint8_t m_shortGuardIntervalFor80Mhz; ///< short guard interval 80 MHz uint8_t m_shortGuardIntervalFor160Mhz; ///< short guard interval 160 MHz diff --git a/src/wifi/model/wifi-information-element-vector.cc b/src/wifi/model/wifi-information-element-vector.cc index adfe1997d..51f9db3cb 100644 --- a/src/wifi/model/wifi-information-element-vector.cc +++ b/src/wifi/model/wifi-information-element-vector.cc @@ -103,6 +103,7 @@ WifiInformationElementVector::DeserializeSingleIe (Buffer::Iterator start) Ptr newElement; switch (id) { + case 0: // eliminate compiler warning default: NS_FATAL_ERROR ("Information element " << static_cast (id) << " is not implemented"); return 0; diff --git a/src/wifi/model/wifi-mac-header.h b/src/wifi/model/wifi-mac-header.h index e7578b3a2..16b16bdc0 100644 --- a/src/wifi/model/wifi-mac-header.h +++ b/src/wifi/model/wifi-mac-header.h @@ -588,7 +588,7 @@ private: uint8_t m_qosEosp; ///< QOS EOSP uint8_t m_qosAckPolicy; ///< QOS ack policy uint8_t m_amsduPresent; ///< AMSDU present - uint16_t m_qosStuff; ///< QOS stuff + uint8_t m_qosStuff; ///< QOS stuff }; } //namespace ns3 diff --git a/src/wifi/model/wifi-mac-queue.cc b/src/wifi/model/wifi-mac-queue.cc index 3e925eb69..a52856f58 100644 --- a/src/wifi/model/wifi-mac-queue.cc +++ b/src/wifi/model/wifi-mac-queue.cc @@ -97,7 +97,7 @@ WifiMacQueue::GetTypeId (void) .SetGroupName ("Wifi") .AddConstructor () .AddAttribute ("MaxDelay", "If a packet stays longer than this delay in the queue, it is dropped.", - TimeValue (MilliSeconds (500.0)), + TimeValue (MilliSeconds (500)), MakeTimeAccessor (&WifiMacQueue::m_maxDelay), MakeTimeChecker ()) .AddAttribute ("DropPolicy", "Upon enqueue with full queue, drop oldest (DropOldest) or newest (DropNewest) packet", diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 4c37922be..c2e8e4b7f 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -24,7 +24,6 @@ #include "ns3/boolean.h" #include "ns3/enum.h" #include "wifi-mac.h" -#include "wifi-phy.h" #include "wifi-utils.h" #include "wifi-mac-header.h" #include "wifi-mac-trailer.h"