Fix cpplint whitespace/parens issues
Change-Id: Ifc678d59a8bed24ffddde5a0e543620b17b0aba9
diff --git a/runtime/gc/accounting/atomic_stack.h b/runtime/gc/accounting/atomic_stack.h
index 5310c18..1e8beda 100644
--- a/runtime/gc/accounting/atomic_stack.h
+++ b/runtime/gc/accounting/atomic_stack.h
@@ -66,7 +66,7 @@
// Stack overflow.
return false;
}
- } while(!back_index_.CompareAndSwap(index, index + 1));
+ } while (!back_index_.CompareAndSwap(index, index + 1));
begin_[index] = value;
return true;
}
diff --git a/runtime/gc/accounting/mod_union_table.cc b/runtime/gc/accounting/mod_union_table.cc
index aa02f82..91c9253 100644
--- a/runtime/gc/accounting/mod_union_table.cc
+++ b/runtime/gc/accounting/mod_union_table.cc
@@ -44,8 +44,8 @@
}
// Extra parameters are required since we use this same visitor signature for checking objects.
- void operator ()(const Object* obj, const Object* ref, const MemberOffset& /* offset */,
- bool /* is_static */) const {
+ void operator()(const Object* obj, const Object* ref, const MemberOffset& /* offset */,
+ bool /* is_static */) const {
// TODO: Optimize?
// TODO: C++0x auto
const std::vector<space::ContinuousSpace*>& spaces = heap_->GetContinuousSpaces();
@@ -70,7 +70,7 @@
bitmap_(bitmap) {
}
- void operator ()(const Object* obj) const
+ void operator()(const Object* obj) const
SHARED_LOCKS_REQUIRED(Locks::heap_bitmap_lock_,
Locks::mutator_lock_) {
DCHECK(obj != NULL);
@@ -90,7 +90,7 @@
: cleared_cards_(cleared_cards) {
}
- inline void operator ()(byte* card, byte expected_value, byte new_value) const {
+ inline void operator()(byte* card, byte expected_value, byte new_value) const {
if (expected_value == CardTable::kCardDirty) {
cleared_cards_->insert(card);
}
@@ -106,7 +106,7 @@
: cleared_cards_(cleared_cards) {
}
- void operator ()(byte* card, byte expected_card, byte new_card) const {
+ void operator()(byte* card, byte expected_card, byte new_card) const {
if (expected_card == CardTable::kCardDirty) {
cleared_cards_->push_back(card);
}
@@ -120,7 +120,7 @@
explicit ModUnionScanImageRootVisitor(collector::MarkSweep* const mark_sweep)
: mark_sweep_(mark_sweep) {}
- void operator ()(const Object* root) const
+ void operator()(const Object* root) const
EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
DCHECK(root != NULL);
@@ -147,8 +147,8 @@
}
// Extra parameters are required since we use this same visitor signature for checking objects.
- void operator ()(const Object* obj, const Object* ref, const MemberOffset& /* offset */,
- bool /* is_static */) const {
+ void operator()(const Object* obj, const Object* ref, const MemberOffset& /* offset */,
+ bool /* is_static */) const {
// Only add the reference if it is non null and fits our criteria.
if (ref != NULL && mod_union_table_->AddReference(obj, ref)) {
references_->push_back(ref);
@@ -168,7 +168,7 @@
references_(references) {
}
- void operator ()(const Object* obj) const
+ void operator()(const Object* obj) const
SHARED_LOCKS_REQUIRED(Locks::heap_bitmap_lock_, Locks::mutator_lock_) {
DCHECK(obj != NULL);
// We don't have an early exit since we use the visitor pattern, an early
@@ -191,8 +191,8 @@
// Extra parameters are required since we use this same visitor signature for checking objects.
// TODO: Fixme when anotatalysis works with visitors.
- void operator ()(const Object* obj, const Object* ref, const MemberOffset& /* offset */,
- bool /* is_static */) const
+ void operator()(const Object* obj, const Object* ref, const MemberOffset& /* offset */,
+ bool /* is_static */) const
SHARED_LOCKS_REQUIRED(Locks::heap_bitmap_lock_, Locks::mutator_lock_) {
Heap* heap = mod_union_table_->GetHeap();
if (ref != NULL && mod_union_table_->AddReference(obj, ref) &&
@@ -216,13 +216,13 @@
class ModUnionCheckReferences {
public:
- explicit ModUnionCheckReferences (ModUnionTableReferenceCache* mod_union_table,
- const std::set<const Object*>& references)
+ explicit ModUnionCheckReferences(ModUnionTableReferenceCache* mod_union_table,
+ const std::set<const Object*>& references)
EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_)
: mod_union_table_(mod_union_table), references_(references) {
}
- void operator ()(const Object* obj) const NO_THREAD_SAFETY_ANALYSIS {
+ void operator()(const Object* obj) const NO_THREAD_SAFETY_ANALYSIS {
Locks::heap_bitmap_lock_->AssertSharedHeld(Thread::Current());
DCHECK(obj != NULL);
CheckReferenceVisitor visitor(mod_union_table_, references_);
@@ -333,7 +333,7 @@
typedef SafeMap<const byte*, std::vector<const mirror::Object*> >::const_iterator It;
for (It it = references_.begin(); it != references_.end(); ++it) {
typedef std::vector<const mirror::Object*>::const_iterator It2;
- for (It2 it_ref = it->second.begin(); it_ref != it->second.end(); ++it_ref ) {
+ for (It2 it_ref = it->second.begin(); it_ref != it->second.end(); ++it_ref) {
mark_sweep->MarkRoot(*it_ref);
++count;
}
diff --git a/runtime/gc/accounting/space_bitmap.h b/runtime/gc/accounting/space_bitmap.h
index bf4c1ed..77f93a2 100644
--- a/runtime/gc/accounting/space_bitmap.h
+++ b/runtime/gc/accounting/space_bitmap.h
@@ -103,7 +103,7 @@
: bitmap_(bitmap) {
}
- void operator ()(mirror::Object* obj) const {
+ void operator()(mirror::Object* obj) const {
bitmap_->Clear(obj);
}
private:
@@ -112,7 +112,7 @@
template <typename Visitor>
void VisitRange(uintptr_t visit_begin, uintptr_t visit_end, const Visitor& visitor) const {
- for (; visit_begin < visit_end; visit_begin += kAlignment ) {
+ for (; visit_begin < visit_end; visit_begin += kAlignment) {
visitor(reinterpret_cast<mirror::Object*>(visit_begin));
}
}
diff --git a/runtime/gc/accounting/space_bitmap_test.cc b/runtime/gc/accounting/space_bitmap_test.cc
index d00d7c2..516a449 100644
--- a/runtime/gc/accounting/space_bitmap_test.cc
+++ b/runtime/gc/accounting/space_bitmap_test.cc
@@ -46,7 +46,7 @@
begin_(begin),
end_(end) {}
- void operator ()(const mirror::Object* obj) {
+ void operator()(const mirror::Object* obj) {
EXPECT_TRUE(obj >= begin_);
EXPECT_TRUE(obj <= end_);
EXPECT_TRUE(bitmap_->Test(obj) == ((reinterpret_cast<uintptr_t>(obj) & 0xF) != 0));
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index a5bad2f..2ca5f2d 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -72,7 +72,7 @@
public:
explicit SetFingerVisitor(MarkSweep* const mark_sweep) : mark_sweep_(mark_sweep) {}
- void operator ()(void* finger) const {
+ void operator()(void* finger) const {
mark_sweep_->SetFinger(reinterpret_cast<Object*>(finger));
}
@@ -524,7 +524,7 @@
public:
explicit CheckObjectVisitor(MarkSweep* const mark_sweep) : mark_sweep_(mark_sweep) {}
- void operator ()(const Object* obj, const Object* ref, MemberOffset offset, bool is_static) const
+ void operator()(const Object* obj, const Object* ref, MemberOffset offset, bool is_static) const
NO_THREAD_SAFETY_ANALYSIS {
if (kDebugLocking) {
Locks::heap_bitmap_lock_->AssertSharedHeld(Thread::Current());
@@ -565,7 +565,7 @@
explicit ScanObjectVisitor(MarkSweep* const mark_sweep) : mark_sweep_(mark_sweep) {}
// TODO: Fixme when anotatalysis works with visitors.
- void operator ()(const Object* obj) const NO_THREAD_SAFETY_ANALYSIS {
+ void operator()(const Object* obj) const NO_THREAD_SAFETY_ANALYSIS {
if (kDebugLocking) {
Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
Locks::heap_bitmap_lock_->AssertExclusiveHeld(Thread::Current());
@@ -609,7 +609,7 @@
public:
explicit CheckBitmapVisitor(MarkSweep* mark_sweep) : mark_sweep_(mark_sweep) {}
- void operator ()(const Object* obj) const NO_THREAD_SAFETY_ANALYSIS {
+ void operator()(const Object* obj) const NO_THREAD_SAFETY_ANALYSIS {
if (kDebugLocking) {
Locks::heap_bitmap_lock_->AssertSharedHeld(Thread::Current());
}
@@ -1081,8 +1081,8 @@
explicit MarkObjectVisitor(MarkSweep* const mark_sweep) : mark_sweep_(mark_sweep) {}
// TODO: Fixme when anotatalysis works with visitors.
- void operator ()(const Object* /* obj */, const Object* ref, const MemberOffset& /* offset */,
- bool /* is_static */) const
+ void operator()(const Object* /* obj */, const Object* ref, const MemberOffset& /* offset */,
+ bool /* is_static */) const
NO_THREAD_SAFETY_ANALYSIS {
if (kDebugLocking) {
Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
@@ -1148,8 +1148,8 @@
public:
explicit MarkObjectParallelVisitor(MarkStackChunk* chunk_task) : chunk_task_(chunk_task) {}
- void operator ()(const Object* /* obj */, const Object* ref,
- const MemberOffset& /* offset */, bool /* is_static */) const {
+ void operator()(const Object* /* obj */, const Object* ref,
+ const MemberOffset& /* offset */, bool /* is_static */) const {
if (ref != NULL && chunk_task_->mark_sweep_->MarkObjectParallel(ref)) {
chunk_task_->MarkStackPush(ref);
}
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index deb1b8c..7bd7c5d 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -228,7 +228,7 @@
// Sort spaces based on begin address
struct ContinuousSpaceSorter {
- bool operator ()(const space::ContinuousSpace* a, const space::ContinuousSpace* b) const {
+ bool operator()(const space::ContinuousSpace* a, const space::ContinuousSpace* b) const {
return a->Begin() < b->Begin();
}
};
@@ -894,8 +894,8 @@
}
// For MarkSweep::VisitObjectReferences.
- void operator ()(const mirror::Object* referrer, const mirror::Object* object,
- const MemberOffset&, bool) const {
+ void operator()(const mirror::Object* referrer, const mirror::Object* object,
+ const MemberOffset&, bool) const {
if (object == object_ && (max_count_ == 0 || referring_objects_.size() < max_count_)) {
referring_objects_.push_back(const_cast<mirror::Object*>(referrer));
}
@@ -1165,7 +1165,7 @@
class ScanVisitor {
public:
- void operator ()(const mirror::Object* obj) const {
+ void operator()(const mirror::Object* obj) const {
LOG(INFO) << "Would have rescanned object " << obj;
}
};
@@ -1183,8 +1183,8 @@
// TODO: Fix lock analysis to not use NO_THREAD_SAFETY_ANALYSIS, requires support for smarter
// analysis on visitors.
- void operator ()(const mirror::Object* obj, const mirror::Object* ref,
- const MemberOffset& offset, bool /* is_static */) const
+ void operator()(const mirror::Object* obj, const mirror::Object* ref,
+ const MemberOffset& offset, bool /* is_static */) const
NO_THREAD_SAFETY_ANALYSIS {
// Verify that the reference is live.
if (UNLIKELY(ref != NULL && !IsLive(ref))) {
@@ -1264,7 +1264,7 @@
public:
explicit VerifyObjectVisitor(Heap* heap) : heap_(heap), failed_(false) {}
- void operator ()(const mirror::Object* obj) const
+ void operator()(const mirror::Object* obj) const
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_, Locks::heap_bitmap_lock_) {
// Note: we are verifying the references in obj but not obj itself, this is because obj must
// be live or else how did we find it in the live bitmap?
@@ -1311,8 +1311,8 @@
// TODO: Fix lock analysis to not use NO_THREAD_SAFETY_ANALYSIS, requires support for
// annotalysis on visitors.
- void operator ()(const mirror::Object* obj, const mirror::Object* ref, const MemberOffset& offset,
- bool is_static) const NO_THREAD_SAFETY_ANALYSIS {
+ void operator()(const mirror::Object* obj, const mirror::Object* ref, const MemberOffset& offset,
+ bool is_static) const NO_THREAD_SAFETY_ANALYSIS {
// Filter out class references since changing an object's class does not mark the card as dirty.
// Also handles large objects, since the only reference they hold is a class reference.
if (ref != NULL && !ref->IsClass()) {
@@ -1378,7 +1378,7 @@
: heap_(heap),
failed_(false) {}
- void operator ()(const mirror::Object* obj) const
+ void operator()(const mirror::Object* obj) const
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_, Locks::heap_bitmap_lock_) {
VerifyReferenceCardVisitor visitor(heap_, const_cast<bool*>(&failed_));
collector::MarkSweep::VisitObjectReferences(obj, visitor);
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 630d063..32e068c 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -70,7 +70,7 @@
class AgeCardVisitor {
public:
- byte operator ()(byte card) const {
+ byte operator()(byte card) const {
if (card == accounting::CardTable::kCardDirty) {
return card - 1;
} else {