mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
This commit is contained in:
parent
7dc3a5ce3f
commit
6dc2c38fd0
10 changed files with 105 additions and 112 deletions
|
@ -28,6 +28,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/Endian.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/MappedFile.h>
|
||||
|
@ -41,8 +42,6 @@
|
|||
#include <LibGfx/ImageDecoder.h>
|
||||
#include <LibGfx/Streamer.h>
|
||||
|
||||
//#define PORTABLE_IMAGE_LOADER_DEBUG
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
static constexpr Color adjust_color(u16 max_val, Color color)
|
||||
|
@ -105,18 +104,14 @@ static bool read_magic_number(TContext& context, Streamer& streamer)
|
|||
|
||||
if (!context.data || context.data_size < 2) {
|
||||
context.state = TContext::State::Error;
|
||||
#ifdef PORTABLE_IMAGE_LOADER_DEBUG
|
||||
dbg() << "There is no enough data for " << TContext::image_type;
|
||||
#endif
|
||||
dbgln<debug_portable_image_loader>("There is no enough data for {}", TContext::image_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
u8 magic_number[2] {};
|
||||
if (!streamer.read_bytes(magic_number, 2)) {
|
||||
context.state = TContext::State::Error;
|
||||
#ifdef PORTABLE_IMAGE_LOADER_DEBUG
|
||||
dbg() << "We can't read magic number for " << TContext::image_type;
|
||||
#endif
|
||||
dbgln<debug_portable_image_loader>("We can't read magic number for {}", TContext::image_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -133,10 +128,7 @@ static bool read_magic_number(TContext& context, Streamer& streamer)
|
|||
}
|
||||
|
||||
context.state = TContext::State::Error;
|
||||
#ifdef PORTABLE_IMAGE_LOADER_DEBUG
|
||||
dbg() << "Magic number is not valid for "
|
||||
<< magic_number[0] << magic_number[1] << TContext::image_type;
|
||||
#endif
|
||||
dbgln<debug_portable_image_loader>("Magic number is not valid for {}{}{}", magic_number[0], magic_number[1], TContext::image_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -194,9 +186,7 @@ static bool read_max_val(TContext& context, Streamer& streamer)
|
|||
}
|
||||
|
||||
if (context.max_val > 255) {
|
||||
#ifdef PORTABLE_IMAGE_LOADER_DEBUG
|
||||
dbg() << "We can't parse 2 byte color for " << TContext::image_type;
|
||||
#endif
|
||||
dbgln<debug_portable_image_loader>("We can't parse 2 byte color for {}", TContext::image_type);
|
||||
context.state = TContext::Error;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue