feat(libSceLibcInternal): implement wide num_put::_Fput #24911
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24911"
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 0x70776c on 2026-11-21T10:19:47Z.
What
Implement
std::num_put<wchar_t>::_Fput(ostreambuf_iterator<wchar_t>, ios_base&, wchar_t, const char*, size_t)(_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE5_FputES3_RSt8ios_basewPKcm, NIDIdV-tXejEGQ) inlibSceLibcInternal:digits, widen throughctype<wchar_t>when present (or unsigned byte widening fallback), applynumpunct<wchar_t>decimal point and grouping/thousands separators (skippinginf/nan, stopping at exponents, and guarding empty grouping patterns), preserve sign and0x/0Xprefixes forinternalpadding, and resetstream->widthto 0.out.failedbecomes true.core/libs/prx/libSceLibcInternal/tests/WideNumPutFloatField.cpp(guest_libc_internal_wide_num_put_float_field).docs/dev/debt/changes/feat-libcinternal-wide-num-put-fput.md.Tested
python3 tools/check_conventions.py --base origin/maincmake --build build --target guest_libc_internal_wide_num_put_float_field_tests --parallelctest --test-dir build --output-on-failure -R '^(guest_libc_internal_wide_num_put_float_field|public_headers)$'(2/2 passed)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 repositoryImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T10:23:31Z.
Review: DISMISSED
Reviewed — changes requested
Changes are required before merge: fix unsafe handling of an empty grouping pattern and add coverage for it.
What I ran
Reviewed head
dd7830c373e32ba4cbb29684a7c2c4bab861ade4. No build or test commands were run; the run folder reports author-side test results only.Results
Findings
Blocking
core/libs/prx/libSceLibcInternal/WideNumPutFloatField.cpp:82—InsertWideSeparatorsdereferences*groupwithout first checking thatgroupingcontains a byte. An empty grouping string therefore reads beyond its valid contents when the grouping loop is entered, which can happen for a finite value with enough integer digits and no decimal separator. Guard the loop on*group != '\0'and add a test with an empty grouping pattern.Non-blocking
None.
Not verified
Build and tests were not run here; reported checks came from the PR description. No files were excluded by the manifest. Read the changed implementation, test, export declaration, CMake section and relevant
Err.cppcontext, plus the description, commits, manifest and diff.To get this to a good state
Fix the empty-pattern read and add a regression test; rerun the reported build and tests on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-21T10:26:01Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
dd7830c373:tools/check_conventions.pyfailed.guest_libc_internal_wide_num_put_float_field_testsbuilt cleanly.guest_libc_internal_wide_num_put_float_field):Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-21T11:03:31Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
7fd6adf3ab:tools/check_conventions.pypassed.guest_libc_internal_wide_num_put_float_field_testsbuilt cleanly.guest_libc_internal_wide_num_put_float_field):core/libs/prx/libSceLibcInternal/Err.cpp,core/libs/prx/libSceLibcInternal/include/ErrExports.hpp,core/libs/prx/libSceLibcInternal/WideNumPutFloatField.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T11:07:00Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation changes wide floating field formatting at head
7fd6adf3ab872dda4dfb51164dd5db9eebe0fa30; I found no verified blocking defect, but did not run the reported checks or verify all changed files.What I ran
No commands were run. I inspected the prepared diff and bundled file contents;
repo_read.pywas unavailable as a callable command in this review interface.Results
Findings
Blocking
None verified in the inspected implementation.
Non-blocking
None.
Not verified
Read:
description.md,commits.md,manifest.json,diff.patch,files/core/libs/prx/libSceLibcInternal/WideNumPutFloatField.cpp,files/core/libs/prx/libSceLibcInternal/tests/WideNumPutFloatField.cpp,files/core/libs/prx/libSceLibcInternal/include/ErrExports.hpp, andcore/libs/prx/libc/include/GuestLocale.hpp.Not read: the full contents of
core/libs/prx/libSceLibcInternal/CMakeLists.txtandErr.cpp, the full changed-file inventory infiles.json, and any changed files other than those listed above. The repository reader search command and checks reported in the description were not run.To get this to a good state
Nothing is required. Optional: complete inspection of the remaining changed files and run the reported build and tests before relying on this review as approval evidence.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:43:19Z.
Review: COMMENTED
Compiled and ran
WideNumPutFloatFieldon Linux with the branch’s changed sources and the existing libc runtime. The wide float output, overflow, and rejected-input assertions passed.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.