diff options
Diffstat (limited to 'runtime/base')
| -rw-r--r-- | runtime/base/allocator.h | 2 | ||||
| -rw-r--r-- | runtime/base/arena_containers.h | 4 | ||||
| -rw-r--r-- | runtime/base/bit_string.h | 2 | ||||
| -rw-r--r-- | runtime/base/bit_string_test.cc | 4 | ||||
| -rw-r--r-- | runtime/base/bit_struct.h | 2 | ||||
| -rw-r--r-- | runtime/base/bit_struct_detail.h | 2 | ||||
| -rw-r--r-- | runtime/base/bit_struct_test.cc | 26 | ||||
| -rw-r--r-- | runtime/base/mutex.cc | 2 | ||||
| -rw-r--r-- | runtime/base/scoped_arena_containers.h | 4 | ||||
| -rw-r--r-- | runtime/base/transform_array_ref.h | 2 | ||||
| -rw-r--r-- | runtime/base/transform_array_ref_test.cc | 4 | ||||
| -rw-r--r-- | runtime/base/transform_iterator.h | 2 | ||||
| -rw-r--r-- | runtime/base/transform_iterator_test.cc | 12 | ||||
| -rw-r--r-- | runtime/base/variant_map.h | 2 | ||||
| -rw-r--r-- | runtime/base/variant_map_test.cc | 4 |
15 files changed, 37 insertions, 37 deletions
diff --git a/runtime/base/allocator.h b/runtime/base/allocator.h index fba9308e8e..99cdb49984 100644 --- a/runtime/base/allocator.h +++ b/runtime/base/allocator.h @@ -111,7 +111,7 @@ class TrackingAllocatorImpl : public std::allocator<T> { // Used internally by STL data structures. template <class U> - TrackingAllocatorImpl( // NOLINT, implicit + TrackingAllocatorImpl( const TrackingAllocatorImpl<U, kTag>& alloc ATTRIBUTE_UNUSED) noexcept {} // Used internally by STL data structures. diff --git a/runtime/base/arena_containers.h b/runtime/base/arena_containers.h index 2e71156ee8..dcdb92b9d8 100644 --- a/runtime/base/arena_containers.h +++ b/runtime/base/arena_containers.h @@ -143,7 +143,7 @@ class ArenaAllocatorAdapter<void> : private ArenaAllocatorAdapterKind { allocator_(allocator) { } template <typename U> - ArenaAllocatorAdapter(const ArenaAllocatorAdapter<U>& other) // NOLINT, implicit + ArenaAllocatorAdapter(const ArenaAllocatorAdapter<U>& other) : ArenaAllocatorAdapterKind(other), allocator_(other.allocator_) { } @@ -179,7 +179,7 @@ class ArenaAllocatorAdapter : private ArenaAllocatorAdapterKind { allocator_(allocator) { } template <typename U> - ArenaAllocatorAdapter(const ArenaAllocatorAdapter<U>& other) // NOLINT, implicit + ArenaAllocatorAdapter(const ArenaAllocatorAdapter<U>& other) : ArenaAllocatorAdapterKind(other), allocator_(other.allocator_) { } diff --git a/runtime/base/bit_string.h b/runtime/base/bit_string.h index 1cda021017..a2164f335d 100644 --- a/runtime/base/bit_string.h +++ b/runtime/base/bit_string.h @@ -248,7 +248,7 @@ struct BitString { // Does this bitstring contain exactly 0 characters? bool IsEmpty() const { - return (*this) == BitString{}; // NOLINT + return (*this) == BitString{}; } // Remove all BitStringChars starting at end. diff --git a/runtime/base/bit_string_test.cc b/runtime/base/bit_string_test.cc index d5610e7a73..96aa154ef3 100644 --- a/runtime/base/bit_string_test.cc +++ b/runtime/base/bit_string_test.cc @@ -47,7 +47,7 @@ BitStringChar MakeBitStringChar(size_t val) { BitString MakeBitString(std::initializer_list<size_t> values = {}) { CHECK_GE(BitString::kCapacity, values.size()); - BitString bs{}; // NOLINT + BitString bs{}; size_t i = 0; for (size_t val : values) { @@ -68,7 +68,7 @@ size_t AsUint(const T& value) { // Make max bitstring, e.g. BitString[4095,7,255] for {12,3,8} template <size_t kCount = BitString::kCapacity> BitString MakeBitStringMax() { - BitString bs{}; // NOLINT + BitString bs{}; for (size_t i = 0; i < kCount; ++i) { bs.SetAt(i, diff --git a/runtime/base/bit_struct.h b/runtime/base/bit_struct.h index 16b555e1c6..b207459419 100644 --- a/runtime/base/bit_struct.h +++ b/runtime/base/bit_struct.h @@ -288,7 +288,7 @@ using BitStructUint = // // See top of file for usage example. #define BITSTRUCT_DEFINE_END(name) \ - }; /* NOLINT [readability/braces] [4] */ \ + }; \ static_assert(art::detail::ValidateBitStructSize<name>(), \ #name "bitsize incorrect: " \ "did you insert extra fields that weren't BitStructX, " \ diff --git a/runtime/base/bit_struct_detail.h b/runtime/base/bit_struct_detail.h index 49d432e69c..912f51c7b0 100644 --- a/runtime/base/bit_struct_detail.h +++ b/runtime/base/bit_struct_detail.h @@ -79,7 +79,7 @@ struct HasUnderscoreField { using FalseT = std::integral_constant<bool, false>::type; template <typename C> - static constexpr auto Test(void*) -> decltype(std::declval<C>()._, TrueT{}); // NOLINT + static constexpr auto Test(void*) -> decltype(std::declval<C>()._, TrueT{}); template <typename> static constexpr FalseT Test(...); diff --git a/runtime/base/bit_struct_test.cc b/runtime/base/bit_struct_test.cc index a80d39eb91..577682ccce 100644 --- a/runtime/base/bit_struct_test.cc +++ b/runtime/base/bit_struct_test.cc @@ -73,7 +73,7 @@ struct CustomBitStruct { TEST(BitStructs, Custom) { CustomBitStruct expected(0b1111); - BitStructField<CustomBitStruct, /*lsb*/4, /*width*/4> f{}; // NOLINT + BitStructField<CustomBitStruct, /*lsb*/4, /*width*/4> f{}; EXPECT_EQ(1u, sizeof(f)); @@ -95,7 +95,7 @@ TEST(BitStructs, TwoCustom) { VALIDATE_BITSTRUCT_SIZE(TestTwoCustom); - TestTwoCustom cst{}; // NOLINT + TestTwoCustom cst{}; // Test the write to most-significant field doesn't clobber least-significant. cst.f4_a = CustomBitStruct(0b0110); @@ -122,7 +122,7 @@ TEST(BitStructs, TwoCustom) { } TEST(BitStructs, Number) { - BitStructNumber<uint16_t, /*lsb*/4, /*width*/4> bsn{}; // NOLINT + BitStructNumber<uint16_t, /*lsb*/4, /*width*/4> bsn{}; EXPECT_EQ(2u, sizeof(bsn)); bsn = 0b1111; @@ -154,7 +154,7 @@ TEST(BitStructs, Test1) { EXPECT_EQ(1u, sizeof(u4)); EXPECT_EQ(1u, sizeof(alias_all)); } - TestBitStruct tst{}; // NOLINT + TestBitStruct tst{}; // Check minimal size selection is correct. EXPECT_EQ(1u, sizeof(TestBitStruct)); @@ -229,7 +229,7 @@ BITSTRUCT_DEFINE_END(MixedSizeBitStruct); TEST(BitStructs, Mixed) { EXPECT_EQ(4u, sizeof(MixedSizeBitStruct)); - MixedSizeBitStruct tst{}; // NOLINT + MixedSizeBitStruct tst{}; // Check operator assignment. tst.u3 = 0b111u; @@ -263,11 +263,11 @@ BITSTRUCT_DEFINE_START(TestBitStruct_u8, /* size */ 8) BITSTRUCT_DEFINE_END(TestBitStruct_u8); TEST(BitStructs, FieldAssignment) { - TestBitStruct_u8 all_1s{}; // NOLINT + TestBitStruct_u8 all_1s{}; all_1s.alias_all = 0xffu; { - TestBitStruct_u8 tst{}; // NOLINT + TestBitStruct_u8 tst{}; tst.i3 = all_1s.i3; // Copying a single bitfield does not copy all bitfields. @@ -275,7 +275,7 @@ TEST(BitStructs, FieldAssignment) { } { - TestBitStruct_u8 tst{}; // NOLINT + TestBitStruct_u8 tst{}; tst.u4 = all_1s.u4; // Copying a single bitfield does not copy all bitfields. @@ -291,13 +291,13 @@ BITSTRUCT_DEFINE_START(NestedStruct, /* size */ 64) BITSTRUCT_DEFINE_END(NestedStruct); TEST(BitStructs, NestedFieldAssignment) { - MixedSizeBitStruct mixed_all_1s{}; // NOLINT + MixedSizeBitStruct mixed_all_1s{}; mixed_all_1s.alias_all = 0xFFFFFFFFu; { - NestedStruct xyz{}; // NOLINT + NestedStruct xyz{}; - NestedStruct other{}; // NOLINT + NestedStruct other{}; other.mixed_upper = mixed_all_1s; other.mixed_lower = mixed_all_1s; @@ -307,9 +307,9 @@ TEST(BitStructs, NestedFieldAssignment) { } { - NestedStruct xyz{}; // NOLINT + NestedStruct xyz{}; - NestedStruct other{}; // NOLINT + NestedStruct other{}; other.mixed_upper = mixed_all_1s; other.mixed_lower = mixed_all_1s; diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index 877f052006..3adebe7e00 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -584,7 +584,7 @@ ReaderWriterMutex::ReaderWriterMutex(const char* name, LockLevel level) #if ART_USE_FUTEXES , state_(0), num_pending_readers_(0), num_pending_writers_(0) #endif -{ // NOLINT(whitespace/braces) +{ #if !ART_USE_FUTEXES CHECK_MUTEX_CALL(pthread_rwlock_init, (&rwlock_, nullptr)); #endif diff --git a/runtime/base/scoped_arena_containers.h b/runtime/base/scoped_arena_containers.h index fccaaeaa42..756089f438 100644 --- a/runtime/base/scoped_arena_containers.h +++ b/runtime/base/scoped_arena_containers.h @@ -110,7 +110,7 @@ class ScopedArenaAllocatorAdapter<void> arena_stack_(allocator->arena_stack_) { } template <typename U> - ScopedArenaAllocatorAdapter(const ScopedArenaAllocatorAdapter<U>& other) // NOLINT, implicit + ScopedArenaAllocatorAdapter(const ScopedArenaAllocatorAdapter<U>& other) : DebugStackReference(other), DebugStackIndirectTopRef(other), ArenaAllocatorAdapterKind(other), @@ -153,7 +153,7 @@ class ScopedArenaAllocatorAdapter arena_stack_(allocator->arena_stack_) { } template <typename U> - ScopedArenaAllocatorAdapter(const ScopedArenaAllocatorAdapter<U>& other) // NOLINT, implicit + ScopedArenaAllocatorAdapter(const ScopedArenaAllocatorAdapter<U>& other) : DebugStackReference(other), DebugStackIndirectTopRef(other), ArenaAllocatorAdapterKind(other), diff --git a/runtime/base/transform_array_ref.h b/runtime/base/transform_array_ref.h index b432f86d77..a4e0bc27ed 100644 --- a/runtime/base/transform_array_ref.h +++ b/runtime/base/transform_array_ref.h @@ -72,7 +72,7 @@ class TransformArrayRef { template <typename OtherBT, typename = typename std::enable_if<std::is_same<BaseType, const OtherBT>::value>::type> - TransformArrayRef(const TransformArrayRef<OtherBT, Function>& other) // NOLINT, implicit + TransformArrayRef(const TransformArrayRef<OtherBT, Function>& other) : TransformArrayRef(other.base(), other.GetFunction()) { } // Assignment operators. diff --git a/runtime/base/transform_array_ref_test.cc b/runtime/base/transform_array_ref_test.cc index 494dbb29aa..da0340d36b 100644 --- a/runtime/base/transform_array_ref_test.cc +++ b/runtime/base/transform_array_ref_test.cc @@ -38,7 +38,7 @@ ATTRIBUTE_UNUSED bool operator==(const ValueHolder& lhs, const ValueHolder& rhs) } // anonymous namespace TEST(TransformArrayRef, ConstRefAdd1) { - auto add1 = [](const ValueHolder& h) { return h.value + 1; }; // NOLINT [readability/braces] + auto add1 = [](const ValueHolder& h) { return h.value + 1; }; std::vector<ValueHolder> input({ 7, 6, 4, 0 }); std::vector<int> output; @@ -79,7 +79,7 @@ TEST(TransformArrayRef, ConstRefAdd1) { } TEST(TransformArrayRef, NonConstRefSub1) { - auto sub1 = [](ValueHolder& h) { return h.value - 1; }; // NOLINT [readability/braces] + auto sub1 = [](ValueHolder& h) { return h.value - 1; }; std::vector<ValueHolder> input({ 4, 4, 5, 7, 10 }); std::vector<int> output; diff --git a/runtime/base/transform_iterator.h b/runtime/base/transform_iterator.h index f1a8a52ceb..9c8f822b71 100644 --- a/runtime/base/transform_iterator.h +++ b/runtime/base/transform_iterator.h @@ -62,7 +62,7 @@ class TransformIterator { : data_(base, fn) { } template <typename OtherBI> - TransformIterator(const TransformIterator<OtherBI, Function>& other) // NOLINT, implicit + TransformIterator(const TransformIterator<OtherBI, Function>& other) : data_(other.base(), other.GetFunction()) { } diff --git a/runtime/base/transform_iterator_test.cc b/runtime/base/transform_iterator_test.cc index a85dda8958..63b6e4f531 100644 --- a/runtime/base/transform_iterator_test.cc +++ b/runtime/base/transform_iterator_test.cc @@ -41,7 +41,7 @@ bool operator==(const ValueHolder& lhs, const ValueHolder& rhs) { } // anonymous namespace TEST(TransformIterator, VectorAdd1) { - auto add1 = [](const ValueHolder& h) { return h.value + 1; }; // NOLINT [readability/braces] + auto add1 = [](const ValueHolder& h) { return h.value + 1; }; std::vector<ValueHolder> input({ 1, 7, 3, 8 }); std::vector<int> output; @@ -144,7 +144,7 @@ TEST(TransformIterator, VectorAdd1) { } TEST(TransformIterator, ListSub1) { - auto sub1 = [](const ValueHolder& h) { return h.value - 1; }; // NOLINT [readability/braces] + auto sub1 = [](const ValueHolder& h) { return h.value - 1; }; std::list<ValueHolder> input({ 2, 3, 5, 7, 11 }); std::vector<int> output; @@ -208,7 +208,7 @@ TEST(TransformIterator, ListSub1) { } TEST(TransformIterator, ForwardListSub1) { - auto mul3 = [](const ValueHolder& h) { return h.value * 3; }; // NOLINT [readability/braces] + auto mul3 = [](const ValueHolder& h) { return h.value * 3; }; std::forward_list<ValueHolder> input({ 1, 1, 2, 3, 5, 8 }); std::vector<int> output; @@ -246,7 +246,7 @@ TEST(TransformIterator, ForwardListSub1) { } TEST(TransformIterator, VectorConstReference) { - auto ref = [](const ValueHolder& h) -> const int& { return h.value; }; // NOLINT [readability/braces] + auto ref = [](const ValueHolder& h) -> const int& { return h.value; }; std::vector<ValueHolder> input({ 7, 3, 1, 2, 4, 8 }); std::vector<int> output; @@ -339,7 +339,7 @@ TEST(TransformIterator, VectorConstReference) { } TEST(TransformIterator, VectorNonConstReference) { - auto ref = [](ValueHolder& h) -> int& { return h.value; }; // NOLINT [readability/braces] + auto ref = [](ValueHolder& h) -> int& { return h.value; }; std::vector<ValueHolder> input({ 7, 3, 1, 2, 4, 8 }); std::vector<int> output; @@ -519,7 +519,7 @@ TEST(TransformIterator, VectorConstAndNonConstReference) { } TEST(TransformIterator, TransformRange) { - auto ref = [](ValueHolder& h) -> int& { return h.value; }; // NOLINT [readability/braces] + auto ref = [](ValueHolder& h) -> int& { return h.value; }; std::vector<ValueHolder> data({ 1, 0, 1, 3, 1, 0 }); for (int& v : MakeTransformRange(data, ref)) { diff --git a/runtime/base/variant_map.h b/runtime/base/variant_map.h index fe332d1e3b..c480b5162d 100644 --- a/runtime/base/variant_map.h +++ b/runtime/base/variant_map.h @@ -139,7 +139,7 @@ struct VariantMapKey : detail::VariantMapKeyRaw { // then that is used. Otherwise, the default value for the type TValue{} is returned. TValue CreateDefaultValue() const { if (default_value_ == nullptr) { - return TValue{}; // NOLINT [readability/braces] [4] + return TValue{}; } else { return TValue(*default_value_); } diff --git a/runtime/base/variant_map_test.cc b/runtime/base/variant_map_test.cc index 9dd29baf48..4677b6d3b3 100644 --- a/runtime/base/variant_map_test.cc +++ b/runtime/base/variant_map_test.cc @@ -107,8 +107,8 @@ TEST(VariantMaps, RuleOfFive) { fmFilled.Set(FruitMap::Orange, 555.0); EXPECT_EQ(size_t(2), fmFilled.Size()); - // Test copy constructor (NOLINT as a reference is suggested, instead) - FruitMap fmEmptyCopy(fmEmpty); // NOLINT + // Test copy constructor + FruitMap fmEmptyCopy(fmEmpty); EXPECT_EQ(size_t(0), fmEmptyCopy.Size()); // Test copy constructor |