From 93a6d340fa8d12c85127ac7ae94e908d2e2c8a34 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 18 Jun 2018 12:08:11 -0700 Subject: [PATCH] Add explicit casts to pointer data members on Android. (flutter/engine#5558) This accounts for changes made in https://github.com/flutter/engine/pull/5556 --- .../android/platform_view_android_jni.cc | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/platform_view_android_jni.cc b/engine/src/flutter/shell/platform/android/platform_view_android_jni.cc index 30fc565c842..3c4e03ff851 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android_jni.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android_jni.cc @@ -211,8 +211,8 @@ static void RunBundleAndSnapshot( // bundle or a zip asset bundle. const auto file_ext_index = bundlepath.rfind("."); if (bundlepath.substr(file_ext_index) == ".zip") { - asset_manager->PushBack(std::make_unique( - bundlepath)); + asset_manager->PushBack( + std::make_unique(bundlepath)); } else { asset_manager->PushBack(std::make_unique( fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true))); @@ -332,17 +332,18 @@ static void SetViewportMetrics(JNIEnv* env, jint physicalViewInsetBottom, jint physicalViewInsetLeft) { const blink::ViewportMetrics metrics = { - .device_pixel_ratio = devicePixelRatio, - .physical_width = physicalWidth, - .physical_height = physicalHeight, - .physical_padding_top = physicalPaddingTop, - .physical_padding_right = physicalPaddingRight, - .physical_padding_bottom = physicalPaddingBottom, - .physical_padding_left = physicalPaddingLeft, - .physical_view_inset_top = physicalViewInsetTop, - .physical_view_inset_right = physicalViewInsetRight, - .physical_view_inset_bottom = physicalViewInsetBottom, - .physical_view_inset_left = physicalViewInsetLeft, + .device_pixel_ratio = static_cast(devicePixelRatio), + .physical_width = static_cast(physicalWidth), + .physical_height = static_cast(physicalHeight), + .physical_padding_top = static_cast(physicalPaddingTop), + .physical_padding_right = static_cast(physicalPaddingRight), + .physical_padding_bottom = static_cast(physicalPaddingBottom), + .physical_padding_left = static_cast(physicalPaddingLeft), + .physical_view_inset_top = static_cast(physicalViewInsetTop), + .physical_view_inset_right = static_cast(physicalViewInsetRight), + .physical_view_inset_bottom = + static_cast(physicalViewInsetBottom), + .physical_view_inset_left = static_cast(physicalViewInsetLeft), }; ANDROID_SHELL_HOLDER->SetViewportMetrics(metrics);