mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
Everywhere: Use ReadonlySpan<T> instead of Span<T const>
This commit is contained in:
parent
1c92e6ee9d
commit
63b11030f0
102 changed files with 206 additions and 206 deletions
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
ErrorOr<NonnullRefPtr<Credentials>> Credentials::create(UserID uid, GroupID gid, UserID euid, GroupID egid, UserID suid, GroupID sgid, Span<GroupID const> extra_gids, SessionID sid, ProcessGroupID pgid)
|
||||
ErrorOr<NonnullRefPtr<Credentials>> Credentials::create(UserID uid, GroupID gid, UserID euid, GroupID egid, UserID suid, GroupID sgid, ReadonlySpan<GroupID> extra_gids, SessionID sid, ProcessGroupID pgid)
|
||||
{
|
||||
auto extra_gids_array = TRY(FixedArray<GroupID>::create(extra_gids));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Credentials(uid, gid, euid, egid, suid, sgid, move(extra_gids_array), sid, pgid));
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Kernel {
|
|||
|
||||
class Credentials final : public AtomicRefCounted<Credentials> {
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<Credentials>> create(UserID uid, GroupID gid, UserID euid, GroupID egid, UserID suid, GroupID sgid, Span<GroupID const> extra_gids, SessionID sid, ProcessGroupID pgid);
|
||||
static ErrorOr<NonnullRefPtr<Credentials>> create(UserID uid, GroupID gid, UserID euid, GroupID egid, UserID suid, GroupID sgid, ReadonlySpan<GroupID> extra_gids, SessionID sid, ProcessGroupID pgid);
|
||||
~Credentials();
|
||||
|
||||
bool is_superuser() const { return euid() == 0; }
|
||||
|
@ -25,7 +25,7 @@ public:
|
|||
GroupID gid() const { return m_gid; }
|
||||
UserID suid() const { return m_suid; }
|
||||
GroupID sgid() const { return m_sgid; }
|
||||
Span<GroupID const> extra_gids() const { return m_extra_gids.span(); }
|
||||
ReadonlySpan<GroupID> extra_gids() const { return m_extra_gids.span(); }
|
||||
SessionID sid() const { return m_sid; };
|
||||
ProcessGroupID pgid() const { return m_pgid; }
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ struct InodeMetadata {
|
|||
bool may_write(Credentials const&, UseEffectiveIDs = UseEffectiveIDs::Yes) const;
|
||||
bool may_execute(Credentials const&, UseEffectiveIDs = UseEffectiveIDs::Yes) const;
|
||||
|
||||
bool may_read(UserID u, GroupID g, Span<GroupID const> eg) const
|
||||
bool may_read(UserID u, GroupID g, ReadonlySpan<GroupID> eg) const
|
||||
{
|
||||
if (u == 0)
|
||||
return true;
|
||||
|
@ -59,7 +59,7 @@ struct InodeMetadata {
|
|||
return (mode & S_IROTH) == S_IROTH;
|
||||
}
|
||||
|
||||
bool may_write(UserID u, GroupID g, Span<GroupID const> eg) const
|
||||
bool may_write(UserID u, GroupID g, ReadonlySpan<GroupID> eg) const
|
||||
{
|
||||
if (u == 0)
|
||||
return true;
|
||||
|
@ -70,7 +70,7 @@ struct InodeMetadata {
|
|||
return (mode & S_IWOTH) == S_IWOTH;
|
||||
}
|
||||
|
||||
bool may_execute(UserID u, GroupID g, Span<GroupID const> eg) const
|
||||
bool may_execute(UserID u, GroupID g, ReadonlySpan<GroupID> eg) const
|
||||
{
|
||||
if (u == 0)
|
||||
return true;
|
||||
|
|
|
@ -67,7 +67,7 @@ void GenericInterruptHandler::change_interrupt_number(u8 number)
|
|||
register_generic_interrupt_handler(InterruptManagement::acquire_mapped_interrupt_number(interrupt_number()), *this);
|
||||
}
|
||||
|
||||
Span<u32 const> GenericInterruptHandler::per_cpu_call_counts() const
|
||||
ReadonlySpan<u32> GenericInterruptHandler::per_cpu_call_counts() const
|
||||
{
|
||||
return m_per_cpu_call_counts.span().slice(0, Processor::count());
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
|
||||
u8 interrupt_number() const { return m_interrupt_number; }
|
||||
|
||||
Span<u32 const> per_cpu_call_counts() const;
|
||||
ReadonlySpan<u32> per_cpu_call_counts() const;
|
||||
|
||||
virtual size_t sharing_devices_count() const = 0;
|
||||
virtual bool is_shared_handler() const = 0;
|
||||
|
|
|
@ -60,7 +60,7 @@ Span<RefPtr<PhysicalPage>> SharedFramebufferVMObject::real_framebuffer_physical_
|
|||
{
|
||||
return m_real_framebuffer_vmobject->physical_pages();
|
||||
}
|
||||
Span<RefPtr<PhysicalPage> const> SharedFramebufferVMObject::real_framebuffer_physical_pages() const
|
||||
ReadonlySpan<RefPtr<PhysicalPage>> SharedFramebufferVMObject::real_framebuffer_physical_pages() const
|
||||
{
|
||||
return m_real_framebuffer_vmobject->physical_pages();
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ Span<RefPtr<PhysicalPage>> SharedFramebufferVMObject::fake_sink_framebuffer_phys
|
|||
return m_physical_pages.span();
|
||||
}
|
||||
|
||||
Span<RefPtr<PhysicalPage> const> SharedFramebufferVMObject::fake_sink_framebuffer_physical_pages() const
|
||||
ReadonlySpan<RefPtr<PhysicalPage>> SharedFramebufferVMObject::fake_sink_framebuffer_physical_pages() const
|
||||
{
|
||||
return m_physical_pages.span();
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ void SharedFramebufferVMObject::switch_to_real_framebuffer_writes(Badge<Kernel::
|
|||
});
|
||||
}
|
||||
|
||||
Span<RefPtr<PhysicalPage> const> SharedFramebufferVMObject::physical_pages() const
|
||||
ReadonlySpan<RefPtr<PhysicalPage>> SharedFramebufferVMObject::physical_pages() const
|
||||
{
|
||||
SpinlockLocker locker(m_writes_state_lock);
|
||||
if (m_writes_are_faked)
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
}
|
||||
virtual StringView class_name() const override { return "FakeWritesFramebufferVMObject"sv; }
|
||||
virtual ErrorOr<NonnullLockRefPtr<VMObject>> try_clone() override { return Error::from_errno(ENOTIMPL); }
|
||||
virtual Span<RefPtr<PhysicalPage> const> physical_pages() const override { return m_parent_object->fake_sink_framebuffer_physical_pages(); }
|
||||
virtual ReadonlySpan<RefPtr<PhysicalPage>> physical_pages() const override { return m_parent_object->fake_sink_framebuffer_physical_pages(); }
|
||||
virtual Span<RefPtr<PhysicalPage>> physical_pages() override { return m_parent_object->fake_sink_framebuffer_physical_pages(); }
|
||||
NonnullLockRefPtr<SharedFramebufferVMObject> m_parent_object;
|
||||
};
|
||||
|
@ -46,7 +46,7 @@ public:
|
|||
}
|
||||
virtual StringView class_name() const override { return "RealWritesFramebufferVMObject"sv; }
|
||||
virtual ErrorOr<NonnullLockRefPtr<VMObject>> try_clone() override { return Error::from_errno(ENOTIMPL); }
|
||||
virtual Span<RefPtr<PhysicalPage> const> physical_pages() const override { return m_parent_object->real_framebuffer_physical_pages(); }
|
||||
virtual ReadonlySpan<RefPtr<PhysicalPage>> physical_pages() const override { return m_parent_object->real_framebuffer_physical_pages(); }
|
||||
virtual Span<RefPtr<PhysicalPage>> physical_pages() override { return m_parent_object->real_framebuffer_physical_pages(); }
|
||||
NonnullLockRefPtr<SharedFramebufferVMObject> m_parent_object;
|
||||
};
|
||||
|
@ -60,14 +60,14 @@ public:
|
|||
void switch_to_fake_sink_framebuffer_writes(Badge<Kernel::DisplayConnector>);
|
||||
void switch_to_real_framebuffer_writes(Badge<Kernel::DisplayConnector>);
|
||||
|
||||
virtual Span<RefPtr<PhysicalPage> const> physical_pages() const override;
|
||||
virtual ReadonlySpan<RefPtr<PhysicalPage>> physical_pages() const override;
|
||||
virtual Span<RefPtr<PhysicalPage>> physical_pages() override;
|
||||
|
||||
Span<RefPtr<PhysicalPage>> fake_sink_framebuffer_physical_pages();
|
||||
Span<RefPtr<PhysicalPage> const> fake_sink_framebuffer_physical_pages() const;
|
||||
ReadonlySpan<RefPtr<PhysicalPage>> fake_sink_framebuffer_physical_pages() const;
|
||||
|
||||
Span<RefPtr<PhysicalPage>> real_framebuffer_physical_pages();
|
||||
Span<RefPtr<PhysicalPage> const> real_framebuffer_physical_pages() const;
|
||||
ReadonlySpan<RefPtr<PhysicalPage>> real_framebuffer_physical_pages() const;
|
||||
|
||||
FakeWritesFramebufferVMObject const& fake_writes_framebuffer_vmobject() const { return *m_fake_writes_framebuffer_vmobject; }
|
||||
FakeWritesFramebufferVMObject& fake_writes_framebuffer_vmobject() { return *m_fake_writes_framebuffer_vmobject; }
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
|
||||
size_t page_count() const { return m_physical_pages.size(); }
|
||||
|
||||
virtual Span<RefPtr<PhysicalPage> const> physical_pages() const { return m_physical_pages.span(); }
|
||||
virtual ReadonlySpan<RefPtr<PhysicalPage>> physical_pages() const { return m_physical_pages.span(); }
|
||||
virtual Span<RefPtr<PhysicalPage>> physical_pages() { return m_physical_pages.span(); }
|
||||
|
||||
size_t size() const { return m_physical_pages.size() * PAGE_SIZE; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue