Fix cpplint whitespace/parens issues

Change-Id: Ifc678d59a8bed24ffddde5a0e543620b17b0aba9
diff --git a/runtime/atomic_integer.h b/runtime/atomic_integer.h
index 6711722..05024b4 100644
--- a/runtime/atomic_integer.h
+++ b/runtime/atomic_integer.h
@@ -34,7 +34,7 @@
     return *this;
   }
 
-  operator int32_t () const {
+  operator int32_t() const {
     return value_;
   }
 
diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h
index 07157da..b3f5092 100644
--- a/runtime/base/mutex-inl.h
+++ b/runtime/base/mutex-inl.h
@@ -148,7 +148,7 @@
       }
       android_atomic_dec(&num_pending_readers_);
     }
-  } while(!done);
+  } while (!done);
 #else
   CHECK_MUTEX_CALL(pthread_rwlock_rdlock, (&rwlock_));
 #endif
@@ -176,7 +176,7 @@
     } else {
       LOG(FATAL) << "Unexpected state_:" << cur_state << " for " << name_;
     }
-  } while(!done);
+  } while (!done);
 #else
   CHECK_MUTEX_CALL(pthread_rwlock_unlock, (&rwlock_));
 #endif
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc
index 25c0b9e..1df0207 100644
--- a/runtime/base/mutex.cc
+++ b/runtime/base/mutex.cc
@@ -178,7 +178,7 @@
     do {
       slot = cur_content_log_entry_;
       new_slot = (slot + 1) % kContentionLogSize;
-    } while(!cur_content_log_entry_.CompareAndSwap(slot, new_slot));
+    } while (!cur_content_log_entry_.CompareAndSwap(slot, new_slot));
     contention_log_[new_slot].blocked_tid = blocked_tid;
     contention_log_[new_slot].owner_tid = owner_tid;
     contention_log_[new_slot].count = 1;
@@ -312,7 +312,7 @@
         }
         android_atomic_dec(&num_contenders_);
       }
-    } while(!done);
+    } while (!done);
     DCHECK_EQ(state_, 1);
     exclusive_owner_ = SafeGetTid(self);
 #else
@@ -344,7 +344,7 @@
       } else {
         return false;
       }
-    } while(!done);
+    } while (!done);
     DCHECK_EQ(state_, 1);
     exclusive_owner_ = SafeGetTid(self);
 #else
@@ -404,7 +404,7 @@
         _exit(1);
       }
     }
-  } while(!done);
+  } while (!done);
 #else
     CHECK_MUTEX_CALL(pthread_mutex_unlock, (&mutex_));
 #endif
@@ -513,7 +513,7 @@
       }
       android_atomic_dec(&num_pending_writers_);
     }
-  } while(!done);
+  } while (!done);
   DCHECK_EQ(state_, -1);
   exclusive_owner_ = SafeGetTid(self);
 #else
@@ -545,7 +545,7 @@
     } else {
       LOG(FATAL) << "Unexpected state_:" << cur_state << " for " << name_;
     }
-  } while(!done);
+  } while (!done);
 #else
   CHECK_MUTEX_CALL(pthread_rwlock_unlock, (&rwlock_));
 #endif
@@ -583,7 +583,7 @@
       }
       android_atomic_dec(&num_pending_writers_);
     }
-  } while(!done);
+  } while (!done);
   exclusive_owner_ = SafeGetTid(self);
 #else
   timespec ts;
@@ -616,7 +616,7 @@
       // Owner holds it exclusively.
       return false;
     }
