mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 22:45:06 +00:00
AK: SinglyLinkedList::size_slow() should return size_t
This commit is contained in:
parent
6f4c380d95
commit
7248c34e35
3 changed files with 7 additions and 7 deletions
|
@ -53,9 +53,9 @@ public:
|
||||||
|
|
||||||
bool is_empty() const { return !head(); }
|
bool is_empty() const { return !head(); }
|
||||||
|
|
||||||
inline int size_slow() const
|
inline size_t size_slow() const
|
||||||
{
|
{
|
||||||
int size = 0;
|
size_t size = 0;
|
||||||
for (auto* node = m_head; node; node = node->next)
|
for (auto* node = m_head; node; node = node->next)
|
||||||
++size;
|
++size;
|
||||||
return size;
|
return size;
|
||||||
|
|
|
@ -238,7 +238,7 @@ ssize_t IPv4Socket::recvfrom(FileDescription& description, void* buffer, size_t
|
||||||
packet = m_receive_queue.take_first();
|
packet = m_receive_queue.take_first();
|
||||||
m_can_read = !m_receive_queue.is_empty();
|
m_can_read = !m_receive_queue.is_empty();
|
||||||
#ifdef IPV4_SOCKET_DEBUG
|
#ifdef IPV4_SOCKET_DEBUG
|
||||||
kprintf("IPv4Socket(%p): recvfrom without blocking %d bytes, packets in queue: %d\n", this, packet.data.value().size(), m_receive_queue.size_slow());
|
kprintf("IPv4Socket(%p): recvfrom without blocking %d bytes, packets in queue: %zu\n", this, packet.data.value().size(), m_receive_queue.size_slow());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ ssize_t IPv4Socket::recvfrom(FileDescription& description, void* buffer, size_t
|
||||||
packet = m_receive_queue.take_first();
|
packet = m_receive_queue.take_first();
|
||||||
m_can_read = !m_receive_queue.is_empty();
|
m_can_read = !m_receive_queue.is_empty();
|
||||||
#ifdef IPV4_SOCKET_DEBUG
|
#ifdef IPV4_SOCKET_DEBUG
|
||||||
kprintf("IPv4Socket(%p): recvfrom with blocking %d bytes, packets in queue: %d\n", this, packet.data.value().size(), m_receive_queue.size_slow());
|
kprintf("IPv4Socket(%p): recvfrom with blocking %d bytes, packets in queue: %zu\n", this, packet.data.value().size(), m_receive_queue.size_slow());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ASSERT(packet.data.has_value());
|
ASSERT(packet.data.has_value());
|
||||||
|
@ -306,7 +306,7 @@ bool IPv4Socket::did_receive(const IPv4Address& source_address, u16 source_port,
|
||||||
m_can_read = true;
|
m_can_read = true;
|
||||||
m_bytes_received += packet_size;
|
m_bytes_received += packet_size;
|
||||||
#ifdef IPV4_SOCKET_DEBUG
|
#ifdef IPV4_SOCKET_DEBUG
|
||||||
kprintf("IPv4Socket(%p): did_receive %d bytes, total_received=%u, packets in queue: %d\n", this, packet_size, m_bytes_received, m_receive_queue.size_slow());
|
kprintf("IPv4Socket(%p): did_receive %d bytes, total_received=%u, packets in queue: %zu\n", this, packet_size, m_bytes_received, m_receive_queue.size_slow());
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ Vector<pid_t> Process::all_pids()
|
||||||
{
|
{
|
||||||
Vector<pid_t> pids;
|
Vector<pid_t> pids;
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
pids.ensure_capacity(g_processes->size_slow());
|
pids.ensure_capacity((int)g_processes->size_slow());
|
||||||
for (auto& process : *g_processes)
|
for (auto& process : *g_processes)
|
||||||
pids.append(process.pid());
|
pids.append(process.pid());
|
||||||
return pids;
|
return pids;
|
||||||
|
@ -84,7 +84,7 @@ Vector<Process*> Process::all_processes()
|
||||||
{
|
{
|
||||||
Vector<Process*> processes;
|
Vector<Process*> processes;
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
processes.ensure_capacity(g_processes->size_slow());
|
processes.ensure_capacity((int)g_processes->size_slow());
|
||||||
for (auto& process : *g_processes)
|
for (auto& process : *g_processes)
|
||||||
processes.append(&process);
|
processes.append(&process);
|
||||||
return processes;
|
return processes;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue