Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cascadia/ShellExtension/OpenTerminalHere.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct
#else // DEV
__declspec(uuid("52065414-e077-47ec-a3ac-1cc5455e1b54"))
#endif
OpenTerminalHere : public RuntimeClass<RuntimeClassFlags<ClassicCom | InhibitFtmBase>, IExplorerCommand, IObjectWithSite>
OpenTerminalHere : public RuntimeClass<RuntimeClassFlags<ClassicCom | InhibitFtmBase>, IExplorerCommand, IObjectWithSite>
{
#pragma region IExplorerCommand
STDMETHODIMP Invoke(IShellItemArray* psiItemArray,
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/DebugTapConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace winrt::Microsoft::TerminalApp::implementation
{
public:
explicit DebugTapConnection(Microsoft::Terminal::TerminalConnection::ITerminalConnection wrappedConnection);
void Initialize(const Windows::Foundation::Collections::ValueSet& /*settings*/){};
void Initialize(const Windows::Foundation::Collections::ValueSet& /*settings*/) {};
~DebugTapConnection();
void Start();
void WriteInput(const winrt::array_view<const char16_t> data);
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/MarkdownPaneContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace winrt::TerminalApp::implementation
#pragma region IPaneContent
winrt::Windows::UI::Xaml::FrameworkElement GetRoot();

void UpdateSettings(const winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings&){};
void UpdateSettings(const winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings&) {};

winrt::Windows::Foundation::Size MinimumSize() { return { 1, 1 }; };
void Focus(winrt::Windows::UI::Xaml::FocusState reason = winrt::Windows::UI::Xaml::FocusState::Programmatic) { reason; };
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/TaskbarState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace winrt::TerminalApp::implementation
{
// Default to unset, 0%.
TaskbarState::TaskbarState() :
TaskbarState(0, 0){};
TaskbarState(0, 0) {};

TaskbarState::TaskbarState(const uint64_t dispatchTypesState, const uint64_t progressParam) :
_State{ dispatchTypesState },
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalConnection/CTerminalHandoff.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Author(s):
using NewHandoffFunction = HRESULT (*)(HANDLE* in, HANDLE* out, HANDLE signal, HANDLE reference, HANDLE server, HANDLE client, const TERMINAL_STARTUP_INFO* startupInfo);

struct __declspec(uuid(__CLSID_CTerminalHandoff))
CTerminalHandoff : public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::ClassicCom>, ITerminalHandoff3>
CTerminalHandoff : public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::ClassicCom>, ITerminalHandoff3>
{
#pragma region ITerminalHandoff
STDMETHODIMP EstablishPtyHandoff(HANDLE* in, HANDLE* out, HANDLE signal, HANDLE reference, HANDLE server, HANDLE client, const TERMINAL_STARTUP_INFO* startupInfo) override;
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalControl/HwndTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ void _stdcall TerminalSetTheme(void* terminal, TerminalTheme theme, LPCWSTR font
for (size_t tableIndex = 0; tableIndex < 16; tableIndex++)
{
// It's using gsl::at to check the index is in bounds, but the analyzer still calls this array-to-pointer-decay
GSL_SUPPRESS(bounds .3)
GSL_SUPPRESS(bounds.3)
renderSettings.SetColorTableEntry(tableIndex, gsl::at(theme.ColorTable, tableIndex));
}

Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalSettingsModel/MediaResourceSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Licensed under the MIT license.

struct
__declspec(uuid("6068ee1b-1ea0-4804-993a-42ef0c58d867"))
IMediaResourceContainer : public IUnknown
IMediaResourceContainer : public IUnknown
{
virtual void ResolveMediaResources(const winrt::Microsoft::Terminal::Settings::Model::MediaResourceResolver& resolver) = 0;
};

struct
__declspec(uuid("9f11361c-7c8f-45c9-8948-36b66d67eca8"))
IPathlessMediaResourceContainer : public IUnknown
IPathlessMediaResourceContainer : public IUnknown
{
virtual void ResolveMediaResourcesWithBasePath(const winrt::hstring& basePath, const winrt::Microsoft::Terminal::Settings::Model::MediaResourceResolver& resolver) = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/UnitTests_Control/MockConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace ControlUnitTests
public:
MockConnection() noexcept = default;

void Initialize(const winrt::Windows::Foundation::Collections::ValueSet& /*settings*/){};
void Initialize(const winrt::Windows::Foundation::Collections::ValueSet& /*settings*/) {};
void Start() noexcept {};
void WriteInput(const winrt::array_view<const char16_t> data)
{
Expand Down
10 changes: 5 additions & 5 deletions src/host/conddkrefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class _RTL_CONSTANT_STRING_remove_const_template_class<sizeof(WCHAR)>
#define _RTL_CONSTANT_STRING_remove_const_macro(s) \
(const_cast<_RTL_CONSTANT_STRING_remove_const_template_class<sizeof((s)[0])>::T*>(s))

#define RTL_CONSTANT_STRING(s) \
{ \
sizeof(s) - sizeof((s)[0]), \
sizeof(s) / sizeof(_RTL_CONSTANT_STRING_type_check(s)), \
_RTL_CONSTANT_STRING_remove_const_macro(s) \
#define RTL_CONSTANT_STRING(s) \
{ \
sizeof(s) - sizeof((s)[0]), \
sizeof(s) / sizeof(_RTL_CONSTANT_STRING_type_check(s)), \
_RTL_CONSTANT_STRING_remove_const_macro(s) \
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/host/exe/CConsoleHandoff.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Author(s):
using namespace Microsoft::WRL;

struct __declspec(uuid(__CLSID_CConsoleHandoff))
CConsoleHandoff : public RuntimeClass<RuntimeClassFlags<ClassicCom>, IConsoleHandoff, IDefaultTerminalMarker>
CConsoleHandoff : public RuntimeClass<RuntimeClassFlags<ClassicCom>, IConsoleHandoff, IDefaultTerminalMarker>
{
#pragma region IConsoleHandoff
STDMETHODIMP EstablishHandoff(HANDLE server,
Expand Down
2 changes: 1 addition & 1 deletion src/host/ntprivapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace

if (hNtDll != nullptr)
{
typedef NTSTATUS (*PfnNtOpenProcess)(HANDLE ProcessHandle, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes, CLIENT_ID * ClientId);
typedef NTSTATUS (*PfnNtOpenProcess)(HANDLE ProcessHandle, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes, CLIENT_ID* ClientId);

static auto pfn = (PfnNtOpenProcess)GetProcAddress(hNtDll, "NtOpenProcess");

Expand Down
6 changes: 3 additions & 3 deletions src/inc/til/rle.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,17 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
rle_pair(rle_pair&&) = default;
rle_pair& operator=(rle_pair&&) = default;

constexpr rle_pair(const T& value, const S& length) noexcept(std::is_nothrow_copy_constructible_v<T>&& std::is_nothrow_copy_constructible_v<S>) :
constexpr rle_pair(const T& value, const S& length) noexcept(std::is_nothrow_copy_constructible_v<T> && std::is_nothrow_copy_constructible_v<S>) :
value(value), length(length)
{
}

constexpr rle_pair(T&& value, S&& length) noexcept(std::is_nothrow_constructible_v<T>&& std::is_nothrow_constructible_v<S>) :
constexpr rle_pair(T&& value, S&& length) noexcept(std::is_nothrow_constructible_v<T> && std::is_nothrow_constructible_v<S>) :
value(std::forward<T>(value)), length(std::forward<S>(length))
{
}

constexpr void swap(rle_pair& other) noexcept(std::is_nothrow_swappable_v<T>&& std::is_nothrow_swappable_v<S>)
constexpr void swap(rle_pair& other) noexcept(std::is_nothrow_swappable_v<T> && std::is_nothrow_swappable_v<S>)
{
if (this != std::addressof(other))
{
Expand Down
8 changes: 4 additions & 4 deletions src/interactivity/win32/windowdpiapi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ typedef enum DPI_AWARENESS
DPI_AWARENESS_PER_MONITOR_AWARE = 2
} DPI_AWARENESS;

#define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1)
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2)
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3)
#define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT) - 1)
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT) - 2)
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT) - 3)

#endif

// This type is being defined in RS2 but is percolating through the
// tree. Def it here if it hasn't collided with our branch yet.
#ifndef DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT) - 4)
#endif

namespace Microsoft::Console::Interactivity::Win32
Expand Down
2 changes: 1 addition & 1 deletion src/propsheet/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void Undo(HWND hControlWindow);
//
// Macros
//
#define AttrToRGB(Attr) (gpStateInfo->ColorTable[(Attr)&0x0F])
#define AttrToRGB(Attr) (gpStateInfo->ColorTable[(Attr) & 0x0F])
#define ScreenTextColor(pStateInfo) \
(AttrToRGB(LOBYTE(pStateInfo->ScreenAttributes) & 0x0F))
#define ScreenBkColor(pStateInfo) \
Expand Down
2 changes: 1 addition & 1 deletion src/propsheet/font.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ typedef struct tagFACENODE

#pragma warning(pop)

#define TM_IS_TT_FONT(x) (((x)&TMPF_TRUETYPE) == TMPF_TRUETYPE)
#define TM_IS_TT_FONT(x) (((x) & TMPF_TRUETYPE) == TMPF_TRUETYPE)
#define IS_BOLD(w) ((w) >= FW_SEMIBOLD)
#define SIZE_EQUAL(s1, s2) (((s1).X == (s2).X) && ((s1).Y == (s2).Y))
#define POINTS_PER_INCH 72
Expand Down
2 changes: 1 addition & 1 deletion src/propsheet/fontdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Revision History:
SendMessage(hWnd, bLB ? LB_GETTEXT : CB_GETLBTEXT, w, 0L)

#define lcbFINDSTRINGEXACT(hWnd, bLB, pwsz) \
(LONG) SendMessage(hWnd, bLB ? LB_FINDSTRINGEXACT : CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pwsz)
(LONG) SendMessage(hWnd, bLB ? LB_FINDSTRINGEXACT : CB_FINDSTRINGEXACT, (WPARAM) - 1, (LPARAM)pwsz)

#define lcbADDSTRING(hWnd, bLB, pwsz) \
(LONG) SendMessage(hWnd, bLB ? LB_ADDSTRING : CB_ADDSTRING, 0, (LPARAM)pwsz)
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/atlas/BackendD3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,12 @@ void BackendD3D::_debugUpdateShaders(const RenderingPayload& p) noexcept
struct FileVS
{
std::wstring_view filename;
wil::com_ptr<ID3D11VertexShader> BackendD3D::*target;
wil::com_ptr<ID3D11VertexShader> BackendD3D::* target;
};
struct FilePS
{
std::wstring_view filename;
wil::com_ptr<ID3D11PixelShader> BackendD3D::*target;
wil::com_ptr<ID3D11PixelShader> BackendD3D::* target;
};

static constexpr std::array filesVS{
Expand Down
4 changes: 2 additions & 2 deletions src/terminal/adapter/termDispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ class Microsoft::Console::VirtualTerminal::TermDispatch : public Microsoft::Cons
void RequestPresentationStateReport(const DispatchTypes::PresentationReportFormat /*format*/) override {} // DECRQPSR
StringHandler RestorePresentationState(const DispatchTypes::PresentationReportFormat /*format*/) override { return nullptr; } // DECRSPS

void PlaySounds(const VTParameters /*parameters*/) override{}; // DECPS
void PlaySounds(const VTParameters /*parameters*/) override {}; // DECPS

void SetOptionalFeatures(const til::enumset<OptionalFeature> /*features*/) override{};
void SetOptionalFeatures(const til::enumset<OptionalFeature> /*features*/) override {};
};

#pragma warning(default : 26440) // Restore "can be declared noexcept" warning
2 changes: 1 addition & 1 deletion src/terminal/parser/ft_fuzzer/fuzzing_directed.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ namespace fuzz
protected:
CFuzzBase() :
m_fFuzzed(FALSE),
m_iPercentageTotal(100){};
m_iPercentageTotal(100) {};
virtual ~CFuzzBase() = default;

// Converts a percentage into a valid range. Note that riTotal
Expand Down
4 changes: 2 additions & 2 deletions src/terminal/parser/ft_fuzzer/fuzzing_logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ namespace fuzz
}

private:
CFuzzLogic(){};
virtual ~CFuzzLogic(){};
CFuzzLogic() {};
virtual ~CFuzzLogic() {};

static LPWSTR FuzzStringW_NoRealloc(__inout LPWSTR pwsz, __inout size_t& rcch)
{
Expand Down
23 changes: 7 additions & 16 deletions tools/OpenConsole.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -416,28 +416,19 @@ function Invoke-CodeFormat() {
[switch]$IgnoreXaml
)

$clangFormatPath = & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -latest -find "**\x64\bin\clang-format.exe"
If ([String]::IsNullOrEmpty($clangFormatPath)) {
Write-Error "No Visual Studio-supplied version of clang-format could be found."
}

$root = Find-OpenConsoleRoot
& "$root\dep\nuget\nuget.exe" restore "$root\tools\packages.config"
$clangPackage = ([xml](Get-Content "$root\tools\packages.config")).packages.package | Where-Object id -like "clang-format*"
$clangFormatPath = "$root\packages\$($clangPackage.id).$($clangPackage.version)\tools\clang-format.exe"
Get-ChildItem -Recurse "$root\src" -Include *.cpp, *.hpp, *.h |
Where FullName -NotLike "*Generated Files*" |
Invoke-ClangFormat -ClangFormatPath $clangFormatPath

if ($IgnoreXaml) {
# do nothing
}
else {
if (-Not $IgnoreXaml) {
Invoke-XamlFormat
}
}

#.SYNOPSIS
# Download clang-format.exe required for code formatting
function Get-Format()
{
$root = Find-OpenConsoleRoot
& "$root\dep\nuget\nuget.exe" restore "$root\tools\packages.config"
}

Export-ModuleMember -Function Set-MsbuildDevEnvironment,Invoke-OpenConsoleTests,Invoke-OpenConsoleBuild,Start-OpenConsole,Debug-OpenConsole,Invoke-CodeFormat,Invoke-XamlFormat,Test-XamlFormat,Get-Format
Export-ModuleMember -Function Set-MsbuildDevEnvironment,Invoke-OpenConsoleTests,Invoke-OpenConsoleBuild,Start-OpenConsole,Debug-OpenConsole,Invoke-CodeFormat,Invoke-XamlFormat,Test-XamlFormat
4 changes: 0 additions & 4 deletions tools/packages.config

This file was deleted.