Apply utils/check-style.py script on lr-wpan source code again
authorTom Henderson <tomh@tomh.org>
Sat, 26 Apr 2014 23:27:34 -0700
changeset 10760 d7d73e3ceb3c
parent 10759 3ad3b09254da
child 10761 e15f3213d9ac
Apply utils/check-style.py script on lr-wpan source code again
src/lr-wpan/examples/lr-wpan-data.cc
src/lr-wpan/helper/lr-wpan-helper.h
src/lr-wpan/model/lr-wpan-interference-helper.cc
src/lr-wpan/model/lr-wpan-interference-helper.h
src/lr-wpan/model/lr-wpan-lqi-tag.h
src/lr-wpan/model/lr-wpan-mac-header.h
src/lr-wpan/model/lr-wpan-mac-trailer.cc
src/lr-wpan/model/lr-wpan-mac.cc
src/lr-wpan/model/lr-wpan-mac.h
src/lr-wpan/model/lr-wpan-net-device.cc
src/lr-wpan/model/lr-wpan-phy.cc
src/lr-wpan/model/lr-wpan-phy.h
src/lr-wpan/model/lr-wpan-spectrum-value-helper.cc
src/lr-wpan/test/lr-wpan-ack-test.cc
src/lr-wpan/test/lr-wpan-collision-test.cc
src/lr-wpan/test/lr-wpan-ed-test.cc
--- a/src/lr-wpan/examples/lr-wpan-data.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/examples/lr-wpan-data.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -74,7 +74,7 @@
 
   // Enable calculation of FCS in the trailers. Only necessary when interacting with real devices or wireshark.
   // GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
-  
+
   // Create 2 nodes, and a NetDevice for each one
   Ptr<Node> n0 = CreateObject <Node> ();
   Ptr<Node> n1 = CreateObject <Node> ();
@@ -146,15 +146,15 @@
   params.m_txOptions = TX_OPTION_ACK;
 //  dev0->GetMac ()->McpsDataRequest (params, p0);
   Simulator::ScheduleWithContext (1, Seconds (0.0),
-                       &LrWpanMac::McpsDataRequest,
-                       dev0->GetMac (), params, p0);
+                                  &LrWpanMac::McpsDataRequest,
+                                  dev0->GetMac (), params, p0);
 
   // Send a packet back at time 2 seconds
   Ptr<Packet> p2 = Create<Packet> (60);  // 60 bytes of dummy data
   params.m_dstAddr = Mac16Address ("00:01");
   Simulator::ScheduleWithContext (2, Seconds (2.0),
-                       &LrWpanMac::McpsDataRequest,
-                       dev1->GetMac (), params, p2);
+                                  &LrWpanMac::McpsDataRequest,
+                                  dev1->GetMac (), params, p2);
 
   Simulator::Run ();
 
--- a/src/lr-wpan/helper/lr-wpan-helper.h	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/helper/lr-wpan-helper.h	Sat Apr 26 23:27:34 2014 -0700
@@ -82,7 +82,7 @@
 
   /**
    * Assign a fixed random variable stream number to the random variables
-   * used by this model. Return the number of streams that have been 
+   * used by this model. Return the number of streams that have been
    * assigned. The Install() method should have previously been
    * called by the user.
    *
--- a/src/lr-wpan/model/lr-wpan-interference-helper.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-interference-helper.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -27,8 +27,9 @@
 
 namespace ns3 {
 
-LrWpanInterferenceHelper::LrWpanInterferenceHelper (Ptr<const SpectrumModel> spectrumModel) :
-    m_spectrumModel (spectrumModel), m_dirty (false)
+LrWpanInterferenceHelper::LrWpanInterferenceHelper (Ptr<const SpectrumModel> spectrumModel)
+  : m_spectrumModel (spectrumModel),
+    m_dirty (false)
 {
   m_signal = Create<SpectrumValue> (m_spectrumModel);
 }
--- a/src/lr-wpan/model/lr-wpan-interference-helper.h	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-interference-helper.h	Sat Apr 26 23:27:34 2014 -0700
@@ -86,7 +86,6 @@
    */
   Ptr<const SpectrumModel> GetSpectrumModel (void) const;
 private:
