mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 00:07:35 +00:00
Everywhere: Debug macros instead of constexpr.
This was done with the following script: find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/dbgln<debug_([a-z_]+)>/dbgln<\U\1_DEBUG>/' {} \; find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/if constexpr \(debug_([a-z0-9_]+)/if constexpr \(\U\1_DEBUG/' {} \;
This commit is contained in:
parent
bb483f7ef4
commit
8465683dcf
98 changed files with 414 additions and 972 deletions
|
@ -102,7 +102,7 @@ static Optional<ByteBuffer> get_gzip_payload(const ByteBuffer& data)
|
|||
}
|
||||
|
||||
auto new_size = data.size() - current;
|
||||
dbgln<debug_gzip>("get_gzip_payload: Returning slice from {} with size {}", current, new_size);
|
||||
dbgln<GZIP_DEBUG>("get_gzip_payload: Returning slice from {} with size {}", current, new_size);
|
||||
return data.slice(current, new_size);
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ Optional<ByteBuffer> Gzip::decompress(const ByteBuffer& data)
|
|||
{
|
||||
ASSERT(is_compressed(data));
|
||||
|
||||
dbgln<debug_gzip>("Gzip::decompress: Decompressing gzip compressed data. size={}", data.size());
|
||||
dbgln<GZIP_DEBUG>("Gzip::decompress: Decompressing gzip compressed data. size={}", data.size());
|
||||
auto optional_payload = get_gzip_payload(data);
|
||||
if (!optional_payload.has_value()) {
|
||||
return Optional<ByteBuffer>();
|
||||
|
@ -122,7 +122,7 @@ Optional<ByteBuffer> Gzip::decompress(const ByteBuffer& data)
|
|||
while (true) {
|
||||
unsigned long destination_len = destination.size();
|
||||
|
||||
if constexpr (debug_gzip) {
|
||||
if constexpr (GZIP_DEBUG) {
|
||||
dbgln("Gzip::decompress: Calling puff()");
|
||||
dbgln(" destination_data = {}", destination.data());
|
||||
dbgln(" destination_len = {}", destination_len);
|
||||
|
|
|
@ -55,7 +55,7 @@ void NetworkJob::did_finish(NonnullRefPtr<NetworkResponse>&& response)
|
|||
NonnullRefPtr<NetworkJob> protector(*this);
|
||||
|
||||
m_response = move(response);
|
||||
dbgln<debug_cnetworkjob>("{} job did_finish", *this);
|
||||
dbgln<CNETWORKJOB_DEBUG>("{} job did_finish", *this);
|
||||
ASSERT(on_finish);
|
||||
on_finish(true);
|
||||
shutdown();
|
||||
|
|
|
@ -79,7 +79,7 @@ bool Socket::connect(const String& hostname, int port)
|
|||
}
|
||||
|
||||
IPv4Address host_address((const u8*)hostent->h_addr_list[0]);
|
||||
dbgln<debug_csocket>("Socket::connect: Resolved '{}' to {}", hostname, host_address);
|
||||
dbgln<CSOCKET_DEBUG>("Socket::connect: Resolved '{}' to {}", hostname, host_address);
|
||||
return connect(host_address, port);
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ bool Socket::connect(const SocketAddress& address, int port)
|
|||
{
|
||||
ASSERT(!is_connected());
|
||||
ASSERT(address.type() == SocketAddress::Type::IPv4);
|
||||
dbgln<debug_csocket>("{} connecting to {}...", *this, address);
|
||||
dbgln<CSOCKET_DEBUG>("{} connecting to {}...", *this, address);
|
||||
|
||||
ASSERT(port > 0 && port <= 65535);
|
||||
|
||||
|
@ -119,7 +119,7 @@ bool Socket::connect(const SocketAddress& address)
|
|||
{
|
||||
ASSERT(!is_connected());
|
||||
ASSERT(address.type() == SocketAddress::Type::Local);
|
||||
dbgln<debug_csocket>("{} connecting to {}...", *this, address);
|
||||
dbgln<CSOCKET_DEBUG>("{} connecting to {}...", *this, address);
|
||||
|
||||
sockaddr_un saddr;
|
||||
saddr.sun_family = AF_LOCAL;
|
||||
|
@ -138,7 +138,7 @@ bool Socket::connect(const SocketAddress& address)
|
|||
bool Socket::common_connect(const struct sockaddr* addr, socklen_t addrlen)
|
||||
{
|
||||
auto connected = [this] {
|
||||
dbgln<debug_csocket>("{} connected!", *this);
|
||||
dbgln<CSOCKET_DEBUG>("{} connected!", *this);
|
||||
if (!m_connected) {
|
||||
m_connected = true;
|
||||
ensure_read_notifier();
|
||||
|
@ -153,7 +153,7 @@ bool Socket::common_connect(const struct sockaddr* addr, socklen_t addrlen)
|
|||
int rc = ::connect(fd(), addr, addrlen);
|
||||
if (rc < 0) {
|
||||
if (errno == EINPROGRESS) {
|
||||
dbgln<debug_csocket>("{} connection in progress (EINPROGRESS)", *this);
|
||||
dbgln<CSOCKET_DEBUG>("{} connection in progress (EINPROGRESS)", *this);
|
||||
m_notifier = Notifier::construct(fd(), Notifier::Event::Write, this);
|
||||
m_notifier->on_ready_to_write = move(connected);
|
||||
return true;
|
||||
|
@ -163,7 +163,7 @@ bool Socket::common_connect(const struct sockaddr* addr, socklen_t addrlen)
|
|||
errno = saved_errno;
|
||||
return false;
|
||||
}
|
||||
dbgln<debug_csocket>("{} connected ok!", *this);
|
||||
dbgln<CSOCKET_DEBUG>("{} connected ok!", *this);
|
||||
connected();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ inline int safe_syscall(Syscall syscall, Args&&... args)
|
|||
for (;;) {
|
||||
int sysret = syscall(forward<Args>(args)...);
|
||||
if (sysret == -1) {
|
||||
if constexpr (debug_safe_syscall) {
|
||||
if constexpr (SAFE_SYSCALL_DEBUG) {
|
||||
int saved_errno = errno;
|
||||
dbgln<debug_safe_syscall>("Core::safe_syscall: {} ({}: {})", sysret, saved_errno, strerror(saved_errno));
|
||||
dbgln<SAFE_SYSCALL_DEBUG>("Core::safe_syscall: {} ({}: {})", sysret, saved_errno, strerror(saved_errno));
|
||||
}
|
||||
|
||||
if (errno == EINTR)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue