From 00b529b15a46df30b8e25d9e9d2d0d616f666ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sun, 22 Dec 2024 11:40:41 +0100 Subject: [PATCH] wifi: Fix type of some variables --- src/wifi/test/wifi-primary-channels-test.cc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/wifi/test/wifi-primary-channels-test.cc b/src/wifi/test/wifi-primary-channels-test.cc index 10373b0bc..310191731 100644 --- a/src/wifi/test/wifi-primary-channels-test.cc +++ b/src/wifi/test/wifi-primary-channels-test.cc @@ -608,10 +608,9 @@ WifiPrimaryChannelsTest::DoRun() // To have simultaneous transmissions on adjacent channels, just initialize // nRounds to 1 and nApsPerRound to m_channelWidth / 20. Of course, the test // will fail because some stations will not receive some frames due to interfence - for (MHz_u txChannelWidth = 20, - nRounds = 2, - nApsPerRound = Count20MHzSubchannels(m_channelWidth) / 2; - txChannelWidth <= m_channelWidth; + uint16_t nRounds = 2; + uint16_t nApsPerRound = Count20MHzSubchannels(m_channelWidth) / 2; + for (MHz_u txChannelWidth{20}; txChannelWidth <= m_channelWidth; txChannelWidth *= 2, nRounds *= 2, nApsPerRound /= 2) { nRounds = std::min(nRounds, m_nBss); @@ -646,10 +645,9 @@ WifiPrimaryChannelsTest::DoRun() * channel width, every round is repeated as many times as the number of ways in * which we can partition the transmission channel width in equal sized RUs. */ - for (MHz_u txChannelWidth = 20, - nRounds = 2, - nApsPerRound = Count20MHzSubchannels(m_channelWidth) / 2; - txChannelWidth <= m_channelWidth; + nRounds = 2; + nApsPerRound = Count20MHzSubchannels(m_channelWidth) / 2; + for (MHz_u txChannelWidth{20}; txChannelWidth <= m_channelWidth; txChannelWidth *= 2, nRounds *= 2, nApsPerRound /= 2) { nRounds = std::min(nRounds, m_nBss); @@ -696,10 +694,9 @@ WifiPrimaryChannelsTest::DoRun() * channel width, every round is repeated as many times as the number of ways in * which we can partition the transmission channel width in equal sized RUs. */ - for (MHz_u txChannelWidth = 20, - nRounds = 2, - nApsPerRound = Count20MHzSubchannels(m_channelWidth) / 2; - txChannelWidth <= m_channelWidth; + nRounds = 2; + nApsPerRound = Count20MHzSubchannels(m_channelWidth) / 2; + for (MHz_u txChannelWidth{20}; txChannelWidth <= m_channelWidth; txChannelWidth *= 2, nRounds *= 2, nApsPerRound /= 2) { nRounds = std::min(nRounds, m_nBss);