ddnet/src/engine/client
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
..
backend Declare variables as const when possible 2022-11-29 23:32:32 +01:00
backend_sdl.cpp fix some valgrind conditional jump relies on uninit warnings 2022-12-04 22:54:18 +01:00
backend_sdl.h fix some valgrind conditional jump relies on uninit warnings 2022-12-04 22:54:18 +01:00
blocklist_driver.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
blocklist_driver.h Add Intel as vendor to the block list on windows 2021-05-06 12:23:40 +02:00
checksum.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
client.cpp Merge #6035 2022-12-05 20:00:07 +00:00
client.h Remove // in ddnet:// url handler 2022-11-29 18:15:09 +01:00
demoedit.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
demoedit.h Mark virtual function as override using a script: 2022-05-17 23:47:32 +02:00
discord.cpp Only announce servers using Steam/Discord integration which are registered 2022-10-09 16:16:54 +02:00
favorites.cpp Fix windows build 2022-09-27 13:45:58 +02:00
friends.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
friends.h Organize engine-client includes 2022-06-17 17:46:43 +02:00
ghost.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
ghost.h Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
graphics_defines.h Remove GL includes from headers 2021-05-01 23:56:30 +02:00
graphics_threaded.cpp Use str_copy instead of str_format with format "%s" 2022-10-27 21:42:14 +02:00
graphics_threaded.h Fix misspellings 2022-10-25 13:51:56 -03:00
input.cpp Use traditional casts instead of functional-style casts 2022-11-06 11:52:21 +01:00
input.h Add IInput::ShiftIsPressed and IInput::AltIsPressed 2022-11-15 21:17:55 +01:00
keynames.h Remove all references to memset 2022-09-02 14:32:39 +02:00
notifications.cpp Emscripten support 2022-03-25 12:42:18 +01:00
notifications.h Libnotify support for linux client (#2099) 2020-04-14 17:53:53 +02:00
serverbrowser.cpp Remove support for legacy 64 player info protocol 2022-10-12 16:12:02 +02:00
serverbrowser.h Remove support for legacy 64 player info protocol 2022-10-12 16:12:02 +02:00
serverbrowser_http.cpp Use new ddnet.org domain 2022-08-30 10:09:06 +02:00
serverbrowser_http.h Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
serverbrowser_ping_cache.cpp Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
serverbrowser_ping_cache.h Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
sound.cpp Let CKernel clean-up. Use unused CSound::Shutdown 2022-09-16 16:50:19 +02:00
sound.h Let CKernel clean-up. Use unused CSound::Shutdown 2022-09-16 16:50:19 +02:00
sqlite.cpp Make use of IO_MAX_PATH_LENGTH 2021-09-13 12:14:50 +02:00
steam.cpp Only announce servers using Steam/Discord integration which are registered 2022-10-09 16:16:54 +02:00
text.cpp Remove unused member SFontSizeChar::m_TouchTime 2022-11-29 23:28:37 +01:00
updater.cpp Use new ddnet.org domain 2022-08-30 10:09:06 +02:00
updater.h Use nullptr in generated and editor 2022-06-13 18:28:13 +02:00
video.cpp Fix deprecation warning in ffmpeg 5.1 (fixes #5681) 2022-07-31 00:58:15 +02:00
video.h Huge variable naming format 2022-07-08 18:01:29 +02:00