From 330c867370fcf9ea40294344ba3bc86cdb49dc70 Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Fri, 28 Aug 2020 17:44:13 -0400 Subject: [PATCH] Enable MSVC warning 4312. This is caught in the Skia build. Bug: skia:7647 Change-Id: I9b164f6fcc55b7e13981659ee8a08766a99a2122 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2381084 Commit-Queue: Jamie Madill Reviewed-by: Geoff Lang --- BUILD.gn | 1 + src/libANGLE/FrameCapture.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 7547a4d1b..bc5bc85eb 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -133,6 +133,7 @@ config("extra_warnings") { if (is_win) { cflags += [ "/we4244", # Conversion: possible loss of data. + "/we4312", # Conversion: greater size. "/we4456", # Variable shadowing. "/we4458", # declaration hides class member. "/we4715", # not all control paths return a value diff --git a/src/libANGLE/FrameCapture.cpp b/src/libANGLE/FrameCapture.cpp index e7674fb1e..c87188fa8 100644 --- a/src/libANGLE/FrameCapture.cpp +++ b/src/libANGLE/FrameCapture.cpp @@ -2957,8 +2957,8 @@ void CaptureMidExecutionSetup(const gl::Context *context, const gl::SyncManager &syncs = apiState.getSyncManagerForCapture(); for (const auto &syncIter : syncs) { - GLsync syncID = reinterpret_cast(syncIter.first); - gl::Sync *sync = syncIter.second; + GLsync syncID = gl::bitCast(syncIter.first); + const gl::Sync *sync = syncIter.second; if (!sync) {