diff --git a/src/traffic-control/helper/queue-disc-container.cc b/src/traffic-control/helper/queue-disc-container.cc index 02cbec27a..06c420565 100644 --- a/src/traffic-control/helper/queue-disc-container.cc +++ b/src/traffic-control/helper/queue-disc-container.cc @@ -43,14 +43,14 @@ QueueDiscContainer::End (void) const return m_queueDiscs.end (); } -uint32_t +std::size_t QueueDiscContainer::GetN (void) const { - return static_cast(m_queueDiscs.size ()); + return m_queueDiscs.size (); } Ptr -QueueDiscContainer::Get (uint32_t i) const +QueueDiscContainer::Get (std::size_t i) const { return m_queueDiscs[i]; } diff --git a/src/traffic-control/helper/queue-disc-container.h b/src/traffic-control/helper/queue-disc-container.h index 8dfe7d81e..15a1c4946 100644 --- a/src/traffic-control/helper/queue-disc-container.h +++ b/src/traffic-control/helper/queue-disc-container.h @@ -122,7 +122,7 @@ public: * * \returns the number of Ptr stored in this container. */ - uint32_t GetN (void) const; + std::size_t GetN (void) const; /** * \brief Get the Ptr stored in this container at a given @@ -145,7 +145,7 @@ public: * \param i the index of the requested queue disc pointer. * \returns the requested queue disc pointer. */ - Ptr Get (uint32_t i) const; + Ptr Get (std::size_t i) const; /** * \brief Append the contents of another QueueDiscContainer to the end of diff --git a/src/traffic-control/helper/traffic-control-helper.cc b/src/traffic-control/helper/traffic-control-helper.cc index aafd95589..f06f07f34 100644 --- a/src/traffic-control/helper/traffic-control-helper.cc +++ b/src/traffic-control/helper/traffic-control-helper.cc @@ -367,11 +367,11 @@ TrafficControlHelper::Install (Ptr d) m_queueDiscs.resize (m_queueDiscFactory.size ()); // Create queue discs (from leaves to root) - for (auto i = m_queueDiscFactory.size (); i > 0; i--) + for (auto i = m_queueDiscFactory.size (); i-- > 0; ) { - Ptr q = m_queueDiscFactory[i-1].CreateQueueDisc (m_queueDiscs); + Ptr q = m_queueDiscFactory[i].CreateQueueDisc (m_queueDiscs); q->SetNetDevice (d); - m_queueDiscs[i-1] = q; + m_queueDiscs[i] = q; } // Set the root queue disc (if any has been created) on the device diff --git a/src/traffic-control/model/queue-disc.cc b/src/traffic-control/model/queue-disc.cc index aaa6d7563..f91dbfdbd 100644 --- a/src/traffic-control/model/queue-disc.cc +++ b/src/traffic-control/model/queue-disc.cc @@ -584,16 +584,16 @@ QueueDisc::AddInternalQueue (Ptr queue) } Ptr -QueueDisc::GetInternalQueue (uint32_t i) const +QueueDisc::GetInternalQueue (std::size_t i) const { NS_ASSERT (i < m_queues.size ()); return m_queues[i]; } -uint32_t +std::size_t QueueDisc::GetNInternalQueues (void) const { - return static_cast(m_queues.size ()); + return m_queues.size (); } void @@ -604,16 +604,16 @@ QueueDisc::AddPacketFilter (Ptr filter) } Ptr -QueueDisc::GetPacketFilter (uint32_t i) const +QueueDisc::GetPacketFilter (std::size_t i) const { NS_ASSERT (i < m_filters.size ()); return m_filters[i]; } -uint32_t +std::size_t QueueDisc::GetNPacketFilters (void) const { - return static_cast(m_filters.size ()); + return m_filters.size (); } void @@ -642,16 +642,16 @@ QueueDisc::AddQueueDiscClass (Ptr qdClass) } Ptr -QueueDisc::GetQueueDiscClass (uint32_t i) const +QueueDisc::GetQueueDiscClass (std::size_t i) const { NS_ASSERT (i < m_classes.size ()); return m_classes[i]; } -uint32_t +std::size_t QueueDisc::GetNQueueDiscClasses (void) const { - return static_cast(m_classes.size ()); + return m_classes.size (); } int32_t diff --git a/src/traffic-control/model/queue-disc.h b/src/traffic-control/model/queue-disc.h index 50db991d1..b26a67a6a 100644 --- a/src/traffic-control/model/queue-disc.h +++ b/src/traffic-control/model/queue-disc.h @@ -409,13 +409,13 @@ public: * \param i the index of the queue * \return the i-th internal queue. */ - Ptr GetInternalQueue (uint32_t i) const; + Ptr GetInternalQueue (std::size_t i) const; /** * \brief Get the number of internal queues * \return the number of internal queues. */ - uint32_t GetNInternalQueues (void) const; + std::size_t GetNInternalQueues (void) const; /** * \brief Add a packet filter to the tail of the list of filters used to classify packets. @@ -428,13 +428,13 @@ public: * \param i the index of the packet filter * \return the i-th packet filter. */ - Ptr GetPacketFilter (uint32_t i) const; + Ptr GetPacketFilter (std::size_t i) const; /** * \brief Get the number of packet filters * \return the number of packet filters. */ - uint32_t GetNPacketFilters (void) const; + std::size_t GetNPacketFilters (void) const; /** * \brief Add a queue disc class to the tail of the list of classes. @@ -447,13 +447,13 @@ public: * \param i the index of the queue disc class * \return the i-th queue disc class. */ - Ptr GetQueueDiscClass (uint32_t i) const; + Ptr GetQueueDiscClass (std::size_t i) const; /** * \brief Get the number of queue disc classes * \return the number of queue disc classes. */ - uint32_t GetNQueueDiscClasses (void) const; + std::size_t GetNQueueDiscClasses (void) const; /** * Classify a packet by calling the packet filters, one at a time, until either