Skip to content

Commit

Permalink
Upgrade clang-format to 13.0.1 (#12826)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lhecker authored Apr 5, 2022
1 parent e9785e4 commit 8aa38d3
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/api-ms-win-core-synch-l1-2-0/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace
class [[nodiscard]] SRWLockGuard
{
public:
explicit SRWLockGuard(SRWLOCK & lock) noexcept :
explicit SRWLockGuard(SRWLOCK& lock) noexcept :
_lock(&lock)
{
AcquireSRWLockExclusive(_lock);
Expand All @@ -42,7 +42,7 @@ namespace
SRWLockGuard(const SRWLockGuard&) = delete;
SRWLockGuard& operator=(const SRWLockGuard&) = delete;

SRWLockGuard(SRWLockGuard &&) = delete;
SRWLockGuard(SRWLockGuard&&) = delete;
SRWLockGuard& operator=(SRWLockGuard&&) = delete;

private:
Expand Down Expand Up @@ -77,7 +77,7 @@ namespace
GuardedWaitContext(const GuardedWaitContext&) = delete;
GuardedWaitContext& operator=(const GuardedWaitContext&) = delete;

GuardedWaitContext(GuardedWaitContext &&) = delete;
GuardedWaitContext(GuardedWaitContext&&) = delete;
GuardedWaitContext& operator=(GuardedWaitContext&&) = delete;
};

Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/TerminalTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
// Check if Tab's lifetime has expired
if (auto tab{ weakThis.get() })
Expand Down Expand Up @@ -1069,7 +1069,7 @@ namespace winrt::TerminalApp::implementation
// 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
// 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 (tab->_zoomedPane)
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ void NonClientIslandWindow::_OnMaximizeChange() noexcept
const auto isIconified = WI_IsFlagSet(windowStyle, WS_ICONIC);

const auto state = _isMaximized ? winrt::TerminalApp::WindowVisualState::WindowVisualStateMaximized :
isIconified ? winrt::TerminalApp::WindowVisualState::WindowVisualStateIconified :
winrt::TerminalApp::WindowVisualState::WindowVisualStateNormal;
isIconified ? winrt::TerminalApp::WindowVisualState::WindowVisualStateIconified :
winrt::TerminalApp::WindowVisualState::WindowVisualStateNormal;

try
{
Expand Down
6 changes: 2 additions & 4 deletions src/propsheet/dbcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ void MakeAltRasterFont(
}

[[nodiscard]] NTSTATUS
InitializeDbcsMisc(
VOID)
InitializeDbcsMisc(VOID)
{
return TrueTypeFontList::s_Initialize();
}
Expand Down Expand Up @@ -158,8 +157,7 @@ GetAltFaceName(
}

[[nodiscard]] NTSTATUS
DestroyDbcsMisc(
VOID)
DestroyDbcsMisc(VOID)
{
return TrueTypeFontList::s_Destroy();
}
Expand Down
12 changes: 3 additions & 9 deletions src/propsheet/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ AddFaceNode(
return pNew;
}

VOID
DestroyFaceNodes(
VOID)
VOID DestroyFaceNodes(VOID)
{
PFACENODE pNext, pTmp;

Expand Down Expand Up @@ -435,16 +433,12 @@ int AddFont(
return FE_FONTOK; // and continue enumeration
}

VOID
InitializeFonts(
VOID)
VOID InitializeFonts(VOID)
{
LOG_IF_FAILED(EnumerateFonts(EF_DEFFACE)); // Just the Default font
}

VOID
DestroyFonts(
VOID)
VOID DestroyFonts(VOID)
{
ULONG FontIndex;

Expand Down
3 changes: 1 addition & 2 deletions src/propsheet/preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ POINT NonClientSize;
RECT WindowRect;
DWORD PreviewFlags;

VOID
UpdatePreviewRect(VOID)
VOID UpdatePreviewRect(VOID)

/*++
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/gdi/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ GdiEngine::~GdiEngine()

// If the font type has changed, select an appropriate font variant or soft font.
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)
{
switch (fontType)
Expand Down
2 changes: 1 addition & 1 deletion tools/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<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>

0 comments on commit 8aa38d3

Please sign in to comment.