Skip to content

Commit

Permalink
LibCore: Wrap commented out debug messages in a preprocessor define
Browse files Browse the repository at this point in the history
We can also remove an outdated FIXME as dbg() does now support unsigned
longs :^)
  • Loading branch information
shannonbooth authored and awesomekling committed Mar 22, 2020
1 parent 757c146 commit 83425b1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Libraries/LibCore/Gzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <limits.h>
#include <stddef.h>

//#define DEBUG_GZIP

namespace Core {

bool Gzip::is_compressed(const ByteBuffer& data)
Expand Down Expand Up @@ -119,12 +121,14 @@ Optional<ByteBuffer> Gzip::decompress(const ByteBuffer& data)
auto destination = ByteBuffer::create_uninitialized(1024);
while (true) {
unsigned long destination_len = destination.size();
// FIXME: dbg() cannot take ulong?
// dbg() << "Gzip::decompress: Calling puff()\n"
// << " destination_data = " << destination.data() << "\n"
// << " destination_len = " << (int)destination_len << "\n"
// << " source_data = " << source.data() << "\n"
// << " source_len = " << (int)source_len;

#ifdef DEBUG_GZIP
dbg() << "Gzip::decompress: Calling puff()\n"
<< " destination_data = " << destination.data() << "\n"
<< " destination_len = " << destination_len << "\n"
<< " source_data = " << source.data() << "\n"
<< " source_len = " << source_len;
#endif

auto puff_ret = puff(
destination.data(), &destination_len,
Expand Down

0 comments on commit 83425b1

Please sign in to comment.