From b75ee4aacbf41539d73f494da5aba468310b71b9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 19 Jan 2019 22:53:05 +0100 Subject: [PATCH] Coding style fixes in AK. --- AK/DoublyLinkedList.h | 12 +- AK/FileSystemPath.cpp | 2 +- AK/HashTable.h | 176 +++++++++++----------- AK/SinglyLinkedList.h | 12 +- AK/Vector.h | 24 +-- AK/test.cpp | 2 +- Kernel/MemoryManager.cpp | 6 +- Kernel/PTYMultiplexer.cpp | 4 +- Kernel/Process.cpp | 6 +- Kernel/i386.cpp | 4 +- VirtualFileSystem/Ext2FileSystem.cpp | 2 +- VirtualFileSystem/SyntheticFileSystem.cpp | 2 +- 12 files changed, 126 insertions(+), 126 deletions(-) diff --git a/AK/DoublyLinkedList.h b/AK/DoublyLinkedList.h index 822374ca64d..e011d680a43 100644 --- a/AK/DoublyLinkedList.h +++ b/AK/DoublyLinkedList.h @@ -63,8 +63,8 @@ public: bool operator==(const Iterator& other) const { return m_node == other.m_node; } Iterator& operator++() { m_node = m_node->next; return *this; } T& operator*() { return m_node->value; } - bool isEnd() const { return !m_node; } - static Iterator universalEnd() { return Iterator(nullptr); } + bool is_end() const { return !m_node; } + static Iterator universal_end() { return Iterator(nullptr); } private: friend class DoublyLinkedList; explicit Iterator(DoublyLinkedList::Node* node) : m_node(node) { } @@ -72,7 +72,7 @@ public: }; Iterator begin() { return Iterator(m_head); } - Iterator end() { return Iterator::universalEnd(); } + Iterator end() { return Iterator::universal_end(); } class ConstIterator { public: @@ -80,8 +80,8 @@ public: bool operator==(const ConstIterator& other) const { return m_node == other.m_node; } ConstIterator& operator++() { m_node = m_node->next; return *this; } const T& operator*() const { return m_node->value; } - bool isEnd() const { return !m_node; } - static ConstIterator universalEnd() { return ConstIterator(nullptr); } + bool is_end() const { return !m_node; } + static ConstIterator universal_end() { return ConstIterator(nullptr); } private: friend class DoublyLinkedList; explicit ConstIterator(const DoublyLinkedList::Node* node) : m_node(node) { } @@ -89,7 +89,7 @@ public: }; ConstIterator begin() const { return ConstIterator(m_head); } - ConstIterator end() const { return ConstIterator::universalEnd(); } + ConstIterator end() const { return ConstIterator::universal_end(); } ConstIterator find(const T& value) const { diff --git a/AK/FileSystemPath.cpp b/AK/FileSystemPath.cpp index 232c05ecb30..defdd1a9d6c 100644 --- a/AK/FileSystemPath.cpp +++ b/AK/FileSystemPath.cpp @@ -23,7 +23,7 @@ bool FileSystemPath::canonicalize(bool resolve_symbolic_links) continue; if (part == "..") { if (!canonical_parts.is_empty()) - canonical_parts.takeLast(); + canonical_parts.take_last(); continue; } if (!part.is_empty()) diff --git a/AK/HashTable.h b/AK/HashTable.h index 079df8402e2..fef82c4692c 100644 --- a/AK/HashTable.h +++ b/AK/HashTable.h @@ -59,73 +59,73 @@ public: public: bool operator!=(const Iterator& other) const { - if (m_isEnd && other.m_isEnd) + if (m_is_end && other.m_is_end) return false; return &m_table != &other.m_table - || m_isEnd != other.m_isEnd - || m_bucketIndex != other.m_bucketIndex - || m_bucketIterator != other.m_bucketIterator; + || m_is_end != other.m_is_end + || m_bucket_index != other.m_bucket_index + || m_bucket_iterator != other.m_bucket_iterator; } bool operator==(const Iterator& other) const { return !(*this != other); } T& operator*() { #ifdef HASHTABLE_DEBUG - kprintf("retrieve { bucketIndex: %u, isEnd: %u }\n", m_bucketIndex, m_isEnd); + kprintf("retrieve { bucket_index: %u, is_end: %u }\n", m_bucket_index, m_is_end); #endif - return *m_bucketIterator; + return *m_bucket_iterator; } Iterator& operator++() { - skipToNext(); + skip_to_next(); return *this; } - void skipToNext() + void skip_to_next() { #ifdef HASHTABLE_DEBUG unsigned pass = 0; #endif - while (!m_isEnd) { + while (!m_is_end) { #ifdef HASHTABLE_DEBUG ++pass; - kprintf("skipToNext pass %u, m_bucketIndex=%u\n", pass, m_bucketIndex); + kprintf("skip_to_next pass %u, m_bucket_index=%u\n", pass, m_bucket_index); #endif - if (m_bucketIterator.isEnd()) { - ++m_bucketIndex; - if (m_bucketIndex >= m_table.capacity()) { - m_isEnd = true; + if (m_bucket_iterator.is_end()) { + ++m_bucket_index; + if (m_bucket_index >= m_table.capacity()) { + m_is_end = true; return; } - m_bucketIterator = m_table.m_buckets[m_bucketIndex].chain.begin(); + m_bucket_iterator = m_table.m_buckets[m_bucket_index].chain.begin(); } else { - ++m_bucketIterator; + ++m_bucket_iterator; } - if (!m_bucketIterator.isEnd()) + if (!m_bucket_iterator.is_end()) return; } } private: friend class HashTable; - explicit Iterator(HashTable& table, bool isEnd, typename DoublyLinkedList::Iterator bucketIterator = DoublyLinkedList::Iterator::universalEnd(), unsigned bucketIndex = 0) + explicit Iterator(HashTable& table, bool is_end, typename DoublyLinkedList::Iterator bucket_iterator = DoublyLinkedList::Iterator::universal_end(), unsigned bucket_index = 0) : m_table(table) - , m_bucketIndex(bucketIndex) - , m_isEnd(isEnd) - , m_bucketIterator(bucketIterator) + , m_bucket_index(bucket_index) + , m_is_end(is_end) + , m_bucket_iterator(bucket_iterator) { - if (!isEnd && !m_table.is_empty() && !(m_bucketIterator != DoublyLinkedList::Iterator::universalEnd())) { + if (!is_end && !m_table.is_empty() && !(m_bucket_iterator != DoublyLinkedList::Iterator::universal_end())) { #ifdef HASHTABLE_DEBUG kprintf("bucket iterator init!\n"); #endif - m_bucketIterator = m_table.m_buckets[0].chain.begin(); - if (m_bucketIterator.isEnd()) - skipToNext(); + m_bucket_iterator = m_table.m_buckets[0].chain.begin(); + if (m_bucket_iterator.is_end()) + skip_to_next(); } } HashTable& m_table; - unsigned m_bucketIndex { 0 }; - bool m_isEnd { false }; - typename DoublyLinkedList::Iterator m_bucketIterator; + unsigned m_bucket_index { 0 }; + bool m_is_end { false }; + typename DoublyLinkedList::Iterator m_bucket_iterator; }; Iterator begin() { return Iterator(*this, is_empty()); } @@ -135,75 +135,75 @@ public: public: bool operator!=(const ConstIterator& other) const { - if (m_isEnd && other.m_isEnd) + if (m_is_end && other.m_is_end) return false; return &m_table != &other.m_table - || m_isEnd != other.m_isEnd - || m_bucketIndex != other.m_bucketIndex - || m_bucketIterator != other.m_bucketIterator; + || m_is_end != other.m_is_end + || m_bucket_index != other.m_bucket_index + || m_bucket_iterator != other.m_bucket_iterator; } bool operator==(const ConstIterator& other) const { return !(*this != other); } const T& operator*() const { #ifdef HASHTABLE_DEBUG - kprintf("retrieve { bucketIndex: %u, isEnd: %u }\n", m_bucketIndex, m_isEnd); + kprintf("retrieve { bucket_index: %u, is_end: %u }\n", m_bucket_index, m_is_end); #endif - return *m_bucketIterator; + return *m_bucket_iterator; } ConstIterator& operator++() { - skipToNext(); + skip_to_next(); return *this; } - void skipToNext() + void skip_to_next() { #ifdef HASHTABLE_DEBUG unsigned pass = 0; #endif - while (!m_isEnd) { + while (!m_is_end) { #ifdef HASHTABLE_DEBUG ++pass; - kprintf("skipToNext pass %u, m_bucketIndex=%u\n", pass, m_bucketIndex); + kprintf("skip_to_next pass %u, m_bucket_index=%u\n", pass, m_bucket_index); #endif - if (m_bucketIterator.isEnd()) { - ++m_bucketIndex; - if (m_bucketIndex >= m_table.capacity()) { - m_isEnd = true; + if (m_bucket_iterator.is_end()) { + ++m_bucket_index; + if (m_bucket_index >= m_table.capacity()) { + m_is_end = true; return; } - const DoublyLinkedList& chain = m_table.m_buckets[m_bucketIndex].chain; - m_bucketIterator = chain.begin(); + const DoublyLinkedList& chain = m_table.m_buckets[m_bucket_index].chain; + m_bucket_iterator = chain.begin(); } else { - ++m_bucketIterator; + ++m_bucket_iterator; } - if (!m_bucketIterator.isEnd()) + if (!m_bucket_iterator.is_end()) return; } } private: friend class HashTable; - ConstIterator(const HashTable& table, bool isEnd, typename DoublyLinkedList::ConstIterator bucketIterator = DoublyLinkedList::ConstIterator::universalEnd(), unsigned bucketIndex = 0) + ConstIterator(const HashTable& table, bool is_end, typename DoublyLinkedList::ConstIterator bucket_iterator = DoublyLinkedList::ConstIterator::universal_end(), unsigned bucket_index = 0) : m_table(table) - , m_bucketIndex(bucketIndex) - , m_isEnd(isEnd) - , m_bucketIterator(bucketIterator) + , m_bucket_index(bucket_index) + , m_is_end(is_end) + , m_bucket_iterator(bucket_iterator) { - if (!isEnd && !m_table.is_empty() && !(m_bucketIterator != DoublyLinkedList::ConstIterator::universalEnd())) { + if (!is_end && !m_table.is_empty() && !(m_bucket_iterator != DoublyLinkedList::ConstIterator::universal_end())) { #ifdef HASHTABLE_DEBUG kprintf("const bucket iterator init!\n"); #endif const DoublyLinkedList& chain = m_table.m_buckets[0].chain; - m_bucketIterator = chain.begin(); - if (m_bucketIterator.isEnd()) - skipToNext(); + m_bucket_iterator = chain.begin(); + if (m_bucket_iterator.is_end()) + skip_to_next(); } } const HashTable& m_table; - unsigned m_bucketIndex { 0 }; - bool m_isEnd { false }; - typename DoublyLinkedList::ConstIterator m_bucketIterator; + unsigned m_bucket_index { 0 }; + bool m_is_end { false }; + typename DoublyLinkedList::ConstIterator m_bucket_iterator; }; ConstIterator begin() const { return ConstIterator(*this, is_empty()); } @@ -222,8 +222,8 @@ public: void remove(Iterator); private: - Bucket& lookup(const T&, unsigned* bucketIndex = nullptr); - const Bucket& lookup(const T&, unsigned* bucketIndex = nullptr) const; + Bucket& lookup(const T&, unsigned* bucket_index = nullptr); + const Bucket& lookup(const T&, unsigned* bucket_index = nullptr) const; void rehash(unsigned capacity); void insert(const T&); void insert(T&&); @@ -274,28 +274,28 @@ void HashTable::set(const T& value) template -void HashTable::rehash(unsigned newCapacity) +void HashTable::rehash(unsigned new_capacity) { - newCapacity *= 2; + new_capacity *= 2; #ifdef HASHTABLE_DEBUG - kprintf("rehash to %u buckets\n", newCapacity); + kprintf("rehash to %u buckets\n", new_capacity); #endif - auto* newBuckets = new Bucket[newCapacity]; - auto* oldBuckets = m_buckets; - unsigned oldCapacity = m_capacity; - m_buckets = newBuckets; - m_capacity = newCapacity; + auto* new_buckets = new Bucket[new_capacity]; + auto* old_buckets = m_buckets; + unsigned old_capacity = m_capacity; + m_buckets = new_buckets; + m_capacity = new_capacity; #ifdef HASHTABLE_DEBUG - kprintf("reinsert %u buckets\n", oldCapacity); + kprintf("reinsert %u buckets\n", old_capacity); #endif - for (unsigned i = 0; i < oldCapacity; ++i) { - for (auto& value : oldBuckets[i].chain) { + for (unsigned i = 0; i < old_capacity; ++i) { + for (auto& value : old_buckets[i].chain) { insert(move(value)); } } - delete [] oldBuckets; + delete [] old_buckets; } template @@ -338,11 +338,11 @@ auto HashTable::find(const T& value) -> Iterator { if (is_empty()) return end(); - unsigned bucketIndex; - auto& bucket = lookup(value, &bucketIndex); - auto bucketIterator = bucket.chain.find(value); - if (bucketIterator != bucket.chain.end()) - return Iterator(*this, false, bucketIterator, bucketIndex); + unsigned bucket_index; + auto& bucket = lookup(value, &bucket_index); + auto bucket_iterator = bucket.chain.find(value); + if (bucket_iterator != bucket.chain.end()) + return Iterator(*this, false, bucket_iterator, bucket_index); return end(); } @@ -351,11 +351,11 @@ auto HashTable::find(const T& value) const -> ConstIterator { if (is_empty()) return end(); - unsigned bucketIndex; - auto& bucket = lookup(value, &bucketIndex); - auto bucketIterator = bucket.chain.find(value); - if (bucketIterator != bucket.chain.end()) - return ConstIterator(*this, false, bucketIterator, bucketIndex); + unsigned bucket_index; + auto& bucket = lookup(value, &bucket_index); + auto bucket_iterator = bucket.chain.find(value); + if (bucket_iterator != bucket.chain.end()) + return ConstIterator(*this, false, bucket_iterator, bucket_index); return end(); } @@ -363,12 +363,12 @@ template void HashTable::remove(Iterator it) { ASSERT(!is_empty()); - m_buckets[it.m_bucketIndex].chain.remove(it.m_bucketIterator); + m_buckets[it.m_bucket_index].chain.remove(it.m_bucket_iterator); --m_size; } template -typename HashTable::Bucket& HashTable::lookup(const T& value, unsigned* bucketIndex) +typename HashTable::Bucket& HashTable::lookup(const T& value, unsigned* bucket_index) { unsigned hash = TraitsForT::hash(value); #ifdef HASHTABLE_DEBUG @@ -376,13 +376,13 @@ typename HashTable::Bucket& HashTable::lookup(cons TraitsForT::dump(value); kprintf(" is %u\n", hash); #endif - if (bucketIndex) - *bucketIndex = hash % m_capacity; + if (bucket_index) + *bucket_index = hash % m_capacity; return m_buckets[hash % m_capacity]; } template -const typename HashTable::Bucket& HashTable::lookup(const T& value, unsigned* bucketIndex) const +const typename HashTable::Bucket& HashTable::lookup(const T& value, unsigned* bucket_index) const { unsigned hash = TraitsForT::hash(value); #ifdef HASHTABLE_DEBUG @@ -390,8 +390,8 @@ const typename HashTable::Bucket& HashTable::looku TraitsForT::dump(value); kprintf(" is %u\n", hash); #endif - if (bucketIndex) - *bucketIndex = hash % m_capacity; + if (bucket_index) + *bucket_index = hash % m_capacity; return m_buckets[hash % m_capacity]; } diff --git a/AK/SinglyLinkedList.h b/AK/SinglyLinkedList.h index ab552c46647..b22cab0ac54 100644 --- a/AK/SinglyLinkedList.h +++ b/AK/SinglyLinkedList.h @@ -61,8 +61,8 @@ public: bool operator!=(const Iterator& other) { return m_node != other.m_node; } Iterator& operator++() { m_node = m_node->next; return *this; } T& operator*() { return m_node->value; } - bool isEnd() const { return !m_node; } - static Iterator universalEnd() { return Iterator(nullptr); } + bool is_end() const { return !m_node; } + static Iterator universal_end() { return Iterator(nullptr); } private: friend class SinglyLinkedList; explicit Iterator(SinglyLinkedList::Node* node) : m_node(node) { } @@ -70,15 +70,15 @@ public: }; Iterator begin() { return Iterator(m_head); } - Iterator end() { return Iterator::universalEnd(); } + Iterator end() { return Iterator::universal_end(); } class ConstIterator { public: bool operator!=(const ConstIterator& other) { return m_node != other.m_node; } ConstIterator& operator++() { m_node = m_node->next; return *this; } const T& operator*() const { return m_node->value; } - bool isEnd() const { return !m_node; } - static ConstIterator universalEnd() { return ConstIterator(nullptr); } + bool is_end() const { return !m_node; } + static ConstIterator universal_end() { return ConstIterator(nullptr); } private: friend class SinglyLinkedList; explicit ConstIterator(const SinglyLinkedList::Node* node) : m_node(node) { } @@ -86,7 +86,7 @@ public: }; ConstIterator begin() const { return ConstIterator(m_head); } - ConstIterator end() const { return ConstIterator::universalEnd(); } + ConstIterator end() const { return ConstIterator::universal_end(); } ConstIterator find(const T& value) const { diff --git a/AK/Vector.h b/AK/Vector.h index c406e9db7d5..6d9c7c1ff82 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -77,7 +77,7 @@ public: Vector(const Vector& other) { - ensureCapacity(other.size()); + ensure_capacity(other.size()); for (size_t i = 0; i < other.size(); ++i) unchecked_append(other[i]); } @@ -137,7 +137,7 @@ public: const T& last() const { return at(size() - 1); } T& last() { return at(size() - 1); } - T takeLast() + T take_last() { ASSERT(!is_empty()); T value = move(last()); @@ -163,7 +163,7 @@ public: { if (this != &other) { clear(); - ensureCapacity(other.size()); + ensure_capacity(other.size()); for (const auto& v : other) unchecked_append(v); } @@ -173,7 +173,7 @@ public: void append(Vector&& other) { Vector tmp = move(other); - ensureCapacity(size() + tmp.size()); + ensure_capacity(size() + tmp.size()); for (auto&& v : tmp) { unchecked_append(move(v)); } @@ -194,32 +194,32 @@ public: void append(T&& value) { - ensureCapacity(size() + 1); + ensure_capacity(size() + 1); new (m_impl->slot(m_impl->m_size)) T(move(value)); ++m_impl->m_size; } void append(const T& value) { - ensureCapacity(size() + 1); + ensure_capacity(size() + 1); new (m_impl->slot(m_impl->m_size)) T(value); ++m_impl->m_size; } void append(const T* values, size_t count) { - ensureCapacity(size() + count); + ensure_capacity(size() + count); for (size_t i = 0; i < count; ++i) new (m_impl->slot(m_impl->m_size + i)) T(values[i]); m_impl->m_size += count; } - void ensureCapacity(size_t neededCapacity) + void ensure_capacity(size_t neededCapacity) { if (capacity() >= neededCapacity) return; - size_t newCapacity = paddedCapacity(neededCapacity); - auto newImpl = VectorImpl::create(newCapacity); + size_t new_capacity = padded_capacity(neededCapacity); + auto newImpl = VectorImpl::create(new_capacity); if (m_impl) { newImpl->m_size = m_impl->m_size; for (size_t i = 0; i < size(); ++i) { @@ -236,7 +236,7 @@ public: ASSERT(new_size >= size()); if (!new_size) return; - ensureCapacity(new_size); + ensure_capacity(new_size); for (size_t i = size(); i < new_size; ++i) new (m_impl->slot(i)) T; m_impl->m_size = new_size; @@ -273,7 +273,7 @@ public: ConstIterator end() const { return ConstIterator(*this, size()); } //private: - static size_t paddedCapacity(size_t capacity) + static size_t padded_capacity(size_t capacity) { return max(size_t(4), capacity + (capacity / 4) + 4); } diff --git a/AK/test.cpp b/AK/test.cpp index 5690fb8fb50..34ba3244be8 100644 --- a/AK/test.cpp +++ b/AK/test.cpp @@ -126,7 +126,7 @@ int main(int c, char** v) strings.append("f"); strings.append("g"); - auto g = strings.takeLast(); + auto g = strings.take_last(); for (unsigned i = 0; i < strings.size(); ++i) { printf("[%u]: '%s'\n", i, strings[i].characters()); diff --git a/Kernel/MemoryManager.cpp b/Kernel/MemoryManager.cpp index 6618457f283..e719243e2f8 100644 --- a/Kernel/MemoryManager.cpp +++ b/Kernel/MemoryManager.cpp @@ -84,7 +84,7 @@ void MemoryManager::initialize_paging() #endif for (size_t i = (4 * MB); i < (32 * MB); i += PAGE_SIZE) m_free_physical_pages.append(adopt(*new PhysicalPage(PhysicalAddress(i), false))); - m_quickmap_addr = LinearAddress(m_free_physical_pages.takeLast().leakRef()->paddr().get()); + m_quickmap_addr = LinearAddress(m_free_physical_pages.take_last().leakRef()->paddr().get()); #ifdef MM_DEBUG dbgprintf("MM: Quickmap will use P%x\n", m_quickmap_addr.get()); dbgprintf("MM: Installing page directory\n"); @@ -357,7 +357,7 @@ RetainPtr MemoryManager::allocate_physical_page() #ifdef MM_DEBUG dbgprintf("MM: allocate_physical_page vending P%x (%u remaining)\n", m_free_physical_pages.last()->paddr().get(), m_free_physical_pages.size()); #endif - return m_free_physical_pages.takeLast(); + return m_free_physical_pages.take_last(); } RetainPtr MemoryManager::allocate_supervisor_physical_page() @@ -368,7 +368,7 @@ RetainPtr MemoryManager::allocate_supervisor_physical_page() #ifdef MM_DEBUG dbgprintf("MM: allocate_supervisor_physical_page vending P%x (%u remaining)\n", m_free_supervisor_physical_pages.last()->paddr().get(), m_free_supervisor_physical_pages.size()); #endif - return m_free_supervisor_physical_pages.takeLast(); + return m_free_supervisor_physical_pages.take_last(); } void MemoryManager::enter_process_paging_scope(Process& process) diff --git a/Kernel/PTYMultiplexer.cpp b/Kernel/PTYMultiplexer.cpp index 26403e898cd..33a1e3cc0f5 100644 --- a/Kernel/PTYMultiplexer.cpp +++ b/Kernel/PTYMultiplexer.cpp @@ -5,7 +5,7 @@ PTYMultiplexer::PTYMultiplexer() : CharacterDevice(5, 2) { - m_freelist.ensureCapacity(4); + m_freelist.ensure_capacity(4); for (int i = 4; i > 0; --i) m_freelist.unchecked_append(adopt(*new MasterPTY(i - 1))); } @@ -21,7 +21,7 @@ RetainPtr PTYMultiplexer::open(int& error, int options) error = -EBUSY; return nullptr; } - auto master = m_freelist.takeLast(); + auto master = m_freelist.take_last(); dbgprintf("PTYMultiplexer::open: Vending master %u\n", master->index()); return VFS::the().open(move(master), error, options); } diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index ca81c7dfd80..cfc720bfa7a 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -63,7 +63,7 @@ Vector Process::allProcesses() { InterruptDisabler disabler; Vector processes; - processes.ensureCapacity(g_processes->size_slow()); + processes.ensure_capacity(g_processes->size_slow()); for (auto* process = g_processes->head(); process; process = process->next()) processes.append(process); return processes; @@ -380,7 +380,7 @@ int Process::do_exec(const String& path, Vector&& arguments, Vectorexec(path, move(arguments), move(environment)); if (error != 0) { diff --git a/Kernel/i386.cpp b/Kernel/i386.cpp index 221bb5ef7a7..3dcb3752cb9 100644 --- a/Kernel/i386.cpp +++ b/Kernel/i386.cpp @@ -29,7 +29,7 @@ word gdt_alloc_entry() { ASSERT(s_gdt_freelist); ASSERT(!s_gdt_freelist->is_empty()); - return s_gdt_freelist->takeLast(); + return s_gdt_freelist->take_last(); } void gdt_free_entry(word entry) @@ -323,7 +323,7 @@ void gdt_init() s_gdtLength = 5; s_gdt_freelist = new Vector(); - s_gdt_freelist->ensureCapacity(256); + s_gdt_freelist->ensure_capacity(256); for (size_t i = s_gdtLength; i < 256; ++i) s_gdt_freelist->append(i * 8); diff --git a/VirtualFileSystem/Ext2FileSystem.cpp b/VirtualFileSystem/Ext2FileSystem.cpp index 56d01a08cf0..106b1058ddf 100644 --- a/VirtualFileSystem/Ext2FileSystem.cpp +++ b/VirtualFileSystem/Ext2FileSystem.cpp @@ -158,7 +158,7 @@ Vector Ext2FS::block_list_for_inode(const ext2_inode& e2inode) const unsigned blockCount = e2inode.i_blocks / (blockSize() / 512); unsigned blocksRemaining = blockCount; Vector list; - list.ensureCapacity(blocksRemaining); + list.ensure_capacity(blocksRemaining); unsigned directCount = min(blockCount, (unsigned)EXT2_NDIR_BLOCKS); for (unsigned i = 0; i < directCount; ++i) { diff --git a/VirtualFileSystem/SyntheticFileSystem.cpp b/VirtualFileSystem/SyntheticFileSystem.cpp index a0cdb297402..579f02525a2 100644 --- a/VirtualFileSystem/SyntheticFileSystem.cpp +++ b/VirtualFileSystem/SyntheticFileSystem.cpp @@ -131,7 +131,7 @@ bool SynthFS::remove_file(InodeIndex inode) } Vector indices_to_remove; - indices_to_remove.ensureCapacity(file.m_children.size()); + indices_to_remove.ensure_capacity(file.m_children.size()); for (auto& child : file.m_children) indices_to_remove.unchecked_append(child->m_metadata.inode.index()); for (auto& index : indices_to_remove)