diff --git a/build-support/version-defines-template.h b/build-support/version-defines-template.h index acf65fce8..7f214035f 100644 --- a/build-support/version-defines-template.h +++ b/build-support/version-defines-template.h @@ -18,6 +18,8 @@ * Authors: Mathew Bielejeski */ +// clang-format off + #ifndef NS3_VERSION_DEFINES_H_ #define NS3_VERSION_DEFINES_H_ @@ -143,3 +145,5 @@ /** @} */ #endif + +// clang-format on diff --git a/examples/wireless/wifi-ofdm-eht-validation.cc b/examples/wireless/wifi-ofdm-eht-validation.cc index 041f73bb7..42c155bea 100644 --- a/examples/wireless/wifi-ofdm-eht-validation.cc +++ b/examples/wireless/wifi-ofdm-eht-validation.cc @@ -41,7 +41,6 @@ int main (int argc, char *argv[]) std::ofstream nistfile ("nist-frame-success-rate-be.plt"); std::ofstream tablefile ("table-frame-success-rate-be.plt"); - // clang-format off const std::vector modes { "EhtMcs0", "EhtMcs1", @@ -58,7 +57,6 @@ int main (int argc, char *argv[]) "EhtMcs12", "EhtMcs13", }; - // clang-format on CommandLine cmd (__FILE__); cmd.AddValue ("FrameSize", "The frame size", FrameSize); diff --git a/examples/wireless/wifi-ofdm-he-validation.cc b/examples/wireless/wifi-ofdm-he-validation.cc index e5d6b0dd6..b5cf7dec7 100644 --- a/examples/wireless/wifi-ofdm-he-validation.cc +++ b/examples/wireless/wifi-ofdm-he-validation.cc @@ -39,7 +39,6 @@ int main (int argc, char *argv[]) std::ofstream nistfile ("nist-frame-success-rate-ax.plt"); std::ofstream tablefile ("table-frame-success-rate-ax.plt"); - // clang-format off const std::vector modes { "HeMcs0", "HeMcs1", @@ -54,7 +53,6 @@ int main (int argc, char *argv[]) "HeMcs10", "HeMcs11", }; - // clang-format on CommandLine cmd (__FILE__); cmd.AddValue ("FrameSize", "The frame size", FrameSize); diff --git a/examples/wireless/wifi-ofdm-ht-validation.cc b/examples/wireless/wifi-ofdm-ht-validation.cc index 66e2f0b1f..92e797605 100644 --- a/examples/wireless/wifi-ofdm-ht-validation.cc +++ b/examples/wireless/wifi-ofdm-ht-validation.cc @@ -39,7 +39,6 @@ int main (int argc, char *argv[]) std::ofstream nistfile ("nist-frame-success-rate-n.plt"); std::ofstream tablefile ("table-frame-success-rate-n.plt"); - // clang-format off const std::vector modes { "HtMcs0", "HtMcs1", @@ -50,7 +49,6 @@ int main (int argc, char *argv[]) "HtMcs6", "HtMcs7", }; - // clang-format on CommandLine cmd (__FILE__); diff --git a/examples/wireless/wifi-ofdm-validation.cc b/examples/wireless/wifi-ofdm-validation.cc index cd289da38..a92b83537 100644 --- a/examples/wireless/wifi-ofdm-validation.cc +++ b/examples/wireless/wifi-ofdm-validation.cc @@ -41,7 +41,6 @@ int main (int argc, char *argv[]) std::ofstream nistfile ("nist-frame-success-rate-ofdm.plt"); std::ofstream tablefile ("table-frame-success-rate-ofdm.plt"); - // clang-format off const std::vector modes { "OfdmRate6Mbps", "OfdmRate9Mbps", @@ -52,7 +51,6 @@ int main (int argc, char *argv[]) "OfdmRate48Mbps", "OfdmRate54Mbps", }; - // clang-format on CommandLine cmd (__FILE__); cmd.AddValue ("FrameSize", "The frame size in bytes", FrameSize); diff --git a/examples/wireless/wifi-ofdm-vht-validation.cc b/examples/wireless/wifi-ofdm-vht-validation.cc index 93ff53fff..5a05e6674 100644 --- a/examples/wireless/wifi-ofdm-vht-validation.cc +++ b/examples/wireless/wifi-ofdm-vht-validation.cc @@ -40,7 +40,6 @@ int main (int argc, char *argv[]) std::ofstream nistfile ("nist-frame-success-rate-ac.plt"); std::ofstream tablefile ("table-frame-success-rate-ac.plt"); - // clang-format off const std::vector modes { "VhtMcs0", "VhtMcs1", @@ -52,7 +51,6 @@ int main (int argc, char *argv[]) "VhtMcs7", "VhtMcs8", }; - // clang-format on CommandLine cmd (__FILE__); cmd.AddValue ("FrameSize", "The frame size in bytes", FrameSize); diff --git a/src/core/examples/hash-example.cc b/src/core/examples/hash-example.cc index 537908a2e..2293ca864 100644 --- a/src/core/examples/hash-example.cc +++ b/src/core/examples/hash-example.cc @@ -191,11 +191,9 @@ public: switch (m_bits) { - /* *NS_CHECK_STYLE_OFF* */ case Bits32: name += " (32-bit version)"; break; case Bits64: name += " (64-bit version)"; break; default: name += " (unknown!?!)"; - /* *NS_CHECK_STYLE_ON* */ } return name; } diff --git a/src/core/helper/csv-reader.h b/src/core/helper/csv-reader.h index 40098de8b..de78bbed2 100644 --- a/src/core/helper/csv-reader.h +++ b/src/core/helper/csv-reader.h @@ -45,8 +45,6 @@ namespace ns3 { * A way to extract data from simple csv files. */ -// *NS_CHECK_STYLE_OFF* Style checker trims blank lines in code blocks - /** * \ingroup csvreader * @@ -231,7 +229,6 @@ namespace ns3 { * foo, "String with ""embedded"" quotes" * \endcode */ -// *NS_CHECK_STYLE_ON* class CsvReader { public: diff --git a/src/core/model/cairo-wideint-private.h b/src/core/model/cairo-wideint-private.h index 07b424082..657dcc2a6 100644 --- a/src/core/model/cairo-wideint-private.h +++ b/src/core/model/cairo-wideint-private.h @@ -49,7 +49,7 @@ // extern const char * cairo_impl64; // extern const char * cairo_impl128; -// *NS_CHECK_STYLE_OFF* +// clang-format off /*for compatibility with MacOS and Cygwin*/ #ifndef HAVE_STDINT_H @@ -360,6 +360,6 @@ _cairo_int_96by64_32x64_divrem (cairo_int128_t num, }; #endif -// *NS_CHECK_STYLE_ON* + // clang-format on #endif /* CAIRO_WIDEINT_H */ diff --git a/src/core/model/cairo-wideint.c b/src/core/model/cairo-wideint.c index 3d9fe065f..9304f0f24 100644 --- a/src/core/model/cairo-wideint.c +++ b/src/core/model/cairo-wideint.c @@ -40,7 +40,7 @@ * Implementation of the cairo_x functions which implement high precision arithmetic. */ -// *NS_CHECK_STYLE_OFF* +// clang-format off #if HAVE_UINT64_T @@ -825,3 +825,5 @@ _cairo_int_96by64_32x64_divrem (cairo_int128_t num, cairo_int64_t den) qr.quo = uqr.quo; return qr; } + +// clang-format on diff --git a/src/core/model/command-line.cc b/src/core/model/command-line.cc index 9c49e76bf..a6505c0d5 100644 --- a/src/core/model/command-line.cc +++ b/src/core/model/command-line.cc @@ -65,7 +65,6 @@ Encode (const std::string & source) for(size_t pos = 0; pos != source.size (); ++pos) { - /* *NS_CHECK_STYLE_OFF* */ switch (source[pos]) { case '&': buffer.append ("&"); break; @@ -91,7 +90,6 @@ Encode (const std::string & source) default: buffer.append (&source[pos], 1); break; } - /* *NS_CHECK_STYLE_ON* */ } return buffer; } diff --git a/src/core/model/hash-fnv.cc b/src/core/model/hash-fnv.cc index 62e87b969..0e5472cdf 100644 --- a/src/core/model/hash-fnv.cc +++ b/src/core/model/hash-fnv.cc @@ -69,7 +69,7 @@ extern "C" { // Changes from FNV distribution are marked with `//PDB' // -/* Begin fnv.h -------------- *NS_CHECK_STYLE_OFF* ----> */ +// clang-format off /* * fnv - Fowler/Noll/Vo- hash code @@ -292,10 +292,6 @@ enum fnv_type { #endif /* __FNV_H__ */ -/* End fnv.h ---------------- *NS_CHECK_STYLE_ON* -----> */ - -/* Begin hash_32a.c --------- *NS_CHECK_STYLE_OFF* ----> */ - /* * hash_32 - 32 bit Fowler/Noll/Vo FNV-1a hash code * @@ -439,10 +435,6 @@ fnv_32a_str(char *str, Fnv32_t hval) return hval; } -/* End hash_32a.c ----------- *NS_CHECK_STYLE_ON* -----> */ - -/* Begin hash_64a.c --------- *NS_CHECK_STYLE_OFF* ----> */ - /* * hash_64 - 64 bit Fowler/Noll/Vo-0 FNV-1a hash code * @@ -735,9 +727,9 @@ fnv_64a_str(char *str, Fnv64_t hval) return hval; } -/* End hash_64a.c ----------- *NS_CHECK_STYLE_ON* -----> */ +// clang-format on -} /* extern "C" */ +} /* extern "C" */ //----------------------------------------------------------------------------- diff --git a/src/core/model/hash-murmur3.cc b/src/core/model/hash-murmur3.cc index 5b1e05110..92cf59fbc 100644 --- a/src/core/model/hash-murmur3.cc +++ b/src/core/model/hash-murmur3.cc @@ -72,7 +72,7 @@ namespace Murmur3Implementation { // Adapted from http://code.google.com/p/smhasher/ -// Begin Murmur3.cpp -------- *NS_CHECK_STYLE_OFF* ----> +// clang-format off // //----------------------------------------------------------------------------- @@ -505,8 +505,7 @@ void MurmurHash3_x64_128 ( const void * key, const std::size_t len, ((uint32_t *)out)[1] = static_cast (h2); //PDB cast } - -// End Murmur3.cpp ---------- *NS_CHECK_STYLE_ON* -----> +// clang-format on #undef BIG_CONSTANT diff --git a/src/core/model/int64x64-128.h b/src/core/model/int64x64-128.h index 5ddc8b917..939e57190 100644 --- a/src/core/model/int64x64-128.h +++ b/src/core/model/int64x64-128.h @@ -329,10 +329,11 @@ private: * \param [in] rhs Right hand argument * \return The result of the operator. */ - // *NS_CHECK_STYLE_OFF* - friend inline bool operator == (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v == rhs._v; }; - friend inline bool operator < (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v < rhs._v; }; - friend inline bool operator > (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v > rhs._v; }; + + + friend inline bool operator == (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v == rhs._v; } + friend inline bool operator < (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v < rhs._v; } + friend inline bool operator > (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v > rhs._v; } friend inline int64x64_t & operator += (int64x64_t & lhs, const int64x64_t & rhs) { @@ -354,7 +355,7 @@ private: lhs.Div (rhs); return lhs; }; - // *NS_CHECK_STYLE_ON* + /**@}*/ /** diff --git a/src/core/model/int64x64-cairo.h b/src/core/model/int64x64-cairo.h index 4b4c6c932..67ea4ffac 100644 --- a/src/core/model/int64x64-cairo.h +++ b/src/core/model/int64x64-cairo.h @@ -308,10 +308,10 @@ private: * \param [in] rhs Right hand argument * \return The result of the operator. */ - // *NS_CHECK_STYLE_OFF* - friend inline bool operator == (const int64x64_t & lhs, const int64x64_t & rhs) { return _cairo_int128_eq (lhs._v, rhs._v); }; - friend inline bool operator < (const int64x64_t & lhs, const int64x64_t & rhs) { return _cairo_int128_lt (lhs._v, rhs._v); }; - friend inline bool operator > (const int64x64_t & lhs, const int64x64_t & rhs) { return _cairo_int128_gt (lhs._v, rhs._v); }; + + friend inline bool operator == (const int64x64_t & lhs, const int64x64_t & rhs) { return _cairo_int128_eq (lhs._v, rhs._v); } + friend inline bool operator < (const int64x64_t & lhs, const int64x64_t & rhs) { return _cairo_int128_lt (lhs._v, rhs._v); } + friend inline bool operator > (const int64x64_t & lhs, const int64x64_t & rhs) { return _cairo_int128_gt (lhs._v, rhs._v); } friend inline int64x64_t & operator += (int64x64_t & lhs, const int64x64_t & rhs) { @@ -333,7 +333,7 @@ private: lhs.Div (rhs); return lhs; }; - // *NS_CHECK_STYLE_ON* + /** @} */ /** diff --git a/src/core/model/int64x64-double.h b/src/core/model/int64x64-double.h index 2a54a4bac..13d9a353e 100644 --- a/src/core/model/int64x64-double.h +++ b/src/core/model/int64x64-double.h @@ -301,10 +301,10 @@ private: * \param [in] rhs Right hand argument * \return The result of the operator. */ - // *NS_CHECK_STYLE_OFF* - friend inline bool operator == (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v == rhs._v; }; - friend inline bool operator < (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v < rhs._v; }; - friend inline bool operator > (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v > rhs._v; }; + + friend inline bool operator == (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v == rhs._v; } + friend inline bool operator < (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v < rhs._v; } + friend inline bool operator > (const int64x64_t & lhs, const int64x64_t & rhs) { return lhs._v > rhs._v; } friend inline int64x64_t & operator += ( int64x64_t & lhs, const int64x64_t & rhs) { @@ -326,7 +326,7 @@ private: lhs._v /= rhs._v; return lhs; }; - // *NS_CHECK_STYLE_ON* + /**@}*/ /** diff --git a/src/core/model/rng-stream.cc b/src/core/model/rng-stream.cc index 5ab88d3cc..a2054d94c 100644 --- a/src/core/model/rng-stream.cc +++ b/src/core/model/rng-stream.cc @@ -49,7 +49,7 @@ NS_LOG_COMPONENT_DEFINE ("RngStream"); /** Namespace for MRG32k3a implementation details. */ namespace MRG32k3a { -// *NS_CHECK_STYLE_OFF* +// clang-format off /** Type for 3x3 matrix of doubles. */ typedef double Matrix[3][3]; @@ -325,7 +325,7 @@ void PowerOfTwoMatrix (int n, Matrix a1p, Matrix a2p) } // namespace MRG32k3a -// *NS_CHECK_STYLE_ON* +// clang-format on namespace ns3 { diff --git a/src/core/model/time-printer.cc b/src/core/model/time-printer.cc index 0a4158ebf..b54ad76f4 100644 --- a/src/core/model/time-printer.cc +++ b/src/core/model/time-printer.cc @@ -43,12 +43,10 @@ DefaultTimePrinter (std::ostream &os) os << std::fixed; switch (Time::GetResolution ()) { - // *NS_CHECK_STYLE_OFF* case Time::US : os << std::setprecision (6); break; case Time::NS : os << std::setprecision (9); break; case Time::PS : os << std::setprecision (12); break; case Time::FS : os << std::setprecision (15); break; - // *NS_CHECK_STYLE_ON* default: // default C++ precision of 5 diff --git a/src/core/model/time.cc b/src/core/model/time.cc index 1e3a08cac..c4572de39 100644 --- a/src/core/model/time.cc +++ b/src/core/model/time.cc @@ -456,7 +456,6 @@ operator << (std::ostream & os, const TimeWithUnit & timeU) switch (unit) { - // *NS_CHECK_STYLE_OFF* case Time::Y: label = "y"; break; case Time::D: label = "d"; break; case Time::H: label = "h"; break; @@ -467,7 +466,6 @@ operator << (std::ostream & os, const TimeWithUnit & timeU) case Time::NS: label = "ns"; break; case Time::PS: label = "ps"; break; case Time::FS: label = "fs"; break; - // *NS_CHECK_STYLE_ON* case Time::LAST: case Time::AUTO: diff --git a/src/core/model/valgrind.h b/src/core/model/valgrind.h index 6f9536840..068c2bde9 100644 --- a/src/core/model/valgrind.h +++ b/src/core/model/valgrind.h @@ -1,4 +1,6 @@ -/* -*- c -*- *NS_CHECK_STYLE_OFF* +// clang-format off + +/* -*- c -*- ---------------------------------------------------------------- Notice that the following BSD-style license applies to this one @@ -5623,4 +5625,4 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) #endif /* __VALGRIND_H */ -/* *NS_CHECK_STYLE_ON* */ +// clang-format on diff --git a/src/core/test/build-profile-test-suite.cc b/src/core/test/build-profile-test-suite.cc index 49e349119..10f263f37 100644 --- a/src/core/test/build-profile-test-suite.cc +++ b/src/core/test/build-profile-test-suite.cc @@ -64,7 +64,6 @@ BuildProfileTestCase::DoRun (void) int i = 0; int j = 0; - /* *NS_CHECK_STYLE_OFF* */ #ifdef NS3_BUILD_PROFILE_DEBUG std::cout << GetName () << ": running in build profile debug" << std::endl; NS_BUILD_DEBUG (++i; ++j); @@ -77,7 +76,6 @@ BuildProfileTestCase::DoRun (void) #else NS_TEST_ASSERT_MSG_EQ (0, 1, ": no build profile case executed"); #endif - /* *NS_CHECK_STYLE_ON* */ if (i == 1) { diff --git a/src/core/test/callback-test-suite.cc b/src/core/test/callback-test-suite.cc index d62924a13..350158ac5 100644 --- a/src/core/test/callback-test-suite.cc +++ b/src/core/test/callback-test-suite.cc @@ -947,27 +947,25 @@ private: bool m_test1; //!< true if Target1 has been called, false otherwise. }; -/* *NS_CHECK_STYLE_OFF* */ /** * Test function - does nothing. * @{ */ -void TestFZero (void) {} -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 TestFZero (void) {}; +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 &) {} +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 &) {}; /** @} */ -/* *NS_CHECK_STYLE_ON* */ /** * \ingroup callback-tests @@ -1005,27 +1003,25 @@ private: class CallbackTestClass : public CallbackTestParent { public: - /* *NS_CHECK_STYLE_OFF* */ /** * Test function - does nothing. * @{ */ - void TestZero (void) {} - 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 (void) 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 {} + void TestZero (void) {}; + 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 (void) 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 {}; /** @} */ - /* *NS_CHECK_STYLE_ON* */ /** * Tries to make a callback to public and protected functions of a class. diff --git a/src/core/test/int64x64-test-suite.cc b/src/core/test/int64x64-test-suite.cc index 663527e0d..e48c89564 100644 --- a/src/core/test/int64x64-test-suite.cc +++ b/src/core/test/int64x64-test-suite.cc @@ -811,6 +811,8 @@ Int64x64Bug1786TestCase::DoRun (void) // by one count in the last place // because operator<< truncates the last output digit, // instead of rounding. + + // clang-format off Check ( 1ULL, "+0.0000000000000000000542"); Check ( 2ULL, "+0.0000000000000000001084"); Check ( 3ULL, "+0.0000000000000000001626"); @@ -871,6 +873,7 @@ Int64x64Bug1786TestCase::DoRun (void) Check (0xFFFFFFFFFFFFFFFDULL, "+0.9999999999999999998374", tolerance); Check (0xFFFFFFFFFFFFFFFEULL, "+0.9999999999999999998916", tolerance); Check (0xFFFFFFFFFFFFFFFFULL, "+0.9999999999999999999458", tolerance); + // clang-format on } @@ -1558,12 +1561,10 @@ Int64x64ImplTestCase::DoRun (void) std::cout << "int64x64_t::implementation: "; switch (int64x64_t::implementation) { - /* *NS_CHECK_STYLE_OFF* */ case (int64x64_t::int128_impl) : std::cout << "int128_impl"; break; case (int64x64_t::cairo_impl) : std::cout << "cairo_impl"; break; case (int64x64_t::ld_impl) : std::cout << "ld_impl"; break; default : std::cout << "unknown!"; - /* *NS_CHECK_STYLE_ON* */ } std::cout << std::endl; diff --git a/src/core/test/simulator-test-suite.cc b/src/core/test/simulator-test-suite.cc index 1f2c32637..d1c11ad7f 100644 --- a/src/core/test/simulator-test-suite.cc +++ b/src/core/test/simulator-test-suite.cc @@ -236,48 +236,45 @@ public: private: virtual void DoRun (void); - /* *NS_CHECK_STYLE_OFF* */ /** * Function used for scheduling. * * @{ */ - void bar0 (void) {} - 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 bar0 (void) {}; + 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 (void) 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 {} + void bar0c (void) 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 {}; /** @} */ - /* *NS_CHECK_STYLE_ON* */ - }; /** diff --git a/src/core/test/timer-test-suite.cc b/src/core/test/timer-test-suite.cc index a05f40bf4..cae42c50c 100644 --- a/src/core/test/timer-test-suite.cc +++ b/src/core/test/timer-test-suite.cc @@ -35,22 +35,24 @@ namespace { -/* *NS_CHECK_STYLE_OFF* */ +// 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 &) {} -/* *NS_CHECK_STYLE_ON* */ +void barir (int &) {}; + +// clang-format on } // anonymous namespace @@ -117,28 +119,26 @@ public: virtual void DoRun (void); virtual void DoTeardown (void); - /* *NS_CHECK_STYLE_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 *) {} - /* *NS_CHECK_STYLE_ON* */ + void bazcip (const int *) {}; }; TimerTemplateTestCase::TimerTemplateTestCase () diff --git a/src/lte/model/lte-mi-error-model.cc b/src/lte/model/lte-mi-error-model.cc index 101b21bd1..ae201571c 100644 --- a/src/lte/model/lte-mi-error-model.cc +++ b/src/lte/model/lte-mi-error-model.cc @@ -157,6 +157,7 @@ static const double MI_map_64qam_axis[MI_MAP_64QAM_SIZE] = { }; +// clang-format off /// BECR table static const double bEcrTable [9][38] = { @@ -243,7 +244,6 @@ static const double bEcrTable [9][38] = { }, }; - /// CECR table static const double cEcrTable [9][38] = { // CB of 40 bits @@ -327,9 +327,10 @@ static const double cEcrTable [9][38] = { 0.00303, 0.00377, 0.00507, // 64QAM retx 0.0060, 0.00609, 0.0061, 0.0066, 0.0069, 0.0080, 0.0081, 0.0080, 0.0077, 0.0068, 0.0066, 0.0058 // 64QAM } - }; +// clang-format on + double LteMiErrorModel::Mib (const SpectrumValue& sinr, const std::vector& map, uint8_t mcs) diff --git a/src/wifi/model/eht/eht-phy.cc b/src/wifi/model/eht/eht-phy.cc index 9b6aa72ab..c49c677c3 100644 --- a/src/wifi/model/eht/eht-phy.cc +++ b/src/wifi/model/eht/eht-phy.cc @@ -33,7 +33,8 @@ NS_LOG_COMPONENT_DEFINE ("EhtPhy"); * EHT PHY (P802.11be/D1.5) *******************************************************/ -/* *NS_CHECK_STYLE_OFF* */ +// clang-format off + const PhyEntity::PpduFormats EhtPhy::m_ehtPpduFormats { { WIFI_PREAMBLE_EHT_MU, { WIFI_PPDU_FIELD_PREAMBLE, //L-STF + L-LTF WIFI_PPDU_FIELD_NON_HT_HEADER, //L-SIG + RL-SIG @@ -47,7 +48,8 @@ const PhyEntity::PpduFormats EhtPhy::m_ehtPpduFormats { WIFI_PPDU_FIELD_TRAINING, //EHT-STF + EHT-LTFs WIFI_PPDU_FIELD_DATA } } }; -/* *NS_CHECK_STYLE_ON* */ + +// clang-format on EhtPhy::EhtPhy (bool buildModeList /* = true */) : HePhy (false) //don't add HE modes to list diff --git a/src/wifi/model/he/he-phy.cc b/src/wifi/model/he/he-phy.cc index f2e524124..98c1025d9 100644 --- a/src/wifi/model/he/he-phy.cc +++ b/src/wifi/model/he/he-phy.cc @@ -44,7 +44,8 @@ NS_LOG_COMPONENT_DEFINE ("HePhy"); * HE PHY (P802.11ax/D4.0, clause 27) *******************************************************/ -/* *NS_CHECK_STYLE_OFF* */ +// clang-format off + const PhyEntity::PpduFormats HePhy::m_hePpduFormats { //Ignoring PE (Packet Extension) { WIFI_PREAMBLE_HE_SU, { WIFI_PPDU_FIELD_PREAMBLE, //L-STF + L-LTF WIFI_PPDU_FIELD_NON_HT_HEADER, //L-SIG + RL-SIG @@ -68,7 +69,8 @@ const PhyEntity::PpduFormats HePhy::m_hePpduFormats { //Ignoring PE (Packet Exte WIFI_PPDU_FIELD_TRAINING, //HE-STF + HE-LTFs WIFI_PPDU_FIELD_DATA } } }; -/* *NS_CHECK_STYLE_ON* */ + +// clang-format on HePhy::HePhy (bool buildModeList /* = true */) : VhtPhy (false), //don't add VHT modes to list diff --git a/src/wifi/model/he/he-ru.cc b/src/wifi/model/he/he-ru.cc index 028e653cb..0aff43bfa 100644 --- a/src/wifi/model/he/he-ru.cc +++ b/src/wifi/model/he/he-ru.cc @@ -354,7 +354,7 @@ const HeRu::RuAllocationMap HeRu::m_heRuAllocations = { {HeRu::RuSpec{HeRu::RU_484_TONE, 1, true}}}, {208, {HeRu::RuSpec{HeRu::RU_996_TONE, 1, true}}}, - // clang-formt on + // clang-format on }; std::vector diff --git a/src/wifi/model/ht/ht-phy.cc b/src/wifi/model/ht/ht-phy.cc index 7ef4e19ab..1b7e16a4a 100644 --- a/src/wifi/model/ht/ht-phy.cc +++ b/src/wifi/model/ht/ht-phy.cc @@ -36,7 +36,8 @@ NS_LOG_COMPONENT_DEFINE ("HtPhy"); * HT PHY (IEEE 802.11-2016, clause 19) *******************************************************/ -/* *NS_CHECK_STYLE_OFF* */ +// clang-format off + const PhyEntity::PpduFormats HtPhy::m_htPpduFormats { { WIFI_PREAMBLE_HT_MF, { WIFI_PPDU_FIELD_PREAMBLE, //L-STF + L-LTF WIFI_PPDU_FIELD_NON_HT_HEADER, //L-SIG @@ -44,7 +45,8 @@ const PhyEntity::PpduFormats HtPhy::m_htPpduFormats { WIFI_PPDU_FIELD_TRAINING, //HT-STF + HT-LTFs WIFI_PPDU_FIELD_DATA } } }; -/* *NS_CHECK_STYLE_ON* */ + +// clang-format on HtPhy::HtPhy (uint8_t maxNss /* = 1 */, bool buildModeList /* = true */) : OfdmPhy (OFDM_PHY_DEFAULT, false) //don't add OFDM modes to list diff --git a/src/wifi/model/non-ht/dsss-phy.cc b/src/wifi/model/non-ht/dsss-phy.cc index b4541a1ea..01105994c 100644 --- a/src/wifi/model/non-ht/dsss-phy.cc +++ b/src/wifi/model/non-ht/dsss-phy.cc @@ -38,7 +38,8 @@ NS_LOG_COMPONENT_DEFINE ("DsssPhy"); * HR/DSSS PHY (IEEE 802.11-2016, clause 16) *******************************************************/ -/* *NS_CHECK_STYLE_OFF* */ +// clang-format off + const PhyEntity::PpduFormats DsssPhy::m_dsssPpduFormats { { WIFI_PREAMBLE_LONG, { WIFI_PPDU_FIELD_PREAMBLE, //PHY preamble WIFI_PPDU_FIELD_NON_HT_HEADER, //PHY header @@ -55,7 +56,8 @@ const PhyEntity::ModulationLookupTable DsssPhy::m_dsssModulationLookupTable { { "DsssRate5_5Mbps", { WIFI_CODE_RATE_UNDEFINED, 16 } }, { "DsssRate11Mbps", { WIFI_CODE_RATE_UNDEFINED, 256 } } }; -/* *NS_CHECK_STYLE_ON* */ + +// clang-format on /// DSSS rates in bits per second static const std::array s_dsssRatesBpsList = {1000000, 2000000, 5500000, 11000000}; diff --git a/src/wifi/model/non-ht/erp-ofdm-phy.cc b/src/wifi/model/non-ht/erp-ofdm-phy.cc index b2685ae1d..991aad3a9 100644 --- a/src/wifi/model/non-ht/erp-ofdm-phy.cc +++ b/src/wifi/model/non-ht/erp-ofdm-phy.cc @@ -36,7 +36,8 @@ NS_LOG_COMPONENT_DEFINE ("ErpOfdmPhy"); * ERP-OFDM PHY (IEEE 802.11-2016, clause 18) *******************************************************/ -/* *NS_CHECK_STYLE_OFF* */ +// clang-format off + const PhyEntity::ModulationLookupTable ErpOfdmPhy::m_erpOfdmModulationLookupTable { // Unique name Code rate Constellation size { "ErpOfdmRate6Mbps", { WIFI_CODE_RATE_1_2, 2 } }, @@ -54,7 +55,7 @@ static const std::array s_erpOfdmRatesBpsList = { 6000000, 9000000, 12000000, 18000000, 24000000, 36000000, 48000000, 54000000}; -/* *NS_CHECK_STYLE_ON* */ +// clang-format on /** * Get the array of possible ERP OFDM rates. diff --git a/src/wifi/model/non-ht/ofdm-phy.cc b/src/wifi/model/non-ht/ofdm-phy.cc index aa32f159f..51ae71407 100644 --- a/src/wifi/model/non-ht/ofdm-phy.cc +++ b/src/wifi/model/non-ht/ofdm-phy.cc @@ -38,7 +38,8 @@ NS_LOG_COMPONENT_DEFINE ("OfdmPhy"); * OFDM PHY (IEEE 802.11-2016, clause 17) *******************************************************/ -/* *NS_CHECK_STYLE_OFF* */ +// clang-format off + const PhyEntity::PpduFormats OfdmPhy::m_ofdmPpduFormats { { WIFI_PREAMBLE_LONG, { WIFI_PPDU_FIELD_PREAMBLE, //STF + LTF WIFI_PPDU_FIELD_NON_HT_HEADER, //SIG @@ -85,7 +86,7 @@ const std::map > s_ofdmRatesBpsList = { 1500000, 2250000, 3000000, 4500000, 6000000, 9000000, 12000000, 13500000 }}}; -/* *NS_CHECK_STYLE_ON* */ +// clang-format on /** * Get the array of possible OFDM rates for each bandwidth (MHz). diff --git a/src/wifi/model/phy-entity.h b/src/wifi/model/phy-entity.h index 93cd85840..c75e83ec4 100644 --- a/src/wifi/model/phy-entity.h +++ b/src/wifi/model/phy-entity.h @@ -111,7 +111,6 @@ public: */ struct PhyFieldRxStatus { - /* *NS_CHECK_STYLE_OFF* */ bool isSuccess {true}; //!< outcome (\c true if success) of the reception WifiPhyRxfailureReason reason {UNKNOWN}; //!< failure reason PhyRxFailureAction actionIfFailure {DROP}; //!< action to perform in case of failure \see PhyRxFailureAction @@ -120,7 +119,7 @@ public: * * \param s \c true if success */ - PhyFieldRxStatus (bool s) : isSuccess (s) {}; + PhyFieldRxStatus (bool s) : isSuccess (s) {} /** * Constructor. * @@ -128,8 +127,7 @@ public: * \param r reason of failure * \param a action to perform in case of failure */ - PhyFieldRxStatus (bool s, WifiPhyRxfailureReason r, PhyRxFailureAction a) : isSuccess (s), reason (r), actionIfFailure (a) {}; - /* *NS_CHECK_STYLE_ON* */ + PhyFieldRxStatus (bool s, WifiPhyRxfailureReason r, PhyRxFailureAction a) : isSuccess (s), reason (r), actionIfFailure (a) {} }; /** @@ -142,14 +140,14 @@ public: /** * Default constructor. */ - SnrPer () {}; + SnrPer () {} /** * Constructor for SnrPer. * * \param s the SNR in linear scale * \param p the PER */ - SnrPer (double s, double p) : snr (s), per (p) {}; + SnrPer (double s, double p) : snr (s), per (p) {} }; /** diff --git a/src/wifi/model/vht/vht-phy.cc b/src/wifi/model/vht/vht-phy.cc index 261f313a6..4723d1681 100644 --- a/src/wifi/model/vht/vht-phy.cc +++ b/src/wifi/model/vht/vht-phy.cc @@ -38,7 +38,8 @@ NS_LOG_COMPONENT_DEFINE ("VhtPhy"); * VHT PHY (IEEE 802.11-2016, clause 21) *******************************************************/ -/* *NS_CHECK_STYLE_OFF* */ +// clang-format off + const PhyEntity::PpduFormats VhtPhy::m_vhtPpduFormats { { WIFI_PREAMBLE_VHT_SU, { WIFI_PPDU_FIELD_PREAMBLE, //L-STF + L-LTF WIFI_PPDU_FIELD_NON_HT_HEADER, //L-SIG @@ -89,7 +90,7 @@ const std::map secondaryChannels { {80, WIFI_CHANLIST_SECONDARY80} }; -/* *NS_CHECK_STYLE_ON* */ +// clang-format on VhtPhy::VhtPhy (bool buildModeList /* = true */) : HtPhy (1, false) //don't add HT modes to list diff --git a/utils/print-introspected-doxygen.cc b/utils/print-introspected-doxygen.cc index 54c1388ac..3b88428e1 100644 --- a/utils/print-introspected-doxygen.cc +++ b/utils/print-introspected-doxygen.cc @@ -1528,6 +1528,7 @@ PrintAttributeImplementations (std::ostream & os) { NS_LOG_FUNCTION_NOARGS (); + // clang-format off const AttributeDescriptor attributes [] = { // Name Type see Base header-file @@ -1574,6 +1575,7 @@ PrintAttributeImplementations (std::ostream & os) { "Uinteger", "uint64_t", false, "uinteger.h" }, { "", "", false, "last placeholder" } }; + // clang-format on int i = 0; while (attributes[i].m_name != "")