wifi: Eliminate some Visual Studio compiler warnings

This commit is contained in:
Robert Ammon
2018-02-18 17:44:16 +01:00
parent 8c2037e2cf
commit ddd5d35908
14 changed files with 27 additions and 30 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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<uint8_t>((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);

View File

@@ -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
};

View File

@@ -731,7 +731,6 @@ MacLow::ReceiveOk (Ptr<Packet> 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

View File

@@ -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

View File

@@ -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:

View File

@@ -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;

View File

@@ -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

View File

@@ -103,6 +103,7 @@ WifiInformationElementVector::DeserializeSingleIe (Buffer::Iterator start)
Ptr<WifiInformationElement> newElement;
switch (id)
{
case 0: // eliminate compiler warning
default:
NS_FATAL_ERROR ("Information element " << static_cast<uint16_t> (id) << " is not implemented");
return 0;

View File

@@ -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

View File

@@ -97,7 +97,7 @@ WifiMacQueue::GetTypeId (void)
.SetGroupName ("Wifi")
.AddConstructor<WifiMacQueue> ()
.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",

View File

@@ -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"