diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-02 21:55:15 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-02 21:55:15 +0200 |
| commit | f1d3744829a661d1600c2f3bbdbdf679ee0bd0e1 (patch) | |
| tree | 07dde500d4545bcf4ac752d946dab36e56dbd099 /Kernel/Sources | |
| parent | 1ee8b64b32004b3a00a7cf836df178ba2d179b74 (diff) | |
MHR-36: Add HintKit keywords.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/Sources')
| -rw-r--r-- | Kernel/Sources/FileManager.cxx | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/Kernel/Sources/FileManager.cxx b/Kernel/Sources/FileManager.cxx index 2c0bd366..11830252 100644 --- a/Kernel/Sources/FileManager.cxx +++ b/Kernel/Sources/FileManager.cxx @@ -23,7 +23,7 @@ namespace NewOS /// @brief Unmount filesystem. /// @return The unmounted filesystem. - FilesystemManagerInterface* FilesystemManagerInterface::Unmount() + _Output FilesystemManagerInterface* FilesystemManagerInterface::Unmount() { if (kMounted) { @@ -39,7 +39,7 @@ namespace NewOS /// @brief Mount filesystem. /// @param mountPtr The filesystem to mount. /// @return if it succeeded true, otherwise false. - bool FilesystemManagerInterface::Mount(FilesystemManagerInterface* mountPtr) + bool FilesystemManagerInterface::Mount(_Input FilesystemManagerInterface* mountPtr) { if (kMounted == nullptr) { @@ -55,7 +55,7 @@ namespace NewOS /// @param path /// @param r /// @return - NodePtr NewFilesystemManager::Open(const char* path, const char* r) + NodePtr NewFilesystemManager::Open(_Input const Char* path, _Input const Char* r) { if (!path || *path == 0) return nullptr; @@ -79,10 +79,13 @@ namespace NewOS /// @param data the data. /// @param flags the size. /// @return - Void NewFilesystemManager::Write(NodePtr node, VoidPtr data, Int32 flags, SizeT size) + Void NewFilesystemManager::Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags, _Input SizeT size) { - auto dataForkName = kNewFSDataFork; - this->Write(dataForkName, node, data, flags, size); + if (!node) return; + if (!size) return; + + constexpr auto cDataForkName = kNewFSDataFork; + this->Write(cDataForkName, node, data, flags, size); } /// @brief Read from filesystem fork. @@ -90,10 +93,13 @@ namespace NewOS /// @param flags the flags with it. /// @param sz the size to read. /// @return - VoidPtr NewFilesystemManager::Read(NodePtr node, Int32 flags, SizeT sz) + VoidPtr NewFilesystemManager::Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT size) { - auto dataForkName = kNewFSDataFork; - return this->Read(dataForkName, node, flags, sz); + if (!node) return nullptr; + if (!size) return nullptr; + + constexpr auto cDataForkName = kNewFSDataFork; + return this->Read(cDataForkName, node, flags, size); } Void NewFilesystemManager::Write(_Input const Char* name, |
