From 301cab188cfd64f0f22f95050160afc3a59fdef5 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Wed, 4 Aug 2021 13:34:45 +0200 Subject: [PATCH] AK: Use `explode_byte` in BumpAllocator.h When compiling this code with Clang, both branches of the ternary operator get evaluated at compile-time, triggering a warning about a narrowing implicit conversion. We can use `explode_byte` instead. --- AK/BumpAllocator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/BumpAllocator.h b/AK/BumpAllocator.h index 9f67fe4627..e206842e2a 100644 --- a/AK/BumpAllocator.h +++ b/AK/BumpAllocator.h @@ -125,7 +125,7 @@ protected: return true; } - constexpr static FlatPtr chunk_magic = sizeof(FlatPtr) == sizeof(u32) ? 0xdfdfdfdfu : 0xdfdfdfdfdfdfdfdfull; + constexpr static FlatPtr chunk_magic = explode_byte(0xdf); struct ChunkHeader { FlatPtr magic; FlatPtr next_chunk;