mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
cf6e89c319
6035: Fix various issues reported by cppcheck static analyser r=def- a=Robyt3 After generating `compile_commands.json` with cmake, I ran [cppcheck](https://cppcheck.sourceforge.io/) like this: ``` cppcheck --project=compile_commands.json -DWIN64 --suppressions-list=cppcheck.supp --enable=all 2>cppcheck.log ``` With these suppressions in `cppcheck.supp`: ``` cstyleCast useStlAlgorithm unusedFunction variableScope noExplicitConstructor useInitializationList noConstructor uninitMemberVar uninitMemberVarPrivate uninitDerivedMemberVar uninitStructMember uninitvar shadowFunction memleakOnRealloc internalAstError virtualCallInConstructor unknownMacro noOperatorEq noCopyConstructor ``` Many of these occur too often or are false positives. Here is a list of all remaining non-suppressed issues reported by cppcheck: [cppcheck.log](https://github.com/ddnet/ddnet/files/9997663/cppcheck.log) And here is a list of all remaining issues including the suppressed ones: [cppcheck_all.log](https://github.com/ddnet/ddnet/files/9997662/cppcheck_all.log) I couldn't get cppcheck's command line argument to ignore the external folders to work correctly, so I manually removed those entries from the files. ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Robert Müller <robytemueller@gmail.com> |
||
---|---|---|
.. | ||
client | ||
editor | ||
server | ||
collision.cpp | ||
collision.h | ||
ddracechat.h | ||
ddracecommands.h | ||
gamecore.cpp | ||
gamecore.h | ||
layers.cpp | ||
layers.h | ||
localization.cpp | ||
localization.h | ||
mapbugs.cpp | ||
mapbugs.h | ||
mapbugs_list.h | ||
mapitems.cpp | ||
mapitems.h | ||
mapitems_ex.cpp | ||
mapitems_ex.h | ||
mapitems_ex_types.h | ||
prng.cpp | ||
prng.h | ||
teamscore.cpp | ||
teamscore.h | ||
tuning.h | ||
variables.h | ||
version.h | ||
voting.h |