mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-21 01:54:19 +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> |
||
---|---|---|
.. | ||
tl | ||
unicode | ||
bezier.cpp | ||
bezier.h | ||
Cargo.toml | ||
color.h | ||
color.rs | ||
detect.h | ||
dynamic.h | ||
hash.cpp | ||
hash.h | ||
hash_bundled.cpp | ||
hash_ctxt.h | ||
hash_libtomcrypt.cpp | ||
hash_openssl.cpp | ||
lib.rs | ||
lock_scope.h | ||
log.cpp | ||
log.h | ||
logger.h | ||
math.h | ||
rust.h | ||
rust.rs | ||
system.cpp | ||
system.h | ||
types.h | ||
vmath.h |