aboutsummaryrefslogtreecommitdiff
path: root/.clang-format
AgeCommit message (Collapse)AuthorFilesLines
2023-06-15Add a clang-format configuration and reformat C code (#261)Alexander Richardson1-0/+11
* Add a clang-format configuration and reformat C code From my testing it turns out the built-in WebKit style is the closest to the current style. I added a few config options to further reduce the diff and I think the current output looks reasonable. In the future it would be good to add a CI and pre-commit check to enforce that all C code is consistently formatted to reduce the need for reviewers to look for formatting issues. * Fix formatting of commented-out reservation debug code Use an empty-by-default macro instead of commented-out fprintf calls. This way clang-format can format the calls sensibly and it's easier to enable the debug prints. * Improve formatting of fprintf call in set_config_print() Clang-format does not like long string literals, so split this manually to format the call sensibly. * Fix formatting of function pointer typedef Clang-format gets this wrong `*` is part of the typedef. * Improve formatting of getopt_long call * Fix odd fprintf continuation by splitting long string literal