From a8cf25e6b66425d89b25381bb07fd4074cdc8deb Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 9 Jan 2024 09:34:28 +0100 Subject: mpt: add operator bool for FileType. Signed-off-by: Amlal El Mahrouss --- Source/Heap.cxx | 5 ++--- newBoot/Source/MPT/FileType.hxx | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/Heap.cxx b/Source/Heap.cxx index 0a159c4e..732fc782 100644 --- a/Source/Heap.cxx +++ b/Source/Heap.cxx @@ -9,7 +9,6 @@ #include #include -#include /// @file Heap.cxx /// @brief hCore Process Heap Manager @@ -21,7 +20,7 @@ namespace hCore class HeapManager final { public: - static Size& GetCount() { return s_NumPools; } + static SizeT& GetCount() { return s_NumPools; } static Ref& GetPmm() { return s_Pmm; } static Boolean& IsEnabled() { return s_PoolsAreEnabled; } static Array, kPoolMaxSz>& The() { return s_Pool; } @@ -162,7 +161,7 @@ namespace hCore /// @brief free a pool pointer. /// @param ptr The pool pointer to free. - /// @return + /// @return status code Int32 pool_free_ptr(voidPtr ptr) { if (!HeapManager::IsEnabled()) diff --git a/newBoot/Source/MPT/FileType.hxx b/newBoot/Source/MPT/FileType.hxx index 818d8197..4d7a5cf2 100644 --- a/newBoot/Source/MPT/FileType.hxx +++ b/newBoot/Source/MPT/FileType.hxx @@ -27,4 +27,10 @@ public: FileType* Read(const char* path) { return _Manager::Read(path); } FileType* Write(FileType* path) { return _Manager::Write(path); } + // little sanity test + operator bool() + { + return DiskError != 0 && DiskSize > 0; + } + }; \ No newline at end of file -- cgit v1.2.3