Skip to content

Commit

Permalink
Fix audit failures in TerminalCore (#15002)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
j4james authored Mar 16, 2023
1 parent 931aa8c commit 7562c81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cascadia/TerminalCore/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ catch (...)
// Arguments:
// - vkey: The virtual key code.
// - scanCode: The scan code.
void Terminal::_StoreKeyEvent(const WORD vkey, const WORD scanCode)
void Terminal::_StoreKeyEvent(const WORD vkey, const WORD scanCode) noexcept
{
_lastKeyEventCodes.emplace(KeyEventCodes{ vkey, scanCode });
}
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalCore/Terminal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class Microsoft::Terminal::Core::Terminal final :
void SelectHyperlink(const SearchDirection dir);

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

void _StoreKeyEvent(const WORD vkey, const WORD scanCode);
void _StoreKeyEvent(const WORD vkey, const WORD scanCode) noexcept;
WORD _TakeVirtualKeyFromLastKeyEvent(const WORD scanCode) noexcept;

int _VisibleStartIndex() const noexcept;
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalCore/TerminalSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ void Terminal::SelectHyperlink(const SearchDirection dir)
};

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

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

Terminal::UpdateSelectionParams Terminal::ConvertKeyEventToUpdateSelectionParams(const ControlKeyStates mods, const WORD vkey) const
Terminal::UpdateSelectionParams Terminal::ConvertKeyEventToUpdateSelectionParams(const ControlKeyStates mods, const WORD vkey) const noexcept
{
if ((_selectionMode == SelectionInteractionMode::Mark || mods.IsShiftPressed()) && !mods.IsAltPressed())
{
Expand Down

0 comments on commit 7562c81

Please sign in to comment.