-  } while(!done);
+  } while (!done);
 #else
   int result = pthread_rwlock_tryrdlock(&rwlock_);
   if (result == EBUSY) {
diff --git a/runtime/check_jni.cc b/runtime/check_jni.cc
index 403a2eb..7429ab1 100644
--- a/runtime/check_jni.cc
+++ b/runtime/check_jni.cc
@@ -401,7 +401,7 @@
    *
    * Use the kFlag_NullableUtf flag where 'u' field(s) are nullable.
    */
-  void Check(bool entry, const char* fmt0, ...) SHARED_LOCKS_REQUIRED (Locks::mutator_lock_) {
+  void Check(bool entry, const char* fmt0, ...) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
     va_list ap;
 
     const mirror::AbstractMethod* traceMethod = NULL;
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index e5844b0..3c1cd78 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -937,14 +937,14 @@
 
   // TODO: Remove EXPECT_FALSE when GCC can handle EXPECT_EQ
   // http://code.google.com/p/googletest/issues/detail?id=322
-  EXPECT_FALSE(                   s0->GetBoolean(statics));
-  EXPECT_EQ(6,                    s1->GetByte(statics));
-  EXPECT_EQ('b',                  s2->GetChar(statics));
-  EXPECT_EQ(-535,                 s3->GetShort(statics));
-  EXPECT_EQ(2000000001,           s4->GetInt(statics));
+  EXPECT_FALSE(s0->GetBoolean(statics));
+  EXPECT_EQ(6, s1->GetByte(statics));
+  EXPECT_EQ('b', s2->GetChar(statics));
+  EXPECT_EQ(-535, s3->GetShort(statics));
+  EXPECT_EQ(2000000001, s4->GetInt(statics));
   EXPECT_EQ(0x34567890abcdef12LL, s5->GetLong(statics));
-  EXPECT_EQ(0.75,                 s6->GetFloat(statics));
-  EXPECT_EQ(16777219,             s7->GetDouble(statics));
+  EXPECT_EQ(0.75, s6->GetFloat(statics));
+  EXPECT_EQ(16777219, s7->GetDouble(statics));
   EXPECT_TRUE(s8->GetObject(statics)->AsString()->Equals("robot"));
 }
 
diff --git a/runtime/common_test.h b/runtime/common_test.h
index 73c47b5..e735e27 100644
--- a/runtime/common_test.h
+++ b/runtime/common_test.h
@@ -178,8 +178,7 @@
                                 fp_spill_mask,
                                 reinterpret_cast<uint32_t>(mapping_table),
                                 reinterpret_cast<uint32_t>(vmap_table),
-                                reinterpret_cast<uint32_t>(gc_map)
-                                );
+                                reinterpret_cast<uint32_t>(gc_map));
   }
 
   void MakeExecutable(mirror::AbstractMethod* method) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
@@ -308,7 +307,7 @@
     options.push_back(std::make_pair("-Xcheck:jni", reinterpret_cast<void*>(NULL)));
     options.push_back(std::make_pair(min_heap_string.c_str(), reinterpret_cast<void*>(NULL)));
     options.push_back(std::make_pair(max_heap_string.c_str(), reinterpret_cast<void*>(NULL)));
-    if(!Runtime::Create(options, false)) {
+    if (!Runtime::Create(options, false)) {
       LOG(FATAL) << "Failed to create runtime";
       return;
     }
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index b502c9a..4fbee51 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -184,7 +184,7 @@
 static ObjectRegistry* gRegistry = NULL;
 
 // Recent allocation tracking.
-static Mutex gAllocTrackerLock DEFAULT_MUTEX_ACQUIRED_AFTER ("AllocTracker lock");
+static Mutex gAllocTrackerLock DEFAULT_MUTEX_ACQUIRED_AFTER("AllocTracker lock");
 AllocRecord* Dbg::recent_allocation_records_ PT_GUARDED_BY(gAllocTrackerLock) = NULL; // TODO: CircularBuffer<AllocRecord>
 static size_t gAllocRecordMax GUARDED_BY(gAllocTrackerLock) = 0;
 static size_t gAllocRecordHead GUARDED_BY(gAllocTrackerLock) = 0;
@@ -2761,7 +2761,7 @@
     VLOG(jdwp) << "    Control has returned from event thread";
 
     /* wait for thread to re-suspend itself */
-    SuspendThread(thread_id, false /* request_suspension */ );
+    SuspendThread(thread_id, false /* request_suspension */);
     self->TransitionFromSuspendedToRunnable();
   }
 
