1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

Kernel: Fix all compiler warnings.

This commit is contained in:
Andreas Kling 2019-06-22 16:22:34 +02:00
parent 17acc1e0a8
commit 46a06c23e3
13 changed files with 19 additions and 19 deletions

View file

@ -78,10 +78,11 @@ void PhysicalRegion::return_page_at(PhysicalAddress addr)
int local_offset = addr.get() - m_lower.get();
ASSERT(local_offset >= 0);
ASSERT(local_offset < m_pages * PAGE_SIZE);
ASSERT(local_offset < (int)(m_pages * PAGE_SIZE));
auto page = local_offset / PAGE_SIZE;
if (page < m_last) m_last = page;
auto page = (unsigned)local_offset / PAGE_SIZE;
if (page < m_last)
m_last = page;
m_bitmap.set(page, false);
m_used--;

View file

@ -98,16 +98,16 @@ void VMObject::inode_size_changed(Badge<Inode>, size_t old_size, size_t new_size
InterruptDisabler disabler;
size_t old_page_count = page_count();
auto old_page_count = page_count();
m_size = new_size;
if (page_count() > old_page_count) {
// Add null pages and let the fault handler page these in when that day comes.
for (size_t i = old_page_count; i < page_count(); ++i)
for (auto i = old_page_count; i < page_count(); ++i)
m_physical_pages.append(nullptr);
} else {
// Prune the no-longer valid pages. I'm not sure this is actually correct behavior.
for (size_t i = page_count(); i < old_page_count; ++i)
for (auto i = page_count(); i < old_page_count; ++i)
m_physical_pages.take_last();
}

View file

@ -33,7 +33,7 @@ public:
const String& name() const { return m_name; }
void set_name(const String& name) { m_name = name; }
size_t page_count() const { return m_size / PAGE_SIZE; }
int page_count() const { return m_size / PAGE_SIZE; }
const Vector<RefPtr<PhysicalPage>>& physical_pages() const { return m_physical_pages; }
Vector<RefPtr<PhysicalPage>>& physical_pages() { return m_physical_pages; }