-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Change return values to bool or void in FPM #9911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Girgias
wants to merge
23
commits into
php:master
Choose a base branch
from
Girgias:fpm-bool-usage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
It always returns 0
As it only returns 0 or -1
As it only returns 0 or -1
562124f
to
f7cc2cd
Compare
As it only returns 0 or -1
Either the return value was always the same, or just returned either 0 or -1
Either the return value was always the same, or just returned either 0 or -1
The return value was always either 0 or -1
f7cc2cd
to
78f06e5
Compare
The return value was always either 0 or -1
The return value was always one of two values.
As it only returns 0 or -1
Either the return value was always the same, or just returned either 0 or -1
The return value was always one of two values.
The return value was always one of two values.
The return value was always either 0 or -1
The return value was always either 0 or -1
Either the return value was always the same, or just returned either 0 or -1
It always returns 0
The return value was always either 0 or -1
The return value was always either 0 or -1
The return value was always either 0 or -1
The return value was always either 0 or -1
78f06e5
to
21023b4
Compare
I'm sorry but this is too invasive and will make fixing bugs really painful when merging up. I will be happy to reconsider it once most of the FPM bugs are fixed but not at this stage I'm afraid as the value of this is more cosmetic really... |
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.
A lot of functions in FPM declare an
int
return type but only return one, or two distinct values.Since C99
bool
is defined by the standard and I have thus changed the0
/-1
return values totrue
andfalse
, however to not break API usage (e.g. to make merging upwards) it would be possible to returnSUCCESS
andFAILURE
and mark the return type aszend_result
.This came about as I was checking that a doc PR for FPM was correct and the conditionals
0 >
confused me at first, and I think using the more standard boolean behaviour (or changing to checking explicitly for== FAILURE
) is clearer.