diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-22 08:48:37 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-22 08:48:37 +0200 |
| commit | 5d38a6302720eb1d2783c2067965ade316cc92de (patch) | |
| tree | 906b56ec92e9075181494e8a4012ebde72d22175 /dev/ZKA/Sources | |
| parent | b95b1fc42d371b08aa82fea8e92aa04b2ef5631f (diff) | |
[REFACTOR] use Char instead of builtin char.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/Sources')
| -rw-r--r-- | dev/ZKA/Sources/CodeManager.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/Sources/KernelCheck.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/Sources/Network/IP.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/Sources/Network/NetworkDevice.cxx | 4 | ||||
| -rw-r--r-- | dev/ZKA/Sources/NewFS+FileManager.cxx | 16 | ||||
| -rw-r--r-- | dev/ZKA/Sources/PEFCodeManager.cxx | 10 | ||||
| -rw-r--r-- | dev/ZKA/Sources/ProcessScheduler.cxx | 4 | ||||
| -rw-r--r-- | dev/ZKA/Sources/Storage/AHCIDeviceInterface.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/Sources/Storage/ATADeviceInterface.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/Sources/Storage/NVMEDeviceInterface.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/Sources/String.cxx | 10 | ||||
| -rw-r--r-- | dev/ZKA/Sources/Utils.cxx | 10 |
12 files changed, 33 insertions, 33 deletions
diff --git a/dev/ZKA/Sources/CodeManager.cxx b/dev/ZKA/Sources/CodeManager.cxx index c0d1d308..ae4354c8 100644 --- a/dev/ZKA/Sources/CodeManager.cxx +++ b/dev/ZKA/Sources/CodeManager.cxx @@ -14,7 +14,7 @@ namespace Kernel /// @note This sets up a new stack, anything on the main function that calls the kernel will not be accessible. /// @param main the start of the process. /// @return if the process was started or not. - bool execute_from_image(MainKind main, const char* processName) noexcept + bool execute_from_image(MainKind main, const Char* processName) noexcept { if (!main) return false; diff --git a/dev/ZKA/Sources/KernelCheck.cxx b/dev/ZKA/Sources/KernelCheck.cxx index 27519369..6a900039 100644 --- a/dev/ZKA/Sources/KernelCheck.cxx +++ b/dev/ZKA/Sources/KernelCheck.cxx @@ -126,7 +126,7 @@ namespace Kernel } } - void ke_runtime_check(bool expr, const char* file, const char* line) + void ke_runtime_check(bool expr, const Char* file, const Char* line) { if (!expr) { diff --git a/dev/ZKA/Sources/Network/IP.cxx b/dev/ZKA/Sources/Network/IP.cxx index 3e5462a1..77571bc7 100644 --- a/dev/ZKA/Sources/Network/IP.cxx +++ b/dev/ZKA/Sources/Network/IP.cxx @@ -102,7 +102,7 @@ namespace Kernel return str; } - bool IPFactory::IpCheckVersion4(const char* ip) + bool IPFactory::IpCheckVersion4(const Char* ip) { int cnter = 0; diff --git a/dev/ZKA/Sources/Network/NetworkDevice.cxx b/dev/ZKA/Sources/Network/NetworkDevice.cxx index 1bcd9e24..afb3e468 100644 --- a/dev/ZKA/Sources/Network/NetworkDevice.cxx +++ b/dev/ZKA/Sources/Network/NetworkDevice.cxx @@ -10,13 +10,13 @@ namespace Kernel { /// \brief Getter for fNetworkName. - const char* NetworkDevice::Name() const + const Char* NetworkDevice::Name() const { return this->fNetworkName; } /// \brief Setter for fNetworkName. - Boolean NetworkDevice::Name(const char* strView) + Boolean NetworkDevice::Name(const Char* strView) { if (strView == nullptr) return false; diff --git a/dev/ZKA/Sources/NewFS+FileManager.cxx b/dev/ZKA/Sources/NewFS+FileManager.cxx index 36a0e984..e40e98aa 100644 --- a/dev/ZKA/Sources/NewFS+FileManager.cxx +++ b/dev/ZKA/Sources/NewFS+FileManager.cxx @@ -36,7 +36,7 @@ namespace Kernel /// @brief Removes a node from the filesystem. /// @param fileName The filename /// @return If it was deleted or not. - bool NewFilesystemManager::Remove(const char* fileName) + bool NewFilesystemManager::Remove(const Char* fileName) { if (fileName == nullptr || *fileName == 0) return false; @@ -47,7 +47,7 @@ namespace Kernel /// @brief Creates a node with the specified. /// @param path The filename path. /// @return The Node pointer. - NodePtr NewFilesystemManager::Create(const char* path) + NodePtr NewFilesystemManager::Create(const Char* path) { return node_cast(fImpl->CreateCatalog(path)); } @@ -55,7 +55,7 @@ namespace Kernel /// @brief Creates a node with is a directory. /// @param path The filename path. /// @return The Node pointer. - NodePtr NewFilesystemManager::CreateDirectory(const char* path) + NodePtr NewFilesystemManager::CreateDirectory(const Char* path) { return node_cast(fImpl->CreateCatalog(path, 0, kNewFSCatalogKindDir)); } @@ -63,35 +63,35 @@ namespace Kernel /// @brief Creates a node with is a alias. /// @param path The filename path. /// @return The Node pointer. - NodePtr NewFilesystemManager::CreateAlias(const char* path) + NodePtr NewFilesystemManager::CreateAlias(const Char* path) { return node_cast(fImpl->CreateCatalog(path, 0, kNewFSCatalogKindAlias)); } /// @brief Gets the root directory. /// @return - const char* NewFilesystemHelper::Root() + const Char* NewFilesystemHelper::Root() { return kNewFSRoot; } /// @brief Gets the up-dir directory. /// @return - const char* NewFilesystemHelper::UpDir() + const Char* NewFilesystemHelper::UpDir() { return kNewFSUpDir; } /// @brief Gets the separator character. /// @return - const char NewFilesystemHelper::Separator() + const Char NewFilesystemHelper::Separator() { return kNewFSSeparator; } /// @brief Gets the metafile character. /// @return - const char NewFilesystemHelper::MetaFile() + const Char NewFilesystemHelper::MetaFile() { return kNewFSMetaFilePrefix; } diff --git a/dev/ZKA/Sources/PEFCodeManager.cxx b/dev/ZKA/Sources/PEFCodeManager.cxx index d557cc2f..746b75eb 100644 --- a/dev/ZKA/Sources/PEFCodeManager.cxx +++ b/dev/ZKA/Sources/PEFCodeManager.cxx @@ -100,7 +100,7 @@ namespace Kernel fFile.Delete(); } - VoidPtr PEFLoader::FindSymbol(const char* name, Int32 kind) + VoidPtr PEFLoader::FindSymbol(const Char* name, Int32 kind) { if (!fCachedBlob || fBad) return nullptr; @@ -115,7 +115,7 @@ namespace Kernel PEFCommandHeader* container_header = reinterpret_cast<PEFCommandHeader*>(blob); constexpr auto cMangleCharacter = '$'; - const char* cContainerKinds[] = {".code64", ".data64", ".zero64", nullptr}; + const Char* cContainerKinds[] = {".code64", ".data64", ".zero64", nullptr}; ErrorOr<StringView> errOrSym; @@ -214,12 +214,12 @@ namespace Kernel } } // namespace Utils - const char* PEFLoader::Path() + const Char* PEFLoader::Path() { return fPath.Leak().CData(); } - const char* PEFLoader::AsString() + const Char* PEFLoader::AsString() { #ifdef __32x0__ return "32x0 PEF format."; @@ -234,7 +234,7 @@ namespace Kernel #endif // __32x0__ || __64x0__ || __x86_64__ || __powerpc64__ } - const char* PEFLoader::MIME() + const Char* PEFLoader::MIME() { return kPefApplicationMime; } diff --git a/dev/ZKA/Sources/ProcessScheduler.cxx b/dev/ZKA/Sources/ProcessScheduler.cxx index c5933ed8..3fb82067 100644 --- a/dev/ZKA/Sources/ProcessScheduler.cxx +++ b/dev/ZKA/Sources/ProcessScheduler.cxx @@ -93,12 +93,12 @@ namespace Kernel } this->HeapCursor = reinterpret_cast<VoidPtr>((UIntPtr)this->HeapCursor + (sizeof(sz))); - VoidPtr ptr = this->HeapCursor; + VoidPtr cursor = this->HeapCursor; ++this->UsedMemory; --this->FreeMemory; - return ptr; + return cursor; } return nullptr; diff --git a/dev/ZKA/Sources/Storage/AHCIDeviceInterface.cxx b/dev/ZKA/Sources/Storage/AHCIDeviceInterface.cxx index dde33193..cfb80c0f 100644 --- a/dev/ZKA/Sources/Storage/AHCIDeviceInterface.cxx +++ b/dev/ZKA/Sources/Storage/AHCIDeviceInterface.cxx @@ -29,7 +29,7 @@ AHCIDeviceInterface::~AHCIDeviceInterface() /// @brief Returns the name of the device interface. /// @return it's name as a string. -const char* AHCIDeviceInterface::Name() const +const Char* AHCIDeviceInterface::Name() const { return "AHCIDeviceInterface"; } diff --git a/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx b/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx index 1611e790..183481e1 100644 --- a/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx +++ b/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx @@ -30,7 +30,7 @@ ATADeviceInterface::~ATADeviceInterface() /// @brief Returns the name of the device interface. /// @return it's name as a string. -const char* ATADeviceInterface::Name() const +const Char* ATADeviceInterface::Name() const { return "ATADeviceInterface"; } diff --git a/dev/ZKA/Sources/Storage/NVMEDeviceInterface.cxx b/dev/ZKA/Sources/Storage/NVMEDeviceInterface.cxx index 7d07bf4b..5809a5e6 100644 --- a/dev/ZKA/Sources/Storage/NVMEDeviceInterface.cxx +++ b/dev/ZKA/Sources/Storage/NVMEDeviceInterface.cxx @@ -21,7 +21,7 @@ namespace Kernel fCleanup(); } - const char* NVMEDeviceInterface::Name() const + const Char* NVMEDeviceInterface::Name() const { return ("NVMEDeviceInterface"); } diff --git a/dev/ZKA/Sources/String.cxx b/dev/ZKA/Sources/String.cxx index 8c928aa5..2681dddd 100644 --- a/dev/ZKA/Sources/String.cxx +++ b/dev/ZKA/Sources/String.cxx @@ -93,7 +93,7 @@ namespace Kernel return ErrorOr<StringView>(view); } - const char* StringBuilder::FromInt(const char* fmt, int i) + const Char* StringBuilder::FromInt(const Char* fmt, int i) { if (!fmt) return ("-1"); @@ -134,12 +134,12 @@ namespace Kernel return ret; /* Copy that ret into a buffer, 'ALLOCA' allocates to the stack */ } - const char* StringBuilder::FromBool(const char* fmt, bool i) + const Char* StringBuilder::FromBool(const Char* fmt, bool i) { if (!fmt) return ("?"); - const char* boolean_expr = i ? "true" : "false"; + const Char* boolean_expr = i ? "true" : "false"; char* ret = (char*)ALLOCA((sizeof(char) * i) ? 4 : 5 + rt_string_len(fmt)); if (!ret) @@ -169,7 +169,7 @@ namespace Kernel return ret; } - bool StringBuilder::Equals(const char* lhs, const char* rhs) + bool StringBuilder::Equals(const Char* lhs, const Char* rhs) { if (rt_string_len(rhs) != rt_string_len(lhs)) return false; @@ -194,7 +194,7 @@ namespace Kernel return true; } - const char* StringBuilder::Format(const char* fmt, const char* fmt2) + const Char* StringBuilder::Format(const Char* fmt, const Char* fmt2) { if (!fmt || !fmt2) return ("?"); diff --git a/dev/ZKA/Sources/Utils.cxx b/dev/ZKA/Sources/Utils.cxx index 5673c5fd..1557ce7d 100644 --- a/dev/ZKA/Sources/Utils.cxx +++ b/dev/ZKA/Sources/Utils.cxx @@ -66,7 +66,7 @@ namespace Kernel { if (!src || len < 1) return nullptr; - + char* start = reinterpret_cast<Char*>(src); while (len) @@ -184,7 +184,7 @@ namespace Kernel return chr == '\n'; } - voidPtr rt_string_in_string(const char* in, const char* needle) + voidPtr rt_string_in_string(const Char* in, const Char* needle) { for (SizeT i = 0; i < rt_string_len(in); ++i) { @@ -197,7 +197,7 @@ namespace Kernel // @brief Checks for a string start at the character. - char* rt_string_has_char(char* str, const char chr) + char* rt_string_has_char(char* str, const Char chr) { while (*str != chr) { @@ -237,7 +237,7 @@ EXTERN_C void* memmove(void* dst, void* src, Kernel::SizeT len) } /// @brief strlen definition in C++. -EXTERN_C Kernel::SizeT strlen(const char* whatToCheck) +EXTERN_C Kernel::SizeT strlen(const Char* whatToCheck) { return Kernel::rt_string_len(whatToCheck); } @@ -254,4 +254,4 @@ EXTERN_C Kernel::SizeT strcmp(char* dst, char* src, Kernel::SizeT len) return Kernel::rt_string_cmp(src, dst, len); } -#endif // __FREESTANDING__
\ No newline at end of file +#endif // __FREESTANDING__ |
