refactor(common-dialog): define the shared dialog status and error codes once #16362
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16362"
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 LeandroLP23 on 2026-11-06T12:02:51Z.
What
Step 1 of #15643, without the busy change. The common dialog statuses, results and error codes were redefined in an anonymous namespace in 22 dialog libraries and 2 tests.
CommonDialog.hppnow defines them once, and the copies are removed. No library returns a different value.CommonDialog.hppgainsSTATUS_NONE/INITIALIZED/RUNNING/FINISHED,RESULT_OK,RESULT_USER_CANCELEDand the errorsNOT_SYSTEM_INITIALIZED(0x80B80001),NOT_INITIALIZED,NOT_FINISHED,INVALID_STATE(0x80B80006),INVALID_ARGUMENT(0x80B8000A),NOT_RUNNINGandARG_NULL.COMMON_DIALOG_OK,ALREADY_SYSTEM_INITIALIZEDandALREADY_INITIALIZEDwere already there. Every removed copy had the same value as the shared one.COMMON_DIALOG_ERROR_PARAMETER(libSceWebBrowserDialog's name for0x80B8000A) is an alias ofINVALID_ARGUMENT. #15643 proposed a singlePARAM_INVALIDname. Renaming would touch 59 lines in 11 files, inside functions that open pull requests are changing, so it is left for later.COMMON_DIALOG_ERROR_BUSYstays in each library. 14 use0x80B80007and libSceInvitationDialog0x80B80008, and which one is right is still the open question on #15643, so nothing changes there until it is decided.ERROR_INVALID_STATE=0x80B80007) keeps its own codes exceptNOT_FINISHED. libScePlayerInvitationDialog is left as onmain, because #14300 adds a busy code beside its constants.GuestPlayerReviewDialog.cppandGuestWebBrowserDialog.cppincludedCommonDialog.hppand defined the same names, which would now be ambiguous, so their copies go too. To keep an independent check of the numbers,GuestCommonDialog.cpppins every shared value with astatic_assertagainst its literal.Tested
-fsyntax-onlyand the exact flags of amainbuild (ninja -t compdb), with the include paths pointed at this branch. As a negative check, a duplicateCOMMON_DIALOG_STATUS_NONEplanted in libSceSigninDialog fails withreference to 'COMMON_DIALOG_STATUS_NONE' is ambiguous.static_asserts pin the shared ones. The Windows pull request job runs the changed guest tests.python tools/check_conventions.py --base origin/mainpasses.python tools/pr_overlap.py: 22 open pull requests touch these files, and none edits the constant lines. #16049 and #16051 conflict withmainalready, and their code hunks start at lines 39 and 45, after the constant blocks this changes. Rebased ontomain6c1efc7c59after #15391, #15392 and #15420 merged: their files keep their new include,RACE_ROUNDSand Terminate race test, and lose only the duplicated constants. #16746 (opened 7 Nov) adds two test constants right afterGuestWebBrowserDialog.cpp's constant block: whichever merges second keeps its new lines and drops the old block, since a local copy beside the header's names makes them ambiguous. The 25 changed.cppfiles pass-fsyntax-onlywith the build's flags.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)