From f4e804afe1d739f0e322ed6d977a8c5d7e0761a8 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Fri, 2 May 2025 18:00:51 +0200 Subject: [PATCH] Fix warnings with g++ 15.1.1 in optimized mode --- src/core/model/attribute-container.h | 6 ++---- src/lte/model/a2-a4-rsrq-handover-algorithm.cc | 2 -- src/lte/model/a2-a4-rsrq-handover-algorithm.h | 1 - src/lte/model/lte-rrc-sap.h | 2 +- src/lte/model/lte-ue-mac.cc | 3 +-- src/lte/model/tdtbfq-ff-mac-scheduler.cc | 14 +++++++------- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/core/model/attribute-container.h b/src/core/model/attribute-container.h index 9660adebc..6a3ffc1d0 100644 --- a/src/core/model/attribute-container.h +++ b/src/core/model/attribute-container.h @@ -180,10 +180,9 @@ class AttributeContainerValue : public AttributeValue * @tparam ITER \deduced iterator type * \param[in] begin Points to first item to copy * \param[in] end Points to one after last item to copy - * @return This object with items copied. */ template - inline Ptr> CopyFrom(const ITER begin, const ITER end); + inline void CopyFrom(const ITER begin, const ITER end); container_type m_container; //!< Internal container }; @@ -572,14 +571,13 @@ AttributeContainerValue::end() const template class C> template -Ptr> +void AttributeContainerValue::CopyFrom(const ITER begin, const ITER end) { for (ITER iter = begin; iter != end; ++iter) { m_container.push_back(Create(*iter)); } - return this; } template class C, typename T1> diff --git a/src/lte/model/a2-a4-rsrq-handover-algorithm.cc b/src/lte/model/a2-a4-rsrq-handover-algorithm.cc index ee701a7a5..26b2ebd8c 100644 --- a/src/lte/model/a2-a4-rsrq-handover-algorithm.cc +++ b/src/lte/model/a2-a4-rsrq-handover-algorithm.cc @@ -241,7 +241,6 @@ A2A4RsrqHandoverAlgorithm::UpdateNeighbourMeasurements(uint16_t rnti, uint16_t c { neighbourCellMeasures = it2->second; neighbourCellMeasures->m_cellId = cellId; - neighbourCellMeasures->m_rsrp = 0; neighbourCellMeasures->m_rsrq = rsrq; } else @@ -249,7 +248,6 @@ A2A4RsrqHandoverAlgorithm::UpdateNeighbourMeasurements(uint16_t rnti, uint16_t c // insert a new cell entry neighbourCellMeasures = Create(); neighbourCellMeasures->m_cellId = cellId; - neighbourCellMeasures->m_rsrp = 0; neighbourCellMeasures->m_rsrq = rsrq; it1->second[cellId] = neighbourCellMeasures; } diff --git a/src/lte/model/a2-a4-rsrq-handover-algorithm.h b/src/lte/model/a2-a4-rsrq-handover-algorithm.h index 54bab71c4..b96f59a1b 100644 --- a/src/lte/model/a2-a4-rsrq-handover-algorithm.h +++ b/src/lte/model/a2-a4-rsrq-handover-algorithm.h @@ -139,7 +139,6 @@ class A2A4RsrqHandoverAlgorithm : public LteHandoverAlgorithm { public: uint16_t m_cellId; ///< Cell ID. - uint8_t m_rsrp; ///< RSRP in quantized format. \todo Can be removed? uint8_t m_rsrq; ///< RSRQ in quantized format. }; diff --git a/src/lte/model/lte-rrc-sap.h b/src/lte/model/lte-rrc-sap.h index f1695e6bb..8bdad14b2 100644 --- a/src/lte/model/lte-rrc-sap.h +++ b/src/lte/model/lte-rrc-sap.h @@ -669,7 +669,7 @@ class LteRrcSap { uint16_t physCellId; ///< Phy cell ID bool haveCgiInfo; ///< have CGI info? - CgiInfo cgiInfo; ///< CGI info + CgiInfo cgiInfo{}; ///< CGI info bool haveRsrpResult; ///< have RSRP result uint8_t rsrpResult; ///< RSRP result bool haveRsrqResult; ///< have RSRQ result? diff --git a/src/lte/model/lte-ue-mac.cc b/src/lte/model/lte-ue-mac.cc index df6fa7a25..8d0f8a9c2 100644 --- a/src/lte/model/lte-ue-mac.cc +++ b/src/lte/model/lte-ue-mac.cc @@ -230,11 +230,11 @@ LteUeMac::LteUeMac() m_bsrLast(), m_freshUlBsr(false), m_harqProcessId(0), + m_miUlHarqProcessesPacketTimer(HARQ_PERIOD, 0), m_rnti(0), m_imsi(0), m_rachConfigured(false), m_waitingForRaResponse(false) - { NS_LOG_FUNCTION(this); m_miUlHarqProcessesPacket.resize(HARQ_PERIOD); @@ -243,7 +243,6 @@ LteUeMac::LteUeMac() Ptr pb = CreateObject(); m_miUlHarqProcessesPacket.at(i) = pb; } - m_miUlHarqProcessesPacketTimer.resize(HARQ_PERIOD, 0); m_macSapProvider = new UeMemberLteMacSapProvider(this); m_cmacSapProvider = new UeMemberLteUeCmacSapProvider(this); diff --git a/src/lte/model/tdtbfq-ff-mac-scheduler.cc b/src/lte/model/tdtbfq-ff-mac-scheduler.cc index b06799a06..1caefc239 100644 --- a/src/lte/model/tdtbfq-ff-mac-scheduler.cc +++ b/src/lte/model/tdtbfq-ff-mac-scheduler.cc @@ -694,16 +694,16 @@ TdTbfqFfMacScheduler::DoSchedDlTriggerReq( NS_LOG_INFO(this << " Processing DLHARQ feedback"); if (nLayers == 1) { - retx.push_back(m_dlInfoListBuffered.at(i).m_harqStatus.at(0) == - DlInfoListElement_s::NACK); - retx.push_back(false); + retx.emplace_back(m_dlInfoListBuffered.at(i).m_harqStatus.at(0) == + DlInfoListElement_s::NACK); + retx.emplace_back(false); } else { - retx.push_back(m_dlInfoListBuffered.at(i).m_harqStatus.at(0) == - DlInfoListElement_s::NACK); - retx.push_back(m_dlInfoListBuffered.at(i).m_harqStatus.at(1) == - DlInfoListElement_s::NACK); + retx.emplace_back(m_dlInfoListBuffered.at(i).m_harqStatus.at(0) == + DlInfoListElement_s::NACK); + retx.emplace_back(m_dlInfoListBuffered.at(i).m_harqStatus.at(1) == + DlInfoListElement_s::NACK); } if (retx.at(0) || retx.at(1)) {