diff --git a/runtime/dex_file.h b/runtime/dex_file.h
index 28e06cc..8edeb18 100644
--- a/runtime/dex_file.h
+++ b/runtime/dex_file.h
@@ -1039,7 +1039,7 @@
   }
   InvokeType GetMethodInvokeType(const DexFile::ClassDef& class_def) const {
     if (HasNextDirectMethod()) {
-      if ((GetMemberAccessFlags() & kAccStatic) != 0 ) {
+      if ((GetMemberAccessFlags() & kAccStatic) != 0) {
         return kStatic;
       } else {
         return kDirect;
diff --git a/runtime/dex_instruction.cc b/runtime/dex_instruction.cc
index 6527f10..a36d7c5 100644
--- a/runtime/dex_instruction.cc
+++ b/runtime/dex_instruction.cc
@@ -56,12 +56,11 @@
 
 int const Instruction::kInstructionSizeInCodeUnits[] = {
 #define INSTRUCTION_SIZE(opcode, c, p, format, r, i, a, v) \
-  (( opcode == NOP                      ) ? -1 : \
+  ((opcode == NOP)                        ? -1 : \
    ((format >= k10x) && (format <= k10t)) ? 1 : \
    ((format >= k20t) && (format <= k22c)) ? 2 : \
    ((format >= k32x) && (format <= k3rc)) ? 3 : \
-   ( format == k51l                     ) ? 5 : -1 \
-  ),
+    (format == k51l)                      ? 5 : -1),
 #include "dex_instruction_list.h"
   DEX_INSTRUCTION_LIST(INSTRUCTION_SIZE)
 #undef DEX_INSTRUCTION_LIST
diff --git a/runtime/disassembler_arm.cc b/runtime/disassembler_arm.cc
index 172bef8..3c9cb6e 100644
--- a/runtime/disassembler_arm.cc
+++ b/runtime/disassembler_arm.cc
@@ -1184,7 +1184,7 @@
         ThumbRegister Rm(instr, 6);
         ThumbRegister Rn(instr, 3);
         ThumbRegister Rt(instr, 0);
-        switch(opB) {
+        switch (opB) {
           case 0: opcode << "str"; break;
           case 1: opcode << "strh"; break;
           case 2: opcode << "strb"; break;
@@ -1206,7 +1206,7 @@
         uint16_t opB = (instr >> 11) & 1;
         ThumbRegister Rn(instr, 3);
         ThumbRegister Rt(instr, 0);
-        switch(opA) {
+        switch (opA) {
           case 6:
             imm5 <<= 2;
             opcode << (opB == 0 ? "str" : "ldr");
diff --git a/runtime/elf_file.cc b/runtime/elf_file.cc
index da122e6..6ce36e8 100644
--- a/runtime/elf_file.cc
+++ b/runtime/elf_file.cc
@@ -366,7 +366,7 @@
   const unsigned char *name = (const unsigned char *) _name;
   unsigned h = 0, g;
 
-  while(*name) {
+  while (*name) {
     h = (h << 4) + *name++;
     g = h & 0xf0000000;
     h ^= g;
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 {
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index 45314c2..376d3be 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -969,11 +969,11 @@
       return JValue(); /* Handled in caller. */ \
     } \
   } else { \
-    inst = inst-> next_function (); \
+    inst = inst->next_function(); \
   }
 
 static void UnexpectedOpcode(const Instruction* inst, MethodHelper& mh)
-  __attribute__ ((cold, noreturn, noinline));
+  __attribute__((cold, noreturn, noinline));
 
 static void UnexpectedOpcode(const Instruction* inst, MethodHelper& mh)
     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
@@ -989,7 +989,7 @@
 template<bool do_access_check>
 static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item,
                       ShadowFrame& shadow_frame, JValue result_register)
-    NO_THREAD_SAFETY_ANALYSIS __attribute__ ((hot));
+    NO_THREAD_SAFETY_ANALYSIS __attribute__((hot));
 
 template<bool do_access_check>
 static JValue ExecuteImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item,
@@ -1254,7 +1254,7 @@
         if (UNLIKELY(s == NULL)) {
           HANDLE_PENDING_EXCEPTION();
         } else {
-          shadow_frame.SetVRegReference( inst->VRegA_21c(), s);
+          shadow_frame.SetVRegReference(inst->VRegA_21c(), s);
           inst = inst->Next_2xx();
         }
         break;
@@ -1265,7 +1265,7 @@
         if (UNLIKELY(s == NULL)) {
           HANDLE_PENDING_EXCEPTION();
         } else {
-          shadow_frame.SetVRegReference( inst->VRegA_31c(), s);
+          shadow_frame.SetVRegReference(inst->VRegA_31c(), s);
           inst = inst->Next_3xx();
         }
         break;
diff --git a/runtime/oat.h b/runtime/oat.h
index fb28962..4bd1871 100644
--- a/runtime/oat.h
+++ b/runtime/oat.h
@@ -97,8 +97,7 @@
                    uint32_t fp_spill_mask,
                    uint32_t mapping_table_offset,
                    uint32_t vmap_table_offset,
-                   uint32_t gc_map_offset
-                   );
+                   uint32_t gc_map_offset);
 
   ~OatMethodOffsets();
 
diff --git a/runtime/reflection.cc b/runtime/reflection.cc
index 467575c..359b539 100644
--- a/runtime/reflection.cc
+++ b/runtime/reflection.cc
@@ -206,8 +206,7 @@
     ThrowClassCastException(throw_location,
                             StringPrintf("Couldn't convert result of type %s to %s",
                                          PrettyDescriptor(srcType).c_str(),
-                                         PrettyDescriptor(dstType).c_str()
-                                         ).c_str());
+                                         PrettyDescriptor(dstType).c_str()).c_str());
   }
   return false;
 }
@@ -297,8 +296,7 @@
         ThrowClassCastException(throw_location,
                                 StringPrintf("Couldn't convert result of type %s to %s",
                                              PrettyTypeOf(o).c_str(),
-                                             PrettyDescriptor(dst_class).c_str()
-                                             ).c_str());
+                                             PrettyDescriptor(dst_class).c_str()).c_str());
       }
       return false;
     }
