summaryrefslogtreecommitdiff
path: root/AK/Endian.h
AgeCommit message (Collapse)Author
2021-08-02AK: Add formatters for BigEndian and LittleEndiansin-ack
This allows printing out BigEndian and LittleEndian values without having to perform a static_cast first.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-01-12AK: Simplify constructors and conversions from nullptr_tLenny Maiorani
Problem: - Many constructors are defined as `{}` rather than using the ` = default` compiler-provided constructor. - Some types provide an implicit conversion operator from `nullptr_t` instead of requiring the caller to default construct. This violates the C++ Core Guidelines suggestion to declare single-argument constructors explicit (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit). Solution: - Change default constructors to use the compiler-provided default constructor. - Remove implicit conversion operators from `nullptr_t` and change usage to enforce type consistency without conversion.
2020-12-31Everywhere: Re-format with clang-format-11Linus Groh
Compared to version 10 this fixes a bunch of formatting issues, mostly around structs/classes with attributes like [[gnu::packed]], and incorrect insertion of spaces in parameter types ("T &"/"T &&"). I also removed a bunch of // clang-format off/on and FIXME comments that are no longer relevant - on the other hand it tried to destroy a couple of neatly formatted comments, so I had to add some as well.
2020-12-28AK/Userland: Use AK/Endian.h for portable byte swapping in ntpqueryAndrew Kaster
Create macros for the byte swap operations one would expect to be in endian.h or byteswap.h in AK/Endian.h. It's likely a similar/different change will be needed for BSDs, but there's no github action for those added to the project yet.
2020-10-08Endian: constexpr constructors and conversion operatorsLenny Maiorani
Problem: - Constructors and conversion operators are not `constexpr`, but they can be. - `constexpr` is needed here so that other classes can add `constexpr` evaluation. Solution: - Add the `constexpr` keyword to the constructors and conversion operators. - Add `static_assert` tests which ensure the capability works.
2020-08-29AK: Don't swap endianness when writing endian wrappers to stream.asynts
2020-08-25AK: Add Endian.h header to replace NetworkOrdered.h.asynts