Apologies in advance for the monster PR here. It consists entirely of clang-tidy fixes; avoiding any functional change.
After all the auto fixes were applied, I spent some time doing a few more linter suggestions. The goal was to fix items that didn't change functionality.
- Change a few reinterpret casts
- Give function declarations named variables
- More liberally use const references
- Cleanup some pointer arithmetic (although there are more to fix)
- Change some typedefs and defines to their cpp counterparts
- Replace deprecated macros
- Narrowing (there are more though)
- More I am forgetting
There are still plenty clang tidy warnings, but some require delicate refactors, type changes, and more cpp idomatic code.
As a result of touching many lines, I thought it fitting to also give the .clang-format some reasonable rules. I gave it rules similar to the .editorconfig. Then I allowed the formatter to modify only lines that I touched. It may be worth doing a larger format over the whole codebase, but I didn't want to own all of those changes. I think some checkin rules or git action can do that without changing the line owner.
Final note, I did not test this on Windows but didn't see any lines that would have effected a Win build. Worth checking for sure.
Let me know what you think, cheers.
Apologies in advance for the monster PR here. It consists entirely of `clang-tidy` fixes; avoiding any functional change.
After all the auto fixes were applied, I spent some time doing a few more linter suggestions. The goal was to fix items that didn't change functionality.
- Change a few reinterpret casts
- Give function declarations named variables
- More liberally use const references
- Cleanup some pointer arithmetic (although there are more to fix)
- Change some typedefs and defines to their cpp counterparts
- Replace deprecated macros
- Narrowing (there are more though)
- More I am forgetting
There are still plenty clang tidy warnings, but some require delicate refactors, type changes, and more cpp idomatic code.
As a result of touching many lines, I thought it fitting to also give the `.clang-format` some reasonable rules. I gave it rules similar to the `.editorconfig`. Then I allowed the formatter to modify only lines that I touched. It may be worth doing a larger format over the whole codebase, but I didn't want to own all of those changes. I think some checkin rules or git action can do that without changing the line owner.
**Final note, I did not test this on Windows but didn't see any lines that would have effected a Win build. Worth checking for sure.**
Let me know what you think, cheers.