[PR #11640] [MERGED] Add noexcept to all FontInfo structs #28678

Open
opened 2026-01-31 09:30:04 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11640
Author: @lhecker
Created: 10/28/2021
Status: Merged
Merged: 10/29/2021
Merged by: @undefined

Base: mainHead: dev/lhecker/font-info-noexcept


📝 Commits (3)

📊 Changes

19 files changed (+117 additions, -165 deletions)

View changed files

📝 src/cascadia/PublicTerminalCore/HwndTerminal.cpp (+1 -1)
📝 src/cascadia/PublicTerminalCore/HwndTerminal.hpp (+1 -1)
📝 src/cascadia/TerminalControl/InteractivityAutomationPeer.cpp (+4 -4)
📝 src/cascadia/TerminalControl/InteractivityAutomationPeer.h (+4 -4)
📝 src/host/getset.cpp (+1 -2)
📝 src/renderer/base/FontInfoBase.cpp (+23 -39)
📝 src/renderer/base/FontInfoDesired.cpp (+23 -23)
📝 src/renderer/base/fontinfo.cpp (+12 -21)
📝 src/renderer/gdi/state.cpp (+1 -1)
📝 src/renderer/inc/FontInfo.hpp (+9 -18)
📝 src/renderer/inc/FontInfoBase.hpp (+15 -25)
📝 src/renderer/inc/FontInfoDesired.hpp (+6 -9)
📝 src/types/IControlAccessibilityInfo.h (+5 -5)
📝 src/types/TermControlUiaProvider.cpp (+4 -4)
📝 src/types/TermControlUiaProvider.hpp (+4 -4)
📝 src/types/TermControlUiaTextRange.cpp (+1 -1)
📝 src/types/TermControlUiaTextRange.hpp (+1 -1)
📝 src/types/UiaTextRangeBase.cpp (+1 -1)
📝 src/types/UiaTextRangeBase.hpp (+1 -1)

📄 Description

FontInfoBase and it's descendents are missing noexcept annotations, which
virally forces other code to not be noexcept as well during AuditMode checks.
Apart from adding noexcept, this commit also

  • Passes std::wstring_view by reference.
  • Pass the FillLegacyNameBuffer argument as a simple pointer-to-array,
    allowing us to fill the buffer with a single memcpy.
    (gsl::span's iterators inhibit any internal STL optimizations.)
  • Move operator== declarations inside the class to reduce code size.

All other changes are an effect of the virality of noexcept.

This is an offshoot from #11623.

Validation Steps Performed

  • It still compiles ✔️

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/11640 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 10/28/2021 **Status:** ✅ Merged **Merged:** 10/29/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/font-info-noexcept` --- ### 📝 Commits (3) - [`f6b3d04`](https://github.com/microsoft/terminal/commit/f6b3d04d771ffde0f79c00da8b43434d3b7a0094) Add noexcept to all FontInfo structs - [`1ede43f`](https://github.com/microsoft/terminal/commit/1ede43f71cf0b5c80441eee232453f5bc9662174) Fix build issues - [`3187767`](https://github.com/microsoft/terminal/commit/3187767cfd50ba5bdf4f04cef7bdf3cfe7f8c50b) Address Mike's comments ### 📊 Changes **19 files changed** (+117 additions, -165 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.cpp` (+1 -1) 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.hpp` (+1 -1) 📝 `src/cascadia/TerminalControl/InteractivityAutomationPeer.cpp` (+4 -4) 📝 `src/cascadia/TerminalControl/InteractivityAutomationPeer.h` (+4 -4) 📝 `src/host/getset.cpp` (+1 -2) 📝 `src/renderer/base/FontInfoBase.cpp` (+23 -39) 📝 `src/renderer/base/FontInfoDesired.cpp` (+23 -23) 📝 `src/renderer/base/fontinfo.cpp` (+12 -21) 📝 `src/renderer/gdi/state.cpp` (+1 -1) 📝 `src/renderer/inc/FontInfo.hpp` (+9 -18) 📝 `src/renderer/inc/FontInfoBase.hpp` (+15 -25) 📝 `src/renderer/inc/FontInfoDesired.hpp` (+6 -9) 📝 `src/types/IControlAccessibilityInfo.h` (+5 -5) 📝 `src/types/TermControlUiaProvider.cpp` (+4 -4) 📝 `src/types/TermControlUiaProvider.hpp` (+4 -4) 📝 `src/types/TermControlUiaTextRange.cpp` (+1 -1) 📝 `src/types/TermControlUiaTextRange.hpp` (+1 -1) 📝 `src/types/UiaTextRangeBase.cpp` (+1 -1) 📝 `src/types/UiaTextRangeBase.hpp` (+1 -1) </details> ### 📄 Description FontInfoBase and it's descendents are missing noexcept annotations, which virally forces other code to not be noexcept as well during AuditMode checks. Apart from adding noexcept, this commit also * Passes std::wstring_view by reference. * Pass the FillLegacyNameBuffer argument as a simple pointer-to-array, allowing us to fill the buffer with a single memcpy. (gsl::span's iterators inhibit any internal STL optimizations.) * Move operator== declarations inside the class to reduce code size. All other changes are an effect of the virality of noexcept. This is an offshoot from #11623. ## Validation Steps Performed * It still compiles ✔️ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:30:04 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28678