Skip to content

Commit abe6057

Browse files
mplekhStefano Avallone
authored andcommitted
wifi, lte, internet, energy: remove unused variables
Remove unused variables that escape compiler detection because they are disguised as RAII idiom due to side effects in Time destructor.
1 parent ba9319e commit abe6057

9 files changed

+2
-15
lines changed

src/energy/test/basic-energy-harvester-test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ BasicEnergyHarvesterTestCase::DoRun()
7777
harvester->SetNode(node);
7878
harvester->SetEnergySource(source);
7979

80-
Time now = Simulator::Now();
81-
8280
/*
8381
* The energy harvester will recharge the energy source for m_timeS seconds.
8482
*/

src/internet/test/tcp-pacing-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void
242242
TcpPacingTest::UpdateExpectedInterval()
243243
{
244244
double_t factor;
245-
Time rtt = 2 * GetPropagationDelay();
245+
246246
if (m_curCwnd < m_ssThresh / 2)
247247
{
248248
factor = static_cast<double>(m_pacingSsRatio) / 100;

src/internet/test/tcp-rate-ops-test.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,7 @@ TcpRateLinuxWithBufferTest::TestWithSackBlocks()
569569
MakeCallback(&TcpRateOps::SkbDelivered, m_rateOps));
570570
}
571571
m_expectedAckedSacked = 5 * m_segmentSize;
572-
TcpRateOps::TcpRateSample rateSample =
573-
m_rateOps->GenerateSample(5 * m_segmentSize, 0, false, priorInFlight, Seconds(0));
572+
m_rateOps->GenerateSample(5 * m_segmentSize, 0, false, priorInFlight, Seconds(0));
574573
}
575574

576575
void

src/lte/test/lte-simple-spectrum-phy.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ LteSimpleSpectrumPhy::StartRx(Ptr<SpectrumSignalParameters> spectrumRxParams)
114114

115115
NS_LOG_FUNCTION(this << spectrumRxParams);
116116
Ptr<const SpectrumValue> rxPsd = spectrumRxParams->psd;
117-
Time duration = spectrumRxParams->duration;
118117

119118
// the device might start RX only if the signal is of a type
120119
// understood by this device - in this case, an LTE signal.

src/wifi/model/eht/eht-frame-exchange-manager.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ EhtFrameExchangeManager::StartTransmission(Ptr<Txop> edca, MHz_u allowedWidth)
234234
}
235235
}
236236

237-
std::optional<Time> timeToCtsEnd;
238-
239237
if (m_staMac && m_staMac->IsEmlsrLink(m_linkId))
240238
{
241239
// Cannot start a transmission on a link blocked because another EMLSR link is being used

src/wifi/model/ht/ht-phy.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ HtPhy::GetTrainingDuration(const WifiTxVector& txVector,
262262
<< +nDataLtf << ") and extension (" << +nExtensionLtf
263263
<< ") LTFs numbers for HT"); // see IEEE 802.11-2016, section 19.3.9.4.6
264264
// "HT-LTF definition"
265-
Time duration = MicroSeconds(4) * (nDataLtf + nExtensionLtf);
266265
return MicroSeconds(4) * (1 /* HT-STF */ + nDataLtf + nExtensionLtf);
267266
}
268267

src/wifi/test/wifi-channel-switching-test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ WifiChannelSwitchingTest::StateChange(uint32_t nodeId,
209209
void
210210
WifiChannelSwitchingTest::DoRun()
211211
{
212-
Time simulationTime(Seconds(6));
213-
214212
RngSeedManager::SetSeed(1);
215213
RngSeedManager::SetRun(40);
216214
int64_t streamNumber = 100;

src/wifi/test/wifi-emlsr-basic-exchanges-test.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ EmlsrDlTxopTest::DoSetup()
151151
{
152152
// Channel switch delay should be less than the ICF padding duration, otherwise
153153
// DL TXOPs cannot be initiated on auxiliary links
154-
auto delay = std::min(MicroSeconds(100),
155-
*std::min_element(m_paddingDelay.cbegin(), m_paddingDelay.cend()));
156154
Config::SetDefault("ns3::WifiPhy::ChannelSwitchDelay", TimeValue(MicroSeconds(75)));
157155

158156
EmlsrOperationsTestBase::DoSetup();
@@ -778,7 +776,6 @@ EmlsrDlTxopTest::CheckResults()
778776
bAckRespTxEnd = bAckRespIt->startTx + WifiPhy::CalculateTxDuration(bAckRespIt->psduMap,
779777
bAckRespIt->txVector,
780778
phy->GetPhyBand());
781-
auto timeout = phy->GetSifs() + phy->GetSlot() + MicroSeconds(20);
782779

783780
// the fourth frame exchange starts a PIFS after the previous one because the AP
784781
// performs PIFS recovery (the initial frame in the TXOP was successfully received by

src/wifi/test/wifi-emlsr-link-switch-test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2193,7 +2193,6 @@ EmlsrSwitchMainPhyBackTest::RunOne()
21932193
m_events.emplace_back(
21942194
WIFI_MAC_CTL_ACK,
21952195
[=, this](Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint8_t linkId) {
2196-
const auto phyHdrDuration = WifiPhy::CalculatePhyPreambleAndHeaderDuration(txVector);
21972196
const auto txDuration =
21982197
WifiPhy::CalculateTxDuration(psdu,
21992198
txVector,

0 commit comments

Comments
 (0)