feat(libSceIcu): give six number formatter exports their ICU 68.2 signatures and early returns #23848
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23848"
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 ToRaNek on 2026-11-19T19:16:36Z.
What
Six number formatting exports of libSceIcu were parameterless
intplaceholders inRecoveredInventory.cppthat threw on every call. They now have their ICU 68.2 prototypes and the early returns of number_capi.cpp and unum.cpp, inNumberFormatter.cppandNumberFormat.cpp, the way #17265 did it for 70 other recovered exports. NoUNumberFormatter,UFormattedNumberorUNumberFormatobject can exist yet, so every path that reads one still throwsNotImplemented_nid_no_patch.unumf_formatDouble,unumf_formatDecimalU_ILLEGAL_ARGUMENT_ERROR.IcuCApiHelper::validatechecks the formatter first, so a non-null formatter has its magic number read and throws, whatever the result handle isunumf_resultToStringU_ILLEGAL_ARGUMENT_ERROR. The buffer check comes after the magic number, so it is not reachable without the objectunumf_resultGetAllFieldPositionsU_ILLEGAL_ARGUMENT_ERRORunumf_openForSkeletonAndLocaleunum_formatDoubleForFieldsU_ILLEGAL_ARGUMENT_ERROR, checked before the format is readunumf_openForSkeletonAndLocaleis the one that differs from the usual pattern: returning null on a failing status would be wrong, since ICU returns an object there.Debt: two entries are added next to the existing number format and number formatter ones. The
recovered inventory exportsentry goes from 24 to 18 placeholders left, edited in the pendingfeat-libsceicu-field-position-iterator.mdfragment becausetools/debt_fold.py --checkrefuses two fragments that change the same entry.Stacked on #23844, which is stacked on #23839 and #23819. The four PRs change that same count line, so they cannot be independent. This branch is one commit,
830ba03e6d, on top of the previous one; until the others merge, the diff shows four commits and only the last belongs to this PR. The functions of the four PRs are different.Tested
Windows 11 IoT Enterprise LTSC 2024 (10.0.26100), WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, on81dc9c3045(#23844). Not run on a console; the console behaviour of these exports is unverified, as the debt entries say.guest_icu_recovered_signaturespasses.tests/NumberFormatter.cppandtests/NumberFormat.cppgain one group each:static_asserts on the six prototypes; seven failing status values (result returned, status unchanged, with null and non-null handles, and a throw fromunumf_openForSkeletonAndLocalewith the status unchanged); four non-failing status values against each illegal argument (U_ILLEGAL_ARGUMENT_ERROR) and against valid calls (a throw, status unchanged); a null status; the output buffer and the fake object's bytes unchanged.mainthe placeholders areint(), so the new checks cannot compile against them (by construction, not built). Seven one-line mutations of the new code each fail the test, then it passes again with the code restored:unumf_formatDoubleaccepting a null formatter;unumf_formatDecimalignoring a failing status;unumf_resultToStringreturning -1 for a null result;unumf_resultGetAllFieldPositionsleaving the status for a null result;unumf_openForSkeletonAndLocalereturning null on a failing status;unum_formatDoubleForFieldsreturning 0 on a failing status;unum_formatDoubleForFieldsaccepting a negative length.ctest -R icu: 76 of 76 pass.python tools/check_conventions.py --base origin/mainandpython tools/debt_fold.py --checkpass.python tools/pr_overlap.py --namesover the six names: each is a stub onmainand no open PR adds or edits it.--branchcould not compare six open PRs that conflict withmainon the recovered inventory files (#18210, #19635, #19645, #19670, #19720, #23196); compared by hand, none of them touches one of the six exports. #19720 implements other classicunumexports and conflicts withmainalready.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 PrivacyOnion on 2026-11-19T19:46:35Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
830ba03e6d:tools/check_conventions.pypassed.guest_icu_recovered_signatures_testsbuilt cleanly.guest_icu_recovered_signatures):core/libs/prx/libSceIcu/Calendar.cpp,core/libs/prx/libSceIcu/DateFormat.cpp,core/libs/prx/libSceIcu/DateIntervalFormat.cpp,core/libs/prx/libSceIcu/ListFormatter.cpp,core/libs/prx/libSceIcu/LocaleDisplayNames.cpp,core/libs/prx/libSceIcu/NumberFormat.cpp,core/libs/prx/libSceIcu/NumberFormatter.cpp,core/libs/prx/libSceIcu/PluralRules.cpp,core/libs/prx/libSceIcu/RecoveredInventory.cpp,core/libs/prx/libSceIcu/RecoveredInventory.hpp,core/libs/prx/libSceIcu/RecoveredSignatures.hpp,core/libs/prx/libSceIcu/RelativeDateTimeFormatter.cpp,core/libs/prx/libSceIcu/StringSearch.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me