clang-format formatting harmonization (clang-format guards)

This commit is contained in:
Eduardo Almeida
2025-01-30 17:45:52 +00:00
parent 2c4bcab296
commit 2d74cbf3fc
8 changed files with 143 additions and 152 deletions

View File

@@ -23,11 +23,13 @@ using namespace ns3;
*
* This script creates 1-dimensional grid topology and then ping last node from the first one:
*/
// clang-format off
/**
* [10.1.1.1] <-- step --> [10.1.1.2] <-- step --> [10.1.1.3] <-- step --> [10.1.1.4] <-- step --> [10.1.1.5]
*/
// clang-format on
/**
* Each node can hear only his right and his left neighbor, if they exist.
* When one third of total time expired, central node moves away.

View File

@@ -501,10 +501,12 @@ operator>(const U& lhs, const TracedValue<T>& rhs)
* @returns The result of doing the operator on
* the underlying values.
*/
// clang-format off
template <typename T, typename U>
auto
operator+(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() + rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x+x");
return TracedValue<decltype(lhs.Get() + rhs.Get())>(lhs.Get() + rhs.Get());
@@ -529,10 +531,12 @@ operator+(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs +
}
/** @copydoc operator+(const TracedValue<T>&lhs,const TracedValue<U>&rhs) */
// clang-format off
template <typename T, typename U>
auto
operator-(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() - rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x-x");
return TracedValue<decltype(lhs.Get() - rhs.Get())>(lhs.Get() - rhs.Get());
@@ -557,10 +561,12 @@ operator-(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs -
}
/** @copydoc operator+(const TracedValue<T>&lhs,const TracedValue<U>&rhs) */
// clang-format off
template <typename T, typename U>
auto
operator*(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() * rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x*x");
return TracedValue<decltype(lhs.Get() * rhs.Get())>(lhs.Get() * rhs.Get());
@@ -585,10 +591,12 @@ operator*(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs +
}
/** @copydoc operator+(const TracedValue<T>&lhs,const TracedValue<U>&rhs) */
// clang-format off
template <typename T, typename U>
auto
operator/(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() / rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x/x");
return TracedValue<decltype(lhs.Get() / rhs.Get())>(lhs.Get() / rhs.Get());
@@ -613,10 +621,12 @@ operator/(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs /
}
/** @copydoc operator+(const TracedValue<T>&lhs,const TracedValue<U>&rhs) */
// clang-format off
template <typename T, typename U>
auto
operator%(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() % rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x%x");
return TracedValue<decltype(lhs.Get() % rhs.Get())>(lhs.Get() % rhs.Get());
@@ -641,10 +651,12 @@ operator%(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs %
}
/** @copydoc operator+(const TracedValue<T>&lhs,const TracedValue<U>&rhs) */
// clang-format off
template <typename T, typename U>
auto
operator^(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() ^ rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x^x");
return TracedValue<decltype(lhs.Get() ^ rhs.Get())>(lhs.Get() ^ rhs.Get());
@@ -669,10 +681,12 @@ operator^(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs ^
}
/** @copydoc operator+(const TracedValue<T>&lhs,const TracedValue<U>&rhs) */
// clang-format off
template <typename T, typename U>
auto
operator|(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() | rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x|x");
return TracedValue<decltype(lhs.Get() | rhs.Get())>(lhs.Get() | rhs.Get());
@@ -697,10 +711,12 @@ operator|(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs |
}
/** @copydoc operator+(const TracedValue<T>&lhs,const TracedValue<U>&rhs) */
// clang-format off
template <typename T, typename U>
auto
operator&(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() & rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x&x");
return TracedValue<decltype(lhs.Get() & rhs.Get())>(lhs.Get() & rhs.Get());
@@ -725,10 +741,12 @@ operator&(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs &
}
/** @copydoc operator+(const TracedValue<T>&lhs,const TracedValue<U>&rhs) */
// clang-format off
template <typename T, typename U>
auto
operator<<(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() << rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x<<x");
return TracedValue<decltype(lhs.Get() << rhs.Get())>(lhs.Get() << rhs.Get());
@@ -753,10 +771,12 @@ operator<<(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs
}
/** @copydoc operator+(const TracedValue<T>&lhs,const TracedValue<U>&rhs) */
// clang-format off
template <typename T, typename U>
auto
operator>>(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
-> TracedValue<decltype(lhs.Get() >> rhs.Get())>
// clang-format on
{
TRACED_VALUE_DEBUG("x>>x");
return TracedValue<decltype(lhs.Get() >> rhs.Get())>(lhs.Get() >> rhs.Get());

View File

@@ -1013,20 +1013,25 @@ class MakeCallbackTemplatesTestCase : public TestCase
* Test function - does nothing.
* @{
*/
void TestFZero(){};
void TestFOne(int){};
void TestFTwo(int, int){};
void TestFThree(int, int, int){};
void TestFFour(int, int, int, int){};
void TestFFive(int, int, int, int, int){};
void TestFSix(int, int, int, int, int, int){};
void TestFROne(int&){};
void TestFRTwo(int&, int&){};
void TestFRThree(int&, int&, int&){};
void TestFRFour(int&, int&, int&, int&){};
void TestFRFive(int&, int&, int&, int&, int&){};
void TestFRSix(int&, int&, int&, int&, int&, int&){};
// clang-format off
void TestFZero() {}
void TestFOne(int) {}
void TestFTwo(int, int) {}
void TestFThree(int, int, int) {}
void TestFFour(int, int, int, int) {}
void TestFFive(int, int, int, int, int) {}
void TestFSix(int, int, int, int, int, int) {}
void TestFROne(int&) {}
void TestFRTwo(int&, int&) {}
void TestFRThree(int&, int&, int&) {}
void TestFRFour(int&, int&, int&, int&) {}
void TestFRFive(int&, int&, int&, int&, int&) {}
void TestFRSix(int&, int&, int&, int&, int&, int&) {}
// clang-format on
/** @} */
@@ -1075,20 +1080,25 @@ class CallbackTestClass : public CallbackTestParent
* Test function - does nothing.
* @{
*/
void TestZero(){};
void TestOne(int){};
void TestTwo(int, int){};
void TestThree(int, int, int){};
void TestFour(int, int, int, int){};
void TestFive(int, int, int, int, int){};
void TestSix(int, int, int, int, int, int){};
void TestCZero() const {};
void TestCOne(int) const {};
void TestCTwo(int, int) const {};
void TestCThree(int, int, int) const {};
void TestCFour(int, int, int, int) const {};
void TestCFive(int, int, int, int, int) const {};
void TestCSix(int, int, int, int, int, int) const {};
// clang-format off
void TestZero() {}
void TestOne(int) {}
void TestTwo(int, int) {}
void TestThree(int, int, int) {}
void TestFour(int, int, int, int) {}
void TestFive(int, int, int, int, int) {}
void TestSix(int, int, int, int, int, int) {}
void TestCZero() const {}
void TestCOne(int) const {}
void TestCTwo(int, int) const {}
void TestCThree(int, int, int) const {}
void TestCFour(int, int, int, int) const {}
void TestCFive(int, int, int, int, int) const {}
void TestCSix(int, int, int, int, int, int) const {}
// clang-format on
/** @} */

View File

@@ -235,39 +235,45 @@ class SimulatorTemplateTestCase : public TestCase
*
* @{
*/
void bar0(){};
void bar1(int){};
void bar2(int, int){};
void bar3(int, int, int){};
void bar4(int, int, int, int){};
void bar5(int, int, int, int, int){};
void baz1(int&){};
void baz2(int&, int&){};
void baz3(int&, int&, int&){};
void baz4(int&, int&, int&, int&){};
void baz5(int&, int&, int&, int&, int&){};
void cbaz1(const int&){};
void cbaz2(const int&, const int&){};
void cbaz3(const int&, const int&, const int&){};
void cbaz4(const int&, const int&, const int&, const int&){};
void cbaz5(const int&, const int&, const int&, const int&, const int&){};
void bar0c() const {};
void bar1c(int) const {};
void bar2c(int, int) const {};
void bar3c(int, int, int) const {};
void bar4c(int, int, int, int) const {};
void bar5c(int, int, int, int, int) const {};
void baz1c(int&) const {};
void baz2c(int&, int&) const {};
void baz3c(int&, int&, int&) const {};
void baz4c(int&, int&, int&, int&) const {};
void baz5c(int&, int&, int&, int&, int&) const {};
void cbaz1c(const int&) const {};
void cbaz2c(const int&, const int&) const {};
void cbaz3c(const int&, const int&, const int&) const {};
void cbaz4c(const int&, const int&, const int&, const int&) const {};
void cbaz5c(const int&, const int&, const int&, const int&, const int&) const {};
// clang-format off
void bar0() {}
void bar1(int) {}
void bar2(int, int) {}
void bar3(int, int, int) {}
void bar4(int, int, int, int) {}
void bar5(int, int, int, int, int) {}
void baz1(int&) {}
void baz2(int&, int&) {}
void baz3(int&, int&, int&) {}
void baz4(int&, int&, int&, int&) {}
void baz5(int&, int&, int&, int&, int&) {}
void cbaz1(const int&) {}
void cbaz2(const int&, const int&) {}
void cbaz3(const int&, const int&, const int&) {}
void cbaz4(const int&, const int&, const int&, const int&) {}
void cbaz5(const int&, const int&, const int&, const int&, const int&) {}
void bar0c() const {}
void bar1c(int) const {}
void bar2c(int, int) const {}
void bar3c(int, int, int) const {}
void bar4c(int, int, int, int) const {}
void bar5c(int, int, int, int, int) const {}
void baz1c(int&) const {}
void baz2c(int&, int&) const {}
void baz3c(int&, int&, int&) const {}
void baz4c(int&, int&, int&, int&) const {}
void baz5c(int&, int&, int&, int&, int&) const {}
void cbaz1c(const int&) const {}
void cbaz2c(const int&, const int&) const {}
void cbaz3c(const int&, const int&, const int&) const {}
void cbaz4c(const int&, const int&, const int&, const int&) const {}
void cbaz5c(const int&, const int&, const int&, const int&, const int&) const {}
// clang-format on
/** @} */
};
@@ -276,85 +282,27 @@ class SimulatorTemplateTestCase : public TestCase
*
* @{
*/
static void
foo0()
{
}
static void
foo1(int)
{
}
// clang-format off
static void
foo2(int, int)
{
}
static void foo0() {}
static void foo1(int) {}
static void foo2(int, int) {}
static void foo3(int, int, int) {}
static void foo4(int, int, int, int) {}
static void foo5(int, int, int, int, int) {}
static void ber1(int&) {}
static void ber2(int&, int&) {}
static void ber3(int&, int&, int&) {}
static void ber4(int&, int&, int&, int&) {}
static void ber5(int&, int&, int&, int&, int&) {}
static void cber1(const int&) {}
static void cber2(const int&, const int&) {}
static void cber3(const int&, const int&, const int&) {}
static void cber4(const int&, const int&, const int&, const int&) {}
static void cber5(const int&, const int&, const int&, const int&, const int&) {}
static void
foo3(int, int, int)
{
}
static void
foo4(int, int, int, int)
{
}
static void
foo5(int, int, int, int, int)
{
}
static void
ber1(int&)
{
}
static void
ber2(int&, int&)
{
}
static void
ber3(int&, int&, int&)
{
}
static void
ber4(int&, int&, int&, int&)
{
}
static void
ber5(int&, int&, int&, int&, int&)
{
}
static void
cber1(const int&)
{
}
static void
cber2(const int&, const int&)
{
}
static void
cber3(const int&, const int&, const int&)
{
}
static void
cber4(const int&, const int&, const int&, const int&)
{
}
static void
cber5(const int&, const int&, const int&, const int&, const int&)
{
}
// clang-format on
/** @} */

View File

@@ -24,20 +24,24 @@
namespace
{
// clang-format off
/// Function with one int parameter.
void bari(int){};
void bari(int) {}
/// Function with two int parameters.
void bar2i(int, int){};
void bar2i(int, int) {}
/// Function with three int parameters.
void bar3i(int, int, int){};
void bar3i(int, int, int) {}
/// Function with four int parameters.
void bar4i(int, int, int, int){};
void bar4i(int, int, int, int) {}
/// Function with five int parameters.
void bar5i(int, int, int, int, int){};
void bar5i(int, int, int, int, int) {}
/// Function with one const int reference parameter.
void barcir(const int&){};
void barcir(const int&) {}
/// Function with one int reference parameter.
void barir(int&){};
void barir(int&) {}
// clang-format on
} // anonymous namespace
@@ -106,26 +110,30 @@ class TimerTemplateTestCase : public TestCase
void DoRun() override;
void DoTeardown() override;
// clang-format off
/// Member function with one int parameter.
void bazi(int){};
void bazi(int) {}
/// Member function with two int parameters.
void baz2i(int, int){};
void baz2i(int, int) {}
/// Member function with three int parameters.
void baz3i(int, int, int){};
void baz3i(int, int, int) {}
/// Member function with four int parameters.
void baz4i(int, int, int, int){};
void baz4i(int, int, int, int) {}
/// Member function with five int parameters.
void baz5i(int, int, int, int, int){};
void baz5i(int, int, int, int, int) {}
/// Member function with six int parameters.
void baz6i(int, int, int, int, int, int){};
void baz6i(int, int, int, int, int, int) {}
/// Member function with one const int reference parameter.
void bazcir(const int&){};
void bazcir(const int&) {}
/// Member function with one int reference parameter.
void bazir(int&){};
void bazir(int&) {}
/// Member function with one int pointer parameter.
void bazip(int*){};
void bazip(int*) {}
/// Member function with one const int pointer parameter.
void bazcip(const int*){};
void bazcip(const int*) {}
// clang-format on
};
TimerTemplateTestCase::TimerTemplateTestCase()

View File

@@ -58,6 +58,7 @@ using namespace ns3;
\endverbatim
*/
// clang-format on
class HwmpDoRfRegressionTest : public TestCase
{
public:

View File

@@ -68,6 +68,7 @@ namespace olsr
\endverbatim
*/
// clang-format on
class TcRegressionTest : public TestCase
{
public:

View File

@@ -48,6 +48,7 @@ class WifiMpdu;
\endverbatim
*/
// clang-format on
/**
*
* See also OriginatorBlockAckAgreement::State