summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/metrics/field_trial.cc2
-rw-r--r--base/pickle.cc2
-rw-r--r--base/process_util_mac.mm2
-rw-r--r--base/process_util_win.cc2
-rw-r--r--base/rand_util.cc6
-rw-r--r--base/threading/thread_local_posix.cc4
-rw-r--r--base/threading/thread_local_storage_win.cc6
-rw-r--r--base/time_mac.cc4
8 files changed, 16 insertions, 12 deletions
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc
index daeb369..03e5809 100644
--- a/base/metrics/field_trial.cc
+++ b/base/metrics/field_trial.cc
@@ -163,7 +163,7 @@ FieldTrialList::~FieldTrialList() {
it->second->Release();
registered_.erase(it->first);
}
- DCHECK(this == global_);
+ DCHECK_EQ(this, global_);
global_ = NULL;
}
diff --git a/base/pickle.cc b/base/pickle.cc
index 80d362f..a1d2061 100644
--- a/base/pickle.cc
+++ b/base/pickle.cc
@@ -327,7 +327,7 @@ bool Pickle::WriteData(const char* data, int length) {
}
bool Pickle::WriteBytes(const void* data, int data_len) {
- DCHECK(capacity_ != kCapacityReadOnly) << "oops: pickle is readonly";
+ DCHECK_NE(kCapacityReadOnly, capacity_) << "oops: pickle is readonly";
char* dest = BeginWrite(data_len);
if (!dest)
diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm
index e2df2ca..5c81b2a 100644
--- a/base/process_util_mac.mm
+++ b/base/process_util_mac.mm
@@ -437,7 +437,7 @@ double ProcessMetrics::GetCPUUsage() {
int64 system_time_delta = task_time - last_system_time_;
int64 time_delta = time - last_time_;
- DCHECK(time_delta != 0);
+ DCHECK_NE(0U, time_delta);
if (time_delta == 0)
return 0;
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index a49b78c..5b07105 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -770,7 +770,7 @@ double ProcessMetrics::GetCPUUsage() {
int64 system_time_delta = system_time - last_system_time_;
int64 time_delta = time - last_time_;
- DCHECK(time_delta != 0);
+ DCHECK_NE(0U, time_delta);
if (time_delta == 0)
return 0;
diff --git a/base/rand_util.cc b/base/rand_util.cc
index d89f8b7..a71bb0c 100644
--- a/base/rand_util.cc
+++ b/base/rand_util.cc
@@ -18,7 +18,8 @@ int RandInt(int min, int max) {
uint64 range = static_cast<uint64>(max) - min + 1;
int result = min + static_cast<int>(base::RandGenerator(range));
- DCHECK(result >= min && result <= max);
+ DCHECK_GE(result, min);
+ DCHECK_LE(result, max);
return result;
}
@@ -32,7 +33,8 @@ double RandDouble() {
static const int kBits = std::numeric_limits<double>::digits;
uint64 random_bits = base::RandUint64() & ((GG_UINT64_C(1) << kBits) - 1);
double result = ldexp(static_cast<double>(random_bits), -1 * kBits);
- DCHECK(result >= 0.0 && result < 1.0);
+ DCHECK_GE(result, 0.0);
+ DCHECK_LT(result, 1.0);
return result;
}
diff --git a/base/threading/thread_local_posix.cc b/base/threading/thread_local_posix.cc
index 568fa4b..2071ad8 100644
--- a/base/threading/thread_local_posix.cc
+++ b/base/threading/thread_local_posix.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -21,7 +21,7 @@ void ThreadLocalPlatform::AllocateSlot(SlotType& slot) {
// static
void ThreadLocalPlatform::FreeSlot(SlotType& slot) {
int error = pthread_key_delete(slot);
- DCHECK(error == 0);
+ DCHECK_EQ(0, error);
}
// static
diff --git a/base/threading/thread_local_storage_win.cc b/base/threading/thread_local_storage_win.cc
index c8128f1..90fdcd3 100644
--- a/base/threading/thread_local_storage_win.cc
+++ b/base/threading/thread_local_storage_win.cc
@@ -90,7 +90,8 @@ void* ThreadLocalStorage::Slot::Get() const {
void** tls_data = static_cast<void**>(TlsGetValue(tls_key_));
if (!tls_data)
tls_data = ThreadLocalStorage::Initialize();
- DCHECK(slot_ >= 0 && slot_ < kThreadLocalStorageSize);
+ DCHECK_GE(slot_, 0);
+ DCHECK_LT(slot_, kThreadLocalStorageSize);
return tls_data[slot_];
}
@@ -98,7 +99,8 @@ void ThreadLocalStorage::Slot::Set(void* value) {
void** tls_data = static_cast<void**>(TlsGetValue(tls_key_));
if (!tls_data)
tls_data = ThreadLocalStorage::Initialize();
- DCHECK(slot_ >= 0 && slot_ < kThreadLocalStorageSize);
+ DCHECK_GE(slot_, 0);
+ DCHECK_LT(slot_, kThreadLocalStorageSize);
tls_data[slot_] = value;
}
diff --git a/base/time_mac.cc b/base/time_mac.cc
index ad31410..25cf037 100644
--- a/base/time_mac.cc
+++ b/base/time_mac.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -112,7 +112,7 @@ TimeTicks TimeTicks::Now() {
// whether mach_timebase_info has already been called. This is
// recommended by Apple's QA1398.
kern_return_t kr = mach_timebase_info(&timebase_info);
- DCHECK(kr == KERN_SUCCESS);
+ DCHECK_EQ(KERN_SUCCESS, kr);
}
// mach_absolute_time is it when it comes to ticks on the Mac. Other calls