avoid uninitialized variables.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 14 Dec 2007 15:18:14 +0100
changeset 2277 51c66e7993c0
parent 2276 26e3bc114fdd
child 2278 4b05fbf5c6e3
avoid uninitialized variables.
src/devices/wifi/amrr-mac-stations.cc
src/devices/wifi/onoe-mac-stations.cc
--- a/src/devices/wifi/amrr-mac-stations.cc	Thu Dec 13 15:07:08 2007 +0100
+++ b/src/devices/wifi/amrr-mac-stations.cc	Fri Dec 14 15:18:14 2007 +0100
@@ -51,7 +51,11 @@
 
 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 @@
     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 @@
 AmrrMacStation::IncreaseRate (void)
 {
   m_txrate++;
+  NS_ASSERT (m_txrate < GetNSupportedModes ());
 }
 void 
 AmrrMacStation::DecreaseRate (void)
@@ -152,6 +159,7 @@
     {
       return;
     }
+  m_nextModeUpdate = Simulator::Now () + m_stations->m_updatePeriod;
 
   bool needChange = false;
 
--- a/src/devices/wifi/onoe-mac-stations.cc	Thu Dec 13 15:07:08 2007 +0100
+++ b/src/devices/wifi/onoe-mac-stations.cc	Fri Dec 14 15:18:14 2007 +0100
@@ -61,7 +61,8 @@
     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 @@
     {
       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 @@
   }
 
   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)