summaryrefslogtreecommitdiff
path: root/AK/StdLibExtras.h
AgeCommit message (Collapse)Author
2020-07-26AK: Add global is<T>() and downcast<T>()Andreas Kling
Let's unify the is<T>/to<T> implementations that currently exist in separate versions in LibCore and LibWeb.
2020-07-24AK: Add a couple more helper templates to StdLibExtrasAndreas Kling
2020-07-18AK: Use "signed char" as the opposite of "unsigned char"Andreas Kling
I totally forgot about the C++ basics here. There are three distinct types: "char", "signed char" and "unsigned char". Whether "char" is signed or unsigned is implementation specific.
2020-05-23AK: Add MakeSigned<T> helper templateAndreas Kling
2020-04-22AK: Tweak exchange() implementationAndreas Kling
Make it constexpr and do perfect forwarding.
2020-04-15AK: Add MakeUnsigned<T> helper templateAndreas Kling
2020-04-07AK: Add forward() overload that refuses to forward lvalue as rvalueAndreas Kling
This matches what other forward() implementations do.
2020-03-08AK: Move memory stuff (fast memcpy, etc) to a separate headerAndreas Kling
Move the "fast memcpy" stuff out of StdLibExtras.h and into Memory.h. This will break a ton of things that were relying on StdLibExtras.h to include a bunch of other headers. Fix will follow immediately after. This makes it possible to include StdLibExtras.h from Types.h, which is the main point of this exercise.
2020-03-08AK: Add a Conditional<condition, TrueType, FalseType> templateAndreas Kling
This allows you to select a type based on a compile-time condition.
2020-02-09AK: Apply changes for the Bootstrapper environmentLiav A
2020-01-20AK: Allow clamp() with min==maxAndreas Kling
2020-01-20AK: Add clamp() functionShannon Booth
This function can be used to more cleanly write the common operation of clamping a value between two values.
2020-01-19AK: Add some missing "inline" keywords in StdLibExtras.hAndreas Kling
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2019-07-29Kernel+AK: Remove AK/StdLibExtras.cpp, moving kernel stuff to Kernel/.Andreas Kling
We had some kernel-specific gizmos in AK that should really just be in the Kernel subdirectory instead. The only thing remaining after moving those was mmx_memcpy() which I moved to the ARCH(i386)-specific section of LibC/string.cpp.
2019-07-03AK: Rename the common integer typedefs to make it obvious what they are.Andreas Kling
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
2019-06-27AK: Oops, fix typo in RemoveVolatile<T> helper.Andreas Kling
2019-06-24AK: Mark some helper things constexpr.Andreas Kling
2019-06-07Meta: Tweak .clang-format to not wrap braces after enums.Andreas Kling
2019-06-07AK: Run clang-format on everything.Andreas Kling
2019-06-01LibCore: CObjects without is<T> specialization shouldn't LARP as others.Andreas Kling
2019-05-28Add clang-format fileRobin Burchell
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
2019-05-06Make sure all GraphicsBitmap scanlines are 16-byte aligned.Andreas Kling
This is a prerequisite for some optimizations.
2019-04-22Kernel: Don't use MMX memcpy() in the kernel.Andreas Kling
I just discovered the hard way that clobbering FPU/MMX/SSE registers in the kernel makes things very confusing for userspace (and other kernel threads.) Let's banish all of those things from the kernel to keep things simple.
2019-04-20Get rid of SERENITY macro since the compiler already defines __serenity__Andreas Kling
This makes it a bit easier to use AK templates out-of-tree.
2019-04-05WindowServer: Factor out window frame logic into a WSWindowFrame class.Andreas Kling
The window frame is an object that contains a window, its title bar and window border. This way WSWindowManager doesn't have to know about all the different types of window borders, titlebar rects, etc.
2019-03-21Use 64-bit integers inside Stopwatch to enable longer timings.Andreas Kling
2019-02-25AK: Add Retained<T>, like RetainPtr, but never null.Andreas Kling
Also use some Clang attribute wizardry to get a warning for use-after-move.
2019-02-20Kernel: Reduce code duplication in exception handlers.Andreas Kling
2019-02-15Use modern C++ attributes instead of __attribute__ voodoo.Andreas Kling
This is quite nice, although I wish [[gnu::always_inline]] implied inline. Also "gnu::" is kind of a wart, but whatcha gonna do.
2019-02-07Add a fast memcpy() using MMX when we're moving >= 1KB.Andreas Kling
This is a nice speedup for WindowServer. I'll eventually have to do this with SSE but the kernel doesn't support SSE yet so this is it for now.
2019-01-31Big, possibly complete sweep of naming changes.Andreas Kling
2019-01-17Get rid of #ifdef SERENITY. We're past that phase of bootstrapping.Andreas Kling
2019-01-16Optimize the Painter::blit() loop a bit. ~3% fewer cycles, I'll take it.Andreas Kling
2019-01-13Fix Userland build.Andreas Kling
2019-01-12Optimize WindowManager::flush() with fast_dword_copy().Andreas Kling
2018-12-04Import a simple text editor I started working on.Andreas Kling