summaryrefslogtreecommitdiff
path: root/Libraries/LibGfx
diff options
context:
space:
mode:
authorEmanuel Sprung <emanuel.sprung@gmail.com>2020-02-23 01:32:00 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-25 10:18:46 +0100
commit074d935c6edd48b707788147727b54684a4d6164 (patch)
treee2d748c91e6025f89bae5d0e61c6f99d269e97bb /Libraries/LibGfx
parentcbf2881bf7159b5578dfe7ed7e7cbc950188eb29 (diff)
downloadserenity-074d935c6edd48b707788147727b54684a4d6164.zip
AK, LibGfx, LibGUI: Initialize various variables to zero.
The not initialized variables can lead to compiler warnings that become errors with the -Werror flag.
Diffstat (limited to 'Libraries/LibGfx')
-rw-r--r--Libraries/LibGfx/Color.cpp2
-rw-r--r--Libraries/LibGfx/GIFLoader.cpp2
-rw-r--r--Libraries/LibGfx/Point.cpp4
-rw-r--r--Libraries/LibGfx/Size.cpp4
4 files changed, 6 insertions, 6 deletions
diff --git a/Libraries/LibGfx/Color.cpp b/Libraries/LibGfx/Color.cpp
index 32a0e1b7f1..de5e8eb69e 100644
--- a/Libraries/LibGfx/Color.cpp
+++ b/Libraries/LibGfx/Color.cpp
@@ -352,7 +352,7 @@ const LogStream& operator<<(const LogStream& stream, Color value)
bool IPC::decode(BufferStream& stream, Color& color)
{
- u32 rgba;
+ u32 rgba = 0;
stream >> rgba;
if (stream.handle_read_failure())
return false;
diff --git a/Libraries/LibGfx/GIFLoader.cpp b/Libraries/LibGfx/GIFLoader.cpp
index c958694e92..2f92afe67e 100644
--- a/Libraries/LibGfx/GIFLoader.cpp
+++ b/Libraries/LibGfx/GIFLoader.cpp
@@ -200,7 +200,7 @@ RefPtr<Gfx::Bitmap> load_gif_impl(const u8* data, size_t data_size)
if (sentinel == 0x2c) {
images.append(make<ImageDescriptor>());
auto& image = images.last();
- u8 packed_fields;
+ u8 packed_fields { 0 };
stream >> image.x;
stream >> image.y;
stream >> image.width;
diff --git a/Libraries/LibGfx/Point.cpp b/Libraries/LibGfx/Point.cpp
index e97d883db0..2371e75cb7 100644
--- a/Libraries/LibGfx/Point.cpp
+++ b/Libraries/LibGfx/Point.cpp
@@ -46,8 +46,8 @@ namespace IPC {
bool decode(BufferStream& stream, Gfx::Point& point)
{
- int x;
- int y;
+ int x = 0;
+ int y = 0;
stream >> x;
stream >> y;
if (stream.handle_read_failure())
diff --git a/Libraries/LibGfx/Size.cpp b/Libraries/LibGfx/Size.cpp
index 39f6868e5d..6274e2be8f 100644
--- a/Libraries/LibGfx/Size.cpp
+++ b/Libraries/LibGfx/Size.cpp
@@ -46,8 +46,8 @@ namespace IPC {
bool decode(BufferStream& stream, Gfx::Size& size)
{
- int width;
- int height;
+ int width = 0;
+ int height = 0;
stream >> width;
stream >> height;
if (stream.handle_read_failure())