Improving the formatting of header files #9405
Open
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.
In light of "Another GPU API (#9312)", the different formatting made me remember that I
always had an issue with SDL's function's formatting, specifically in header files.
The way function signatures are formatted in header files make it difficult to read in a thin split window
because function signatures oftentimes go far outside the 80 column limit.
See this SDL example, where all the documentation is nicely layed out to fit in a 80 column window, but not the signature:
The formatting of function signatures in "Another GPU API (#9312)" look like this:
Personnally, putting the closing parenthese on a new line at the end is wasted whitespace and I would keep it on the last parameter. The SDL example would look like this with the new formatting, and now it reads super nice in a 80 column window:
What I propose is this: The formatting of function signatures in header files must have their parameter list layed out vertically below the function name, unless parameters follow some kind of logical grouping, then these can go on the same line together. Logical grouping is not set in stone, pick whatever is most readable. Like in this example:
This PR contains the reformatting for
SDL_render.h
only, it merely took a few minutes to redo the formatting.Tell me what you think, and I shall proceed with the rest of the headers.