Add clang-tidy guards

This commit is contained in:
Eduardo Almeida
2022-09-05 01:51:52 +01:00
parent 2e2c3d7cba
commit b34e5426a5
7 changed files with 22 additions and 1 deletions

View File

@@ -113,6 +113,7 @@ void EqualityOperators ()
Length twoMeter = Meters (2);
Length threeMeter = Meters (3);
// NOLINTBEGIN(misc-redundant-expression)
std::cout << "\n"
<< "Comparison Operations:\n" << std::boolalpha
<< "Equality: " << oneMeter << " == " << oneMeter << " is " << (oneMeter == oneMeter)
@@ -134,6 +135,7 @@ void EqualityOperators ()
<< "Greater: " << oneMeter << " > " << twoMeter << " is " << (oneMeter > twoMeter)
<< "\n"
<< "Greater: " << threeMeter << " > " << oneMeter << " is " << (threeMeter > oneMeter) << std::endl;
// NOLINTEND(misc-redundant-expression)
}
/**

View File

@@ -49,6 +49,7 @@
// extern const char * cairo_impl64;
// extern const char * cairo_impl128;
// NOLINTBEGIN
// clang-format off
/*for compatibility with MacOS and Cygwin*/
@@ -361,5 +362,6 @@ _cairo_int_96by64_32x64_divrem (cairo_int128_t num,
#endif
// clang-format on
// NOLINTEND
#endif /* CAIRO_WIDEINT_H */

View File

@@ -40,6 +40,7 @@
* Implementation of the cairo_x functions which implement high precision arithmetic.
*/
// NOLINTBEGIN
// clang-format off
#if HAVE_UINT64_T
@@ -827,3 +828,4 @@ _cairo_int_96by64_32x64_divrem (cairo_int128_t num, cairo_int64_t den)
}
// clang-format on
// NOLINTEND

View File

@@ -69,6 +69,7 @@ extern "C" {
// Changes from FNV distribution are marked with `//PDB'
//
// NOLINTBEGIN
// clang-format off
/*
@@ -728,6 +729,7 @@ fnv_64a_str(char *str, Fnv64_t hval)
}
// clang-format on
// NOLINTEND
} /* extern "C" */

View File

@@ -72,6 +72,7 @@ namespace Murmur3Implementation {
// Adapted from http://code.google.com/p/smhasher/
// NOLINTBEGIN
// clang-format off
//
@@ -506,6 +507,7 @@ void MurmurHash3_x64_128 ( const void * key, const std::size_t len,
}
// clang-format on
// NOLINTEND
#undef BIG_CONSTANT

View File

@@ -498,6 +498,7 @@ Int64x64ArithmeticTestCase::DoRun (void)
std::cout << GetParent ()->GetName () << " Arithmetic: " << GetName ()
<< std::endl;
// NOLINTBEGIN(misc-redundant-expression)
Check ( 0, zero - zero, zero );
Check ( 1, zero - one, -one );
Check ( 2, one - one, zero );
@@ -522,6 +523,7 @@ Int64x64ArithmeticTestCase::DoRun (void)
Check (19, (-one ) * (-one ), one );
Check (20, (two * thre ) / thre, two );
// NOLINTEND(misc-redundant-expression)
const int64x64_t frac = int64x64_t (0, 0xc000000000000000ULL); // 0.75
const int64x64_t fplf2 = frac + frac * frac; // 1.3125
@@ -534,9 +536,9 @@ Int64x64ArithmeticTestCase::DoRun (void)
const int64x64_t twof = two + frac;
const int64x64_t thref = thre + frac;
// NOLINTBEGIN(misc-redundant-expression)
Check (23, zerof, frac);
Check (24, zerof - zerof, zero );
Check (25, zerof - onef, -one );
Check (26, onef - onef, zero );
@@ -562,6 +564,7 @@ Int64x64ArithmeticTestCase::DoRun (void)
Check (43, onef * onef, onef + fplf2 );
Check (44, onef * (-onef), -onef - fplf2 );
Check (45, (-onef) * (-onef), onef + fplf2 );
// NOLINTEND(misc-redundant-expression)
// Multiplication followed by division is exact:
@@ -812,6 +815,7 @@ Int64x64Bug1786TestCase::DoRun (void)
// because operator<< truncates the last output digit,
// instead of rounding.
// NOLINTBEGIN(misc-redundant-expression)
// clang-format off
Check( 1ULL, "+0.0000000000000000000542");
Check( 2ULL, "+0.0000000000000000001084");
@@ -874,6 +878,7 @@ Int64x64Bug1786TestCase::DoRun (void)
Check(0xFFFFFFFFFFFFFFFEULL, "+0.9999999999999999998916", tolerance);
Check(0xFFFFFFFFFFFFFFFFULL, "+0.9999999999999999999458", tolerance);
// clang-format on
// NOLINTEND(misc-redundant-expression)
}
@@ -932,6 +937,7 @@ Int64x64CompareTestCase::DoRun (void)
const int64x64_t monef = mone - frac;
const int64x64_t mtwof = mtwo - frac;
// NOLINTBEGIN(misc-redundant-expression)
Check ( zerof == zerof, true, "equality, zero");
Check ( onef == onef, true, "equality, positive");
Check ( mtwof == mtwof, true, "equality, negative");
@@ -990,6 +996,7 @@ Int64x64CompareTestCase::DoRun (void)
Check ( (!one) == false, true, "!one == false");
Check ( (+onef) == onef, true, "unary positive");
Check ( (-onef) == monef, true, "unary negative");
// NOLINTEND(misc-redundant-expression)
}

View File

@@ -45,6 +45,8 @@
#include <map>
#include <unordered_map>
// NOLINTBEGIN(modernize-use-override)
namespace ns3 {
/**
@@ -497,4 +499,6 @@ typedef NixVectorRouting<Ipv4RoutingProtocol> Ipv4NixVectorRouting;
typedef NixVectorRouting<Ipv6RoutingProtocol> Ipv6NixVectorRouting;
} // namespace ns3
// NOLINTEND(modernize-use-override)
#endif /* NIX_VECTOR_ROUTING_H */