Upgrade clang-format to 13.0.1 (#12826)

This commit fixes some formatting bugs by upgrading clang-format and ensures
that our code is again formatted the same way Visual Studio 2022 would do it.
This commit is contained in:
Leonard Hecker
2022-04-05 12:52:28 +02:00
committed by GitHub
parent e9785e450a
commit 8aa38d3437
8 changed files with 17 additions and 24 deletions

View File

@@ -28,7 +28,7 @@ namespace
class [[nodiscard]] SRWLockGuard class [[nodiscard]] SRWLockGuard
{ {
public: public:
explicit SRWLockGuard(SRWLOCK & lock) noexcept : explicit SRWLockGuard(SRWLOCK& lock) noexcept :
_lock(&lock) _lock(&lock)
{ {
AcquireSRWLockExclusive(_lock); AcquireSRWLockExclusive(_lock);
@@ -42,7 +42,7 @@ namespace
SRWLockGuard(const SRWLockGuard&) = delete; SRWLockGuard(const SRWLockGuard&) = delete;
SRWLockGuard& operator=(const SRWLockGuard&) = delete; SRWLockGuard& operator=(const SRWLockGuard&) = delete;
SRWLockGuard(SRWLockGuard &&) = delete; SRWLockGuard(SRWLockGuard&&) = delete;
SRWLockGuard& operator=(SRWLockGuard&&) = delete; SRWLockGuard& operator=(SRWLockGuard&&) = delete;
private: private:
@@ -77,7 +77,7 @@ namespace
GuardedWaitContext(const GuardedWaitContext&) = delete; GuardedWaitContext(const GuardedWaitContext&) = delete;
GuardedWaitContext& operator=(const GuardedWaitContext&) = delete; GuardedWaitContext& operator=(const GuardedWaitContext&) = delete;
GuardedWaitContext(GuardedWaitContext &&) = delete; GuardedWaitContext(GuardedWaitContext&&) = delete;
GuardedWaitContext& operator=(GuardedWaitContext&&) = delete; GuardedWaitContext& operator=(GuardedWaitContext&&) = delete;
}; };

View File

@@ -864,7 +864,7 @@ namespace winrt::TerminalApp::implementation
} }
}); });
events.taskbarToken = control.SetTaskbarProgress([dispatcher, weakThis](auto&&, auto &&) -> winrt::fire_and_forget { events.taskbarToken = control.SetTaskbarProgress([dispatcher, weakThis](auto&&, auto&&) -> winrt::fire_and_forget {
co_await wil::resume_foreground(dispatcher); co_await wil::resume_foreground(dispatcher);
// Check if Tab's lifetime has expired // Check if Tab's lifetime has expired
if (auto tab{ weakThis.get() }) if (auto tab{ weakThis.get() })
@@ -1069,7 +1069,7 @@ namespace winrt::TerminalApp::implementation
// Add a Closed event handler to the Pane. If the pane closes out from // Add a Closed event handler to the Pane. If the pane closes out from
// underneath us, and it's zoomed, we want to be able to make sure to // underneath us, and it's zoomed, we want to be able to make sure to
// update our state accordingly to un-zoom that pane. See GH#7252. // update our state accordingly to un-zoom that pane. See GH#7252.
auto closedToken = pane->Closed([weakThis, weakPane](auto&& /*s*/, auto && /*e*/) -> winrt::fire_and_forget { auto closedToken = pane->Closed([weakThis, weakPane](auto&& /*s*/, auto&& /*e*/) -> winrt::fire_and_forget {
if (auto tab{ weakThis.get() }) if (auto tab{ weakThis.get() })
{ {
if (tab->_zoomedPane) if (tab->_zoomedPane)

View File

@@ -63,8 +63,7 @@ void MakeAltRasterFont(
} }
[[nodiscard]] NTSTATUS [[nodiscard]] NTSTATUS
InitializeDbcsMisc( InitializeDbcsMisc(VOID)
VOID)
{ {
return TrueTypeFontList::s_Initialize(); return TrueTypeFontList::s_Initialize();
} }
@@ -158,8 +157,7 @@ GetAltFaceName(
} }
[[nodiscard]] NTSTATUS [[nodiscard]] NTSTATUS
DestroyDbcsMisc( DestroyDbcsMisc(VOID)
VOID)
{ {
return TrueTypeFontList::s_Destroy(); return TrueTypeFontList::s_Destroy();
} }

View File

@@ -119,9 +119,7 @@ AddFaceNode(
return pNew; return pNew;
} }
VOID VOID DestroyFaceNodes(VOID)
DestroyFaceNodes(
VOID)
{ {
PFACENODE pNext, pTmp; PFACENODE pNext, pTmp;
@@ -435,16 +433,12 @@ CreateBoldFont:
return FE_FONTOK; // and continue enumeration return FE_FONTOK; // and continue enumeration
} }
VOID VOID InitializeFonts(VOID)
InitializeFonts(
VOID)
{ {
LOG_IF_FAILED(EnumerateFonts(EF_DEFFACE)); // Just the Default font LOG_IF_FAILED(EnumerateFonts(EF_DEFFACE)); // Just the Default font
} }
VOID VOID DestroyFonts(VOID)
DestroyFonts(
VOID)
{ {
ULONG FontIndex; ULONG FontIndex;

View File

@@ -43,8 +43,7 @@ POINT NonClientSize;
RECT WindowRect; RECT WindowRect;
DWORD PreviewFlags; DWORD PreviewFlags;
VOID VOID UpdatePreviewRect(VOID)
UpdatePreviewRect(VOID)
/*++ /*++

View File

@@ -301,7 +301,9 @@ GdiEngine::~GdiEngine()
// If the font type has changed, select an appropriate font variant or soft font. // If the font type has changed, select an appropriate font variant or soft font.
const auto usingItalicFont = textAttributes.IsItalic(); const auto usingItalicFont = textAttributes.IsItalic();
const auto fontType = usingSoftFont ? FontType::Soft : usingItalicFont ? FontType::Italic : FontType::Default; const auto fontType = usingSoftFont ? FontType::Soft :
usingItalicFont ? FontType::Italic :
FontType::Default;
if (fontType != _lastFontType) if (fontType != _lastFontType)
{ {
switch (fontType) switch (fontType)

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="clang-format.win-x86" version="10.0.0" targetFramework="native" /> <package id="clang-format.win-x86" version="13.0.1" targetFramework="native" />
</packages> </packages>