From 978e8f5a4f1f72c4b3fa94cf14032563d58bf5a1 Mon Sep 17 00:00:00 2001 From: David Machaj <46852402+dmachaj@users.noreply.github.com.> Date: Tue, 29 Oct 2024 15:54:27 -0700 Subject: [PATCH] East const, add newline to end of file --- cppwinrt/code_writers.h | 12 ++++++------ test/test/missing_required_interfaces.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cppwinrt/code_writers.h b/cppwinrt/code_writers.h index 78538af98..0e516b528 100644 --- a/cppwinrt/code_writers.h +++ b/cppwinrt/code_writers.h @@ -1135,8 +1135,8 @@ namespace cppwinrt // immediately while preserving the error code and local variables. format = R"( template auto consume_%::%(%) const noexcept {% - const auto& castedResult = static_cast<% const&>(static_cast(*this)); - const auto abiType = *(abi_t<%>**)&castedResult; + auto const& castedResult = static_cast<% const&>(static_cast(*this)); + auto const abiType = *(abi_t<%>**)&castedResult; check_cast_result(abiType); abiType->%(%);% } @@ -1146,8 +1146,8 @@ namespace cppwinrt { format = R"( template auto consume_%::%(%) const noexcept {% - const auto& castedResult = static_cast<% const&>(static_cast(*this)); - const auto abiType = *(abi_t<%>**)&castedResult; + auto const& castedResult = static_cast<% const&>(static_cast(*this)); + auto const abiType = *(abi_t<%>**)&castedResult; check_cast_result(abiType); WINRT_VERIFY_(0, abiType->%(%));% } @@ -1158,8 +1158,8 @@ namespace cppwinrt { format = R"( template auto consume_%::%(%) const {% - const auto& castedResult = static_cast<% const&>(static_cast(*this)); - const auto abiType = *(abi_t<%>**)&castedResult; + auto const& castedResult = static_cast<% const&>(static_cast(*this)); + auto const abiType = *(abi_t<%>**)&castedResult; check_cast_result(abiType); check_hresult(abiType->%(%));% } diff --git a/test/test/missing_required_interfaces.cpp b/test/test/missing_required_interfaces.cpp index 8bc557944..237e4ff41 100644 --- a/test/test/missing_required_interfaces.cpp +++ b/test/test/missing_required_interfaces.cpp @@ -22,4 +22,4 @@ TEST_CASE("missing_required_interfaces") // The IStringable::ToString method does not exist on this type. In previous versions of cppwinrt // this line would crash with a nullptr deference. It now throws an exception. REQUIRE_THROWS_AS(lies.ToString(), winrt::hresult_error); -} \ No newline at end of file +}