ddnet/src/base
bors[bot] cf6e89c319
Merge #6035
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>
2022-12-05 20:00:07 +00:00
..
tl Fix misspellings 2022-10-25 13:51:56 -03:00
unicode Remove internal utf8 confusable functions from system.h 2022-11-12 20:56:35 +01:00
bezier.cpp Move src/game/bezier.cpp/h to src/base/bezier.cpp/h 2022-09-24 20:53:59 +02:00
bezier.h Move src/game/bezier.cpp/h to src/base/bezier.cpp/h 2022-09-24 20:53:59 +02:00
Cargo.toml Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
color.h Reworked color system 2022-07-06 11:39:51 +02:00
color.rs Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
detect.h Emscripten support 2022-03-25 12:42:18 +01:00
dynamic.h Run clang-format 2020-09-26 21:50:15 +02:00
hash.cpp Use size_t for indices in digest_str 2022-10-15 18:08:41 +02:00
hash.h Remove useless typedef in c++ 2022-06-25 21:05:54 +02:00
hash_bundled.cpp Use cpp 2021-06-24 17:19:17 +02:00
hash_ctxt.h Remove useless typedef in c++ 2022-06-25 21:05:54 +02:00
hash_libtomcrypt.cpp Fix more unsafe define 2022-06-29 23:52:03 +02:00
hash_openssl.cpp Ignore openssl deprecation warning for now (fixes #5597) 2022-07-27 09:06:57 +02:00
lib.rs Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
lock_scope.h Fix TSA warnings in Clang 15 (fixes #5548) 2022-09-15 23:31:09 +02:00
log.cpp Use dynamic buffer size in CLoggerWindowsDebugger 2022-10-29 21:17:47 +02:00
log.h Add logging macros log_{error,warn,info,debug,trace} 2022-04-29 15:32:42 +02:00
logger.h More vector naming format 2022-06-15 19:37:37 +02:00
math.h Work around Windows's definition of min/max 2022-05-31 17:26:35 +02:00
rust.h Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
rust.rs Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
system.cpp Merge #6035 2022-12-05 20:00:07 +00:00
system.h Mark parameters as const when possible 2022-11-29 23:32:31 +01:00
types.h Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
vmath.h Replace 2 floats array with vec2 where it makes sense 2022-07-06 11:39:43 +02:00