On Wed Jan 31 16:15:58 2024 +0000, Rémi Bernon wrote:
I'm going to nitpick again but let's start with it so that we can get it out of the way:
- I find the wrapping used here unusual and not very readable. We have
some kind of flexible line length limit, not a very hard 80 char limit like seems to be used here. 2) Long arguments lines are more often wrapped instead of having each arguments on their line. 2) Don't use hungarian notation even if the documented interface method signature does, use snake case and prefer separating words with underscores. Because of how it looks I'm assuming this was formatted with clang-format, which is okay if that helps, but it's still not going to save you from manually checking for readability and consistency with the rest of the module code. Tweaking the config will help getting nicer results I think. Here's the configuration I've used for dmusic, which is more or less a WineD3D-like code style module (no space in parentheses, double indent continuation):
--- DisableFormat: false SortIncludes: false Language: Cpp IndentWidth: 4 ColumnLimit: 100 BreakBeforeBraces: Allman AlignAfterOpenBracket: DontAlign AllowAllArgumentsOnNextLine: true AllowShortIfStatementsOnASingleLine: AllIfsAndElse AllowShortCaseLabelsOnASingleLine: true AllowShortFunctionsOnASingleLine: None AllowShortLoopsOnASingleLine: true ContinuationIndentWidth: 8 BinPackArguments: true BinPackParameters: true PenaltyBreakString: 1000 PenaltyExcessCharacter: 1 PenaltyIndentedWhitespace: 1 PenaltyBreakAssignment: 10000 PenaltyBreakOpenParenthesis: 10000 PenaltyReturnTypeOnItsOwnLine: 10000 PenaltyBreakBeforeFirstCallParameter: 10000 ...
Note that even with this configuration I don't believe clang-format does a super good job, and there's still several places where reformatting the whole file will need manual adjustments.
Yes, this is indeed formatted by clang-format, thanks for the config.
One annoying thing about clang-format is that it cannot format:
```c static Vtbl vtable = { ... }; ```
it insists on formatting it like this:
```c static Vtbl vtable = { ...}; ```