From f0a264eabdebdbdecb2c269e9791b753176e79f4 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Wed, 12 Mar 2025 18:41:19 +0000 Subject: [PATCH] applications,core,wifi: Fix inconsistent formatting due to clang-format-19 --- .../utils/symmetric-adjacency-matrix.h | 4 +- src/applications/model/udp-client.cc | 22 +++--- src/applications/model/udp-echo-client.cc | 5 +- src/applications/model/udp-trace-client.cc | 27 ++++---- src/core/model/attribute-accessor-helper.h | 15 ++++- src/core/model/object-map.h | 15 ++++- src/core/model/object-vector.h | 15 ++++- src/core/model/trace-source-accessor.h | 10 ++- src/wifi/model/eht/eht-capabilities.h | 1 + src/wifi/model/he/he-ppdu.cc | 15 +++-- src/wifi/model/he/multi-user-scheduler.h | 8 ++- src/wifi/model/txop.cc | 67 ++++++++++--------- src/wifi/model/wifi-net-device.cc | 20 +++--- src/wifi/model/wifi-phy.cc | 3 +- src/wifi/test/wifi-emlsr-test.cc | 7 +- 15 files changed, 140 insertions(+), 94 deletions(-) diff --git a/src/antenna/utils/symmetric-adjacency-matrix.h b/src/antenna/utils/symmetric-adjacency-matrix.h index fcaa05ec8..83d2e21ae 100644 --- a/src/antenna/utils/symmetric-adjacency-matrix.h +++ b/src/antenna/utils/symmetric-adjacency-matrix.h @@ -246,7 +246,7 @@ class SymmetricAdjacencyMatrix { m_rowOffsets.push_back(i * (i + 1) / 2); } - }; + } /** * @brief Retrieve the value of matrix (row, column) node @@ -307,7 +307,7 @@ class SymmetricAdjacencyMatrix m_rowOffsets.push_back(m_matrix.size()); m_rows++; m_matrix.resize(m_matrix.size() + m_rows); - }; + } /** * @brief Retrieve number of rows in the adjacency matrix diff --git a/src/applications/model/udp-client.cc b/src/applications/model/udp-client.cc index f21e7dab4..e3ac5f6b9 100644 --- a/src/applications/model/udp-client.cc +++ b/src/applications/model/udp-client.cc @@ -50,17 +50,17 @@ UdpClient::GetTypeId() MakeTimeAccessor(&UdpClient::m_interval), MakeTimeChecker()) // NS_DEPRECATED_3_44 - .AddAttribute("RemoteAddress", - "The destination Address of the outbound packets", - AddressValue(), - MakeAddressAccessor( - (void(UdpClient::*)(const Address&)) & - UdpClient::SetRemote, // this is needed to indicate which version - // of the function overload to use - &UdpClient::GetRemote), - MakeAddressChecker(), - TypeId::SupportLevel::DEPRECATED, - "Replaced by Remote in ns-3.44.") + .AddAttribute( + "RemoteAddress", + "The destination Address of the outbound packets", + AddressValue(), + MakeAddressAccessor( + // this is needed to indicate which version of the function overload to use + static_cast(&UdpClient::SetRemote), + &UdpClient::GetRemote), + MakeAddressChecker(), + TypeId::SupportLevel::DEPRECATED, + "Replaced by Remote in ns-3.44.") // NS_DEPRECATED_3_44 .AddAttribute("RemotePort", "The destination port of the outbound packets", diff --git a/src/applications/model/udp-echo-client.cc b/src/applications/model/udp-echo-client.cc index c2e0808a4..6d5528014 100644 --- a/src/applications/model/udp-echo-client.cc +++ b/src/applications/model/udp-echo-client.cc @@ -47,9 +47,8 @@ UdpEchoClient::GetTypeId() "The destination Address of the outbound packets", AddressValue(), MakeAddressAccessor( - (void(UdpEchoClient::*)(const Address&)) & - UdpEchoClient::SetRemote, // this is needed to indicate which version of the - // function overload to use + // this is needed to indicate which version of the function overload to use + static_cast(&UdpEchoClient::SetRemote), &UdpEchoClient::GetRemote), MakeAddressChecker(), TypeId::SupportLevel::DEPRECATED, diff --git a/src/applications/model/udp-trace-client.cc b/src/applications/model/udp-trace-client.cc index c644b1c95..bbb6d5482 100644 --- a/src/applications/model/udp-trace-client.cc +++ b/src/applications/model/udp-trace-client.cc @@ -57,25 +57,26 @@ UdpTraceClient::GetTypeId() .SetGroupName("Applications") .AddConstructor() // NS_DEPRECATED_3_44 - .AddAttribute("RemoteAddress", - "The destination Address of the outbound packets", - AddressValue(), - MakeAddressAccessor( - (void(UdpTraceClient::*)(const Address&)) & - UdpTraceClient::SetRemote), // this is needed to indicate which - // version of the function overload to use - MakeAddressChecker(), - TypeId::SupportLevel::DEPRECATED, - "Replaced by Remote in ns-3.44.") + .AddAttribute( + "RemoteAddress", + "The destination Address of the outbound packets", + AddressValue(), + MakeAddressAccessor( + // this is needed to indicate which version of the function overload to use + static_cast( + &UdpTraceClient::SetRemote)), + MakeAddressChecker(), + TypeId::SupportLevel::DEPRECATED, + "Replaced by Remote in ns-3.44.") // NS_DEPRECATED_3_44 .AddAttribute( "RemotePort", "The destination port of the outbound packets", UintegerValue(UdpTraceClient::DEFAULT_PORT), MakeAddressAccessor( - (void(UdpTraceClient::*)(const Address&)) & - UdpTraceClient::SetRemote, // this is needed to indicate which version of - // the function overload to use + // this is needed to indicate which version of the function overload to use + static_cast( + &UdpTraceClient::SetRemote), &UdpTraceClient::GetRemote), MakeUintegerChecker(), TypeId::SupportLevel::DEPRECATED, diff --git a/src/core/model/attribute-accessor-helper.h b/src/core/model/attribute-accessor-helper.h index 5a1db7466..da05d0ec2 100644 --- a/src/core/model/attribute-accessor-helper.h +++ b/src/core/model/attribute-accessor-helper.h @@ -233,9 +233,12 @@ class AccessorHelper : public AttributeAccessor * @param [in] memberVariable The address of the data member. * @returns The AttributeAccessor. */ +// clang-format off +// Clang-format guard needed for versions <= 18 template inline Ptr -DoMakeAccessorHelperOne(U T::*memberVariable) +DoMakeAccessorHelperOne(U T::* memberVariable) +// clang-format on { /* AttributeAccessor implementation for a class member variable. */ class MemberVariable : public AccessorHelper @@ -245,7 +248,10 @@ DoMakeAccessorHelperOne(U T::*memberVariable) * Construct from a class data member address. * @param [in] memberVariable The class data member address. */ - MemberVariable(U T::*memberVariable) + // clang-format off + // Clang-format guard needed for versions <= 18 + MemberVariable(U T::* memberVariable) + // clang-format on : AccessorHelper(), m_memberVariable(memberVariable) { @@ -280,7 +286,10 @@ DoMakeAccessorHelperOne(U T::*memberVariable) return true; } - U T::*m_memberVariable; // Address of the class data member. + // clang-format off + // Clang-format guard needed for versions <= 18 + U T::* m_memberVariable; // Address of the class data member. + // clang-format on }; return Ptr(new MemberVariable(memberVariable), false); diff --git a/src/core/model/object-map.h b/src/core/model/object-map.h index 11b7bbf16..37c3e1a76 100644 --- a/src/core/model/object-map.h +++ b/src/core/model/object-map.h @@ -33,8 +33,11 @@ typedef ObjectPtrContainerValue ObjectMapValue; * MakeAccessorHelper implementation for ObjectVector. * @copydetails ns3::DoMakeAccessorHelperOne(U T::*) */ +// clang-format off +// Clang-format guard needed for versions <= 18 template -Ptr MakeObjectMapAccessor(U T::*memberVariable); +Ptr MakeObjectMapAccessor(U T::* memberVariable); +// clang-format on // Documentation generated by print-introspected-doxygen.cc template @@ -60,9 +63,12 @@ Ptr MakeObjectMapAccessor(INDEX (T::*getN)() const, * Implementation of the templates declared above. ***************************************************************/ +// clang-format off +// Clang-format guard needed for versions <= 18 template Ptr -MakeObjectMapAccessor(U T::*memberVector) +MakeObjectMapAccessor(U T::* memberVector) +// clang-format on { struct MemberStdContainer : public ObjectPtrContainerAccessor { @@ -98,7 +104,10 @@ MakeObjectMapAccessor(U T::*memberVector) return nullptr; } - U T::*m_memberVector; + // clang-format off + // Clang-format guard needed for versions <= 18 + U T::* m_memberVector; + // clang-format on }* spec = new MemberStdContainer(); spec->m_memberVector = memberVector; diff --git a/src/core/model/object-vector.h b/src/core/model/object-vector.h index ff8f0cd3a..fc71eaef6 100644 --- a/src/core/model/object-vector.h +++ b/src/core/model/object-vector.h @@ -33,8 +33,11 @@ typedef ObjectPtrContainerValue ObjectVectorValue; * MakeAccessorHelper implementation for ObjectVector. * @copydetails ns3::DoMakeAccessorHelperOne(U T::*) */ +// clang-format off +// Clang-format guard needed for versions <= 18 template -Ptr MakeObjectVectorAccessor(U T::*memberVariable); +Ptr MakeObjectVectorAccessor(U T::* memberVariable); +// clang-format on // Documentation generated by print-introspected-doxygen.cc template @@ -60,9 +63,12 @@ Ptr MakeObjectVectorAccessor(INDEX (T::*getN)() const, * Implementation of the templates declared above. ***************************************************************/ +// clang-format off +// Clang-format guard needed for versions <= 18 template Ptr -MakeObjectVectorAccessor(U T::*memberVector) +MakeObjectVectorAccessor(U T::* memberVector) +// clang-format on { struct MemberStdContainer : public ObjectPtrContainerAccessor { @@ -98,7 +104,10 @@ MakeObjectVectorAccessor(U T::*memberVector) return nullptr; } - U T::*m_memberVector; + // clang-format off + // Clang-format guard needed for versions <= 18 + U T::* m_memberVector; + // clang-format on }* spec = new MemberStdContainer(); spec->m_memberVector = memberVector; diff --git a/src/core/model/trace-source-accessor.h b/src/core/model/trace-source-accessor.h index df57eff8e..81099b87b 100644 --- a/src/core/model/trace-source-accessor.h +++ b/src/core/model/trace-source-accessor.h @@ -136,9 +136,12 @@ namespace ns3 * @param [in] a The underlying data value. * @returns The TraceSourceAccessor */ +// clang-format off +// Clang-format guard needed for versions <= 18 template Ptr -DoMakeTraceSourceAccessor(SOURCE T::*a) +DoMakeTraceSourceAccessor(SOURCE T::* a) +// clang-format on { struct Accessor : public TraceSourceAccessor { @@ -186,7 +189,10 @@ DoMakeTraceSourceAccessor(SOURCE T::*a) return true; } - SOURCE T::*m_source; + // clang-format off + // Clang-format guard needed for versions <= 18 + SOURCE T::* m_source; + // clang-format on }* accessor = new Accessor(); accessor->m_source = a; diff --git a/src/wifi/model/eht/eht-capabilities.h b/src/wifi/model/eht/eht-capabilities.h index 079de0983..db66db15d 100644 --- a/src/wifi/model/eht/eht-capabilities.h +++ b/src/wifi/model/eht/eht-capabilities.h @@ -103,6 +103,7 @@ struct EhtPhyCapabilities uint8_t support20MhzOperatingStaReceivingNdpWithWiderBw : 1; //!< Support For 20 MHz Operating STA //!< Receiving NDP With Wider Bandwidth + uint8_t nonOfdmaUlMuMimoBwNotLargerThan80Mhz : 1; //!< Non-OFDMA UL MU-MIMO (BW ≤ 80 MHz) uint8_t nonOfdmaUlMuMimo160Mhz : 1; //!< Non-OFDMA UL MU-MIMO (BW = 160 MHz) uint8_t nonOfdmaUlMuMimo320Mhz : 1; //!< Non-OFDMA UL MU-MIMO (BW = 320 MHz) diff --git a/src/wifi/model/he/he-ppdu.cc b/src/wifi/model/he/he-ppdu.cc index 100216ba4..521194fd9 100644 --- a/src/wifi/model/he/he-ppdu.cc +++ b/src/wifi/model/he/he-ppdu.cc @@ -724,13 +724,14 @@ HePpdu::GetHeSigBContentChannels(const WifiTxVector& txVector, uint8_t p20Index) ccIndex = ((prevRuIndex / numRus) % 2 == 0) ? 0 : 1; } const auto central26TonesRus = HeRu::GetCentral26TonesRus(channelWidth, *prevRuType); - if (ruType < HeRu::RuType::RU_242_TONE && (prevCcIndex == ccIndex) && - ((ruType != HeRu::RuType::RU_26_TONE) || - std::none_of(central26TonesRus.cbegin(), - central26TonesRus.cend(), - [ruIndex, channelWidth, p20Index](const auto& ruSpec) { - return ruSpec.GetPhyIndex(channelWidth, p20Index) == ruIndex; - }))) + const auto isCentral26ToneRu = + std::none_of(central26TonesRus.cbegin(), + central26TonesRus.cend(), + [ruIndex, channelWidth, p20Index](const auto& ruSpec) { + return ruSpec.GetPhyIndex(channelWidth, p20Index) == ruIndex; + }); + if (ruType < HeRu::RuType::RU_242_TONE && prevCcIndex == ccIndex && + (ruType != HeRu::RuType::RU_26_TONE || isCentral26ToneRu)) { contentChannels[ccIndex].push_back({NO_USER_STA_ID, 0, 0}); } diff --git a/src/wifi/model/he/multi-user-scheduler.h b/src/wifi/model/he/multi-user-scheduler.h index 4e2cc4dca..39af24b1a 100644 --- a/src/wifi/model/he/multi-user-scheduler.h +++ b/src/wifi/model/he/multi-user-scheduler.h @@ -189,7 +189,9 @@ class MultiUserScheduler : public Object */ virtual void UpdateTriggerFrameAfterProtection(uint8_t linkId, CtrlTriggerHeader& trigger, - WifiTxParameters& txParams) const {}; + WifiTxParameters& txParams) const + { + } /** * Update the given PSDU map after protection is completed on the given link. @@ -200,7 +202,9 @@ class MultiUserScheduler : public Object */ virtual void UpdateDlMuAfterProtection(uint8_t linkId, WifiPsduMap& psduMap, - WifiTxParameters& txParams) const {}; + WifiTxParameters& txParams) const + { + } /** * Remove the User Info fields for which the given predicate is true from the given Trigger diff --git a/src/wifi/model/txop.cc b/src/wifi/model/txop.cc index e081b36f3..d61cdd83f 100644 --- a/src/wifi/model/txop.cc +++ b/src/wifi/model/txop.cc @@ -66,16 +66,17 @@ Txop::GetTypeId() AC_UNDEF, "AC_UNDEF")) // NS_DEPRECATED_3_42 - .AddAttribute("MinCw", - "The minimum value of the contention window (just for the first link, " - "in case of 11be multi-link devices).", - TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time - UintegerValue(15), - MakeUintegerAccessor((void(Txop::*)(uint32_t)) & Txop::SetMinCw, - (uint32_t(Txop::*)() const) & Txop::GetMinCw), - MakeUintegerChecker(), - TypeId::SupportLevel::OBSOLETE, - "Use MinCws attribute instead of MinCw") + .AddAttribute( + "MinCw", + "The minimum value of the contention window (just for the first link, " + "in case of 11be multi-link devices).", + TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time + UintegerValue(15), + MakeUintegerAccessor(static_cast(&Txop::SetMinCw), + static_cast(&Txop::GetMinCw)), + MakeUintegerChecker(), + TypeId::SupportLevel::OBSOLETE, + "Use MinCws attribute instead of MinCw") .AddAttribute( "MinCws", "The minimum values of the contention window for all the links (sorted in " @@ -87,16 +88,17 @@ Txop::GetTypeId() MakeAttributeContainerAccessor(&Txop::SetMinCws, &Txop::GetMinCws), MakeAttributeContainerChecker(MakeUintegerChecker())) // NS_DEPRECATED_3_42 - .AddAttribute("MaxCw", - "The maximum value of the contention window (just for the first link, " - "in case of 11be multi-link devices).", - TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time - UintegerValue(1023), - MakeUintegerAccessor((void(Txop::*)(uint32_t)) & Txop::SetMaxCw, - (uint32_t(Txop::*)() const) & Txop::GetMaxCw), - MakeUintegerChecker(), - TypeId::SupportLevel::OBSOLETE, - "Use MaxCws attribute instead of MaxCw") + .AddAttribute( + "MaxCw", + "The maximum value of the contention window (just for the first link, " + "in case of 11be multi-link devices).", + TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time + UintegerValue(1023), + MakeUintegerAccessor(static_cast(&Txop::SetMaxCw), + static_cast(&Txop::GetMaxCw)), + MakeUintegerChecker(), + TypeId::SupportLevel::OBSOLETE, + "Use MaxCws attribute instead of MaxCw") .AddAttribute( "MaxCws", "The maximum values of the contention window for all the links (sorted in " @@ -114,8 +116,8 @@ Txop::GetTypeId() "in case of 11be multi-link devices).", TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time UintegerValue(2), - MakeUintegerAccessor((void(Txop::*)(uint8_t)) & Txop::SetAifsn, - (uint8_t(Txop::*)() const) & Txop::GetAifsn), + MakeUintegerAccessor(static_cast(&Txop::SetAifsn), + static_cast(&Txop::GetAifsn)), MakeUintegerChecker(), TypeId::SupportLevel::OBSOLETE, "Use Aifsns attribute instead of Aifsn") @@ -130,16 +132,17 @@ Txop::GetTypeId() MakeAttributeContainerAccessor(&Txop::SetAifsns, &Txop::GetAifsns), MakeAttributeContainerChecker(MakeUintegerChecker())) // NS_DEPRECATED_3_42 - .AddAttribute("TxopLimit", - "The TXOP limit: the default value conforms to non-QoS " - "(just for the first link, in case of 11be multi-link devices).", - TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time - TimeValue(MilliSeconds(0)), - MakeTimeAccessor((void(Txop::*)(Time)) & Txop::SetTxopLimit, - (Time(Txop::*)() const) & Txop::GetTxopLimit), - MakeTimeChecker(), - TypeId::SupportLevel::OBSOLETE, - "Use TxopLimits attribute instead of TxopLimit") + .AddAttribute( + "TxopLimit", + "The TXOP limit: the default value conforms to non-QoS " + "(just for the first link, in case of 11be multi-link devices).", + TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time + TimeValue(MilliSeconds(0)), + MakeTimeAccessor(static_cast(&Txop::SetTxopLimit), + static_cast