summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-26 01:52:40 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-26 01:52:40 +0000
commit2fbc33967abe8fd301a1c0ce35a625ed98bf41f9 (patch)
tree2993e976c8470926d9e7f46a1da099c6045eecde
parentb33f1d943fd420857d9c5988ce1f4598f9a8765a (diff)
downloadchromium_src-2fbc33967abe8fd301a1c0ce35a625ed98bf41f9.zip
chromium_src-2fbc33967abe8fd301a1c0ce35a625ed98bf41f9.tar.gz
chromium_src-2fbc33967abe8fd301a1c0ce35a625ed98bf41f9.tar.bz2
Revert "Another dependency the bbot missed!!!"
This reverts commit 161f7fd3bdd425167af9fe26fdc5373a2ff44c98. Revert "Missed a file as part of checkin for r48186" This reverts commit cff86beba5938209393a6c3bccced62a7f3ff36b. Revert "Enable warning 4389 as an error on windows builds. This will make" This reverts commit c78936bcfc65b98edf288191d927a495b0364621. TBR=mbelshe Review URL: http://codereview.chromium.org/2253001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48238 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--app/os_exchange_data_provider_win.cc11
-rw-r--r--app/win/window_impl.h4
-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
-rw-r--r--build/common.gypi6
-rw-r--r--chrome/app/chrome_dll_main.cc4
-rw-r--r--chrome/browser/automation/ui_controls_win.cc8
-rw-r--r--chrome/browser/debugger/devtools_remote_listen_socket_unittest.cc4
-rw-r--r--chrome/browser/extensions/extension_uitest.cc6
-rw-r--r--chrome/browser/importer/importer_unittest.cc4
-rw-r--r--chrome/browser/sync/syncable/syncable.cc11
-rw-r--r--chrome/browser/views/select_profile_dialog.cc18
-rw-r--r--chrome/installer/util/l10n_string_util.cc4
-rw-r--r--chrome_frame/chrome_active_document.cc6
-rw-r--r--chrome_frame/chrome_frame_activex.cc10
-rw-r--r--chrome_frame/chrome_launcher.cc4
-rw-r--r--chrome_frame/function_stub_unittest.cc10
-rw-r--r--chrome_frame/html_utils.cc11
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.cc2
-rw-r--r--chrome_frame/test/exception_barrier_unittest.cc6
-rw-r--r--chrome_frame/test/html_util_unittests.cc6
-rw-r--r--chrome_frame/test/perf/chrome_frame_perftest.cc6
-rw-r--r--chrome_frame/test/util_unittests.cc6
-rw-r--r--chrome_frame/urlmon_url_request.cc6
-rw-r--r--gfx/icon_util.cc6
-rw-r--r--net/base/listen_socket_unittest.cc4
-rw-r--r--net/base/network_change_notifier_win.cc4
-rw-r--r--net/socket/tcp_client_socket_win.cc4
-rw-r--r--net/tools/dump_cache/cache_dumper.cc8
-rw-r--r--net/tools/dump_cache/upgrade.cc8
-rw-r--r--sandbox/src/file_policy_test.cc32
-rw-r--r--sandbox/src/interception_unittest.cc16
-rw-r--r--sandbox/src/job_unittest.cc18
-rw-r--r--sandbox/src/restricted_token_unittest.cc8
-rw-r--r--sandbox/src/win_utils_unittest.cc4
-rw-r--r--views/controls/table/table_view.cc2
-rw-r--r--webkit/default_plugin/plugin_database_handler.cc4
44 files changed, 162 insertions, 167 deletions
diff --git a/app/os_exchange_data_provider_win.cc b/app/os_exchange_data_provider_win.cc
index 9429b58..b977252 100644
--- a/app/os_exchange_data_provider_win.cc
+++ b/app/os_exchange_data_provider_win.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.
@@ -84,7 +84,7 @@ class FormatEtcEnumerator : public IEnumFORMATETC {
std::vector<FORMATETC*> contents_;
// The cursor of the active enumeration - an index into |contents_|.
- size_t cursor_;
+ int cursor_;
LONG ref_count_;
@@ -125,8 +125,9 @@ STDMETHODIMP FormatEtcEnumerator::Next(
DCHECK(count == 1);
// This method copies count elements into |elements_array|.
- ULONG index = 0;
- while (cursor_ < contents_.size() && index < count) {
+ int index = 0;
+ while (cursor_ < static_cast<int>(contents_.size()) &&
+ static_cast<ULONG>(index) < count) {
CloneFormatEtc(contents_.at(cursor_), &elements_array[index]);
++cursor_;
++index;
@@ -143,7 +144,7 @@ STDMETHODIMP FormatEtcEnumerator::Skip(ULONG skip_count) {
cursor_ += skip_count;
// MSDN implies it's OK to leave the enumerator trashed.
// "Whatever you say, boss"
- return cursor_ <= contents_.size() ? S_OK : S_FALSE;
+ return cursor_ <= static_cast<int>(contents_.size()) ? S_OK : S_FALSE;
}
STDMETHODIMP FormatEtcEnumerator::Reset() {
diff --git a/app/win/window_impl.h b/app/win/window_impl.h
index f63894e..67f3bf7 100644
--- a/app/win/window_impl.h
+++ b/app/win/window_impl.h
@@ -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.
@@ -65,7 +65,7 @@ class WindowImpl : public MessageMapInterface {
// Sets the class style to use. The default is CS_DBLCLKS.
void set_initial_class_style(UINT class_style) {
// We dynamically generate the class name, so don't register it globally!
- DCHECK_EQ((class_style & CS_GLOBALCLASS), 0u);
+ DCHECK_EQ((class_style & CS_GLOBALCLASS), 0);
class_style_ = class_style;
}
UINT initial_class_style() const { return class_style_; }
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
diff --git a/build/common.gypi b/build/common.gypi
index be7a21e..0e66dba 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -554,12 +554,6 @@
# We use "POSIX" to refer to all non-Windows operating systems.
['OS=="win"', {
'sources/': [ ['exclude', '_posix\\.cc$'] ],
- # turn on warnings for signed/unsigned mismatch on chromium code.
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'AdditionalOptions': ['/we4389'],
- },
- },
}],
# Though Skia is conceptually shared by Linux and Windows,
# the only _skia files in our tree are Linux-specific.
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index ca682a5..edfadd9 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.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.
@@ -524,7 +524,7 @@ int ChromeMain(int argc, char** argv) {
browser_pid =
static_cast<base::ProcessId>(StringToInt(WideToASCII(channel_name)));
- DCHECK_NE(browser_pid, 0u);
+ DCHECK_NE(browser_pid, 0);
#else
browser_pid = base::GetCurrentProcId();
#endif
diff --git a/chrome/browser/automation/ui_controls_win.cc b/chrome/browser/automation/ui_controls_win.cc
index 85aafec..4e9f673 100644
--- a/chrome/browser/automation/ui_controls_win.cc
+++ b/chrome/browser/automation/ui_controls_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.
@@ -183,7 +183,7 @@ bool SendKeyPressImpl(base::KeyboardCode key,
INPUT input[8] = { 0 }; // 8, assuming all the modifiers are activated
- UINT i = 0;
+ int i = 0;
if (control) {
if (!FillKeyboardInput(base::VKEY_CONTROL, &input[i], false))
return false;
@@ -228,7 +228,9 @@ bool SendKeyPressImpl(base::KeyboardCode key,
i++;
}
- if (::SendInput(i, input, sizeof(INPUT) != i))
+ unsigned int rv = ::SendInput(i, input, sizeof(INPUT));
+
+ if (rv != i)
return false;
if (dispatcher.get())
diff --git a/chrome/browser/debugger/devtools_remote_listen_socket_unittest.cc b/chrome/browser/debugger/devtools_remote_listen_socket_unittest.cc
index be08b4c6..79755e9 100644
--- a/chrome/browser/debugger/devtools_remote_listen_socket_unittest.cc
+++ b/chrome/browser/debugger/devtools_remote_listen_socket_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.
@@ -79,7 +79,7 @@ void DevToolsRemoteListenSocketTester::SetUp() {
// verify the connect/accept and setup test_socket_
test_socket_ = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- ASSERT_NE(INVALID_SOCKET, test_socket_);
+ ASSERT_NE(-1, test_socket_);
struct sockaddr_in client;
client.sin_family = AF_INET;
client.sin_addr.s_addr = inet_addr(kLoopback);
diff --git a/chrome/browser/extensions/extension_uitest.cc b/chrome/browser/extensions/extension_uitest.cc
index 9adb732..6457728 100644
--- a/chrome/browser/extensions/extension_uitest.cc
+++ b/chrome/browser/extensions/extension_uitest.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.
@@ -163,7 +163,7 @@ TEST_F(ExtensionTestSimpleApiCall, FLAKY_RunTest) {
int callback_id = 0xBAADF00D;
message_dict->GetInteger(keys::kAutomationRequestIdKey, &callback_id);
- EXPECT_NE(callback_id, static_cast<int>(0xBAADF00D));
+ EXPECT_NE(callback_id, 0xBAADF00D);
bool has_callback = true;
EXPECT_TRUE(message_dict->GetBoolean(keys::kAutomationHasCallbackKey,
@@ -246,7 +246,7 @@ public:
std::string args;
EXPECT_TRUE(request_dict->GetString(keys::kAutomationArgsKey, &args));
- EXPECT_NE(std::string::npos, args.find("42"));
+ EXPECT_NE(args.find("42"), -1);
loop_.Quit();
} else {
FAIL();
diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc
index 3da8361..eac9bed 100644
--- a/chrome/browser/importer/importer_unittest.cc
+++ b/chrome/browser/importer/importer_unittest.cc
@@ -122,7 +122,7 @@ const int kMaxPathSize = 5;
typedef struct {
const bool in_toolbar;
- const size_t path_size;
+ const int path_size;
const wchar_t* path[kMaxPathSize];
const wchar_t* title;
const char* url;
@@ -184,7 +184,7 @@ bool FindBookmarkEntry(const ProfileWriter::BookmarkEntry& entry,
list[i].url == entry.url.spec() &&
list[i].title == entry.title) {
bool equal = true;
- for (size_t k = 0; k < list[i].path_size; ++k)
+ for (int k = 0; k < list[i].path_size; ++k)
if (list[i].path[k] != entry.path[k]) {
equal = false;
break;
diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc
index ae0307c..01c2fc7 100644
--- a/chrome/browser/sync/syncable/syncable.cc
+++ b/chrome/browser/sync/syncable/syncable.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.
@@ -586,13 +586,12 @@ void Directory::VacuumAfterSaveChanges(const SaveChangesSnapshot& snapshot) {
size_t num_erased = 0;
kernel_->flushed_metahandles.Push(entry->ref(META_HANDLE));
num_erased = kernel_->ids_index->erase(entry);
- DCHECK_EQ(1u, num_erased);
+ DCHECK(1 == num_erased);
num_erased = kernel_->metahandles_index->erase(entry);
- DCHECK_EQ(1u, num_erased);
+ DCHECK(1 == num_erased);
- // Might not be in it
- num_erased = kernel_->client_tag_index->erase(entry);
- DCHECK_EQ(entry->ref(UNIQUE_CLIENT_TAG).empty(), !num_erased);
+ num_erased = kernel_->client_tag_index->erase(entry); // Might not be in it
+ DCHECK(!entry->ref(UNIQUE_CLIENT_TAG).empty() == num_erased);
delete entry;
}
}
diff --git a/chrome/browser/views/select_profile_dialog.cc b/chrome/browser/views/select_profile_dialog.cc
index c92c2f8..d4af82e 100644
--- a/chrome/browser/views/select_profile_dialog.cc
+++ b/chrome/browser/views/select_profile_dialog.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.
@@ -83,8 +83,8 @@ std::wstring SelectProfileDialog::GetWindowTitle() const {
}
bool SelectProfileDialog::Accept() {
- size_t index = profile_combobox_->selected_item();
- if (index > profiles_.size()) {
+ int index = profile_combobox_->selected_item();
+ if (index < 0) {
NOTREACHED();
return true;
}
@@ -93,10 +93,11 @@ bool SelectProfileDialog::Accept() {
// new profile dialog to the user.
if (index == profiles_.size()) {
NewProfileDialog::RunDialog();
- } else {
- std::wstring profile_name = profiles_[index];
- UserDataManager::Get()->LaunchChromeForProfile(profile_name);
+ return true;
}
+
+ std::wstring profile_name = profiles_[index];
+ UserDataManager::Get()->LaunchChromeForProfile(profile_name);
return true;
}
@@ -115,11 +116,10 @@ int SelectProfileDialog::GetItemCount() {
}
std::wstring SelectProfileDialog::GetItemAt(int index) {
- size_t index_size_t = index;
- DCHECK_LE(index_size_t, profiles_.size());
+ DCHECK(index >= 0 && index <= static_cast<int>(profiles_.size()));
// For the last item in the drop down, return the <New Profile> text,
// otherwise return the corresponding profile name from the vector.
- return index_size_t == profiles_.size() ?
+ return index == profiles_.size() ?
l10n_util::GetString(IDS_SELECT_PROFILE_DIALOG_NEW_PROFILE_ENTRY) :
profiles_[index];
}
diff --git a/chrome/installer/util/l10n_string_util.cc b/chrome/installer/util/l10n_string_util.cc
index 2f571de..6e9b726 100644
--- a/chrome/installer/util/l10n_string_util.cc
+++ b/chrome/installer/util/l10n_string_util.cc
@@ -42,7 +42,7 @@ std::wstring GetSystemLanguage(const bool use_omaha_language) {
}
length = GetLocaleInfo(id, LOCALE_SISO639LANGNAME,
WriteInto(&language, length), length);
- DCHECK(length == static_cast<int>(language.length() + 1));
+ DCHECK(length == language.length() + 1);
StringToLowerASCII(&language);
// Add the country if we need it.
@@ -51,7 +51,7 @@ std::wstring GetSystemLanguage(const bool use_omaha_language) {
if (0 != length) {
length = GetLocaleInfo(id, LOCALE_SISO3166CTRYNAME,
WriteInto(&country, length), length);
- DCHECK(length == static_cast<int>(country.length() + 1));
+ DCHECK(length == country.length() + 1);
StringToLowerASCII(&country);
if (L"en" == language) {
if (L"gb" == country) {
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index 894564a..3dab106 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -873,11 +873,11 @@ bool ChromeActiveDocument::HandleContextMenuCommand(UINT cmd,
ScopedComPtr<IWebBrowser2> web_browser2;
DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive());
- if (cmd == static_cast<UINT>(context_menu_IDC_BACK)) {
+ if (cmd == context_menu_IDC_BACK) {
web_browser2->GoBack();
- } else if (cmd == static_cast<UINT>(context_menu_IDC_FORWARD)) {
+ } else if (cmd == context_menu_IDC_FORWARD) {
web_browser2->GoForward();
- } else if (cmd == static_cast<UINT>(context_menu_IDC_RELOAD)) {
+ } else if (cmd == context_menu_IDC_RELOAD) {
web_browser2->Refresh();
} else {
return BaseActiveX::HandleContextMenuCommand(cmd, params);
diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc
index bd6b937..fb8721d 100644
--- a/chrome_frame/chrome_frame_activex.cc
+++ b/chrome_frame/chrome_frame_activex.cc
@@ -128,11 +128,11 @@ HRESULT ChromeFrameActivex::FinalConstruct() {
ChromeFrameActivex::~ChromeFrameActivex() {
// We expect these to be released during a call to SetClientSite(NULL).
- DCHECK_EQ(0u, onmessage_.size());
- DCHECK_EQ(0u, onloaderror_.size());
- DCHECK_EQ(0u, onload_.size());
- DCHECK_EQ(0u, onreadystatechanged_.size());
- DCHECK_EQ(0u, onextensionready_.size());
+ DCHECK_EQ(0, onmessage_.size());
+ DCHECK_EQ(0, onloaderror_.size());
+ DCHECK_EQ(0, onload_.size());
+ DCHECK_EQ(0, onreadystatechanged_.size());
+ DCHECK_EQ(0, onextensionready_.size());
if (chrome_wndproc_hook_) {
BOOL unhook_success = ::UnhookWindowsHookEx(chrome_wndproc_hook_);
diff --git a/chrome_frame/chrome_launcher.cc b/chrome_frame/chrome_launcher.cc
index 34f1e9f..0303b3b 100644
--- a/chrome_frame/chrome_launcher.cc
+++ b/chrome_frame/chrome_launcher.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.
@@ -65,7 +65,7 @@ CommandLine* CreateLaunchCommandLine() {
}
void SanitizeCommandLine(const CommandLine& original, CommandLine* sanitized) {
- size_t num_sanitized_switches = 0;
+ int num_sanitized_switches = 0;
for (int i = 0; i < arraysize(kAllowedSwitches); ++i) {
const char* current_switch = kAllowedSwitches[i];
if (original.HasSwitch(current_switch)) {
diff --git a/chrome_frame/function_stub_unittest.cc b/chrome_frame/function_stub_unittest.cc
index 3f89bec..4ad2c31 100644
--- a/chrome_frame/function_stub_unittest.cc
+++ b/chrome_frame/function_stub_unittest.cc
@@ -74,15 +74,13 @@ class FunctionStubTest: public testing::Test {
static uintptr_t CALLBACK FooCallback0(FunctionStubTest* test) {
return test->Foo0();
}
- static uintptr_t CALLBACK FooCallback1(FunctionStubTest* test,
- uintptr_t arg) {
+ static uintptr_t CALLBACK FooCallback1(FunctionStubTest* test, uintptr_t arg) {
return test->Foo1(arg);
}
static uintptr_t CALLBACK BarCallback0(FunctionStubTest* test) {
return test->Foo0();
}
- static uintptr_t CALLBACK BarCallback1(FunctionStubTest* test,
- uintptr_t arg) {
+ static uintptr_t CALLBACK BarCallback1(FunctionStubTest* test, uintptr_t arg) {
return test->Foo1(arg);
}
@@ -121,10 +119,10 @@ TEST_F(FunctionStubTest, Accessors) {
// Check that the stub code is executable.
MEMORY_BASIC_INFORMATION info = {};
- EXPECT_NE(0u, ::VirtualQuery(stub_->code(), &info, sizeof(info)));
+ EXPECT_NE(0, ::VirtualQuery(stub_->code(), &info, sizeof(info)));
const DWORD kExecutableMask = PAGE_EXECUTE | PAGE_EXECUTE_READ |
PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY;
- EXPECT_NE(0u, info.Protect & kExecutableMask);
+ EXPECT_NE(0, info.Protect & kExecutableMask);
EXPECT_EQ(argument, stub_->argument());
EXPECT_TRUE(stub_->bypass_address() != NULL);
diff --git a/chrome_frame/html_utils.cc b/chrome_frame/html_utils.cc
index 8c8d6d3..9395afa 100644
--- a/chrome_frame/html_utils.cc
+++ b/chrome_frame/html_utils.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.
//
@@ -342,13 +342,15 @@ std::string GetDefaultUserAgent() {
} else if (SUCCEEDED(hr)) {
// Truncate the extra allocation.
DCHECK(size > 0); // NOLINT
- ret.resize(size - 1); // NOLINT
+ ret.resize(size - sizeof(char)); // NOLINT
}
}
if (FAILED(hr)) {
NOTREACHED() << StringPrintf("ObtainUserAgentString==0x%08X", hr);
- return std::string();
+ return "";
+ } else {
+ DCHECK(ret.length() == lstrlenA(ret.c_str()));
}
return ret;
@@ -360,8 +362,7 @@ bool HasFrameBustingHeader(const std::string& http_headers) {
while (it.GetNext()) {
if (lstrcmpiA(it.name().c_str(), kXFrameOptionsHeader) == 0) {
std::string allow_all(kXFrameOptionsValueAllowAll);
- if (it.values_end() - it.values_begin() !=
- static_cast<int>(allow_all.length()) ||
+ if (it.values_end() - it.values_begin() != allow_all.length() ||
!std::equal(it.values_begin(), it.values_end(),
allow_all.begin(),
CaseInsensitiveCompareASCII<const char>())) {
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index 0659c9d..80f2786 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.cc
@@ -775,7 +775,7 @@ HRESULT WebBrowserEventSink::SetWebBrowser(IWebBrowser2* web_browser2) {
}
HRESULT WebBrowserEventSink::CloseWebBrowser() {
- DCHECK_EQ(process_id_to_wait_for_, 0u);
+ DCHECK_EQ(process_id_to_wait_for_, 0);
if (!web_browser2_)
return E_FAIL;
diff --git a/chrome_frame/test/exception_barrier_unittest.cc b/chrome_frame/test/exception_barrier_unittest.cc
index 73f006a..eeffd2a 100644
--- a/chrome_frame/test/exception_barrier_unittest.cc
+++ b/chrome_frame/test/exception_barrier_unittest.cc
@@ -29,7 +29,7 @@ void TestSEHChainSane() {
MEMORY_BASIC_INFORMATION info = { 0 };
// Note that we pass the address of the info struct just as a handy
// moniker to anything at all inside our stack allocation
- ASSERT_NE(0u, ::VirtualQuery(&info, &info, sizeof(info)));
+ ASSERT_NE(0, ::VirtualQuery(&info, &info, sizeof(info)));
// The lower bound of our stack.
// We use the address of info as a lower bound, this assumes that if this
@@ -60,9 +60,9 @@ void TestSEHChainSane() {
ASSERT_EQ(0, (reinterpret_cast<UINT_PTR>(prev) & 0x00000003));
// find the module hosting the handler
- ASSERT_NE(0u, ::VirtualQuery(curr->handler, &info, sizeof(info)));
+ ASSERT_NE(0, ::VirtualQuery(curr->handler, &info, sizeof(info)));
wchar_t module_filename[MAX_PATH];
- ASSERT_NE(0u, ::GetModuleFileName(
+ ASSERT_NE(0, ::GetModuleFileName(
reinterpret_cast<HMODULE>(info.AllocationBase),
module_filename, ARRAYSIZE(module_filename)));
}
diff --git a/chrome_frame/test/html_util_unittests.cc b/chrome_frame/test/html_util_unittests.cc
index 5539e4a..1188482 100644
--- a/chrome_frame/test/html_util_unittests.cc
+++ b/chrome_frame/test/html_util_unittests.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-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.
@@ -292,14 +292,14 @@ TEST_F(HtmlUtilUnittest, AddChromeFrameToUserAgentValue) {
TEST_F(HtmlUtilUnittest, GetDefaultUserAgentHeaderWithCFTag) {
std::string ua(http_utils::GetDefaultUserAgentHeaderWithCFTag());
- EXPECT_NE(0u, ua.length());
+ EXPECT_NE(0, ua.length());
EXPECT_NE(std::string::npos, ua.find("Mozilla"));
EXPECT_NE(std::string::npos, ua.find(kChromeFrameUserAgent));
}
TEST_F(HtmlUtilUnittest, GetDefaultUserAgent) {
std::string ua(http_utils::GetDefaultUserAgent());
- EXPECT_NE(0u, ua.length());
+ EXPECT_NE(0, ua.length());
EXPECT_NE(std::string::npos, ua.find("Mozilla"));
}
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc
index 4806865..a3d3b99 100644
--- a/chrome_frame/test/perf/chrome_frame_perftest.cc
+++ b/chrome_frame/test/perf/chrome_frame_perftest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-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.
#include "chrome_frame/test/perf/chrome_frame_perftest.h"
@@ -508,7 +508,7 @@ class ChromeFrameMemoryTest : public ChromeFramePerfTestBase {
chrome_frame_memory_test_instance_->PrintResult(
"ws_final_browser", "", trace_name + "_ws_b",
working_set_size_ / 1024, "KB", false /* not important */);
- } else if (process_id_ == base::GetCurrentProcId()) {
+ } else if (process_id_ == GetCurrentProcessId()) {
chrome_frame_memory_test_instance_->PrintResult(
"vm_current_process", "", trace_name + "_vm_c",
virtual_size_ / 1024, "KB", false /* not important */);
@@ -520,7 +520,7 @@ class ChromeFrameMemoryTest : public ChromeFramePerfTestBase {
printf("\n");
}
- base::ProcessId process_id_;
+ int process_id_;
size_t virtual_size_;
size_t working_set_size_;
// Set to true if this is the chrome browser process.
diff --git a/chrome_frame/test/util_unittests.cc b/chrome_frame/test/util_unittests.cc
index 81bc752..8780d3d 100644
--- a/chrome_frame/test/util_unittests.cc
+++ b/chrome_frame/test/util_unittests.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-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.
@@ -24,8 +24,8 @@ TEST(UtilTests, GetModuleVersionTest) {
// Use the method that doesn't go to disk
uint32 low = 0, high = 0;
EXPECT_TRUE(GetModuleVersion(mod, &high, &low));
- EXPECT_NE(high, 0u);
- EXPECT_NE(low, 0u);
+ EXPECT_NE(high, 0);
+ EXPECT_NE(low, 0);
// Make sure they give the same results.
FileVersionInfoWin* base_info_win =
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index 922a951..fb7e740 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.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.
@@ -119,7 +119,7 @@ bool UrlmonUrlRequest::Read(int bytes_to_read) {
DLOG(INFO) << __FUNCTION__ << me();
// Re-entrancy check. Thou shall not call Read() while process OnReadComplete!
- DCHECK_EQ(0u, pending_read_size_);
+ DCHECK_EQ(0, pending_read_size_);
if (pending_read_size_ != 0)
return false;
@@ -1136,7 +1136,7 @@ void UrlmonUrlRequestManager::OnResponseEnd(int request_id,
DLOG(INFO) << __FUNCTION__;
DCHECK(status.status() != URLRequestStatus::CANCELED);
RequestMap::size_type n = request_map_.erase(request_id);
- DCHECK_EQ(1u, n);
+ DCHECK_EQ(1, n);
++calling_delegate_;
delegate_->OnResponseEnd(request_id, status);
--calling_delegate_;
diff --git a/gfx/icon_util.cc b/gfx/icon_util.cc
index 8ce2279..b3b89a8 100644
--- a/gfx/icon_util.cc
+++ b/gfx/icon_util.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.
@@ -176,7 +176,7 @@ SkBitmap* IconUtil::CreateSkBitmapFromHICON(HICON icon, const gfx::Size& s) {
if (!bitmap_has_alpha_channel) {
unsigned int* p = static_cast<unsigned int*>(bitmap->getPixels());
for (size_t i = 0; i < num_pixels; ++p, ++i) {
- DCHECK_EQ((*p & 0xff000000), 0u);
+ DCHECK_EQ((*p & 0xff000000), 0);
if (opaque[i])
*p |= 0xff000000;
else
@@ -259,7 +259,7 @@ bool IconUtil::CreateIconFileFromSkBitmap(const SkBitmap& bitmap,
DWORD bytes_written;
bool delete_file = false;
if (!WriteFile(icon_file.Get(), buffer, buffer_size, &bytes_written, NULL) ||
- static_cast<int>(bytes_written) != buffer_size) {
+ bytes_written != buffer_size) {
delete_file = true;
}
diff --git a/net/base/listen_socket_unittest.cc b/net/base/listen_socket_unittest.cc
index ed2b566..eb224c3 100644
--- a/net/base/listen_socket_unittest.cc
+++ b/net/base/listen_socket_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.
@@ -54,7 +54,7 @@ void ListenSocketTester::SetUp() {
// verify the connect/accept and setup test_socket_
test_socket_ = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- ASSERT_NE(INVALID_SOCKET, test_socket_);
+ ASSERT_NE(-1, test_socket_);
struct sockaddr_in client;
client.sin_family = AF_INET;
client.sin_addr.s_addr = inet_addr(kLoopback);
diff --git a/net/base/network_change_notifier_win.cc b/net/base/network_change_notifier_win.cc
index 02b1834..8ae39fb 100644
--- a/net/base/network_change_notifier_win.cc
+++ b/net/base/network_change_notifier_win.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.
@@ -51,7 +51,7 @@ NetworkChangeNotifierWin::Impl::~Impl() {
void NetworkChangeNotifierWin::Impl::WatchForAddressChange() {
HANDLE handle = NULL;
DWORD ret = NotifyAddrChange(&handle, &addr_overlapped_);
- CHECK(ret == ERROR_IO_PENDING);
+ CHECK_EQ(ERROR_IO_PENDING, ret);
addr_watcher_.StartWatching(addr_overlapped_.hEvent, this);
}
diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc
index c663992..7c6f41d 100644
--- a/net/socket/tcp_client_socket_win.cc
+++ b/net/socket/tcp_client_socket_win.cc
@@ -508,7 +508,7 @@ int TCPClientSocketWin::Read(IOBuffer* buf,
core_->read_buffer_.buf = buf->data();
// TODO(wtc): Remove the CHECK after enough testing.
- CHECK_EQ(static_cast<DWORD>(WAIT_TIMEOUT),
+ CHECK_EQ(WAIT_TIMEOUT,
WaitForSingleObject(core_->read_overlapped_.hEvent, 0));
DWORD num, flags = 0;
int rv = WSARecv(socket_, &core_->read_buffer_, 1, &num, &flags,
@@ -558,7 +558,7 @@ int TCPClientSocketWin::Write(IOBuffer* buf,
core_->write_buffer_length_ = buf_len;
// TODO(wtc): Remove the CHECK after enough testing.
- CHECK_EQ(static_cast<DWORD>(WAIT_TIMEOUT),
+ CHECK_EQ(WAIT_TIMEOUT,
WaitForSingleObject(core_->write_overlapped_.hEvent, 0));
DWORD num;
int rv = WSASend(socket_, &core_->write_buffer_, 1, &num, 0,
diff --git a/net/tools/dump_cache/cache_dumper.cc b/net/tools/dump_cache/cache_dumper.cc
index a2e071a3..20ba6b5 100644
--- a/net/tools/dump_cache/cache_dumper.cc
+++ b/net/tools/dump_cache/cache_dumper.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.
@@ -89,10 +89,6 @@ bool DiskDumper::CreateEntry(const std::string& key,
#ifdef WIN32_LARGE_FILENAME_SUPPORT
entry_ = CreateFileW(file.c_str(), GENERIC_WRITE|GENERIC_READ, 0, 0,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
- if (entry_ == INVALID_HANDLE_VALUE) {
- wprintf(L"CreateFileW (%s) failed: %d\n", file.c_str(), GetLastError());
- return false;
- }
return entry_ != INVALID_HANDLE_VALUE;
#else
entry_ = file_util::OpenFile(entry_path_, "w+");
@@ -188,7 +184,7 @@ bool DiskDumper::WriteEntry(disk_cache::Entry* entry, int index, int offset,
#ifdef WIN32_LARGE_FILENAME_SUPPORT
DWORD bytes;
DWORD rv = WriteFile(entry_, data, len, &bytes, 0);
- return rv == TRUE && bytes == static_cast<DWORD>(len);
+ return rv == TRUE && bytes == len;
#else
int bytes = fwrite(data, 1, len, entry_);
return bytes == len;
diff --git a/net/tools/dump_cache/upgrade.cc b/net/tools/dump_cache/upgrade.cc
index 71031dc..566eb0b 100644
--- a/net/tools/dump_cache/upgrade.cc
+++ b/net/tools/dump_cache/upgrade.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 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.
@@ -367,11 +367,11 @@ void MasterSM::DoGetKey(int bytes_read) {
return Fail();
std::string key(input_->buffer);
- DCHECK(key.size() == static_cast<size_t>(input_->msg.buffer_bytes - 1));
+ DCHECK(key.size() == input_->msg.buffer_bytes - 1);
if (!writer_->CreateEntry(key,
reinterpret_cast<disk_cache::Entry**>(&entry_))) {
- printf("Skipping entry \"%s\": %d\n", key.c_str(), GetLastError());
+ printf("Skipping entry \"%s\" (name conflict!)\n", key.c_str());
return SendGetPrevEntry();
}
@@ -698,7 +698,7 @@ void SlaveSM::DoGetKey() {
msg.buffer_bytes = std::min(key.size() + 1,
static_cast<size_t>(kBufferSize));
memcpy(output_->buffer, key.c_str(), msg.buffer_bytes);
- if (msg.buffer_bytes != static_cast<int32>(key.size() + 1)) {
+ if (msg.buffer_bytes != key.size() + 1) {
// We don't support moving this entry. Just tell the master.
msg.result = RESULT_NAME_OVERFLOW;
} else {
diff --git a/sandbox/src/file_policy_test.cc b/sandbox/src/file_policy_test.cc
index 01a8383..f4a2e19 100644
--- a/sandbox/src/file_policy_test.cc
+++ b/sandbox/src/file_policy_test.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-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.
@@ -262,8 +262,8 @@ TEST(FilePolicyTest, AllowReadOnly) {
// Create a temp file because we need write access to it.
wchar_t temp_directory[MAX_PATH];
wchar_t temp_file_name[MAX_PATH];
- ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name), 0u);
+ ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name), 0);
EXPECT_TRUE(runner.AddFsRule(TargetPolicy::FILES_ALLOW_READONLY,
temp_file_name));
@@ -292,8 +292,8 @@ TEST(FilePolicyTest, AllowWildcard) {
// Create a temp file because we need write access to it.
wchar_t temp_directory[MAX_PATH];
wchar_t temp_file_name[MAX_PATH];
- ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name), 0u);
+ ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name), 0);
wcscat_s(temp_directory, MAX_PATH, L"*");
EXPECT_TRUE(runner.AddFsRule(TargetPolicy::FILES_ALLOW_ANY, temp_directory));
@@ -384,15 +384,15 @@ TEST(FilePolicyTest, TestRename) {
wchar_t temp_file_name6[MAX_PATH];
wchar_t temp_file_name7[MAX_PATH];
wchar_t temp_file_name8[MAX_PATH];
- ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name1), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name2), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name3), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name4), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name5), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name6), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name7), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name8), 0u);
+ ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name1), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name2), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name3), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name4), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name5), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name6), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name7), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name8), 0);
// Add rules to make file1->file2 succeed.
@@ -500,8 +500,8 @@ TEST(FilePolicyTest, TestReparsePoint) {
// Create a temp file because we need write access to it.
wchar_t temp_directory[MAX_PATH];
wchar_t temp_file_name[MAX_PATH];
- ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name), 0u);
+ ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, temp_file_name), 0);
// Delete the file and create a directory instead.
ASSERT_TRUE(::DeleteFile(temp_file_name));
diff --git a/sandbox/src/interception_unittest.cc b/sandbox/src/interception_unittest.cc
index 604db06..883cc91 100644
--- a/sandbox/src/interception_unittest.cc
+++ b/sandbox/src/interception_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-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.
@@ -37,20 +37,20 @@ void WalkBuffer(void* buffer, size_t size, int* num_dlls, int* num_functions,
DllPatchInfo *dll = &memory->dll_list[0];
for (int i = 0; i < memory->num_intercepted_dlls; i++) {
- ASSERT_NE(0u, wcslen(dll->dll_name));
- ASSERT_EQ(0u, dll->record_bytes % sizeof(size_t));
- ASSERT_EQ(0u, dll->offset_to_functions % sizeof(size_t));
+ ASSERT_NE(0, wcslen(dll->dll_name));
+ ASSERT_EQ(0, dll->record_bytes % sizeof(size_t));
+ ASSERT_EQ(0, dll->offset_to_functions % sizeof(size_t));
ASSERT_NE(0, dll->num_functions);
FunctionInfo *function = reinterpret_cast<FunctionInfo*>(
reinterpret_cast<char*>(dll) + dll->offset_to_functions);
for (int j = 0; j < dll->num_functions; j++) {
- ASSERT_EQ(0u, function->record_bytes % sizeof(size_t));
+ ASSERT_EQ(0, function->record_bytes % sizeof(size_t));
char* name = function->function;
size_t length = strlen(name);
- ASSERT_NE(0u, length);
+ ASSERT_NE(0, length);
name += length + 1;
// look for overflows
@@ -77,7 +77,7 @@ void WalkBuffer(void* buffer, size_t size, int* num_dlls, int* num_functions,
TEST(InterceptionManagerTest, BufferLayout1) {
wchar_t exe_name[MAX_PATH];
- ASSERT_NE(0u, GetModuleFileName(NULL, exe_name, MAX_PATH - 1));
+ ASSERT_NE(0, GetModuleFileName(NULL, exe_name, MAX_PATH - 1));
TargetProcess *target = MakeTestTargetProcess(::GetCurrentProcess(),
::GetModuleHandle(exe_name));
@@ -164,7 +164,7 @@ TEST(InterceptionManagerTest, BufferLayout1) {
TEST(InterceptionManagerTest, BufferLayout2) {
wchar_t exe_name[MAX_PATH];
- ASSERT_NE(0u, GetModuleFileName(NULL, exe_name, MAX_PATH - 1));
+ ASSERT_NE(0, GetModuleFileName(NULL, exe_name, MAX_PATH - 1));
TargetProcess *target = MakeTestTargetProcess(::GetCurrentProcess(),
::GetModuleHandle(exe_name));
diff --git a/sandbox/src/job_unittest.cc b/sandbox/src/job_unittest.cc
index f7174e3..d7d29ae 100644
--- a/sandbox/src/job_unittest.cc
+++ b/sandbox/src/job_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.
@@ -20,7 +20,7 @@ TEST(JobTest, TestCreation) {
// check if the job exists.
HANDLE job_handle = ::OpenJobObjectW(GENERIC_ALL, FALSE,
L"my_test_job_name");
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_NE(NULL, reinterpret_cast<ULONG_PTR>(job_handle));
if (job_handle)
CloseHandle(job_handle);
@@ -28,7 +28,7 @@ TEST(JobTest, TestCreation) {
// Check if the job is destroyed when the object goes out of scope.
HANDLE job_handle = ::OpenJobObjectW(GENERIC_ALL, FALSE, L"my_test_job_name");
- ASSERT_EQ(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_EQ(NULL, reinterpret_cast<ULONG_PTR>(job_handle));
ASSERT_EQ(ERROR_FILE_NOT_FOUND, ::GetLastError());
}
@@ -42,14 +42,14 @@ TEST(JobTest, TestDetach) {
ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_LOCKDOWN, L"my_test_job_name", 0));
job_handle = job.Detach();
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_NE(NULL, reinterpret_cast<ULONG_PTR>(job_handle));
}
// Check to be sure that the job is still alive even after the object is gone
// out of scope.
HANDLE job_handle_dup = ::OpenJobObjectW(GENERIC_ALL, FALSE,
L"my_test_job_name");
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle_dup);
+ ASSERT_NE(NULL, reinterpret_cast<ULONG_PTR>(job_handle_dup));
// Remove all references.
if (job_handle_dup)
@@ -60,7 +60,7 @@ TEST(JobTest, TestDetach) {
// Check if the jbo is really dead.
job_handle = ::OpenJobObjectW(GENERIC_ALL, FALSE, L"my_test_job_name");
- ASSERT_EQ(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_EQ(NULL, reinterpret_cast<ULONG_PTR>(job_handle));
ASSERT_EQ(ERROR_FILE_NOT_FOUND, ::GetLastError());
}
@@ -75,7 +75,7 @@ TEST(JobTest, TestExceptions) {
JOB_OBJECT_UILIMIT_READCLIPBOARD));
job_handle = job.Detach();
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_NE(NULL, reinterpret_cast<ULONG_PTR>(job_handle));
JOBOBJECT_BASIC_UI_RESTRICTIONS jbur = {0};
DWORD size = sizeof(jbur);
@@ -95,7 +95,7 @@ TEST(JobTest, TestExceptions) {
ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_LOCKDOWN, L"my_test_job_name", 0));
job_handle = job.Detach();
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_NE(NULL, reinterpret_cast<ULONG_PTR>(job_handle));
JOBOBJECT_BASIC_UI_RESTRICTIONS jbur = {0};
DWORD size = sizeof(jbur);
@@ -124,7 +124,7 @@ TEST(JobTest, NoInit) {
Job job;
ASSERT_EQ(ERROR_NO_DATA, job.UserHandleGrantAccess(NULL));
ASSERT_EQ(ERROR_NO_DATA, job.AssignProcessToJob(NULL));
- ASSERT_EQ(reinterpret_cast<HANDLE>(NULL), job.Detach());
+ ASSERT_EQ(NULL, reinterpret_cast<ULONG_PTR>(job.Detach()));
}
// Tests the initialization of the job with different security level.
diff --git a/sandbox/src/restricted_token_unittest.cc b/sandbox/src/restricted_token_unittest.cc
index 310b73f..d8fe233 100644
--- a/sandbox/src/restricted_token_unittest.cc
+++ b/sandbox/src/restricted_token_unittest.cc
@@ -23,11 +23,11 @@ TEST(RestrictedTokenTest, InvalidHandle) {
// Tests the initialization with NULL as parameter.
TEST(RestrictedTokenTest, DefaultInit) {
// Get the current process token.
- HANDLE token_handle = INVALID_HANDLE_VALUE;
+ HANDLE token_handle = NULL;
ASSERT_TRUE(::OpenProcessToken(::GetCurrentProcess(), TOKEN_ALL_ACCESS,
&token_handle));
- ASSERT_NE(INVALID_HANDLE_VALUE, token_handle);
+ ASSERT_NE(NULL, reinterpret_cast<ULONG_PTR>(token_handle));
ATL::CAccessToken access_token;
access_token.Attach(token_handle);
@@ -62,11 +62,11 @@ TEST(RestrictedTokenTest, DefaultInit) {
// Tests the initialization with a custom token as parameter.
TEST(RestrictedTokenTest, CustomInit) {
// Get the current process token.
- HANDLE token_handle = INVALID_HANDLE_VALUE;
+ HANDLE token_handle = NULL;
ASSERT_TRUE(::OpenProcessToken(::GetCurrentProcess(), TOKEN_ALL_ACCESS,
&token_handle));
- ASSERT_NE(INVALID_HANDLE_VALUE, token_handle);
+ ASSERT_NE(NULL, reinterpret_cast<ULONG_PTR>(token_handle));
ATL::CAccessToken access_token;
access_token.Attach(token_handle);
diff --git a/sandbox/src/win_utils_unittest.cc b/sandbox/src/win_utils_unittest.cc
index 27b49af..a7dc998 100644
--- a/sandbox/src/win_utils_unittest.cc
+++ b/sandbox/src/win_utils_unittest.cc
@@ -14,8 +14,8 @@ TEST(WinUtils, IsReparsePoint) {
// Create a temp file because we need write access to it.
wchar_t temp_directory[MAX_PATH];
wchar_t my_folder[MAX_PATH];
- ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0u);
- ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, my_folder), 0u);
+ ASSERT_NE(::GetTempPath(MAX_PATH, temp_directory), 0);
+ ASSERT_NE(::GetTempFileName(temp_directory, L"test", 0, my_folder), 0);
// Delete the file and create a directory instead.
ASSERT_TRUE(::DeleteFile(my_folder));
diff --git a/views/controls/table/table_view.cc b/views/controls/table/table_view.cc
index 2363985..fad9413 100644
--- a/views/controls/table/table_view.cc
+++ b/views/controls/table/table_view.cc
@@ -370,7 +370,7 @@ void TableView::OnItemsRemoved(int start, int length) {
}
void TableView::AddColumn(const TableColumn& col) {
- DCHECK_EQ(0u, all_columns_.count(col.id));
+ DCHECK_EQ(0, all_columns_.count(col.id));
all_columns_[col.id] = col;
}
diff --git a/webkit/default_plugin/plugin_database_handler.cc b/webkit/default_plugin/plugin_database_handler.cc
index 3aeff63..d35fdb1 100644
--- a/webkit/default_plugin/plugin_database_handler.cc
+++ b/webkit/default_plugin/plugin_database_handler.cc
@@ -144,13 +144,13 @@ int32 PluginDatabaseHandler::Write(NPStream* stream, int32 offset,
}
}
- DWORD bytes_written = 0;
+ unsigned long bytes_written = 0;
if (0 == lstrcmpiA(stream->url, plugin_finder_url_.c_str())) {
DCHECK(plugin_downloads_file_ != INVALID_HANDLE_VALUE);
WriteFile(plugin_downloads_file_, buffer, buffer_length, &bytes_written,
NULL);
- DCHECK_EQ(buffer_length, static_cast<int32>(bytes_written));
+ DCHECK(buffer_length == bytes_written);
}
return bytes_written;
}