@@ -359,8 +357,7 @@
                                   StringPrintf("%s has type %s, got %s",
                                                UnboxingFailureKind(m, index, f).c_str(),
                                                PrettyDescriptor(dst_class).c_str(),
-                                               PrettyDescriptor(src_descriptor.c_str()).c_str()
-                                               ).c_str());
+                                               PrettyDescriptor(src_descriptor.c_str()).c_str()).c_str());
     return false;
   }
 
diff --git a/runtime/stack.cc b/runtime/stack.cc
index fcd0f2d..bf0f78f 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -185,12 +185,12 @@
 }
 
 uintptr_t StackVisitor::GetGPR(uint32_t reg) const {
-  DCHECK (cur_quick_frame_ != NULL) << "This is a quick frame routine";
+  DCHECK(cur_quick_frame_ != NULL) << "This is a quick frame routine";
   return context_->GetGPR(reg);
 }
 
 void StackVisitor::SetGPR(uint32_t reg, uintptr_t value) {
-  DCHECK (cur_quick_frame_ != NULL) << "This is a quick frame routine";
+  DCHECK(cur_quick_frame_ != NULL) << "This is a quick frame routine";
   context_->SetGPR(reg, value);
 }
 
@@ -344,7 +344,7 @@
         }
         cur_depth_++;
         cur_shadow_frame_ = cur_shadow_frame_->GetLink();
-      } while(cur_shadow_frame_ != NULL);
+      } while (cur_shadow_frame_ != NULL);
     }
     if (include_transitions) {
       bool should_continue = VisitFrame();
diff --git a/runtime/thread.cc b/runtime/thread.cc
index a1fb862..fb50ed1 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -1816,7 +1816,7 @@
                                       m->GetDexMethodIndex(), m, m->GetAccessFlags(), false, true);
     verifier.Verify();
     std::vector<int32_t> kinds = verifier.DescribeVRegs(dex_pc);
