From 298ae4b98d2a761b948a285979a7bba8167005a2 Mon Sep 17 00:00:00 2001 From: Ujjwal Chadha Date: Wed, 20 Oct 2021 16:23:41 -0700 Subject: [PATCH] cleanup --- src/cswinrt/code_writers.h | 15 +++++---------- src/cswinrt/cswinrt.vcxproj | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/cswinrt/code_writers.h b/src/cswinrt/code_writers.h index 630daa89b..fb14a7074 100644 --- a/src/cswinrt/code_writers.h +++ b/src/cswinrt/code_writers.h @@ -1323,7 +1323,7 @@ remove => %; bind([&](writer& w) { if (paramsForStaticMethodCall.has_value()) { - auto&& [iface_type_semantics, event, is_static] = paramsForStaticMethodCall.value(); + auto&& [iface_type_semantics, _, is_static] = paramsForStaticMethodCall.value(); w.write("%", bind(iface_type_semantics, event, true, w.write_temp("%.Value", bind(iface_type_semantics)), is_static)); } @@ -1335,7 +1335,7 @@ remove => %; bind([&](writer& w) { if (paramsForStaticMethodCall.has_value()) { - auto&& [iface_type_semantics, event, is_static] = paramsForStaticMethodCall.value(); + auto&& [iface_type_semantics, _, is_static] = paramsForStaticMethodCall.value(); w.write("%", bind(iface_type_semantics, event, false, w.write_temp("%.Value", bind(iface_type_semantics)), is_static)); } @@ -2687,7 +2687,6 @@ private % AsInternal(InterfaceTag<%> _) => ((Lazy<%>)_lazyInterfaces[typeof(%)] is_public |= !is_overridable_interface && !is_protected_interface; XLANG_ASSERT(!getter_target.empty() || !setter_target.empty()); } - bool call_static_method = !(settings.netstandard_compat || wrapper_type || is_manually_generated_iface(interface_type)); // If this interface is overridable then we need to emit an explicit implementation of the property for that interface. if (is_overridable_interface || !is_exclusive_to(interface_type)) { @@ -3653,8 +3652,6 @@ global::System.Collections.Concurrent.ConcurrentDictionary 0; - for (auto&& method : type.MethodList()) { if (is_special(method)) @@ -3977,14 +3974,14 @@ public static unsafe %% %(IObjectReference %%%) for (auto&& evt : iface.EventList()) { w.write(R"(% -public static unsafe Tuple, Action<%>> Get_%(IObjectReference %, object _thisObj) +public static unsafe (Action<%>, Action<%>) Get_%(IObjectReference %, object _thisObj) { var eventSource = _%.GetValue(_thisObj, (key) => { % return %; }); -return new Tuple, Action<%>>(eventSource.Subscribe, eventSource.Unsubscribe); +return (eventSource.Subscribe, eventSource.Unsubscribe); } )", bind(evt), @@ -3994,9 +3991,7 @@ return new Tuple, Action<%>>(eventSource.Subscribe, eventSource.Unsubs generic_type ? "_genericObj" : "_obj", evt.Name(), bind(init_call_variables), - bind(evt, index), - bind(get_type_semantics(evt.EventType()), typedef_name_type::Projected, false), - bind(get_type_semantics(evt.EventType()), typedef_name_type::Projected, false) + bind(evt, index) ); index++; } diff --git a/src/cswinrt/cswinrt.vcxproj b/src/cswinrt/cswinrt.vcxproj index 1e8ae2f9e..674c12582 100644 --- a/src/cswinrt/cswinrt.vcxproj +++ b/src/cswinrt/cswinrt.vcxproj @@ -47,7 +47,7 @@ kernel32.lib;user32.lib;%(AdditionalDependencies);windowsapp.lib;advapi32.lib;shlwapi.lib - false + true