AK: Fully qualify some usages of AK features outside of the AK namespace

This commit is contained in:
Tim Schumacher 2022-11-27 16:40:42 +01:00 committed by Andreas Kling
parent 03fd9002da
commit a8c73998f1
3 changed files with 5 additions and 5 deletions

View file

@ -17,13 +17,13 @@
#include <AK/Assertions.h>
template<typename T, typename U>
constexpr auto round_up_to_power_of_two(T value, U power_of_two) requires(IsIntegral<T>&& IsIntegral<U>)
constexpr auto round_up_to_power_of_two(T value, U power_of_two) requires(AK::Detail::IsIntegral<T>&& AK::Detail::IsIntegral<U>)
{
return ((value - 1) & ~(power_of_two - 1)) + power_of_two;
}
template<typename T>
constexpr bool is_power_of_two(T value) requires(IsIntegral<T>)
constexpr bool is_power_of_two(T value) requires(AK::Detail::IsIntegral<T>)
{
return value && !((value) & (value - 1));
}

View file

@ -72,7 +72,7 @@ using mode_t = unsigned short;
# endif
#endif
using FlatPtr = Conditional<sizeof(void*) == 8, u64, u32>;
using FlatPtr = AK::Detail::Conditional<sizeof(void*) == 8, u64, u32>;
constexpr u64 KiB = 1024;
constexpr u64 MiB = KiB * KiB;

View file

@ -40,14 +40,14 @@ inline size_t malloc_good_size(size_t size) { return size; }
using std::nothrow;
inline void* kmalloc_array(Checked<size_t> a, Checked<size_t> b)
inline void* kmalloc_array(AK::Checked<size_t> a, AK::Checked<size_t> b)
{
auto size = a * b;
VERIFY(!size.has_overflow());
return kmalloc(size.value());
}
inline void* kmalloc_array(Checked<size_t> a, Checked<size_t> b, Checked<size_t> c)
inline void* kmalloc_array(AK::Checked<size_t> a, AK::Checked<size_t> b, AK::Checked<size_t> c)
{
auto size = a * b * c;
VERIFY(!size.has_overflow());