summaryrefslogtreecommitdiff
path: root/Services
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@colorado.edu>2020-10-28 10:50:53 -0600
committerAndreas Kling <kling@serenityos.org>2020-11-11 12:18:25 +0100
commit72d019f4a4acbf65ac6f6698f9efe74b46919106 (patch)
tree7a7c7cc5844dfa3958c32d593188eb1e4ba18758 /Services
parent62a74bf282ec8f179f148428190a6e0bac425446 (diff)
downloadserenity-72d019f4a4acbf65ac6f6698f9efe74b46919106.zip
IPv4Address: constexpr support
Problem: - IPv4Address class cannot be used in a compile-time context. - A union is used by initializing one of the members and reading the non-active member. This is undefined behavior and not permitted in a `constexpr` context. Solution: - Eliminate undefined behavior by changing to a simple `u32` for storage instead of the union and performing mask/shift calculations for obtaining the individual octets. - Decorate functions with `constexpr` where possible. Currently string formatting and optionals are not `constexpr`-capable so functions using those are left out. - Modify tests to validate functionality in a `constexpr` context in addition to the run-time tests already being run. This ensures that functionality is the same in both contexts.
Diffstat (limited to 'Services')
0 files changed, 0 insertions, 0 deletions