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:
parent
b3db01e20e
commit
b91c49364d
228 changed files with 461 additions and 461 deletions
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue