Skip to content

Commit 7562c81

Browse files
authored
Fix audit failures in TerminalCore (#15002)
## Summary of the Pull Request This fixes a couple of audit failures in `TerminalCore` where the compiler was complaining about functions that should have been declared as `noexcept`. These failures have actually existed for a while, but you'd only see them if you ran the audit build locally. They only recently started showing up on the CI build server - I'm guessing because the compiler there has now been upgraded. ## Validation Steps Performed Compiled the audit build locally and it no longer fails.
1 parent 931aa8c commit 7562c81

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/cascadia/TerminalCore/Terminal.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ catch (...)
978978
// Arguments:
979979
// - vkey: The virtual key code.
980980
// - scanCode: The scan code.
981-
void Terminal::_StoreKeyEvent(const WORD vkey, const WORD scanCode)
981+
void Terminal::_StoreKeyEvent(const WORD vkey, const WORD scanCode) noexcept
982982
{
983983
_lastKeyEventCodes.emplace(KeyEventCodes{ vkey, scanCode });
984984
}

src/cascadia/TerminalCore/Terminal.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class Microsoft::Terminal::Core::Terminal final :
283283
void SelectHyperlink(const SearchDirection dir);
284284

285285
using UpdateSelectionParams = std::optional<std::pair<SelectionDirection, SelectionExpansion>>;
286-
UpdateSelectionParams ConvertKeyEventToUpdateSelectionParams(const ControlKeyStates mods, const WORD vkey) const;
286+
UpdateSelectionParams ConvertKeyEventToUpdateSelectionParams(const ControlKeyStates mods, const WORD vkey) const noexcept;
287287
til::point SelectionStartForRendering() const;
288288
til::point SelectionEndForRendering() const;
289289
const SelectionEndpoint SelectionEndpointTarget() const noexcept;
@@ -411,7 +411,7 @@ class Microsoft::Terminal::Core::Terminal final :
411411
static WORD _VirtualKeyFromCharacter(const wchar_t ch) noexcept;
412412
static wchar_t _CharacterFromKeyEvent(const WORD vkey, const WORD scanCode, const ControlKeyStates states) noexcept;
413413

414-
void _StoreKeyEvent(const WORD vkey, const WORD scanCode);
414+
void _StoreKeyEvent(const WORD vkey, const WORD scanCode) noexcept;
415415
WORD _TakeVirtualKeyFromLastKeyEvent(const WORD scanCode) noexcept;
416416

417417
int _VisibleStartIndex() const noexcept;

src/cascadia/TerminalCore/TerminalSelection.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ void Terminal::SelectHyperlink(const SearchDirection dir)
417417
};
418418

419419
// extracts the next/previous hyperlink from the list of hyperlink ranges provided
420-
auto extractResultFromList = [&](std::vector<interval_tree::Interval<til::point, size_t>>& list) {
420+
auto extractResultFromList = [&](std::vector<interval_tree::Interval<til::point, size_t>>& list) noexcept {
421421
const auto selectionStartInSearchArea = convertToSearchArea(_selection->start);
422422

423423
std::optional<std::pair<til::point, til::point>> resultFromList;
@@ -533,7 +533,7 @@ void Terminal::SelectHyperlink(const SearchDirection dir)
533533
_ScrollToPoint(_selection->end);
534534
}
535535

536-
Terminal::UpdateSelectionParams Terminal::ConvertKeyEventToUpdateSelectionParams(const ControlKeyStates mods, const WORD vkey) const
536+
Terminal::UpdateSelectionParams Terminal::ConvertKeyEventToUpdateSelectionParams(const ControlKeyStates mods, const WORD vkey) const noexcept
537537
{
538538
if ((_selectionMode == SelectionInteractionMode::Mark || mods.IsShiftPressed()) && !mods.IsAltPressed())
539539
{

0 commit comments

Comments
 (0)