summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/crypto/scoped_capi_types.h2
-rw-r--r--base/event_trace_consumer_win_unittest.cc4
-rw-r--r--base/event_trace_controller_win_unittest.cc12
-rw-r--r--base/event_trace_provider_win_unittest.cc4
-rw-r--r--base/file_util_win.cc16
-rw-r--r--base/iat_patch.cc4
-rw-r--r--base/lock_impl_win.cc6
-rw-r--r--base/scoped_bstr_win_unittest.cc6
-rw-r--r--base/thread_local.h4
9 files changed, 31 insertions, 27 deletions
diff --git a/base/crypto/scoped_capi_types.h b/base/crypto/scoped_capi_types.h
index bdb05c3..73fe51b 100644
--- a/base/crypto/scoped_capi_types.h
+++ b/base/crypto/scoped_capi_types.h
@@ -64,7 +64,7 @@ class ScopedCAPIHandle {
CAPIHandle get() const { return handle_; }
CAPIHandle* receive() {
- CHECK(handle_ == NULL);
+ CHECK_EQ(NULL, handle_);
return &handle_;
}
diff --git a/base/event_trace_consumer_win_unittest.cc b/base/event_trace_consumer_win_unittest.cc
index 6c0a740..9fcc4a6 100644
--- a/base/event_trace_consumer_win_unittest.cc
+++ b/base/event_trace_consumer_win_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
//
@@ -232,7 +232,7 @@ TEST_F(EtwTraceConsumerRealtimeTest, ConsumeEvent) {
INFINITE));
ASSERT_HRESULT_SUCCEEDED(controller.Stop(NULL));
ASSERT_HRESULT_SUCCEEDED(JoinConsumerThread());
- ASSERT_NE(0u, TestConsumer::events_.size());
+ ASSERT_NE(0, TestConsumer::events_.size());
}
namespace {
diff --git a/base/event_trace_controller_win_unittest.cc b/base/event_trace_controller_win_unittest.cc
index 06170de..f688d48 100644
--- a/base/event_trace_controller_win_unittest.cc
+++ b/base/event_trace_controller_win_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
//
@@ -62,9 +62,9 @@ TEST(EtwTracePropertiesTest, Initialization) {
EtwTraceProperties prop;
EVENT_TRACE_PROPERTIES* p = prop.get();
- EXPECT_NE(0u, p->Wnode.BufferSize);
- EXPECT_EQ(0u, p->Wnode.ProviderId);
- EXPECT_EQ(0u, p->Wnode.HistoricalContext);
+ EXPECT_NE(0, p->Wnode.BufferSize);
+ EXPECT_EQ(0, p->Wnode.ProviderId);
+ EXPECT_EQ(0, p->Wnode.HistoricalContext);
EXPECT_TRUE(kGuidNull == p->Wnode.Guid);
EXPECT_EQ(0, p->Wnode.ClientContext);
@@ -86,8 +86,8 @@ TEST(EtwTracePropertiesTest, Initialization) {
EXPECT_EQ(0, p->LogBuffersLost);
EXPECT_EQ(0, p->RealTimeBuffersLost);
EXPECT_EQ(0, p->LoggerThreadId);
- EXPECT_NE(0u, p->LogFileNameOffset);
- EXPECT_NE(0u, p->LoggerNameOffset);
+ EXPECT_NE(0, p->LogFileNameOffset);
+ EXPECT_NE(0, p->LoggerNameOffset);
}
TEST(EtwTracePropertiesTest, Strings) {
diff --git a/base/event_trace_provider_win_unittest.cc b/base/event_trace_provider_win_unittest.cc
index 1efa74f..2ffae82 100644
--- a/base/event_trace_provider_win_unittest.cc
+++ b/base/event_trace_provider_win_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
//
@@ -88,7 +88,7 @@ TEST(EtwTraceProviderTest, Register) {
TEST(EtwTraceProviderTest, RegisterWithNoNameFails) {
EtwTraceProvider provider;
- EXPECT_TRUE(provider.Register() != ERROR_SUCCESS);
+ EXPECT_NE(ERROR_SUCCESS, provider.Register());
}
TEST(EtwTraceProviderTest, Enable) {
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index fcad39c..966a388c 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -647,11 +647,15 @@ int ReadFile(const FilePath& filename, char* data, int size) {
if (file == INVALID_HANDLE_VALUE)
return -1;
+ int ret_value;
DWORD read;
- if (::ReadFile(file, data, size, &read, NULL) &&
- static_cast<int>(read) == size)
- return read;
- return -1;
+ if (::ReadFile(file, data, size, &read, NULL) && read == size) {
+ ret_value = static_cast<int>(read);
+ } else {
+ ret_value = -1;
+ }
+
+ return ret_value;
}
int WriteFile(const FilePath& filename, const char* data, int size) {
@@ -671,8 +675,8 @@ int WriteFile(const FilePath& filename, const char* data, int size) {
DWORD written;
BOOL result = ::WriteFile(file, data, size, &written, NULL);
- if (result && static_cast<int>(written) == size)
- return written;
+ if (result && written == size)
+ return static_cast<int>(written);
if (!result) {
// WriteFile failed.
diff --git a/base/iat_patch.cc b/base/iat_patch.cc
index fa5109f..e705713 100644
--- a/base/iat_patch.cc
+++ b/base/iat_patch.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 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.
@@ -178,7 +178,7 @@ IATPatchFunction::IATPatchFunction()
IATPatchFunction::~IATPatchFunction() {
if (NULL != intercept_function_) {
DWORD error = Unpatch();
- DCHECK(error == NO_ERROR);
+ DCHECK_EQ(NO_ERROR, error);
}
}
diff --git a/base/lock_impl_win.cc b/base/lock_impl_win.cc
index 0d1ac93..0f0e424 100644
--- a/base/lock_impl_win.cc
+++ b/base/lock_impl_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 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.
@@ -29,7 +29,7 @@ bool LockImpl::Try() {
#ifndef NDEBUG
// ONLY access data after locking.
owning_thread_id_ = PlatformThread::CurrentId();
- DCHECK_NE(owning_thread_id_, 0u);
+ DCHECK_NE(owning_thread_id_, 0);
recursion_count_shadow_++;
if (2 == recursion_count_shadow_ && !recursion_used_) {
recursion_used_ = true;
@@ -46,7 +46,7 @@ void LockImpl::Lock() {
#ifndef NDEBUG
// ONLY access data after locking.
owning_thread_id_ = PlatformThread::CurrentId();
- DCHECK_NE(owning_thread_id_, 0u);
+ DCHECK_NE(owning_thread_id_, 0);
recursion_count_shadow_++;
if (2 == recursion_count_shadow_ && !recursion_used_) {
recursion_used_ = true;
diff --git a/base/scoped_bstr_win_unittest.cc b/base/scoped_bstr_win_unittest.cc
index 276f13b..a2e49ac 100644
--- a/base/scoped_bstr_win_unittest.cc
+++ b/base/scoped_bstr_win_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 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.
@@ -52,10 +52,10 @@ void BasicBstrTests() {
EXPECT_TRUE(b2.ByteLength() == 100);
EXPECT_TRUE(b2.Length() == 100 / sizeof(kTestString1[0]));
lstrcpyW(static_cast<BSTR>(b2), kTestString1);
- EXPECT_TRUE(lstrlen(b2) == static_cast<int>(test1_len));
+ EXPECT_TRUE(lstrlen(b2) == test1_len);
EXPECT_TRUE(b2.Length() == 100 / sizeof(kTestString1[0]));
b2.SetByteLen(lstrlen(b2) * sizeof(kTestString2[0]));
- EXPECT_TRUE(lstrlen(b2) == static_cast<int>(b2.Length()));
+ EXPECT_TRUE(lstrlen(b2) == b2.Length());
EXPECT_TRUE(b1.Allocate(kTestString2) != NULL);
EXPECT_TRUE(b1.Length() == test2_len);
diff --git a/base/thread_local.h b/base/thread_local.h
index ec53da5..be387cf 100644
--- a/base/thread_local.h
+++ b/base/thread_local.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 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.
@@ -59,7 +59,7 @@ namespace base {
// Helper functions that abstract the cross-platform APIs. Do not use directly.
struct ThreadLocalPlatform {
#if defined(OS_WIN)
- typedef unsigned long SlotType;
+ typedef int SlotType;
#elif defined(OS_POSIX)
typedef pthread_key_t SlotType;
#endif