From: Haojian Wu Date: Thu, 30 Mar 2017 21:05:47 +0000 (+0200) Subject: Replace C-style casts with static_cast. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8abee9ca904abc744db42dba200c808c6630b1e;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Replace C-style casts with static_cast. --- diff --git a/atom/browser/api/atom_api_dialog.cc b/atom/browser/api/atom_api_dialog.cc index 3268344..c226d3d 100644 --- a/atom/browser/api/atom_api_dialog.cc +++ b/atom/browser/api/atom_api_dialog.cc @@ -78,11 +78,11 @@ void ShowMessageBox(int type, if (mate::Converter::FromV8(args->isolate(), peek, &callback)) { - atom::ShowMessageBox(window, (atom::MessageBoxType)type, buttons, + atom::ShowMessageBox(window, static_cast(type), buttons, default_id, cancel_id, options, title, message, detail, checkbox_label, checkbox_checked, icon, callback); } else { - int chosen = atom::ShowMessageBox(window, (atom::MessageBoxType)type, + int chosen = atom::ShowMessageBox(window, static_cast(type), buttons, default_id, cancel_id, options, title, message, detail, icon); args->Return(chosen); diff --git a/atom/browser/browser_mac.mm b/atom/browser/browser_mac.mm index 1a15bc0..51604e3 100644 --- a/atom/browser/browser_mac.mm +++ b/atom/browser/browser_mac.mm @@ -180,7 +180,7 @@ std::string Browser::GetExecutableFileProductName() const { int Browser::DockBounce(BounceType type) { return [[AtomApplication sharedApplication] - requestUserAttention:(NSRequestUserAttentionType)type]; + requestUserAttention:static_cast(type)]; } void Browser::DockCancelBounce(int request_id) { diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 520ba2d..4cec64e 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -1358,22 +1358,22 @@ void NativeWindowMac::SetVibrancy(const std::string& type) { // they are available in the minimum SDK version if (type == "selection") { // NSVisualEffectMaterialSelection - vibrancyType = (NSVisualEffectMaterial) 4; + vibrancyType = static_cast( 4); } else if (type == "menu") { // NSVisualEffectMaterialMenu - vibrancyType = (NSVisualEffectMaterial) 5; + vibrancyType = static_cast( 5); } else if (type == "popover") { // NSVisualEffectMaterialPopover - vibrancyType = (NSVisualEffectMaterial) 6; + vibrancyType = static_cast( 6); } else if (type == "sidebar") { // NSVisualEffectMaterialSidebar - vibrancyType = (NSVisualEffectMaterial) 7; + vibrancyType = static_cast( 7); } else if (type == "medium-light") { // NSVisualEffectMaterialMediumLight - vibrancyType = (NSVisualEffectMaterial) 8; + vibrancyType = static_cast( 8); } else if (type == "ultra-dark") { // NSVisualEffectMaterialUltraDark - vibrancyType = (NSVisualEffectMaterial) 9; + vibrancyType = static_cast( 9); } } diff --git a/atom/browser/web_contents_permission_helper.cc b/atom/browser/web_contents_permission_helper.cc index 2c79270..050e1d6 100644 --- a/atom/browser/web_contents_permission_helper.cc +++ b/atom/browser/web_contents_permission_helper.cc @@ -66,7 +66,7 @@ void WebContentsPermissionHelper::RequestPermission( void WebContentsPermissionHelper::RequestFullscreenPermission( const base::Callback& callback) { - RequestPermission((content::PermissionType)(PermissionType::FULLSCREEN), + RequestPermission(static_cast(PermissionType::FULLSCREEN), callback); } @@ -86,7 +86,7 @@ void WebContentsPermissionHelper::RequestWebNotificationPermission( void WebContentsPermissionHelper::RequestPointerLockPermission( bool user_gesture) { - RequestPermission((content::PermissionType)(PermissionType::POINTER_LOCK), + RequestPermission(static_cast(PermissionType::POINTER_LOCK), base::Bind(&OnPointerLockResponse, web_contents_), user_gesture); } @@ -94,7 +94,7 @@ void WebContentsPermissionHelper::RequestPointerLockPermission( void WebContentsPermissionHelper::RequestOpenExternalPermission( const base::Callback& callback, bool user_gesture) { - RequestPermission((content::PermissionType)(PermissionType::OPEN_EXTERNAL), + RequestPermission(static_cast(PermissionType::OPEN_EXTERNAL), callback, user_gesture); } diff --git a/atom/common/native_mate_converters/content_converter.cc b/atom/common/native_mate_converters/content_converter.cc index 72f1011..444faa6 100644 --- a/atom/common/native_mate_converters/content_converter.cc +++ b/atom/common/native_mate_converters/content_converter.cc @@ -168,11 +168,11 @@ v8::Local Converter::ToV8( break; } - if (val == (content::PermissionType)(PermissionType::POINTER_LOCK)) + if (val == static_cast(PermissionType::POINTER_LOCK)) return StringToV8(isolate, "pointerLock"); - else if (val == (content::PermissionType)(PermissionType::FULLSCREEN)) + else if (val == static_cast(PermissionType::FULLSCREEN)) return StringToV8(isolate, "fullscreen"); - else if (val == (content::PermissionType)(PermissionType::OPEN_EXTERNAL)) + else if (val == static_cast(PermissionType::OPEN_EXTERNAL)) return StringToV8(isolate, "openExternal"); return StringToV8(isolate, "unknown");