[PR #13025] [MERGED] Use 32-bit coordinates throughout the project #29339

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13025
Author: @lhecker
Created: 5/3/2022
Status: ✅ Merged
Merged: 6/4/2022
Merged by: @undefined

Base: main ← Head: dev/lhecker/4015-32bit-coord


📝 Commits (7)

  • 6d2f72c Use 32-bit coordinates throughout the project
  • 1c8eaf1 Merge remote-tracking branch 'origin/main' into dev/lhecker/4015-32bit-coord
  • 5135590 Address feedback
  • b45ec69 Fix AuditMode checks
  • c95b1a4 Fix issues introduced in 5135590
  • 3f8cb29 Address feedback
  • 80d7fb3 Fix test failures

📊 Changes

237 files changed (+3610 additions, -3906 deletions)

View changed files

📝 src/buffer/out/AttrRow.cpp (+9 -9)
📝 src/buffer/out/AttrRow.hpp (+5 -5)
📝 src/buffer/out/CharRow.cpp (+22 -22)
📝 src/buffer/out/CharRow.hpp (+13 -13)
📝 src/buffer/out/CharRowCellReference.hpp (+2 -2)
📝 src/buffer/out/LineRendition.hpp (+4 -4)
📝 src/buffer/out/OutputCellIterator.cpp (+4 -4)
📝 src/buffer/out/OutputCellIterator.hpp (+4 -4)
📝 src/buffer/out/OutputCellRect.cpp (+10 -13)
📝 src/buffer/out/OutputCellRect.hpp (+9 -9)
📝 src/buffer/out/OutputCellView.cpp (+1 -1)
📝 src/buffer/out/OutputCellView.hpp (+1 -1)
📝 src/buffer/out/Row.cpp (+4 -4)
📝 src/buffer/out/Row.hpp (+9 -9)
📝 src/buffer/out/UnicodeStorage.cpp (+2 -2)
📝 src/buffer/out/UnicodeStorage.hpp (+6 -6)
📝 src/buffer/out/cursor.cpp (+18 -21)
📝 src/buffer/out/cursor.h (+12 -12)
📝 src/buffer/out/precomp.h (+0 -1)
📝 src/buffer/out/search.cpp (+9 -9)

...and 80 more files

📄 Description

Previously this project used a great variety of types to present text buffer
coordinates: short, unsigned short, int, unsigned int, size_t,
ptrdiff_t, COORD/SMALL_RECT (aka short), and more.
This massive commit migrates almost all use of those types over to the
centralized types til::point/size/rect/inclusive_rect and their
underlying type til::CoordType (aka int32_t).

Due to the size of the changeset and statistics I expect it to contain bugs.
The biggest risk I see is that some code potentially, maybe implicitly, expected
arithmetic to be mod 2^16 and that this code now allows it to be mod 2^32.
Any narrowing into short later on would then throw exceptions.

PR Checklist

Validation Steps Performed

Casual usage of OpenConsole and Windows Terminal. ✅


🔄 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/13025 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 5/3/2022 **Status:** ✅ Merged **Merged:** 6/4/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/4015-32bit-coord` --- ### 📝 Commits (7) - [`6d2f72c`](https://github.com/microsoft/terminal/commit/6d2f72c71ff2c84e16ce9c4608ad8e65d1b578f8) Use 32-bit coordinates throughout the project - [`1c8eaf1`](https://github.com/microsoft/terminal/commit/1c8eaf1f4e1fec54fbf894195d7b3f7206ac091c) Merge remote-tracking branch 'origin/main' into dev/lhecker/4015-32bit-coord - [`5135590`](https://github.com/microsoft/terminal/commit/513559060848da1b1c7b8a90c9d9678071fbc904) Address feedback - [`b45ec69`](https://github.com/microsoft/terminal/commit/b45ec699d35c793b6587ede0633b21449be891e9) Fix AuditMode checks - [`c95b1a4`](https://github.com/microsoft/terminal/commit/c95b1a4382958a57e94a8e6223d75cb96f4bff0e) Fix issues introduced in 5135590 - [`3f8cb29`](https://github.com/microsoft/terminal/commit/3f8cb2988045341ac697c553639e6365d5971d45) Address feedback - [`80d7fb3`](https://github.com/microsoft/terminal/commit/80d7fb39437b766ca2dc1b9eb990219ea88e85ac) Fix test failures ### 📊 Changes **237 files changed** (+3610 additions, -3906 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/AttrRow.cpp` (+9 -9) 📝 `src/buffer/out/AttrRow.hpp` (+5 -5) 📝 `src/buffer/out/CharRow.cpp` (+22 -22) 📝 `src/buffer/out/CharRow.hpp` (+13 -13) 📝 `src/buffer/out/CharRowCellReference.hpp` (+2 -2) 📝 `src/buffer/out/LineRendition.hpp` (+4 -4) 📝 `src/buffer/out/OutputCellIterator.cpp` (+4 -4) 📝 `src/buffer/out/OutputCellIterator.hpp` (+4 -4) 📝 `src/buffer/out/OutputCellRect.cpp` (+10 -13) 📝 `src/buffer/out/OutputCellRect.hpp` (+9 -9) 📝 `src/buffer/out/OutputCellView.cpp` (+1 -1) 📝 `src/buffer/out/OutputCellView.hpp` (+1 -1) 📝 `src/buffer/out/Row.cpp` (+4 -4) 📝 `src/buffer/out/Row.hpp` (+9 -9) 📝 `src/buffer/out/UnicodeStorage.cpp` (+2 -2) 📝 `src/buffer/out/UnicodeStorage.hpp` (+6 -6) 📝 `src/buffer/out/cursor.cpp` (+18 -21) 📝 `src/buffer/out/cursor.h` (+12 -12) 📝 `src/buffer/out/precomp.h` (+0 -1) 📝 `src/buffer/out/search.cpp` (+9 -9) _...and 80 more files_ </details> ### 📄 Description Previously this project used a great variety of types to present text buffer coordinates: `short`, `unsigned short`, `int`, `unsigned int`, `size_t`, `ptrdiff_t`, `COORD`/`SMALL_RECT` (aka `short`), and more. This massive commit migrates almost all use of those types over to the centralized types `til::point`/`size`/`rect`/`inclusive_rect` and their underlying type `til::CoordType` (aka `int32_t`). Due to the size of the changeset and statistics I expect it to contain bugs. The biggest risk I see is that some code potentially, maybe implicitly, expected arithmetic to be mod 2^16 and that this code now allows it to be mod 2^32. Any narrowing into `short` later on would then throw exceptions. ## PR Checklist * [x] Closes #4015 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed Casual usage of OpenConsole and Windows Terminal. ✅ --- <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:34:20 +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#29339