1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

LibGUI: Fix compiler warnings.

This commit is contained in:
Andreas Kling 2019-06-22 14:41:11 +02:00
parent 56ae96558b
commit 3f0f7caa45
6 changed files with 21 additions and 13 deletions

View file

@ -27,7 +27,7 @@ static_assert(sizeof(PNG_IHDR) == 13);
struct Scanline {
byte filter { 0 };
ByteBuffer data;
ByteBuffer data { };
};
struct PNGLoadingContext {
@ -61,9 +61,9 @@ public:
template<typename T>
bool read(T& value)
{
if (m_size_remaining < sizeof(T))
if (m_size_remaining < (int)sizeof(T))
return false;
value = *((NetworkOrdered<T>*)m_data_ptr);
value = *((const NetworkOrdered<T>*)m_data_ptr);
m_data_ptr += sizeof(T);
m_size_remaining -= sizeof(T);
return true;
@ -383,7 +383,7 @@ static RefPtr<GraphicsBitmap> load_png_impl(const byte* data, int data_size)
static bool process_IHDR(const ByteBuffer& data, PNGLoadingContext& context)
{
if (data.size() < sizeof(PNG_IHDR))
if (data.size() < (int)sizeof(PNG_IHDR))
return false;
auto& ihdr = *(const PNG_IHDR*)data.pointer();
context.width = ihdr.width;