-    for(uint16_t reg = 0; reg < num_regs; reg++) {
+    for (uint16_t reg = 0; reg < num_regs; reg++) {
       VRegKind kind = static_cast<VRegKind>(kinds.at(reg * 2));
       switch (kind) {
         case kUndefined:
diff --git a/runtime/thread.h b/runtime/thread.h
index 64ff7c2..5c9e8c3 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -104,7 +104,7 @@
   static Thread* Current() {
     // We rely on Thread::Current returning NULL for a detached thread, so it's not obvious
     // that we can replace this with a direct %fs access on x86.
-    if(!is_started_) {
+    if (!is_started_) {
       return NULL;
     } else {
       void* thread = pthread_getspecific(Thread::pthread_key_self_);
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 59c38b4..7aa835a 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -468,7 +468,7 @@
       // Wait for another thread to exit before re-checking.
       thread_exit_cond_.Wait(self);
     }
-  } while(!all_threads_are_daemons);
+  } while (!all_threads_are_daemons);
 }
 
 void ThreadList::SuspendAllDaemonThreads() {
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 3293290..2227b8d 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -230,7 +230,7 @@
   // Create Trace object.
   {
     MutexLock mu(self, *Locks::trace_lock_);
-    if(the_trace_ != NULL) {
+    if (the_trace_ != NULL) {
       LOG(ERROR) << "Trace already in progress, ignoring this request";
     } else {
       the_trace_ = new Trace(trace_file.release(), buffer_size, flags);
diff --git a/runtime/utils.h b/runtime/utils.h
index a08e465..72597f5 100644
--- a/runtime/utils.h
+++ b/runtime/utils.h
@@ -352,18 +352,18 @@
 class VoidFunctor {
  public:
   template <typename A>
-  inline void operator () (A a) const {
+  inline void operator() (A a) const {
     UNUSED(a);
   }
 
   template <typename A, typename B>
-  inline void operator () (A a, B b) const {
+  inline void operator() (A a, B b) const {
     UNUSED(a);
     UNUSED(b);
   }
 
   template <typename A, typename B, typename C>
-  inline void operator () (A a, B b, C c) const {
+  inline void operator() (A a, B b, C c) const {
     UNUSED(a);
     UNUSED(b);
     UNUSED(c);
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index ff7f594..59de9b3 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -1014,12 +1014,12 @@
   verifier::MethodVerifier::SetDexGcMap(ref, *dex_gc_map);
 
   MethodVerifier::MethodSafeCastSet* method_to_safe_casts = GenerateSafeCastSet();
-  if(method_to_safe_casts != NULL ) {
+  if (method_to_safe_casts != NULL) {
     SetSafeCastMap(ref, method_to_safe_casts);
   }
 
   MethodVerifier::PcToConcreteMethodMap* pc_to_concrete_method = GenerateDevirtMap();
-  if(pc_to_concrete_method != NULL ) {
+  if (pc_to_concrete_method != NULL) {
     SetDevirtMap(ref, pc_to_concrete_method);
   }
   return true;
@@ -1824,7 +1824,7 @@
       uint32_t instance_of_idx = 0;
       if (0 != work_insn_idx_) {
         instance_of_idx = work_insn_idx_ - 1;
-        while(0 != instance_of_idx && !insn_flags_[instance_of_idx].IsOpcode()) {
+        while (0 != instance_of_idx && !insn_flags_[instance_of_idx].IsOpcode()) {
           instance_of_idx--;
         }
         CHECK(insn_flags_[instance_of_idx].IsOpcode());
@@ -1854,7 +1854,7 @@
         // which is not done because of the multiple inheritance implications.
         const RegType& cast_type = ResolveClassAndCheckAccess(instance_of_inst->VRegC_22c());
 
-        if(!cast_type.IsUnresolvedTypes() && !cast_type.GetClass()->IsInterface()) {
+        if (!cast_type.IsUnresolvedTypes() && !cast_type.GetClass()->IsInterface()) {
           RegisterLine* update_line = new RegisterLine(code_item_->registers_size_, this);
           if (inst->Opcode() == Instruction::IF_EQZ) {
             fallthrough_line.reset(update_line);
@@ -1868,7 +1868,7 @@
             // register encoding space of instance-of, and propagate type information to the source
             // of the move-object.
             uint32_t move_idx = instance_of_idx - 1;
-            while(0 != move_idx && !insn_flags_[move_idx].IsOpcode()) {
+            while (0 != move_idx && !insn_flags_[move_idx].IsOpcode()) {
               move_idx--;
             }
             CHECK(insn_flags_[move_idx].IsOpcode());
@@ -3766,7 +3766,7 @@
     bool is_interface = (inst->Opcode() == Instruction::INVOKE_INTERFACE) ||
         (inst->Opcode() == Instruction::INVOKE_INTERFACE_RANGE);
 
-    if(!is_interface && !is_virtual) {
+    if (!is_interface && !is_virtual) {
       continue;
     }
     // Get reg type for register holding the reference to the object that will be dispatched upon.
@@ -3792,7 +3792,7 @@
     }
     mirror::AbstractMethod* abstract_method =
         dex_cache_->GetResolvedMethod(is_range ? inst->VRegB_3rc() : inst->VRegB_35c());
-    if(abstract_method == NULL) {
+    if (abstract_method == NULL) {
       // If the method is not found in the cache this means that it was never found
       // by ResolveMethodAndCheckAccess() called when verifying invoke_*.
       continue;
@@ -3986,7 +3986,7 @@
 
   // Look up the PC in the map, get the concrete method to execute and return its reference.
   MethodVerifier::PcToConcreteMethodMap::const_iterator pc_to_concrete_method = it->second->find(dex_pc);
-  if(pc_to_concrete_method != it->second->end()) {
+  if (pc_to_concrete_method != it->second->end()) {
     return &(pc_to_concrete_method->second);
   } else {
     return NULL;
diff --git a/runtime/verifier/reg_type.cc b/runtime/verifier/reg_type.cc
index 1c61a29..8418928 100644
--- a/runtime/verifier/reg_type.cc
+++ b/runtime/verifier/reg_type.cc
@@ -211,7 +211,7 @@
 }
 
 LongLoType* LongLoType::GetInstance() {
-  CHECK (instance_ != NULL);
+  CHECK(instance_ != NULL);
   return instance_;
 }
 
@@ -355,7 +355,7 @@
 }
 
 void BooleanType::Destroy() {
-  if(BooleanType::instance != NULL) {
+  if (BooleanType::instance != NULL) {
     delete instance;
     instance = NULL;
   }
diff --git a/runtime/verifier/reg_type_cache.cc b/runtime/verifier/reg_type_cache.cc
index 6013250..22c585c 100644
--- a/runtime/verifier/reg_type_cache.cc
+++ b/runtime/verifier/reg_type_cache.cc
@@ -377,7 +377,7 @@
     entry = new UnresolvedReferenceType(descriptor.c_str(), entries_.size());
   } else {
     mirror::Class* klass = uninit_type.GetClass();
-    if(uninit_type.IsUninitializedThisReference() && !klass->IsFinal()) {
+    if (uninit_type.IsUninitializedThisReference() && !klass->IsFinal()) {
       // For uninitialized "this reference" look for reference types that are not precise.
       for (size_t i = primitive_count_; i < entries_.size(); i++) {
         RegType* cur_entry = entries_[i];
diff --git a/runtime/verifier/reg_type_cache.h b/runtime/verifier/reg_type_cache.h
index 814dff7..2411758 100644
--- a/runtime/verifier/reg_type_cache.h
+++ b/runtime/verifier/reg_type_cache.h
@@ -44,7 +44,7 @@
   }
   ~RegTypeCache();
   static void Init() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
-    if(!RegTypeCache::primitive_initialized_) {
+    if (!RegTypeCache::primitive_initialized_) {
       CHECK_EQ(RegTypeCache::primitive_count_, 0);
       CreatePrimitiveTypes();
       CHECK_EQ(RegTypeCache::primitive_count_, kNumPrimitives);
diff --git a/runtime/verifier/reg_type_test.cc b/runtime/verifier/reg_type_test.cc
index d2c9dd6..a24c3c9 100644
--- a/runtime/verifier/reg_type_test.cc
+++ b/runtime/verifier/reg_type_test.cc
@@ -405,7 +405,7 @@
   std::string expected = "Unresolved Reference: java.lang.DoesNotExist";
   EXPECT_EQ(expected, unresolved_ref.Dump());
   expected = "Precise Reference: java.lang.String";
-  EXPECT_EQ( expected, resolved_ref.Dump());
+  EXPECT_EQ(expected, resolved_ref.Dump());
   expected ="Uninitialized Reference: java.lang.String Allocation PC: 10";
   EXPECT_EQ(expected, resolved_unintialiesd.Dump());
   expected = "Unresolved And Uninitialized Reference: java.lang.DoesNotExist Allocation PC: 12";