From bd70c3360615ffe68bbd4830daa67eff136c07a2 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Fri, 14 Dec 2007 15:18:14 +0100 Subject: [PATCH] avoid uninitialized variables. --- src/devices/wifi/amrr-mac-stations.cc | 10 +++++++++- src/devices/wifi/onoe-mac-stations.cc | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/devices/wifi/amrr-mac-stations.cc b/src/devices/wifi/amrr-mac-stations.cc index bb481c802..592e5b602 100644 --- a/src/devices/wifi/amrr-mac-stations.cc +++ b/src/devices/wifi/amrr-mac-stations.cc @@ -51,7 +51,11 @@ static NumericDefaultValue g_minSuccessThreshold AmrrMacStations::AmrrMacStations (WifiMode defaultTxMode) : MacStations (defaultTxMode), - m_updatePeriod (g_updatePeriod.GetValue ()) + m_updatePeriod (g_updatePeriod.GetValue ()), + m_failureRatio (g_failureRatio.GetValue ()), + m_successRatio (g_successRatio.GetValue ()), + m_maxSuccessThreshold (g_maxSuccessThreshold.GetValue ()), + m_minSuccessThreshold (g_minSuccessThreshold.GetValue ()) {} MacStation * AmrrMacStations::CreateStation (void) @@ -65,6 +69,8 @@ AmrrMacStation::AmrrMacStation (AmrrMacStations *stations) m_tx_ok (0), m_tx_err (0), m_tx_retr (0), + m_retry (0), + m_txrate (0), m_successThreshold (m_stations->m_minSuccessThreshold), m_success (0), m_recovery (false) @@ -138,6 +144,7 @@ void AmrrMacStation::IncreaseRate (void) { m_txrate++; + NS_ASSERT (m_txrate < GetNSupportedModes ()); } void AmrrMacStation::DecreaseRate (void) @@ -152,6 +159,7 @@ AmrrMacStation::UpdateMode (void) { return; } + m_nextModeUpdate = Simulator::Now () + m_stations->m_updatePeriod; bool needChange = false; diff --git a/src/devices/wifi/onoe-mac-stations.cc b/src/devices/wifi/onoe-mac-stations.cc index d6ea7ef61..da93ddb13 100644 --- a/src/devices/wifi/onoe-mac-stations.cc +++ b/src/devices/wifi/onoe-mac-stations.cc @@ -61,7 +61,8 @@ OnoeMacStation::OnoeMacStation (OnoeMacStations *stations) m_tx_ok (0), m_tx_err (0), m_tx_retr (0), - m_tx_upper (0) + m_tx_upper (0), + m_txrate (0) {} OnoeMacStation::~OnoeMacStation () {} @@ -114,6 +115,7 @@ OnoeMacStation::UpdateMode (void) { return; } + m_nextModeUpdate = Simulator::Now () + m_stations->m_updatePeriod; /** * The following 20 lines of code were copied from the Onoe * rate control kernel module used in the madwifi driver. @@ -163,6 +165,7 @@ OnoeMacStation::UpdateMode (void) } if (nrate != m_txrate) { + NS_ASSERT (nrate < GetNSupportedModes ()); m_txrate = nrate; m_tx_ok = m_tx_err = m_tx_retr = m_tx_upper = 0; } else if (enough)