Commit 8c4feebb authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

win: Fix two -Wmicrosoft-cast warnings.

The C++ standard doesn't allow implicit conversion of function pointers
(such as returned by GetProcAddress()) to void*.  MSVC does accept that,
and so does clang-cl (albeit with a warning).  To fix the warning,
just make LoadComBaseFunction() return FARPROC.

Bug: 550065
Change-Id: I95eeed86c31d45358aabc31414435ae79a1a0e5c
Reviewed-on: https://chromium-review.googlesource.com/955905Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541872}
parent 46e3bc26
......@@ -6,7 +6,7 @@
namespace {
void* LoadComBaseFunction(const char* function_name) {
FARPROC LoadComBaseFunction(const char* function_name) {
static HMODULE const handle = ::LoadLibrary(L"combase.dll");
return handle ? ::GetProcAddress(handle, function_name) : nullptr;
}
......
......@@ -15,7 +15,7 @@ namespace {
static bool g_load_succeeded = false;
void* LoadComBaseFunction(const char* function_name) {
FARPROC LoadComBaseFunction(const char* function_name) {
static HMODULE const handle = ::LoadLibrary(L"combase.dll");
return handle ? ::GetProcAddress(handle, function_name) : nullptr;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment