Skip to content

Tree: use true and false for bool returns - #25988

Open
DanielEScherzer wants to merge 1 commit into
php:masterfrom
DanielEScherzer:bool-returns
Open

DanielEScherzer wants to merge 1 commit into
php:masterfrom
DanielEScherzer:bool-returns

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Member

Also for BOOL returns (php_win32_ioutil_posix_to_open_opts()) and UBool returns (intl_icu_compat_uspoof_check_result_mismatch).

Also for `BOOL` returns (`php_win32_ioutil_posix_to_open_opts()`) and `UBool`
returns (`intl_icu_compat_uspoof_check_result_mismatch`).
@DanielEScherzer

Copy link
Copy Markdown
Member Author

I tried Coccinelle with things like

Details
// Options: --ignore zend_vm
@r1@
identifier fn;
typedef bool;
@@

bool fn(...)
{
...
(
- return 0;
+ return false;
|
- return 1;
+ return true;
)
...
}

@@
@@

static bool fn(...)
{
...
(
- return 0;
+ return false;
|
- return 1;
+ return true;
)
...
}

but that missed a bunch, so most of the changes are manual

@TimWolla

TimWolla commented Dec 1, 2026

Copy link
Copy Markdown
Member

but that missed a bunch

Yeah, Coccinelle likely still is struggling with some of the less clean macros that make it abort safely rather than making an incorrect change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants