diff options
author | Alexander Richardson <alexrichardson@google.com> | 2023-06-15 06:28:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-15 08:28:49 -0500 |
commit | 9b477812019a78510ebc7f4c7b7efbf378e64a42 (patch) | |
tree | c338d406fff3c7a06df1a24c1ce895fa6f21b1fd /model/rvfi_dii.sail | |
parent | 2d214136ce4da767d926bc18ff53478181bc729b (diff) | |
download | sail-riscv-9b477812019a78510ebc7f4c7b7efbf378e64a42.zip sail-riscv-9b477812019a78510ebc7f4c7b7efbf378e64a42.tar.gz sail-riscv-9b477812019a78510ebc7f4c7b7efbf378e64a42.tar.bz2 |
Add a clang-format configuration and reformat C code (#261)
* 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
Diffstat (limited to 'model/rvfi_dii.sail')
0 files changed, 0 insertions, 0 deletions