1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

AK, LibGfx, LibGUI: Initialize various variables to zero.

The not initialized variables can lead to compiler warnings that
become errors with the -Werror flag.
This commit is contained in:
Emanuel Sprung 2020-02-23 01:32:00 +01:00 committed by Andreas Kling
parent cbf2881bf7
commit 074d935c6e
5 changed files with 10 additions and 10 deletions

View file

@ -152,7 +152,7 @@ Utf8CodepointIterator& Utf8CodepointIterator::operator++()
{
ASSERT(m_length > 0);
int codepoint_length_in_bytes;
int codepoint_length_in_bytes = 0;
u32 value;
bool first_byte_makes_sense = decode_first_byte(*m_ptr, codepoint_length_in_bytes, value);
@ -169,7 +169,7 @@ Utf8CodepointIterator& Utf8CodepointIterator::operator++()
int Utf8CodepointIterator::codepoint_length_in_bytes() const
{
ASSERT(m_length > 0);
int codepoint_length_in_bytes;
int codepoint_length_in_bytes = 0;
u32 value;
bool first_byte_makes_sense = decode_first_byte(*m_ptr, codepoint_length_in_bytes, value);
ASSERT(first_byte_makes_sense);
@ -180,8 +180,8 @@ u32 Utf8CodepointIterator::operator*() const
{
ASSERT(m_length > 0);
u32 codepoint_value_so_far;
int codepoint_length_in_bytes;
u32 codepoint_value_so_far = 0;
int codepoint_length_in_bytes = 0;
bool first_byte_makes_sense = decode_first_byte(m_ptr[0], codepoint_length_in_bytes, codepoint_value_so_far);
if (!first_byte_makes_sense) {