Browse files

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
  • Loading branch information...
1 parent 38909a7 commit a5af79716cf0ca0c546260ad49f7d03334bbc380 thakis@chromium.org committed May 2, 2012
View
2 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;
View
2 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.
View
2 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_;
View
16 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()))
View
2 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];
View
4 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);
View
2 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;
View
2 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.
View
2 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);
}
View
4 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) &&

0 comments on commit a5af797

Please sign in to comment.