Partially replaces #5690.
POD types are just memset. Other types are either destructed if not
trivial and/or constructed if not trivial. Types need to have a default
constructor.
Virtual classes can be mem_zeroed only if they already have been
constructed, otherwise it is UB.
Replace usages of platform specific `lock_*` functions with `std::mutex` through the wrapper class `CLock`. Move lock classes to `base/lock.h`.
The `CLock` wrapper class is only necessary because the clang thread-safety attributes are not available for `std::mutex` except when explicitly using libc++.
Round to nearest integer instead of truncating in `f2fx` to ensure correct round-trip with `fx2f`.
Add test to ensure correct round-trip with maximum `0.0005f` absolute error.
The host lookup job and the engine interface are independent so they are moved to separate files.
The include of `engine.h` in `client.h` is therefore unnecessary and other includes also had to be adjusted because of this.
The variable `m_VersionServeraddr` is unused and therefore removed. The host lookup job is currently not used on the client-side.
This class is slightly more light-weight than a CEditorComponent
and its naming makes it more natural to inherit for envelope points,
proof-mode positions etc.
Set DDNET_VERSION_NUMBER from DDNET_NETWORK_VERSION no matter what VERSION is.
Provide get_network_version_number() which parses version to network version.
Update the country codes which are displayed for the flags in the UI. This only changes the names which are displayed in the UI but not how flags are communicated between server and client.
- Use ISO 3166-2 subdivision codes:
- England: XEN → GB-ENG
- Northern Ireland: XNI → GB-NIR
- Scotland: XSC → GB-SCT
- Wales: XWA → GB-WLS
- Catalonia: XCA → ES-CT
- Galicia: XGL → ES-GA
- Use ISO 3166/MA exceptional reservation code:
- European Union: XEU → EU
- Move South Sudan (SS) to official codes, as it was officially assigned in the year 2011.
Closes#7071.
Add more efficient function for formatting integer values as strings.
A benchmark shows that using this function is significantly faster than using `str_format`. It is faster by a factor of 220 with Clang 15.0 O2 (https://quick-bench.com/q/BlNoLnlyqxipf4jvsFTUxKMHDJU) and by a factor of 11 with GCC 12.2 O2 (https://quick-bench.com/q/Fxf9lDCTqXBF4pIa_IyZ5R0IqYg).
This increases FPS in the editor by ~25% when many numbers are rendered for switch/tele/speedup/tune layers or with "Show Info" being enabled.
The additional static analysis for `std::to_chars` revealed that the wrong size was used in `CHud` for `aScoreTeam[TEAM_RED]` and `aScoreTeam[TEAM_BLUE]`.
This requires incrementing the macOS deployment target from 10.13 to 10.15.