-
   /**
    * The helpers SpectrumModel.
    */
--- a/src/lr-wpan/model/lr-wpan-lqi-tag.h	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-lqi-tag.h	Sat Apr 26 23:27:34 2014 -0700
@@ -66,7 +66,6 @@
    */
   uint8_t Get (void) const;
 private:
-
   /**
    * The current LQI value of the tag.
    */
--- a/src/lr-wpan/model/lr-wpan-mac-header.h	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-mac-header.h	Sat Apr 26 23:27:34 2014 -0700
@@ -46,9 +46,9 @@
 namespace ns3 {
 
 
-/* 
+/*
  * \ingroup lr-wpan
- * Represent the Mac Header with the Frame Control and Sequence Number fields 
+ * Represent the Mac Header with the Frame Control and Sequence Number fields
  */
 class LrWpanMacHeader : public Header
 {
--- a/src/lr-wpan/model/lr-wpan-mac-trailer.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-mac-trailer.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -30,7 +30,8 @@
 const uint16_t LrWpanMacTrailer::LR_WPAN_MAC_FCS_LENGTH = 2;
 
 LrWpanMacTrailer::LrWpanMacTrailer (void)
-  : m_fcs (0), m_calcFcs (false)
+  : m_fcs (0),
+    m_calcFcs (false)
 {
 }
 
@@ -92,9 +93,9 @@
       uint16_t size = p->GetSize ();
       uint8_t *serial_packet = new uint8_t[size];
 
-      p->CopyData(serial_packet, size);
+      p->CopyData (serial_packet, size);
 
-      m_fcs = GenerateCrc16(serial_packet, size);
+      m_fcs = GenerateCrc16 (serial_packet, size);
       delete[] serial_packet;
     }
 }
@@ -114,9 +115,9 @@
       uint16_t size = p->GetSize ();
       uint8_t *serial_packet = new uint8_t[size];
 
-      p->CopyData(serial_packet, size);
+      p->CopyData (serial_packet, size);
 
-      checkFcs = GenerateCrc16(serial_packet, size);
+      checkFcs = GenerateCrc16 (serial_packet, size);
       delete[] serial_packet;
       return (checkFcs == GetFcs ());
     }
@@ -144,7 +145,7 @@
   int i;
   uint16_t accumulator = 0;
 
