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.
HBRUSH brush = CreateSolidBrush(skia::SkColorToCOLORREF(background_color));
ULONG_PTR previous_brush = SetClassLongPtr(
GetAcceleratedWidget(), GCLP_HBRBACKGROUND, (LONG)brush);
GetAcceleratedWidget(),
GCLP_HBRBACKGROUND,
reinterpret_cast<LONG_PTR>(brush));
if (previous_brush)
DeleteObject((HBRUSH)previous_brush);
#endif

View file

@ -64,7 +64,8 @@ void MapToCommonID(const std::vector<base::string16>& buttons,
(*button_flags) |= common.button;
} else {
// 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;
if (options & MESSAGE_BOX_NO_LINK) {
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 {
MapToCommonID(buttons, &id_map, &config.dwCommonButtons, &dialog_buttons);
}