feat(libSceIcu): implement u_terminateUChars and u_terminateWChars #22846
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22846"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Callimann8 on 2026-11-18T12:28:45Z.
What
Implements
u_terminateUCharsandu_terminateWCharsin libSceIcu. Both were stubs inLegacyExports.cpp; they now share theTerminatehelper inTerminateBuffer.cppthatu_terminateCharsandu_terminateUChar32salready use, following ICU 68.2's string termination contract (ustring.cpp):length < capacityand clears a pendingU_STRING_NOT_TERMINATED_WARNING.length == capacityreportsU_STRING_NOT_TERMINATED_WARNING;length > capacityreportsU_BUFFER_OVERFLOW_ERROR.u_terminateWCharswrites a 2-byte terminator: the guestwchar_tis taken as 16 bits, as thelibSceLibcInternalwide strings already do.u_terminateCharsandu_terminateUChar32s; it is left alone because the pendingfeat-icu-ulistfragment already changes it.Tested
Linux (Ubuntu 24.04, GCC 13.3, Release).
guest_icu_terminate_buffernow runs its full matrix (16 capacity/length cases × 8 initial statuses, null status, null destination, guard words around the status) forchar16_tand the 16-bitwchar_tas well ascharandint32_t. All 63 libSceIcu tests (ctest -R guest_icu) pass on this branch.tools/check_conventions.py --base origin/mainandtools/debt_fold.py --checkpass. Not tested on a console.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T12:51:24Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review covers the new termination wrappers, their declarations and tests, and the debt note.
What I ran
Reviewed head
17034f619148adbf7b503fb167498844d0249ee3againstmain. I did not run build or tests; the test results below are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read the changed source and test additions in
TerminateBuffer.cpp,TerminateBuffer.hpp,tests/TerminateBuffer.cpp, the relevant removal hunks inLegacyExports.cppandinclude/LegacyExports.hpp, and the new debt fragment. I did not read the full 9,637-lineLegacyExports.cppor 2,256-lineinclude/LegacyExports.hpp; neither has added lines. The 18 changed3rdpartysubmodule pointers were excluded as unsupported files and their contents were not reviewed. I did not run tests, convention checks, or debt checks, and did not verify console ABI behavior.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T12:58:09Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
48c91bf619:tools/check_conventions.pypassed.guest_icu_terminate_buffer_testsbuilt cleanly.guest_icu_terminate_buffer):core/libs/prx/libSceIcu/LegacyExports.cpp,core/libs/prx/libSceIcu/TerminateBuffer.cpp,core/libs/prx/libSceIcu/TerminateBuffer.hpp,core/libs/prx/libSceIcu/include/LegacyExports.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me