diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-02 20:47:47 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-02 20:47:47 +0000 |
commit | bfde7449259ccf84393fd6751fca30ea36eb0368 (patch) | |
tree | 3135f358d5eedda8038ad3e3d6e24107d171609e | |
parent | ac9952bd1cc3880f70a67d3582c9dd51506f4297 (diff) | |
download | chromium_src-bfde7449259ccf84393fd6751fca30ea36eb0368.zip chromium_src-bfde7449259ccf84393fd6751fca30ea36eb0368.tar.gz chromium_src-bfde7449259ccf84393fd6751fca30ea36eb0368.tar.bz2 |
win: Fix a few minor issues found by clang.
No intended functionality change.
BUG=82385
TEST=compiles
Review URL: http://codereview.chromium.org/10332002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134988 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chrome_browser_main_win.h | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/infobars/infobar_view.cc | 2 | ||||
-rw-r--r-- | chrome/service/cloud_print/print_system_win.cc | 2 | ||||
-rw-r--r-- | crypto/rsa_private_key_win.cc | 16 | ||||
-rw-r--r-- | sandbox/src/Wow64.cc | 2 | ||||
-rw-r--r-- | sandbox/src/sandbox_nt_util.cc | 4 | ||||
-rw-r--r-- | sandbox/src/target_process.cc | 2 | ||||
-rw-r--r-- | sandbox/src/target_process.h | 2 | ||||
-rw-r--r-- | ui/gfx/platform_font_win.cc | 2 | ||||
-rw-r--r-- | ui/views/widget/monitor_win.cc | 4 |
10 files changed, 16 insertions, 22 deletions
diff --git a/chrome/browser/chrome_browser_main_win.h b/chrome/browser/chrome_browser_main_win.h index 2feb9fd..5022474 100644 --- a/chrome/browser/chrome_browser_main_win.h +++ b/chrome/browser/chrome_browser_main_win.h @@ -28,7 +28,7 @@ class ChromeBrowserMainPartsWin : public ChromeBrowserMainParts { explicit ChromeBrowserMainPartsWin( const content::MainFunctionParams& parameters); - virtual ChromeBrowserMainPartsWin::~ChromeBrowserMainPartsWin(); + virtual ~ChromeBrowserMainPartsWin(); // BrowserParts overrides. virtual void ToolkitInitialized() OVERRIDE; diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc index e0e0f37..4acf2f2 100644 --- a/chrome/browser/ui/views/infobars/infobar_view.cc +++ b/chrome/browser/ui/views/infobars/infobar_view.cc @@ -130,7 +130,7 @@ views::TextButton* InfoBarView::CreateTextButton( if (needs_elevation && (base::win::GetVersion() >= base::win::VERSION_VISTA) && base::win::UserAccountControlIsEnabled()) { - SHSTOCKICONINFO icon_info = { sizeof SHSTOCKICONINFO }; + SHSTOCKICONINFO icon_info = { sizeof(SHSTOCKICONINFO) }; // Even with the runtime guard above, we have to use GetProcAddress() here, // because otherwise the loader will try to resolve the function address on // startup, which will break on XP. diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index 7ae902c..3a38016 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc @@ -660,7 +660,7 @@ class PrintSystemWin : public PrintSystem { base::win::ScopedComPtr<IXpsPrintJob> xps_print_job_; bool should_couninit_; - DISALLOW_COPY_AND_ASSIGN(JobSpoolerWin::Core); + DISALLOW_COPY_AND_ASSIGN(Core); }; scoped_refptr<Core> core_; diff --git a/crypto/rsa_private_key_win.cc b/crypto/rsa_private_key_win.cc index d87c1ec0..546a303 100644 --- a/crypto/rsa_private_key_win.cc +++ b/crypto/rsa_private_key_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -12,15 +12,6 @@ #pragma comment(lib, "crypt32.lib") -namespace { - // Helper for error handling during key import. -#define READ_ASSERT(truth) \ - if (!(truth)) { \ - NOTREACHED(); \ - return false; \ - } -} // namespace - namespace crypto { // static @@ -102,7 +93,10 @@ RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo( pki.private_exponent()->size()); dest += pki.private_exponent()->size(); - READ_ASSERT(dest == blob.get() + blob_size); + if (dest != blob.get() + blob_size) { + NOTREACHED(); + return NULL; + } if (!CryptImportKey(result->provider_, reinterpret_cast<uint8*>(public_key_struc), blob_size, 0, CRYPT_EXPORTABLE, result->key_.receive())) diff --git a/sandbox/src/Wow64.cc b/sandbox/src/Wow64.cc index 9f10a4b..5098647 100644 --- a/sandbox/src/Wow64.cc +++ b/sandbox/src/Wow64.cc @@ -137,7 +137,7 @@ bool Wow64::WaitForNtdll() { } bool Wow64::RunWowHelper(void* buffer) { - COMPILE_ASSERT(sizeof(buffer) <= sizeof DWORD, unsupported_64_bits); + COMPILE_ASSERT(sizeof(buffer) <= sizeof(DWORD), unsupported_64_bits); // Get the path to the helper (beside the exe). wchar_t prog_name[MAX_PATH]; diff --git a/sandbox/src/sandbox_nt_util.cc b/sandbox/src/sandbox_nt_util.cc index e730ddb..94a343a 100644 --- a/sandbox/src/sandbox_nt_util.cc +++ b/sandbox/src/sandbox_nt_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -538,7 +538,7 @@ void* operator new(size_t size, sandbox::AllocationType type, if (NT_ALLOC == type) { if (!InitHeap()) - return false; + return NULL; // Use default flags for the allocation. return g_nt.RtlAllocateHeap(sandbox::g_heap, 0, size); diff --git a/sandbox/src/target_process.cc b/sandbox/src/target_process.cc index 1e3f9a0..d221158 100644 --- a/sandbox/src/target_process.cc +++ b/sandbox/src/target_process.cc @@ -209,7 +209,7 @@ DWORD TargetProcess::Create(const wchar_t* exe_path, return win_result; } -ResultCode TargetProcess::TransferVariable(char* name, void* address, +ResultCode TargetProcess::TransferVariable(const char* name, void* address, size_t size) { if (!sandbox_process_info_.IsValid()) return SBOX_ERROR_UNEXPECTED_CALL; diff --git a/sandbox/src/target_process.h b/sandbox/src/target_process.h index 5afe654..7d16153 100644 --- a/sandbox/src/target_process.h +++ b/sandbox/src/target_process.h @@ -81,7 +81,7 @@ class TargetProcess { } // Transfers a 32-bit variable between the broker and the target. - ResultCode TransferVariable(char* name, void* address, size_t size); + ResultCode TransferVariable(const char* name, void* address, size_t size); private: // Details of the target process. diff --git a/ui/gfx/platform_font_win.cc b/ui/gfx/platform_font_win.cc index c84b884..a9a7a43f 100644 --- a/ui/gfx/platform_font_win.cc +++ b/ui/gfx/platform_font_win.cc @@ -222,7 +222,7 @@ PlatformFontWin::HFontRef* PlatformFontWin::CreateHFontRef(HFONT font) { { base::win::ScopedGetDC screen_dc(NULL); - base::win::ScopedSelectObject font(screen_dc, font); + base::win::ScopedSelectObject scoped_font(screen_dc, font); ui::ScopedSetMapMode mode(screen_dc, MM_TEXT); GetTextMetrics(screen_dc, &font_metrics); } diff --git a/ui/views/widget/monitor_win.cc b/ui/views/widget/monitor_win.cc index dea232a..78543bb 100644 --- a/ui/views/widget/monitor_win.cc +++ b/ui/views/widget/monitor_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -25,7 +25,7 @@ gfx::Rect GetMonitorBoundsForRect(const gfx::Rect& rect) { } HWND GetTopmostAutoHideTaskbarForEdge(UINT edge, HMONITOR monitor) { - APPBARDATA taskbar_data = { sizeof APPBARDATA, NULL, 0, edge }; + APPBARDATA taskbar_data = { sizeof(APPBARDATA), NULL, 0, edge }; HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR, &taskbar_data)); return (::IsWindow(taskbar) && (monitor != NULL) && |