avoid calling un-implemented method
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 09 Oct 2007 16:15:38 +0200
changeset 1935 c7ac48654295
parent 1934 13c65460caee
child 1936 61d6404e66d8
avoid calling un-implemented method
src/devices/wifi/ideal-mac-stations.cc
src/devices/wifi/mac-stations.h
--- a/src/devices/wifi/ideal-mac-stations.cc	Tue Oct 09 16:11:37 2007 +0200
+++ b/src/devices/wifi/ideal-mac-stations.cc	Tue Oct 09 16:15:38 2007 +0200
@@ -105,18 +105,19 @@
   // highest snr threshold possible which is smaller than m_lastSnr 
   // to ensure correct packet delivery.
   double maxThreshold = 0.0;
-  WifiMode mode = m_stations->GetDefaultMode ();
+  WifiMode maxMode = m_stations->GetDefaultMode ();
   for (uint32_t i = 0; i < GetNSupportedModes (); i++)
     {
-      double threshold = m_stations->GetSnrThreshold (GetSupportedMode (i));
+      WifiMode mode = GetSupportedMode (i);
+      double threshold = m_stations->GetSnrThreshold (mode);
       if (threshold > maxThreshold && 
           threshold < m_lastSnr)
         {
           maxThreshold = threshold;
-          mode = GetSupportedMode (i);
+          maxMode = mode;
         }
     }
-  return mode;
+  return maxMode;
 }
 WifiMode
 IdealMacStation::GetRtsMode (void)
@@ -125,18 +126,19 @@
   // snr threshold possible which is smaller than m_lastSnr to 
   // ensure correct packet delivery.
   double maxThreshold = 0.0;
-  WifiMode mode = m_stations->GetDefaultMode ();
-  for (uint32_t i = 0; i < GetNBasicModes (); i++)
+  WifiMode maxMode = m_stations->GetDefaultMode ();
+  for (uint32_t i = 0; i < m_stations->GetNBasicModes (); i++)
     {
-      double threshold = m_stations->GetSnrThreshold (GetBasicMode (i));
+      WifiMode mode = m_stations->GetBasicMode (i);
+      double threshold = m_stations->GetSnrThreshold (mode);
       if (threshold > maxThreshold && 
           threshold < m_lastSnr)
         {
           maxThreshold = threshold;
-          mode = GetBasicMode (i);
+          maxMode = mode;
         }
     }
-  return mode;
+  return maxMode;
 }
 IdealMacStations *
 IdealMacStation::GetStations (void) const
--- a/src/devices/wifi/mac-stations.h	Tue Oct 09 16:11:37 2007 +0200
+++ b/src/devices/wifi/mac-stations.h	Tue Oct 09 16:15:38 2007 +0200
@@ -111,9 +111,7 @@
   virtual MacStations *GetStations (void) const = 0;
 protected:
   uint32_t GetNSupportedModes (void) const;
-  uint32_t GetNBasicModes (void) const;
   WifiMode GetSupportedMode (uint32_t i) const;
-  WifiMode GetBasicMode (uint32_t i) const;
 private:
   bool IsIn (WifiMode mode) const;
   WifiMode GetControlAnswerMode (WifiMode reqMode);