Fix compilation warnings introduced by VS 2015

This commit is contained in:
Cheng Zhao 2016-05-10 13:09:41 +09:00
parent 2497c73009
commit e77582baee
4 changed files with 16 additions and 4 deletions

View file

@ -623,7 +623,9 @@ void NativeWindowViews::SetBackgroundColor(const std::string& color_name) {
// Set the background color of native window. // Set the background color of native window.
HBRUSH brush = CreateSolidBrush(skia::SkColorToCOLORREF(background_color)); HBRUSH brush = CreateSolidBrush(skia::SkColorToCOLORREF(background_color));
ULONG_PTR previous_brush = SetClassLongPtr( ULONG_PTR previous_brush = SetClassLongPtr(
GetAcceleratedWidget(), GCLP_HBRBACKGROUND, (LONG)brush); GetAcceleratedWidget(),
GCLP_HBRBACKGROUND,
reinterpret_cast<LONG_PTR>(brush));
if (previous_brush) if (previous_brush)
DeleteObject((HBRUSH)previous_brush); DeleteObject((HBRUSH)previous_brush);
#endif #endif

View file

@ -64,7 +64,8 @@ void MapToCommonID(const std::vector<base::string16>& buttons,
(*button_flags) |= common.button; (*button_flags) |= common.button;
} else { } else {
// It is a custom button. // It is a custom button.
dialog_buttons->push_back({i + kIDStart, buttons[i].c_str()}); dialog_buttons->push_back(
{static_cast<int>(i + kIDStart), buttons[i].c_str()});
} }
} }
} }
@ -135,7 +136,8 @@ int ShowMessageBoxUTF16(HWND parent,
std::vector<TASKDIALOG_BUTTON> dialog_buttons; std::vector<TASKDIALOG_BUTTON> dialog_buttons;
if (options & MESSAGE_BOX_NO_LINK) { if (options & MESSAGE_BOX_NO_LINK) {
for (size_t i = 0; i < buttons.size(); ++i) for (size_t i = 0; i < buttons.size(); ++i)
dialog_buttons.push_back({i + kIDStart, buttons[i].c_str()}); dialog_buttons.push_back(
{static_cast<int>(i + kIDStart), buttons[i].c_str()});
} else { } else {
MapToCommonID(buttons, &id_map, &config.dwCommonButtons, &dialog_buttons); MapToCommonID(buttons, &id_map, &config.dwCommonButtons, &dialog_buttons);
} }

View file

@ -327,7 +327,7 @@ void CrashService::OnClientConnected(void* context,
void CrashService::OnClientExited(void* context, void CrashService::OnClientExited(void* context,
const google_breakpad::ClientInfo* client_info) { const google_breakpad::ClientInfo* client_info) {
ProcessingLock lock; ProcessingLock processing_lock;
VLOG(1) << "client end. pid = " << client_info->pid(); VLOG(1) << "client end. pid = " << client_info->pid();
CrashService* self = static_cast<CrashService*>(context); CrashService* self = static_cast<CrashService*>(context);
::InterlockedIncrement(&self->clients_terminated_); ::InterlockedIncrement(&self->clients_terminated_);

View file

@ -62,7 +62,12 @@
4232, # address of dllimport 'free' is not static, identity not guaranteed 4232, # address of dllimport 'free' is not static, identity not guaranteed
4291, # no matching operator delete found 4291, # no matching operator delete found
4295, # array is too small to include a terminating null character 4295, # array is too small to include a terminating null character
4311, # 'type cast': pointer truncation from 'void *const ' to 'unsigned long'
4389, # '==' : signed/unsigned mismatch 4389, # '==' : signed/unsigned mismatch
4456, # declaration of 'm' hides previous local declaration
4457, # declaration of 'message' hides function parameter
4459, # declaration of 'wq' hides global declaration
4477, # format string '%.*s' requires an argument of type 'int'
4505, # unreferenced local function has been removed 4505, # unreferenced local function has been removed
4701, # potentially uninitialized local variable 'sizew' used 4701, # potentially uninitialized local variable 'sizew' used
4703, # potentially uninitialized local pointer variable 'req' used 4703, # potentially uninitialized local pointer variable 'req' used
@ -234,9 +239,12 @@
4189, # local variable is initialized but not referenced 4189, # local variable is initialized but not referenced
4201, # (uv.h) nameless struct/union 4201, # (uv.h) nameless struct/union
4267, # conversion from 'size_t' to 'int', possible loss of data 4267, # conversion from 'size_t' to 'int', possible loss of data
4302, # (atldlgs.h) 'type cast': truncation from 'LPCTSTR' to 'WORD'
4458, # (atldlgs.h) declaration of 'dwCommonButtons' hides class member
4503, # decorated name length exceeded, name was truncated 4503, # decorated name length exceeded, name was truncated
4800, # (v8.h) forcing value to bool 'true' or 'false' 4800, # (v8.h) forcing value to bool 'true' or 'false'
4819, # The file contains a character that cannot be represented in the current code page 4819, # The file contains a character that cannot be represented in the current code page
4838, # (atlgdi.h) conversion from 'int' to 'UINT' requires a narrowing conversion
4996, # (atlapp.h) 'GetVersionExW': was declared deprecated 4996, # (atlapp.h) 'GetVersionExW': was declared deprecated
], ],
}, },