Repository navigation
Conversation
…er and bool members Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you for your contribution! Authors with no pull requests merged into |
Progress report (b11c7bf → e364f9c)📈 System libraries: 26.72% (+0.01%, +6 implemented, -5 removed functions) ✅ 6 implemented
🗑️ 5 removed
Changed libraries (implemented exports)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements five
ostreambuf_iterator<wchar_t>num_putmembers in libSceLibcInternal that used to throw throughNotImplemented_nid_no_patch(sceLibcInternalPending3_144and147..150inErr.cpp). They are whatstd::wostream << integerand<< boolrun:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewb1C2-2WB9NN4sceLibcInternalWideNumPutDoPutBool_nid_no_patchLibcWideNumPutBool_nid_no_patch..._RSt8ios_basewlVpwhOe58wsMsceLibcInternalWideNumPutDoPutLong_nid_no_patchLibcWideNumPutLong_nid_no_patch..._RSt8ios_basewmjHo78LGEtmUsceLibcInternalWideNumPutDoPutUnsignedLong_nid_no_patchLibcWideNumPutUnsignedLong_nid_no_patch..._RSt8ios_basewx9SSHrlIamtosceLibcInternalWideNumPutDoPutLongLong_nid_no_patchLibcWideNumPutLongLong_nid_no_patch..._RSt8ios_basewyuX0nKsUo8gcsceLibcInternalWideNumPutDoPutUnsignedLongLong_nid_no_patchLibcWideNumPutUnsignedLongLong_nid_no_patchThe behaviour is the one [facet.num.put.virtuals] fixes, and the narrow
num_put<char>facet in libc'sLocaleSupport.cppalready implements it. This PR does not add a second formatter. The wide members reuse that code:PutFormattedIntegerbuilds the%[+][#]{l,ll}{d,u,o,x,X}conversion frombasefield,showpos,showbaseanduppercaseand runssnprintf. It is now a template over the iterator and fill type. The sign and0xprefix rule moved into a sharedIntegerPrefix.PutIntegeroverload forWideOutputIteratorwidens the digits through the stream'sctype<wchar_t>. It takesgrouping()andthousands_sep()from the stream'snumpunct<wchar_t>, throughGuestLocale::WideNumpunctVtable, whose slot offsets are alreadystatic_asserted inGuestLocale.hpp. If the locale has nonumpunct<wchar_t>, it falls back to the C-locale facet from libc's existingnumpunct<wchar_t>::_Getcat.InsertSeparatorsis now a template over the string type, so the same grouping loop inserts a 16-bit separator.PutFieldis now a template over the iterator and string type, soleft,internaland the default right adjustment, and the reset ofwidth()to 0, are the same code as forchar.do_put(bool): withoutboolalphait returnsdo_put(out, str, fill, (long)val)as a virtual call through the facet's ownputLongslot, as the standard specifies. A derived facet'sdo_put(long)override is therefore reached, as in the narrowNumPutBool. Withboolalphait writestruename()orfalsename()ofnumpunct<wchar_t>(16-bit strings, inline or heap-stored) through the samePutField.Layouts added to
prx/libc/include/GuestLocale.hpp, each with astatic_assert:WideStreambuf:putNextis at 0x40 andputEndat 0x60, as in the narrowStreambuf.overflow(int_type)is vtable slot 0x20. The writer stores into the put area whileputEnd - putNext(in 16-bit units) is positive. Otherwise it callsoverflowwith the zero-extended code unit (char_traits<wchar_t>::to_int_type) and fails the iterator on-1(WEOF). A null buffer also fails the iterator. This is the narrowPutCharacterrule.WideOutputIteratoris{bool failed; WideStreambuf* buffer}(0x10 bytes), the same layout as the narrowOutputIterator.WideNumPutVtable:putBoolis at 0x20,putLongat 0x28 andputPointerat 0x58. The order and parameter types come from the Itanium-mangleddo_putnames and match the narrowNumPutVtable.WideCtypeVtable:widen(char)is at 0x60 andwiden(const char*, const char*, wchar_t*)at 0x68.ctype<wchar_t>declares 12 virtuals (do_isx2,do_scan_is,do_scan_not,do_tolowerx2,do_toupperx2,do_widenx2,do_narrowx2). After the 2 header slots and 4 facet slots that gives the 18-slot_ZTVSt5ctypeIwEthat libc already exports.do_widenis the ninth and tenth virtual whatever the order of the first eight. The narrowCtypeVtablegetswidenRangeat 0x48 by the same rule. If the stream's locale has noctype<wchar_t>facet, the digits are zero-extended, as the narrow facet copies them unchanged when there is noctype<char>.libc reaches libSceLibcInternal through five
extern "C"_nid_no_patchhelpers declared inGuestLocale.hpp, as #14373 exposes libc's numpunct members through a libc header. The_nid_no_patchsuffix keeps them out of the NID tables, so this PR adds no libc export. The anonymous-namespaceWideNumPutBoolis anAPS5_VABIfunction, sotools/progress.pycounts it as a libcdonename.Changes:
core/libs/prx/libSceLibcInternal/WideNumPut.cppwith the five exports. The five stubs are removed fromErr.cpp, and the entry points are declared inprx/libSceLibcInternal/include/Api.hpp.core/libs/prx/libc/src/LocaleSupport.cpp: the shared stages above, the wide writer,StreamWideNumpunct,WideWiden,TakeWideString, and the five helpers. The narrownum_put<char>output does not change;guest_localestill passes.guest_libc_internal_wide_num_put(core/libs/tests/GuestLibcInternalWideNumPut.cpp). It covers:LLONG_MIN, andULONG_MAXin octal;boolalphatrueandfalse; numericboolthrough the basedo_put(long); a derived facet whosedo_put(long)override is reached from the basedo_put(bool)while the basedo_put(long)ignores it;numpunct<wchar_t>: grouping"\3\2"with U+2009 as the separator, hex grouping after the0xprefix, an ungrouped short number, and a non-ASCIItruename. The heap-stored 15-characterfalsenameis read and freed;ctype<wchar_t>whosedo_widenrange maps digits to fullwidth forms, which shows that the slot at 0x68 is used;overflowwith zero-extended 16-bit units, a refused unit that fails the iterator, and a null buffer.docs/dev/debt/libSceLibcInternal.md: the five "prototype and behavior are unverified" lines are removed. One entry is added. It says these members share the gaps of libc's narrow facet, describes thectype<wchar_t>slot and the zero-extension when that facet is missing, and says the console'slibSceLibcInternal.sprxwas not read.tools/progress.pycollect_libraries(), run on agit archiveoforigin/mainb11c7bf84fand on this branch:origin/main: 9921 done of 37146 (libSceLibcInternal 92 done and 1045 todo; libc 1628 done and 19 todo).sceLibcInternalWideNumPutDoPut*_nid_no_patchentry points and the libcAPS5_VABIhelperWideNumPutBool. The five todo names removed are exactlysceLibcInternalPending3_144,147,148,149and150. No new todo appears.Tested
Only the focused test targets and their libraries were built (
guest_libc_internal_wide_num_put_testsandguest_locale_tests), on heade364f9c9dbon top oforigin/mainb11c7bf84f. No title was run.ctest -R '^(guest_libc_internal_wide_num_put|guest_locale|conventions_unknown_nids|conventions_debt_length|conventions_doc_links|debt_split)$'ran 3 times. Each run passed 6 of 6 tests with 0 failures.b11c7bf84fin a separate clone. The same 6 tests ran 3 times, and each run passed 6 of 6 with 0 failures.guest_libc_internal_wide_num_putis the new guest test.guest_localeis libc's existing locale test; it was run becauseLocaleSupport.cppandGuestLocale.hppchanged and it covers the narrownum_put<char>path that now shares the stages.conventions_unknown_nids,conventions_debt_length,conventions_doc_linksanddebt_splitare the repository's checker self-tests for the conventions and the debt-file split. They were run because the debt file changed.main's production code for these five NIDs is theNotImplemented_nid_no_patch(__func__)stub. With all five bodies inWideNumPut.cppput back to that stub,guest_libc_internal_wide_num_putfails 1 of 1 withsceLibcInternalWideNumPutDoPutLong_nid_no_patch not implemented. With the forwards restored it passes again. Onmainitself the new test does not build, because the five entry points and the wideGuestLocaletypes do not exist there.MSYS_NO_PATHCONV=1 python3 tools/check_conventions.py --base origin/main --title "<title>" --body <this body>: "All conventions checks passed."python3 tools/pr_overlap.py --branch feat/r3-numput-wchar-do-intexited 2 and printed "pr_overlap: overlap check failed closed; manually compare every reported PR branch before opening this one". It found no PR with the same exports or the same new files.gh pr diff; for feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021, whose diffghdoes not return, fromgit diffofrefs/pull/5021/headagainst its merge base) for:Pending3_144,147,148,149and150stub names;num_put<wchar_t>do_putmangled name;WideNumPut,WideStreambuf,WideOutputIterator,WideCtypeVtable,LibcWideNumPut,StreamWideNumpunct,WideWidenandTakeWideString.numpunct<char>members) and feat(libSceLibcInternal): implement basic_string erase, append, assign, _Xran and _Xlen #15692 (basic_string members) edit neighbouring lines ofLocaleSupport.cpp(AsNumpunct/TakeString) and oflibSceLibcInternal/include/Api.hpp. feat(libSceLibcInternal): run the deleting destructors of future_error, overflow_error and underflow_error #14834, feat(libSceLibcInternal): run the C++ ABI type_info destructors #15695, feat(libSceLibcInternal): implement the error category names and codecvt_base queries #15696, feat(libSceLibcInternal): forward the error category destructors, _Xoverflow_error and the __sce_v2 mutex name override to libc #15697 and feat(libSceLibcInternal): implement num_put<char>::put and time_put<char>::put #15715 edit neighbouring lines ofApi.hpp,CMakeLists.txtor the debt file. These are text conflicts only; whichever merges second rebases.GuestLocale.hppandLocaleSupport.cppthat this PR also touches. None of them implements a widenum_putmember.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)🤖 Generated with Claude Code