Skip to content

Commit 5078fb4

Browse files
committed
Fix some more build warnings
1 parent e5d3de1 commit 5078fb4

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

strings/base_composable.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ namespace winrt::impl
44
template <typename D>
55
struct composable_factory
66
{
7+
#ifdef _MSC_VER
8+
#pragma warning(push)
9+
#pragma warning(disable: 4702)
10+
#endif
711
template <typename I, typename... Args>
812
static I CreateInstance(const Windows::Foundation::IInspectable& outer, Windows::Foundation::IInspectable& inner, Args&&... args)
913
{
1014
static_assert(std::is_base_of_v<Windows::Foundation::IInspectable, I>, "Requested interface must derive from winrt::Windows::Foundation::IInspectable");
1115
inner = CreateInstanceImpl(outer, std::forward<Args>(args)...);
1216
return inner.as<I>();
1317
}
18+
#ifdef _MSC_VER
19+
#pragma warning(pop)
20+
#endif
1421

1522
private:
1623
template <typename... Args>

strings/base_implements.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,10 @@ namespace winrt::impl
13901390

13911391
WINRT_EXPORT namespace winrt
13921392
{
1393+
#ifdef _MSC_VER
1394+
#pragma warning(push)
1395+
#pragma warning(disable: 4702)
1396+
#endif
13931397
template <typename D, typename... Args>
13941398
auto make(Args&&... args)
13951399
{
@@ -1443,6 +1447,9 @@ WINRT_EXPORT namespace winrt
14431447
return { impl::create_and_initialize<D>(std::forward<Args>(args)...), take_ownership_from_abi };
14441448
}
14451449
}
1450+
#ifdef _MSC_VER
1451+
#pragma warning(pop)
1452+
#endif
14461453

14471454
template <typename... FactoryClasses>
14481455
inline void clear_factory_static_lifetime()

test/old_tests/Component/Component.idl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ namespace Component
243243
HRESULT Create([in] Windows.Foundation.Collections.IVectorView<HSTRING>* _in, [out, retval] FastInputVector** _out);
244244
};
245245

246+
midl_pragma warning(disable: 4066)
247+
246248
[version(1.0), activatable(IFastInputVectorFactory, 1.0)]
247249
runtimeclass FastInputVector
248250
{
@@ -271,6 +273,8 @@ namespace Component
271273
interface Windows.Foundation.Collections.IMapView<HSTRING, HSTRING>;
272274
};
273275

276+
midl_pragma warning(default: 4066)
277+
274278
//
275279
// Boxing support for enums and their underlying types.
276280
//

test/test/fast_iterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ TEST_CASE("fast_iterator")
4848
REQUIRE(2 - (vbegin + 4) > vbegin);
4949
REQUIRE(vbegin < vbegin + 2);
5050
REQUIRE(vbegin + 2 - 2 == vbegin);
51-
REQUIRE(end(v) - begin(v) == v.Size());
51+
REQUIRE(static_cast<uint32_t>(end(v) - begin(v)) == v.Size());
5252
REQUIRE((begin(v) + 3)[-1] == 4);
5353
}
5454
{

test/test_component/OverloadClass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ namespace winrt::test_component::implementation
88
{
99
throw hresult_not_implemented();
1010
}
11-
void OverloadClass::Overload(int a)
11+
void OverloadClass::Overload(int /*a*/)
1212
{
1313
throw hresult_not_implemented();
1414
}
15-
void OverloadClass::Overload(int a, int b)
15+
void OverloadClass::Overload(int /*a*/, int /*b*/)
1616
{
1717
throw hresult_not_implemented();
1818
}
19-
void OverloadClass::Overload(int a, int b, int c)
19+
void OverloadClass::Overload(int /*a*/, int /*b*/, int /*c*/)
2020
{
2121
throw hresult_not_implemented();
2222
}

0 commit comments

Comments
 (0)