Skip to content

Commit 662ef58

Browse files
authored
Clang conformance (#483)
1 parent 80ebf45 commit 662ef58

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

strings/base_activation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace winrt::impl
3939

4040
if (hr == impl::error_not_initialized)
4141
{
42-
auto usage = static_cast<int32_t(__stdcall*)(void** cookie) noexcept>(WINRT_IMPL_GetProcAddress(WINRT_IMPL_LoadLibraryW(L"combase.dll"), "CoIncrementMTAUsage"));
42+
auto usage = reinterpret_cast<int32_t(__stdcall*)(void** cookie) noexcept>(WINRT_IMPL_GetProcAddress(WINRT_IMPL_LoadLibraryW(L"combase.dll"), "CoIncrementMTAUsage"));
4343

4444
if (!usage)
4545
{
@@ -59,7 +59,7 @@ namespace winrt::impl
5959
std::wstring path{ static_cast<hstring const&>(name) };
6060
std::size_t count{};
6161

62-
while (-1 != (count = path.rfind('.')))
62+
while (std::wstring::npos != (count = path.rfind('.')))
6363
{
6464
path.resize(count);
6565
path += L".dll";

strings/base_agile_ref.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ namespace winrt::impl
109109
return;
110110
}
111111

112-
result = static_cast<F>(WINRT_IMPL_GetProcAddress(WINRT_IMPL_LoadLibraryW(L"combase.dll"), name));
112+
result = reinterpret_cast<F>(WINRT_IMPL_GetProcAddress(WINRT_IMPL_LoadLibraryW(L"combase.dll"), name));
113113

114114
if (result)
115115
{
@@ -119,37 +119,37 @@ namespace winrt::impl
119119
result = fallback;
120120
}
121121

122-
inline hresult get_agile_reference(winrt::guid const& iid, void* object, void** result) noexcept
122+
inline hresult get_agile_reference(winrt::guid const& iid, void* object, void** reference) noexcept
123123
{
124-
static int32_t(__stdcall * handler)(uint32_t options, winrt::guid const& iid, void* object, void** result) noexcept;
124+
static int32_t(__stdcall * handler)(uint32_t options, winrt::guid const& iid, void* object, void** reference) noexcept;
125125

126126
load_runtime_function("RoGetAgileReference", handler,
127-
[](uint32_t, winrt::guid const& iid, void* object, void** result) noexcept -> int32_t
127+
[](uint32_t, winrt::guid const& iid, void* object, void** reference) noexcept -> int32_t
128128
{
129-
*result = nullptr;
129+
*reference = nullptr;
130130
static constexpr guid git_clsid{ 0x00000323, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } };
131131

132132
com_ptr<IGlobalInterfaceTable> git;
133133
hresult hr = WINRT_IMPL_CoCreateInstance(git_clsid, nullptr, 1 /*CLSCTX_INPROC_SERVER*/, guid_of<IGlobalInterfaceTable>(), git.put_void());
134134

135-
if (result < 0)
135+
if (hr < 0)
136136
{
137137
return hr;
138138
}
139139

140140
uint32_t cookie{};
141141
hr = git->RegisterInterfaceInGlobal(object, iid, &cookie);
142142

143-
if (result < 0)
143+
if (hr < 0)
144144
{
145145
return hr;
146146
}
147147

148-
*result = new agile_ref_fallback(std::move(git), cookie);
148+
*reference = new agile_ref_fallback(std::move(git), cookie);
149149
return 0;
150150
});
151151

152-
return handler(0, iid, object, result);
152+
return handler(0, iid, object, reference);
153153
}
154154
}
155155

strings/base_error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ WINRT_EXPORT namespace winrt
560560
return pointer;
561561
}
562562

563-
[[noreturn]] inline void terminate() noexcept
563+
inline void terminate() noexcept
564564
{
565565
static void(__stdcall * handler)(int32_t) noexcept;
566566

0 commit comments

Comments
 (0)