diff options
author | Brian Carlstrom <bdc@google.com> | 2013-07-26 10:54:15 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2013-07-26 11:55:10 -0700 |
commit | 7934ac288acfb2552bb0b06ec1f61e5820d924a4 (patch) | |
tree | 43f3acd8af7fd34d4ae7b64f6e06bb8429d74bb8 /runtime/base | |
parent | fb331d7ca004f39608fcfdae49d38df90c702ea9 (diff) | |
download | art-7934ac288acfb2552bb0b06ec1f61e5820d924a4.zip art-7934ac288acfb2552bb0b06ec1f61e5820d924a4.tar.gz art-7934ac288acfb2552bb0b06ec1f61e5820d924a4.tar.bz2 |
Fix cpplint whitespace/comments issues
Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
Diffstat (limited to 'runtime/base')
-rw-r--r-- | runtime/base/histogram_test.cc | 28 | ||||
-rw-r--r-- | runtime/base/logging.cc | 2 | ||||
-rw-r--r-- | runtime/base/logging.h | 4 | ||||
-rw-r--r-- | runtime/base/macros.h | 2 | ||||
-rw-r--r-- | runtime/base/mutex-inl.h | 2 | ||||
-rw-r--r-- | runtime/base/mutex.cc | 10 | ||||
-rw-r--r-- | runtime/base/unix_file/mapped_file_test.cc | 2 |
7 files changed, 25 insertions, 25 deletions
diff --git a/runtime/base/histogram_test.cc b/runtime/base/histogram_test.cc index 5592f1c..218c022 100644 --- a/runtime/base/histogram_test.cc +++ b/runtime/base/histogram_test.cc @@ -22,16 +22,16 @@ namespace art { -//Simple usage: -// Histogram *hist = new Histogram("SimplePercentiles"); -// Percentile PerValue -// hist->AddValue(121); -// hist->AddValue(132); -// hist->AddValue(140); -// hist->AddValue(145); -// hist->AddValue(155); -// hist->CreateHistogram(); -// PerValue = hist->PercentileVal(0.50); finds the 50th percentile(median). +// Simple usage: +// Histogram *hist = new Histogram("SimplePercentiles"); +// Percentile PerValue +// hist->AddValue(121); +// hist->AddValue(132); +// hist->AddValue(140); +// hist->AddValue(145); +// hist->AddValue(155); +// hist->CreateHistogram(); +// PerValue = hist->PercentileVal(0.50); finds the 50th percentile(median). TEST(Histtest, MeanTest) { UniquePtr<Histogram<uint64_t> > hist(new Histogram<uint64_t>("MeanTest")); @@ -105,7 +105,7 @@ TEST(Histtest, UpdateRange) { hist->AddValue(110); hist->AddValue(121); hist->AddValue(132); - hist->AddValue(140); //Median value + hist->AddValue(140); // Median value hist->AddValue(145); hist->AddValue(155); hist->AddValue(163); @@ -148,7 +148,7 @@ TEST(Histtest, Reset) { hist->AddValue(110); hist->AddValue(121); hist->AddValue(132); - hist->AddValue(140); //Median value + hist->AddValue(140); // Median value hist->AddValue(145); hist->AddValue(155); hist->AddValue(163); @@ -188,7 +188,7 @@ TEST(Histtest, MultipleCreateHist) { hist->AddValue(110); hist->AddValue(121); hist->AddValue(132); - hist->AddValue(140); //Median value + hist->AddValue(140); // Median value hist->AddValue(145); hist->AddValue(155); hist->AddValue(163); @@ -265,4 +265,4 @@ TEST(Histtest, SpikyValues) { EXPECT_EQ(expected, stream.str()); } -} // namespace art +} // namespace art diff --git a/runtime/base/logging.cc b/runtime/base/logging.cc index bf19e8d..83ecca8 100644 --- a/runtime/base/logging.cc +++ b/runtime/base/logging.cc @@ -126,7 +126,7 @@ LogMessageData::LogMessageData(const char* file, int line, LogSeverity severity, LogMessage::~LogMessage() { if (data_->severity < gMinimumLogSeverity) { - return; // No need to format something we're not going to output. + return; // No need to format something we're not going to output. } // Finish constructing the message. diff --git a/runtime/base/logging.h b/runtime/base/logging.h index af2cdb3..d641ae4 100644 --- a/runtime/base/logging.h +++ b/runtime/base/logging.h @@ -299,7 +299,7 @@ class ToStr { // The members of this struct are the valid arguments to VLOG and VLOG_IS_ON in code, // and the "-verbose:" command line argument. struct LogVerbosity { - bool class_linker; // Enabled with "-verbose:class". + bool class_linker; // Enabled with "-verbose:class". bool compiler; bool heap; bool gc; @@ -307,7 +307,7 @@ struct LogVerbosity { bool jni; bool monitor; bool startup; - bool third_party_jni; // Enabled with "-verbose:third-party-jni". + bool third_party_jni; // Enabled with "-verbose:third-party-jni". bool threads; }; diff --git a/runtime/base/macros.h b/runtime/base/macros.h index 44a7f1e..879c10c 100644 --- a/runtime/base/macros.h +++ b/runtime/base/macros.h @@ -196,6 +196,6 @@ template<typename T> void UNUSED(const T&) {} #define SHARED_TRYLOCK_FUNCTION(...) #define UNLOCK_FUNCTION(...) -#endif // defined(__SUPPORT_TS_ANNOTATION__) +#endif // defined(__SUPPORT_TS_ANNOTATION__) #endif // ART_RUNTIME_BASE_MACROS_H_ diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h index b3f5092..1337dff 100644 --- a/runtime/base/mutex-inl.h +++ b/runtime/base/mutex-inl.h @@ -167,7 +167,7 @@ inline void ReaderWriterMutex::SharedUnlock(Thread* self) { if (LIKELY(cur_state > 0)) { // Reduce state by 1. done = android_atomic_release_cas(cur_state, cur_state - 1, &state_) == 0; - if (done && (cur_state - 1) == 0) { // cas may fail due to noise? + if (done && (cur_state - 1) == 0) { // cas may fail due to noise? if (num_pending_writers_ > 0 || num_pending_readers_ > 0) { // Wake any exclusive waiters as there are now no readers. futex(&state_, FUTEX_WAKE, -1, NULL, NULL, 0); diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index 1a6020b..d822eed 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -400,7 +400,7 @@ void Mutex::ExclusiveUnlock(Thread* self) { exclusive_owner_ = 0; // Change state to 0. done = android_atomic_release_cas(cur_state, 0, &state_) == 0; - if (done) { // Spurious fail? + if (done) { // Spurious fail? // Wake a contender if (num_contenders_ > 0) { futex(&state_, FUTEX_WAKE, 1, NULL, NULL, 0); @@ -478,7 +478,7 @@ ReaderWriterMutex::ReaderWriterMutex(const char* name, LockLevel level) #if ART_USE_FUTEXES , state_(0), exclusive_owner_(0), num_pending_readers_(0), num_pending_writers_(0) #endif -{ // NOLINT(whitespace/braces) +{ // NOLINT(whitespace/braces) #if !ART_USE_FUTEXES CHECK_MUTEX_CALL(pthread_rwlock_init, (&rwlock_, NULL)); #endif @@ -551,7 +551,7 @@ void ReaderWriterMutex::ExclusiveUnlock(Thread* self) { exclusive_owner_ = 0; // Change state from -1 to 0. done = android_atomic_release_cas(-1, 0, &state_) == 0; - if (done) { // cmpxchg may fail due to noise? + if (done) { // cmpxchg may fail due to noise? // Wake any waiters. if (num_pending_readers_ > 0 || num_pending_writers_ > 0) { futex(&state_, FUTEX_WAKE, -1, NULL, NULL, 0); @@ -756,7 +756,7 @@ void ConditionVariable::Broadcast(Thread* self) { DCHECK_EQ(guard_.GetExclusiveOwnerTid(), SafeGetTid(self)); #if ART_USE_FUTEXES if (num_waiters_ > 0) { - android_atomic_inc(&sequence_); // Indicate the broadcast occurred. + android_atomic_inc(&sequence_); // Indicate the broadcast occurred. bool done = false; do { int32_t cur_sequence = sequence_; @@ -782,7 +782,7 @@ void ConditionVariable::Signal(Thread* self) { guard_.AssertExclusiveHeld(self); #if ART_USE_FUTEXES if (num_waiters_ > 0) { - android_atomic_inc(&sequence_); // Indicate a signal occurred. + android_atomic_inc(&sequence_); // Indicate a signal occurred. // Futex wake 1 waiter who will then come and in contend on mutex. It'd be nice to requeue them // to avoid this, however, requeueing can only move all waiters. int num_woken = futex(&sequence_, FUTEX_WAKE, 1, NULL, NULL, 0); diff --git a/runtime/base/unix_file/mapped_file_test.cc b/runtime/base/unix_file/mapped_file_test.cc index a3b097d..3dda02f 100644 --- a/runtime/base/unix_file/mapped_file_test.cc +++ b/runtime/base/unix_file/mapped_file_test.cc @@ -212,7 +212,7 @@ TEST_F(MappedFileTest, WriteMappedReadWrite) { EXPECT_EQ(0, memcmp(kContent.c_str(), file.data(), kContent.size())); } -#if 0 // death tests don't work on android yet +#if 0 // death tests don't work on android yet class MappedFileDeathTest : public MappedFileTest {}; |