core, lte, olsr: Fix clang-tidy warnings detected by version 20

Co-author: Gabriel Ferreira
This commit is contained in:
Eduardo Almeida
2025-09-29 15:52:16 +01:00
committed by Tommaso Pecorella
parent fda51df962
commit 6f273a55af
5 changed files with 12 additions and 13 deletions

View File

@@ -200,14 +200,14 @@ main(int argc, char* argv[])
// Create the ERV in sampling mode
Ptr<EmpiricalRandomVariable> erv = CreateObject<EmpiricalRandomVariable>();
// // Expectation for bin
erv->CDF(0.0, 0.0 / 15.0); // 0
erv->CDF(0.2, 1.0 / 15.0); // 0.2 1/15 = 2/150
erv->CDF(0.4, 3.0 / 15.0); // 0.4 2/15 = 8/150
erv->CDF(0.6, 4.0 / 15.0); // 0.6 1/15 = 6/150
erv->CDF(0.8, 7.0 / 15.0); // 0.8 3/15 = 24/150
erv->CDF(1.0, 9.0 / 15.0); // 1.0 2/15 = 20/150
erv->CDF(1.0, 15.0 / 15.0); // 1.0 6/15 = 60/150 <avg> = 120/150 = 0.8
// // Expectation for bin
erv->CDF(0.0, 0.0); // 0
erv->CDF(0.2, 1.0 / 15.0); // 0.2 1/15 = 2/150
erv->CDF(0.4, 3.0 / 15.0); // 0.4 2/15 = 8/150
erv->CDF(0.6, 4.0 / 15.0); // 0.6 1/15 = 6/150
erv->CDF(0.8, 7.0 / 15.0); // 0.8 3/15 = 24/150
erv->CDF(1.0, 9.0 / 15.0); // 1.0 2/15 = 20/150
erv->CDF(1.0, 1.0); // 1.0 6/15 = 60/150 <avg> = 120/150 = 0.8
if (single)
{

View File

@@ -268,12 +268,12 @@ main(int argc, char* argv[])
plot.AppendExtra("set xrange [*:*]");
auto x = CreateObject<EmpiricalRandomVariable>();
x->CDF(0.0, 0.0 / 15.0);
x->CDF(0.0, 0.0);
x->CDF(0.2, 1.0 / 15.0);
x->CDF(0.4, 3.0 / 15.0);
x->CDF(0.6, 6.0 / 15.0);
x->CDF(0.8, 10.0 / 15.0);
x->CDF(1.0, 15.0 / 15.0);
x->CDF(1.0, 1.0);
plot.AddDataset(
Histogram(x, probes, precision, "EmpiricalRandomVariable (Sampling)", true));

View File

@@ -1152,6 +1152,7 @@ class Int64x64DoubleTestCase : public TestCase
*
* This will lie in the closed interval [0, 64]
*/
// NOLINTNEXTLINE(misc-redundant-expression)
static constexpr int MISS_MANT_DIG = std::max(0, 64 - LDBL_MANT_DIG);
/**

View File

@@ -1217,9 +1217,6 @@ UeManager::RecvRrcConnectionReconfigurationCompleted(
// This case is added to NS-3 in order to handle bearer de-activation scenario for CONNECTED
// state UE
case CONNECTED_NORMALLY:
NS_LOG_INFO("ignoring RecvRrcConnectionReconfigurationCompleted in state " << m_state);
break;
case HANDOVER_LEAVING:
NS_LOG_INFO("ignoring RecvRrcConnectionReconfigurationCompleted in state " << m_state);
break;

View File

@@ -3032,6 +3032,7 @@ RoutingProtocol::RouteInput(Ptr<const Packet> p,
NS_LOG_LOGIC("No dynamic route, check network routes");
if (m_hnaRoutingTable->RouteInput(p, header, idev, ucb, mcb, lcb, ecb))
{
// NOLINTNEXTLINE(readability-simplify-boolean-expr)
return true;
}
else