refactor(freetype): drop errno saves around guest copies #25944

Merged
LeandroLP23 merged 1 commit from upstream-pr/25944 into main 2026-11-23 00:54:26 +00:00
LeandroLP23 commented 2026-11-22 23:43:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-11-22T23:43:41Z.


What

Follow-up to #25937, for FreeType. Six files define a CopyInPreservingErrno helper that saves errno around GuestCopyIn_nid_no_patch. That function restores errno itself since #21243 (RestoreErrno in CopyGuestBytes, libc/src/General.cpp), so each helper is removed and its callers call GuestCopyIn_nid_no_patch directly, with the same arguments.

Files: libSceFreeType/src/{BuildInfo,LcdFilter,ModuleManagement,OutlineStorage,SizeRequest}.cpp and libSceFreeTypeOt/Stream.cpp, 52 lines removed and 10 added. libSceFreeType/src/Variations.cpp has the same helper but is left out, because #9848 changes it.

No change in behaviour.

Tested

Windows 11 (10.0.26300), WinLibs GCC 15.2.0 r7, Release. ctest -R freetype, with its 98 build outputs from tools/select_tests.py targets: 106 of 106 on main 19e5a34a46 and 106 of 106 with this change applied to it. tools/check_conventions.py passes. tools/pr_overlap.py --branch finds no overlap with the 2476 open pull requests.

Not run: Linux and macOS.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5444666024 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25944). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-11-22T23:43:41Z. --- ### What Follow-up to #25937, for FreeType. Six files define a `CopyInPreservingErrno` helper that saves `errno` around `GuestCopyIn_nid_no_patch`. That function restores `errno` itself since #21243 (`RestoreErrno` in `CopyGuestBytes`, `libc/src/General.cpp`), so each helper is removed and its callers call `GuestCopyIn_nid_no_patch` directly, with the same arguments. Files: `libSceFreeType/src/{BuildInfo,LcdFilter,ModuleManagement,OutlineStorage,SizeRequest}.cpp` and `libSceFreeTypeOt/Stream.cpp`, 52 lines removed and 10 added. `libSceFreeType/src/Variations.cpp` has the same helper but is left out, because #9848 changes it. No change in behaviour. ### Tested Windows 11 (10.0.26300), WinLibs GCC 15.2.0 r7, Release. `ctest -R freetype`, with its 98 build outputs from `tools/select_tests.py targets`: 106 of 106 on `main` `19e5a34a46` and 106 of 106 with this change applied to it. `tools/check_conventions.py` passes. `tools/pr_overlap.py --branch` finds no overlap with the 2476 open pull requests. Not run: Linux and macOS. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-22 23:54:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T23:54:37Z.

Review: APPROVED


Reviewed — looks good

The reviewed change removes redundant errno-saving wrappers, and the inspected copy implementation restores errno while preserving copy behavior.

What I ran

Reviewed head 91658ae2fc2b13b5934d4acb6adf3fc646221898. No commands or tests were run in this read-only review.

Results

Check Result Note
Changed code review passed All six changed files read
Tests not run No independent test run

Findings

Blocking

None.

Non-blocking

None.

Not verified

Author-reported Windows test results were not independently verified; Linux, macOS, and console behavior were not tested. review/files.json was unavailable through the reader. The changed-file manifest lists six files, all marked included, and each was read: BuildInfo.cpp, LcdFilter.cpp, ModuleManagement.cpp, OutlineStorage.cpp, SizeRequest.cpp, and Stream.cpp. No excluded-file list was available.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6015212035 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25944#pullrequestreview-6015212035). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T23:54:37Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed change removes redundant errno-saving wrappers, and the inspected copy implementation restores errno while preserving copy behavior. ## What I ran Reviewed head `91658ae2fc2b13b5934d4acb6adf3fc646221898`. No commands or tests were run in this read-only review. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | All six changed files read | | Tests | not run | No independent test run | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Author-reported Windows test results were not independently verified; Linux, macOS, and console behavior were not tested. `review/files.json` was unavailable through the reader. The changed-file manifest lists six files, all marked included, and each was read: `BuildInfo.cpp`, `LcdFilter.cpp`, `ModuleManagement.cpp`, `OutlineStorage.cpp`, `SizeRequest.cpp`, and `Stream.cpp`. No excluded-file list was available. ## To get this to a good state Nothing is required.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!25944
No description provided.