1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:07:36 +00:00

Everywhere: Use ReadonlySpan<T> instead of Span<T const>

This commit is contained in:
MacDue 2023-02-05 19:02:54 +00:00 committed by Linus Groh
parent 1c92e6ee9d
commit 63b11030f0
102 changed files with 206 additions and 206 deletions

View file

@ -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)

View file

@ -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; }

View file

@ -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; }