1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

AK: Rename adopt() to adopt_ref()

This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
This commit is contained in:
Andreas Kling 2021-04-23 16:46:57 +02:00
parent b3db01e20e
commit b91c49364d
228 changed files with 461 additions and 461 deletions

View file

@ -165,7 +165,7 @@ UNMAP_AFTER_INIT void E1000NetworkAdapter::detect()
if (!is_valid_device_id(id.device_id))
return;
u8 irq = PCI::get_interrupt_line(address);
[[maybe_unused]] auto& unused = adopt(*new E1000NetworkAdapter(address, irq)).leak_ref();
[[maybe_unused]] auto& unused = adopt_ref(*new E1000NetworkAdapter(address, irq)).leak_ref();
});
}

View file

@ -41,7 +41,7 @@ KResultOr<NonnullRefPtr<Socket>> IPv4Socket::create(int type, int protocol)
if (type == SOCK_DGRAM)
return UDPSocket::create(protocol);
if (type == SOCK_RAW)
return adopt(*new IPv4Socket(type, protocol));
return adopt_ref(*new IPv4Socket(type, protocol));
return EINVAL;
}

View file

@ -33,7 +33,7 @@ void LocalSocket::for_each(Function<void(const LocalSocket&)> callback)
KResultOr<NonnullRefPtr<Socket>> LocalSocket::create(int type)
{
return adopt(*new LocalSocket(type));
return adopt_ref(*new LocalSocket(type));
}
LocalSocket::LocalSocket(int type)

View file

@ -158,7 +158,7 @@ UNMAP_AFTER_INIT void NE2000NetworkAdapter::detect()
if (!ne2k_ids.span().contains_slow(id))
return;
u8 irq = PCI::get_interrupt_line(address);
[[maybe_unused]] auto& unused = adopt(*new NE2000NetworkAdapter(address, irq)).leak_ref();
[[maybe_unused]] auto& unused = adopt_ref(*new NE2000NetworkAdapter(address, irq)).leak_ref();
});
}

View file

@ -114,7 +114,7 @@ UNMAP_AFTER_INIT void RTL8139NetworkAdapter::detect()
if (id != rtl8139_id)
return;
u8 irq = PCI::get_interrupt_line(address);
[[maybe_unused]] auto& unused = adopt(*new RTL8139NetworkAdapter(address, irq)).leak_ref();
[[maybe_unused]] auto& unused = adopt_ref(*new RTL8139NetworkAdapter(address, irq)).leak_ref();
});
}

View file

@ -139,7 +139,7 @@ TCPSocket::~TCPSocket()
NonnullRefPtr<TCPSocket> TCPSocket::create(int protocol)
{
return adopt(*new TCPSocket(protocol));
return adopt_ref(*new TCPSocket(protocol));
}
KResultOr<size_t> TCPSocket::protocol_receive(ReadonlyBytes raw_ipv4_packet, UserOrKernelBuffer& buffer, size_t buffer_size, [[maybe_unused]] int flags)

View file

@ -56,7 +56,7 @@ UDPSocket::~UDPSocket()
NonnullRefPtr<UDPSocket> UDPSocket::create(int protocol)
{
return adopt(*new UDPSocket(protocol));
return adopt_ref(*new UDPSocket(protocol));
}
KResultOr<size_t> UDPSocket::protocol_receive(ReadonlyBytes raw_ipv4_packet, UserOrKernelBuffer& buffer, size_t buffer_size, [[maybe_unused]] int flags)