Commit Graph

294 Commits

Author SHA1 Message Date
Bananymous f4be37700f Kernel/userspace: rework floating point math
SSE is now unconditionally enabled any where and most of math.h is now
actually implemented. using __builtin_<func> lead to many hangs where
the builtin function would just call itself.
2024-11-03 20:28:15 +02:00
Bananymous 07275ecb5f BAN: Implement floating point constants in Numbers.h 2024-11-03 20:19:45 +02:00
Bananymous ddd3b4c093 BAN: Implement is_pod type traits 2024-10-17 01:35:42 +03:00
Bananymous 3a6fc4c197 BAN: Add proper error messages for `MUST()` in userspace 2024-10-17 01:32:55 +03:00
Bananymous dab6e5a60f BAN: Cleanup HashMap implementation and add {insert,emplace}_or_assign 2024-10-13 22:00:16 +03:00
Bananymous 0b05e9827b BAN: Use memmove instead of memcpy on overlapping data
I was accidentally using memcpy where memmove was needed
2024-10-13 22:00:16 +03:00
Bananymous 1c1a76d6d7 BAN: Member function pointers now use references instead of pointers
This seems cleaner as class pointer cannot be null anymore
2024-10-13 22:00:16 +03:00
Bananymous df4f37d68d BAN: only define placement new operators for banan-os targets
This allows building and using BAN library outside of banan-os!
2024-10-10 21:55:25 +03:00
Bananymous 44629ba5dd BAN: Allow userspace to use string literals with BAN::Error 2024-10-10 21:54:52 +03:00
Bananymous 2da6776451 BAN: Update {Byte}Span API with better constness
const BAN::Span<int> is now allowed to modify its underlying data, but
the container itself is const.

BAN::Span<const int> can be used for spans over constant data.
2024-10-10 21:53:23 +03:00
Bananymous a68f411024 BAN: Add requires clauses for Container::emplace{,_back} functions
This allows syntax highlighters to report errors!
2024-10-10 21:51:44 +03:00
Bananymous f432d3fcf8 BAN: Cleanup Optional casting for value getters 2024-10-07 01:44:44 +03:00
Bananymous 6f90974896 BAN: Fix StringView::starts_with
I have no idea what i had been thinking when writing this code :D
2024-10-06 06:23:25 +03:00
Bananymous dce2436b2c BAN: Implement Vector::reverse() 2024-09-14 19:44:20 +03:00
Bananymous c4dadd27ac BAN: Fix refenrece -> reference typo 2024-09-03 16:39:21 +03:00
Bananymous 8a2a444f33 BAN: Make formatting functions inline 2024-08-14 20:26:55 +03:00
Bananymous fd018b32d0 BAN: Implement GUID::to_string 2024-08-14 13:23:27 +03:00
Bananymous e000c7d818 BAN: Use static_cast instead of C-style cast in RefPtr deletion 2024-08-14 13:23:27 +03:00
Bananymous 819c130366 BAN: If format string is started with space, numbers are padded with it 2024-07-19 21:39:31 +03:00
Bananymous fd8dc03ae9 BAN: Default initialize optional storage
This removes maybe uninitialized warning when using default initialized
optionals.
2024-07-16 11:19:16 +03:00
Bananymous 442ea8a692 BAN: Remove Optional emplace constructor
This was kind breaking some initializations. Emplacing is still possible
through Optional::emplace
2024-07-14 01:53:50 +03:00
Bananymous 110a45bee6 BAN: Implement Variant::has_value() and Variant::operator bool() 2024-07-12 20:37:56 +03:00
Bananymous 62003d96f3 BAN: Implement Optional::value_or
This will return value specified in the argument if optional is not
storing any value.
2024-07-12 11:22:10 +03:00
Bananymous 010c2c934b BAN: Write RefPtr and WeakPtr to be thread safe 2024-06-28 22:00:29 +03:00
Bananymous 48a76426e7 BAN: Add more APIs for Atomic and make compare_exchage take a reference 2024-06-28 21:47:47 +03:00
Bananymous 44c7fde2f7 BAN: Fix Function requires clause argument forwariding 2024-06-27 00:33:50 +03:00
Bananymous 3c57e05a65 BAN: Implement hash for StringView 2024-06-25 19:28:45 +03:00
Bananymous 1ac7629459 BAN: Implement StringView::rfind() 2024-06-25 11:04:03 +03:00
Bananymous 67dfe0bcf3 BAN: Allow String::formatted to fail 2024-06-25 11:04:03 +03:00
Bananymous b1869bced4 BAN: Implement StringView::starts_with() 2024-06-25 11:04:03 +03:00
Bananymous 30fdc2198f BAN: Add exchage() to Atomic<T> 2024-06-20 13:24:42 +03:00
Bananymous 318ce5dec8 All: Fix a lot of compiler warnings from header files
While reworking build system, header files started to report warnings.
2024-06-18 23:02:10 +03:00
Bananymous f233715b70 BAN: Add d{print,want,error}ln_if macros for userspace 2024-06-18 02:35:45 +03:00
Bananymous a58ac18fa0 BAN: Add move constructors to ByteSpan 2024-06-18 01:52:02 +03:00
Bananymous 17ecbca204 BAN: Add network_endian_to_host 2024-06-17 22:14:43 +03:00
Bananymous 511fc870a1 BAN: Mark RefPtr and WeakPtr operator bool() as explicit 2024-06-17 20:19:36 +03:00
Bananymous 15f8c7014f BAN: Add line endings to d{warn,error}ln 2024-06-17 16:48:56 +03:00
Bananymous 05e9d76c77 BAN: Implement will_{addition,multiplication}_overflow 2024-06-14 11:04:29 +03:00
Bananymous cc6b80a55b BAN: Optimize Vector copy assignment to reduce allocations
If vector contains enough elements, it will now replace old elements
instead of clearing and reallocating
2024-06-14 00:17:28 +03:00
Bananymous 6707989cd5 BAN: Implement same_as and add requires for BAN::Function with lambda
BAN::Function(lambda) now requires that the object is callable and
returns the correct type. This allows overloads with different
callback formats.
2024-06-14 00:15:48 +03:00
Bananymous caa0111c79 BAN: Implement back() for CircularQueue 2024-06-11 00:05:11 +03:00
Bananymous 65f299038d BAN: Implement traits {true,false}_type with integral_constant 2024-06-03 17:51:44 +03:00
Bananymous 939cbf46e4 BAN: Implement BAN::UTF8::to_codepoint() for single byte types 2024-06-03 03:39:57 +03:00
Bananymous cfdce9be61 BAN: Mark RefPtr and WeakPtr helper destructors virtual
Also fix a bug in WeakPtr::lock() which would assert false if the
underlying weak link was not initialized
2024-06-02 16:50:26 +03:00
Bananymous b2a4797d16 BAN: Fix dwarnln and derrorln stop color 2024-05-31 13:04:36 +03:00
Bananymous 30592b27ce BAN: Add comparison operators for RefPtr 2024-05-29 13:50:03 +03:00
Bananymous 54db4ab215 BAN: Increase BAN::Function storage size to 8 pointers 2024-05-28 16:01:41 +03:00
Bananymous f5987b68ff BAN: Mark some class methods as constexpr 2024-05-28 01:07:29 +03:00
Bananymous 06f4b0b29a BAN: Make String and StringView header only
This allows linking with libc without having to link ban
2024-05-23 15:43:26 +03:00
Bananymous 090a294017 BAN: Add {little,big}_endian_to_host
These just call host_to_{little,big}_endian but are more verbose
and cleaner.
2024-04-09 01:13:28 +03:00