-  for(i = 0; i < length; ++i)
+  for (i = 0; i < length; ++i)
     {
       accumulator ^= *data;
       accumulator  = (accumulator >> 8) | (accumulator << 8);
--- a/src/lr-wpan/model/lr-wpan-mac.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-mac.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -291,7 +291,7 @@
   if (b0 == TX_OPTION_ACK)
     {
       // Set AckReq bit only if the destination is not the broadcast address.
-      if (!(macHdr.GetDstAddrMode () == SHORT_ADDR && macHdr.GetShortDstAddr() == "ff:ff"))
+      if (!(macHdr.GetDstAddrMode () == SHORT_ADDR && macHdr.GetShortDstAddr () == "ff:ff"))
         {
           macHdr.SetAckReq ();
         }
@@ -465,7 +465,7 @@
     }
 
   // level 1 filtering
-  if(!receivedMacTrailer.CheckFcs (p))
+  if (!receivedMacTrailer.CheckFcs (p))
     {
       m_macRxDropTrace (originalPkt);
     }
@@ -601,7 +601,7 @@
                 }
               else if (receivedMacHdr.IsAcknowledgment () && m_txPkt && m_lrWpanMacState == MAC_ACK_PENDING)
                 {
-                  LrWpanMacHeader macHdr;;
+                  LrWpanMacHeader macHdr;
                   m_txPkt->PeekHeader (macHdr);
                   if (receivedMacHdr.GetSeqNum () == macHdr.GetSeqNum ())
                     {
@@ -687,7 +687,7 @@
   pkt->RemoveHeader (hdr);
   if (hdr.GetShortDstAddr () != Mac16Address ("ff:ff"))
     {
-      m_sentPktTrace (p, m_retransmission+1, m_numCsmacaRetry);
+      m_sentPktTrace (p, m_retransmission + 1, m_numCsmacaRetry);
     }
 
   txQElement->txQPkt = 0;
@@ -741,7 +741,7 @@
   else
     {
       m_retransmission++;
-      m_numCsmacaRetry += m_csmaCa->GetNB () +1;
+      m_numCsmacaRetry += m_csmaCa->GetNB () + 1;
       // Start next CCA process for this packet.
       return true;
     }
@@ -767,7 +767,7 @@
               // wait for the ack or the next retransmission timeout
               // start retransmission timer
               Time waitTime = MicroSeconds (GetMacAckWaitDuration () * 1000 * 1000 / m_phy->GetDataOrSymbolRate (false));
-              NS_ASSERT (m_ackWaitTimeout.IsExpired());
+              NS_ASSERT (m_ackWaitTimeout.IsExpired ());
               m_ackWaitTimeout = Simulator::Schedule (waitTime, &LrWpanMac::AckWaitTimeout, this);
               m_setMacState.Cancel ();
               m_setMacState = Simulator::ScheduleNow (&LrWpanMac::SetLrWpanMacState, this, MAC_ACK_PENDING);
@@ -994,7 +994,7 @@
 LrWpanMac::GetMacAckWaitDuration (void) const
 {
   return m_csmaCa->GetUnitBackoffPeriod () + m_phy->aTurnaroundTime + m_phy->GetPhySHRDuration ()
-      + ceil (6 * m_phy->GetPhySymbolsPerOctet ());
+         + ceil (6 * m_phy->GetPhySymbolsPerOctet ());
 }
 
 uint8_t
--- a/src/lr-wpan/model/lr-wpan-mac.h	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-mac.h	Sat Apr 26 23:27:34 2014 -0700
@@ -107,10 +107,15 @@
 
 struct McpsDataRequestParams
 {
-  McpsDataRequestParams () :
-    m_srcAddrMode (SHORT_ADDR), m_dstAddrMode (SHORT_ADDR), m_dstPanId (0),
-    m_dstAddr (), m_msduHandle (0), m_txOptions (0)
-  { };
+  McpsDataRequestParams ()
+    : m_srcAddrMode (SHORT_ADDR),
+      m_dstAddrMode (SHORT_ADDR),
+      m_dstPanId (0),
+      m_dstAddr (),
+      m_msduHandle (0),
+      m_txOptions (0)
+  {
+  }
   LrWpanAddressMode m_srcAddrMode;
   LrWpanAddressMode m_dstAddrMode;
   uint16_t m_dstPanId;
@@ -388,7 +393,7 @@
    * See IEEE 802.15.4-2006, section 7.4.1, Table 85.
    */
   uint64_t m_aBaseSuperframeDuration;
-  
+
   //MAC PIB attributes
   /**
    * The time that the device transmitted its last beacon frame, in symbol
@@ -443,7 +448,7 @@
    * See IEEE 802.15.4-2006, section 7.4.2, Table 86.
    */
   uint8_t m_macMaxFrameRetries;
-  
+
   /**
    * Indication of whether the MAC sublayer is to enable its receiver during
    * idle periods.
--- a/src/lr-wpan/model/lr-wpan-net-device.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-net-device.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -61,9 +61,9 @@
                                         &LrWpanNetDevice::SetMac),
                    MakePointerChecker<LrWpanMac> ())
     .AddAttribute ("UseAcks", "Request acknowledgments for data frames.",
-                  BooleanValue (true),
-                  MakeBooleanAccessor (&LrWpanNetDevice::m_useAcks),
-                  MakeBooleanChecker ())
+                   BooleanValue (true),
+                   MakeBooleanAccessor (&LrWpanNetDevice::m_useAcks),
+                   MakeBooleanChecker ())
   ;
   return tid;
 }
--- a/src/lr-wpan/model/lr-wpan-phy.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-phy.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -486,7 +486,7 @@
     }
 
   // Prevent PHY from sending a packet while switching the transceiver state.
-  if (!m_setTRXState.IsRunning())
+  if (!m_setTRXState.IsRunning ())
     {
       if (m_trxState == IEEE_802_15_4_PHY_TX_ON)
         {
@@ -657,7 +657,7 @@
         {
           NS_LOG_DEBUG ("Cancel m_setTRXState");
           // Keep the transceiver state as the old state before the switching attempt.
-          m_setTRXState.Cancel();
+          m_setTRXState.Cancel ();
         }
     }
   if (m_trxStatePending != IEEE_802_15_4_PHY_IDLE)
@@ -1352,7 +1352,7 @@
   NS_ASSERT (m_phyOption < IEEE_802_15_4_INVALID_PHY_OPTION);
 
   return ppduHeaderSymbolNumbers[m_phyOption].shrPreamble
-    + ppduHeaderSymbolNumbers[m_phyOption].shrSfd;
+         + ppduHeaderSymbolNumbers[m_phyOption].shrSfd;
 }
 
 double
--- a/src/lr-wpan/model/lr-wpan-phy.h	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-phy.h	Sat Apr 26 23:27:34 2014 -0700
@@ -407,7 +407,7 @@
    * @return pointer to LrWpanErrorModel in use
    */
   Ptr<LrWpanErrorModel> GetErrorModel (void) const;
-  
+
   /**
    * Get the duration of the SHR (preamble and SFD) in symbols, depending on
    * the currently selected channel.
@@ -423,7 +423,7 @@
    * \return the number of symbols per octet
    */
   double GetPhySymbolsPerOctet (void) const;
-  
+
   /**
    * Assign a fixed random variable stream number to the random variables
    * used by this model.  Return the number of streams that have been assigned.
--- a/src/lr-wpan/model/lr-wpan-spectrum-value-helper.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/model/lr-wpan-spectrum-value-helper.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -90,7 +90,7 @@
   (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 2 ] = txPowerDensity * 0.005;
 
   // If more power is allocated to more subbands in future revisions of
-  // this model, make sure to renormalize so that the integral of the 
+  // this model, make sure to renormalize so that the integral of the
   // txPsd still equals txPower
 
   return txPsd;
--- a/src/lr-wpan/test/lr-wpan-ack-test.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/test/lr-wpan-ack-test.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -114,7 +114,7 @@
 
   // Enable calculation of FCS in the trailers. Only necessary when interacting with real devices or wireshark.
   // GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
-  
+
   // Set the random seed and run number for this test
   RngSeedManager::SetSeed (1);
   RngSeedManager::SetRun (6);
--- a/src/lr-wpan/test/lr-wpan-collision-test.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/test/lr-wpan-collision-test.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -59,7 +59,7 @@
 
 void LrWpanCollisionTestCase::DataIndication (McpsDataIndicationParams params, Ptr<Packet> p)
 {
-  m_rxPackets ++;
+  m_rxPackets++;
 }
 
 
--- a/src/lr-wpan/test/lr-wpan-ed-test.cc	Sat Apr 26 23:11:44 2014 -0700
+++ b/src/lr-wpan/test/lr-wpan-ed-test.cc	Sat Apr 26 23:27:34 2014 -0700
@@ -62,7 +62,7 @@
 void
 LrWpanEdTestCase::PlmeEdConfirm (LrWpanPhyEnumeration status, uint8_t level)
 {
-  NS_LOG_UNCOND ("Energy Detection completed with status " << LrWpanHelper::LrWpanPhyEnumerationPrinter(status) << " and energy level " << static_cast<uint32_t> (level));
+  NS_LOG_UNCOND ("Energy Detection completed with status " << LrWpanHelper::LrWpanPhyEnumerationPrinter (status) << " and energy level " << static_cast<uint32_t> (level));
   m_status = status;
   m_level = level;
 }
@@ -92,7 +92,7 @@
   // Set the random seed and run number for this test
   RngSeedManager::SetSeed (1);
   RngSeedManager::SetRun (6);
-  
+
   // Create 2 nodes, and a NetDevice for each one
   Ptr<Node> n0 = CreateObject <Node> ();
   Ptr<Node> n1 = CreateObject <Node> ();