mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Userland: Switch static_assert of type sizes to AK::AssertSize
This commit is contained in:
parent
472454cded
commit
3e45c3ed90
Notes:
sideshowbarker
2024-07-18 04:40:18 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/3e45c3ed907 Pull-request: https://github.com/SerenityOS/serenity/pull/9834 Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/linusg
5 changed files with 7 additions and 7 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue