summaryrefslogtreecommitdiff
path: root/Kernel/VM
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-24 09:55:46 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-24 09:56:07 +0100
commit0763f670435f30087d285077bf24bfbef9f76b11 (patch)
tree15434e5149b22f38c73b275594124cf0a3bb1eca /Kernel/VM
parentb813b2f871756bd150bc06e1d74adcfa179a7e56 (diff)
downloadserenity-0763f670435f30087d285077bf24bfbef9f76b11.zip
AK: Make Bitmap use size_t for its size
Also rework its API's to return Optional<size_t> instead of int with -1 as the error value.
Diffstat (limited to 'Kernel/VM')
-rw-r--r--Kernel/VM/InodeVMObject.cpp2
-rw-r--r--Kernel/VM/Region.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/VM/InodeVMObject.cpp b/Kernel/VM/InodeVMObject.cpp
index 8d14b4d3c0..7311fe8886 100644
--- a/Kernel/VM/InodeVMObject.cpp
+++ b/Kernel/VM/InodeVMObject.cpp
@@ -78,7 +78,7 @@ size_t InodeVMObject::amount_clean() const
size_t InodeVMObject::amount_dirty() const
{
size_t count = 0;
- for (int i = 0; i < m_dirty_pages.size(); ++i) {
+ for (size_t i = 0; i < m_dirty_pages.size(); ++i) {
if (m_dirty_pages.get(i))
++count;
}
diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp
index 2c02c045d3..5f399acc72 100644
--- a/Kernel/VM/Region.cpp
+++ b/Kernel/VM/Region.cpp
@@ -164,7 +164,7 @@ u32 Region::cow_pages() const
if (!m_cow_map)
return 0;
u32 count = 0;
- for (int i = 0; i < m_cow_map->size(); ++i)
+ for (size_t i = 0; i < m_cow_map->size(); ++i)
count += m_cow_map->get(i);
return count;
}