Change return values to bool or void in FPM#9911
Draft
Girgias wants to merge 23 commits intophp:masterfrom
Draft
Change return values to bool or void in FPM#9911Girgias wants to merge 23 commits intophp:masterfrom
Girgias wants to merge 23 commits intophp:masterfrom
Conversation
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
Member
|
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... |
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.
A lot of functions in FPM declare an
intreturn type but only return one, or two distinct values.Since C99
boolis defined by the standard and I have thus changed the0/-1return values totrueandfalse, however to not break API usage (e.g. to make merging upwards) it would be possible to returnSUCCESSandFAILUREand 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.