summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 20:21:16 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 20:21:16 +0000
commitbd635c097dfc689674d6b21c006850a7b07f23f4 (patch)
treeb9c8bdf9edc379e288c14f64e063e29efe7635c8 /base
parent19dc5d7922dc07b61c037ebbcc86f20dad27eab2 (diff)
downloadchromium_src-bd635c097dfc689674d6b21c006850a7b07f23f4.zip
chromium_src-bd635c097dfc689674d6b21c006850a7b07f23f4.tar.gz
chromium_src-bd635c097dfc689674d6b21c006850a7b07f23f4.tar.bz2
Enable warning 4389 as an error on windows builds. This will make
windows builds more similar to linux/mac, which already treat signed/ unsigned equality comparisons as warnings (and hence errors). BUG=44471 TEST=none Review URL: http://codereview.chromium.org/2081007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48186 0039d316-1c4b-4281-b951-d872f2087c98
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, 27 insertions, 31 deletions
diff --git a/base/crypto/scoped_capi_types.h b/base/crypto/scoped_capi_types.h
index 73fe51b..bdb05c3 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_EQ(NULL, handle_);
+ CHECK(handle_ == NULL);
return &handle_;
}
diff --git a/base/event_trace_consumer_win_unittest.cc b/base/event_trace_consumer_win_unittest.cc
index 9fcc4a6..6c0a740 100644
--- a/base/event_trace_consumer_win_unittest.cc
+++ b/base/event_trace_consumer_win_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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(0, TestConsumer::events_.size());
+ ASSERT_NE(0u, TestConsumer::events_.size());
}
namespace {
diff --git a/base/event_trace_controller_win_unittest.cc b/base/event_trace_controller_win_unittest.cc
index f688d48..06170de 100644
--- a/base/event_trace_controller_win_unittest.cc
+++ b/base/event_trace_controller_win_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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(0, p->Wnode.BufferSize);
- EXPECT_EQ(0, p->Wnode.ProviderId);
- EXPECT_EQ(0, p->Wnode.HistoricalContext);
+ EXPECT_NE(0u, p->Wnode.BufferSize);
+ EXPECT_EQ(0u, p->Wnode.ProviderId);
+ EXPECT_EQ(0u, 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(0, p->LogFileNameOffset);
- EXPECT_NE(0, p->LoggerNameOffset);
+ EXPECT_NE(0u, p->LogFileNameOffset);
+ EXPECT_NE(0u, p->LoggerNameOffset);
}
TEST(EtwTracePropertiesTest, Strings) {
diff --git a/base/event_trace_provider_win_unittest.cc b/base/event_trace_provider_win_unittest.cc
index 2ffae82..1efa74f 100644
--- a/base/event_trace_provider_win_unittest.cc
+++ b/base/event_trace_provider_win_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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_NE(ERROR_SUCCESS, provider.Register());
+ EXPECT_TRUE(provider.Register() != ERROR_SUCCESS);
}
TEST(EtwTraceProviderTest, Enable) {
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 4f96ef3..fb65feb 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -656,15 +656,11 @@ 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) && read == size) {
- ret_value = static_cast<int>(read);
- } else {
- ret_value = -1;
- }
-
- return ret_value;
+ if (::ReadFile(file, data, size, &read, NULL) &&
+ static_cast<int>(read) == size)
+ return read;
+ return -1;
}
int WriteFile(const FilePath& filename, const char* data, int size) {
@@ -684,8 +680,8 @@ int WriteFile(const FilePath& filename, const char* data, int size) {
DWORD written;
BOOL result = ::WriteFile(file, data, size, &written, NULL);
- if (result && written == size)
- return static_cast<int>(written);
+ if (result && static_cast<int>(written) == size)
+ return written;
if (!result) {
// WriteFile failed.
diff --git a/base/iat_patch.cc b/base/iat_patch.cc
index e705713..fa5109f 100644
--- a/base/iat_patch.cc
+++ b/base/iat_patch.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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_EQ(NO_ERROR, error);
+ DCHECK(error == NO_ERROR);
}
}
diff --git a/base/lock_impl_win.cc b/base/lock_impl_win.cc
index 0f0e424..0d1ac93 100644
--- a/base/lock_impl_win.cc
+++ b/base/lock_impl_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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_, 0);
+ DCHECK_NE(owning_thread_id_, 0u);
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_, 0);
+ DCHECK_NE(owning_thread_id_, 0u);
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 a2e49ac..276f13b 100644
--- a/base/scoped_bstr_win_unittest.cc
+++ b/base/scoped_bstr_win_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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) == test1_len);
+ EXPECT_TRUE(lstrlen(b2) == static_cast<int>(test1_len));
EXPECT_TRUE(b2.Length() == 100 / sizeof(kTestString1[0]));
b2.SetByteLen(lstrlen(b2) * sizeof(kTestString2[0]));
- EXPECT_TRUE(lstrlen(b2) == b2.Length());
+ EXPECT_TRUE(lstrlen(b2) == static_cast<int>(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 be387cf..ec53da5 100644
--- a/base/thread_local.h
+++ b/base/thread_local.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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 int SlotType;
+ typedef unsigned long SlotType;
#elif defined(OS_POSIX)
typedef pthread_key_t SlotType;
#endif