Userland: Switch static_assert of type sizes to AK::AssertSize

This commit is contained in:
Brian Gianforcaro 2021-09-05 01:00:46 -07:00 committed by Andreas Kling
parent 472454cded
commit 3e45c3ed90
Notes: sideshowbarker 2024-07-18 04:40:18 +09:00
5 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,7 @@ union MMX {
i16x4 v16u;
i32x2 v32u;
};
static_assert(sizeof(MMX) == sizeof(u64));
static_assert(AssertSize<MMX, sizeof(u64)>());
class SoftFPU final {
public:

View file

@ -29,7 +29,7 @@ struct [[gnu::packed]] FontFileHeader {
u16 unused;
};
static_assert(sizeof(FontFileHeader) == 80);
static_assert(AssertSize<FontFileHeader, 80>());
NonnullRefPtr<Font> BitmapFont::clone() const
{

View file

@ -23,7 +23,7 @@ struct ICONDIR {
u16 must_be_1 = 0;
u16 image_count = 0;
};
static_assert(sizeof(ICONDIR) == 6);
static_assert(AssertSize<ICONDIR, 6>());
struct ICONDIRENTRY {
u8 width;
@ -35,7 +35,7 @@ struct ICONDIRENTRY {
u32 size;
u32 offset;
};
static_assert(sizeof(ICONDIRENTRY) == 16);
static_assert(AssertSize<ICONDIRENTRY, 16>());
struct [[gnu::packed]] BMPFILEHEADER {
u8 signature[2];

View file

@ -36,7 +36,7 @@ struct PNG_IHDR {
u8 interlace_method { 0 };
};
static_assert(sizeof(PNG_IHDR) == 13);
static_assert(AssertSize<PNG_IHDR, 13>());
struct Scanline {
u8 filter { 0 };
@ -211,7 +211,7 @@ union [[gnu::packed]] Pixel {
u8 a;
};
};
static_assert(sizeof(Pixel) == 4);
static_assert(AssertSize<Pixel, 4>());
template<bool has_alpha, u8 filter_type>
ALWAYS_INLINE static void unfilter_impl(Gfx::Bitmap& bitmap, int y, const void* dummy_scanline_data)

View file

@ -46,7 +46,7 @@ struct [[gnu::packed]] NtpPacket {
uint8_t version_number() const { return (li_vn_mode >> 3) & 7; }
uint8_t mode() const { return li_vn_mode & 7; }
};
static_assert(sizeof(NtpPacket) == 48);
static_assert(AssertSize<NtpPacket, 48>());
// NTP measures time in seconds since 1900-01-01, POSIX in seconds since 1970-01-01.
// 1900 wasn't a leap year, so there are 70/4 leap years between 1900 and 1970.