From e6768dc3b6c7864166211fd6e2f67ff4e5a2cbe5 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 8 Dec 2025 03:56:42 -0500 Subject: chore: use `enum struct` instead of `enum class`. chore: build scripts improvements. Signed-off-by: Amlal El Mahrouss --- src/kernel/HALKit/AMD64/Paging.h | 2 +- src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 2 +- src/kernel/HALKit/ARM64/Paging.h | 2 +- src/kernel/KernelKit/CoreProcessScheduler.h | 8 ++++---- src/kernel/KernelKit/PCI/DMA.h | 2 +- src/kernel/KernelKit/PCI/Database.h | 2 +- src/kernel/KernelKit/PCI/Device.h | 2 +- src/kernel/KernelKit/UserMgr.h | 2 +- src/kernel/NeKit/Config.h | 2 +- src/kernel/NeKit/Variant.h | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/kernel') diff --git a/src/kernel/HALKit/AMD64/Paging.h b/src/kernel/HALKit/AMD64/Paging.h index b8b276c0..77ea6f37 100644 --- a/src/kernel/HALKit/AMD64/Paging.h +++ b/src/kernel/HALKit/AMD64/Paging.h @@ -43,7 +43,7 @@ EXTERN_C Kernel::VoidPtr hal_read_cr3(); // @brief Page directory inside cr3 re namespace Kernel::HAL { namespace Detail { - enum class ControlRegisterBits { + enum struct ControlRegisterBits { kProtectedModeEnable = 0, kMonitorCoProcessor = 1, kEmulation = 2, diff --git a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 51e73fca..d97884ff 100644 --- a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -277,7 +277,7 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz rtl_dma_flush(ptr, size_buffer); if (kSATAHba->Is & kSATAErrTaskFile) { - kout << "ahci: Task File Error during I/O.\r"; + kout << "ahci: tf-error when doing I/O.\r"; rtl_dma_free(size_buffer); err_global_get() = kErrorDiskIsCorrupted; diff --git a/src/kernel/HALKit/ARM64/Paging.h b/src/kernel/HALKit/ARM64/Paging.h index 28d31b60..34cf4213 100644 --- a/src/kernel/HALKit/ARM64/Paging.h +++ b/src/kernel/HALKit/ARM64/Paging.h @@ -68,7 +68,7 @@ struct PACKED PTE_4KB final { }; namespace Detail { - enum class ControlRegisterBits { + enum struct ControlRegisterBits { ProtectedModeEnable = 0, MonitorCoProcessor = 1, Emulation = 2, diff --git a/src/kernel/KernelKit/CoreProcessScheduler.h b/src/kernel/KernelKit/CoreProcessScheduler.h index 7a53f94c..da89b112 100644 --- a/src/kernel/KernelKit/CoreProcessScheduler.h +++ b/src/kernel/KernelKit/CoreProcessScheduler.h @@ -142,7 +142,7 @@ struct PROCESS_SPECIAL_TREE { /// @brief Subsystem enum type. /***********************************************************************************/ -enum class ProcessSubsystem : Int32 { +enum struct ProcessSubsystem : Int32 { kProcessSubsystemSecurity = 100, kProcessSubsystemUser, kProcessSubsystemService, @@ -155,7 +155,7 @@ enum class ProcessSubsystem : Int32 { /***********************************************************************************/ //! @brief Local Process status enum. /***********************************************************************************/ -enum class ProcessStatusKind : Int32 { +enum struct ProcessStatusKind : Int32 { kInvalid = 0, kStarting = 100, kRunning, @@ -168,7 +168,7 @@ enum class ProcessStatusKind : Int32 { /***********************************************************************************/ //! @brief Affinity is the amount of nano-seconds this process is going to run. /***********************************************************************************/ -enum class AffinityKind : Int32 { +enum struct AffinityKind : Int32 { kInvalid = 0, kRealTime = 100, kVeryHigh = 150, @@ -221,7 +221,7 @@ using ProcessID = Int64; /***********************************************************************************/ /// @note For User manager, tells where we run the code. /***********************************************************************************/ -enum class ProcessLevelRing : Int32 { +enum struct ProcessLevelRing : Int32 { kRingStdUser = 1, kRingSuperUser = 2, kRingGuestUser = 5, diff --git a/src/kernel/KernelKit/PCI/DMA.h b/src/kernel/KernelKit/PCI/DMA.h index 0cc642c1..d965a3c9 100644 --- a/src/kernel/KernelKit/PCI/DMA.h +++ b/src/kernel/KernelKit/PCI/DMA.h @@ -13,7 +13,7 @@ #include namespace Kernel { -enum class DmaKind { +enum struct DmaKind { PCI = 10, // Bus mastering is required to be turned on. Basiaclly a request // control system. 64-Bit access depends on the PAE bit and the device // (if Double Address Cycle is available) diff --git a/src/kernel/KernelKit/PCI/Database.h b/src/kernel/KernelKit/PCI/Database.h index 73013c74..35740fdc 100644 --- a/src/kernel/KernelKit/PCI/Database.h +++ b/src/kernel/KernelKit/PCI/Database.h @@ -11,7 +11,7 @@ namespace Kernel { namespace Types { // https://wiki.osdev.org/PCI - enum class PciDeviceKind : UChar { + enum struct PciDeviceKind : UChar { MassStorageController = 0x1, NetworkController = 0x2, DisplayController = 0x3, diff --git a/src/kernel/KernelKit/PCI/Device.h b/src/kernel/KernelKit/PCI/Device.h index e9c5a683..3e7284de 100644 --- a/src/kernel/KernelKit/PCI/Device.h +++ b/src/kernel/KernelKit/PCI/Device.h @@ -10,7 +10,7 @@ #include namespace Kernel::PCI { -enum class PciConfigKind : UShort { +enum struct PciConfigKind : UShort { ConfigAddress = 0xCF8, ConfigData = 0xCFC, CommandReg = 0x0004, diff --git a/src/kernel/KernelKit/UserMgr.h b/src/kernel/KernelKit/UserMgr.h index 3f36f240..3b48f686 100644 --- a/src/kernel/KernelKit/UserMgr.h +++ b/src/kernel/KernelKit/UserMgr.h @@ -34,7 +34,7 @@ namespace Kernel { class User; -enum class UserRingKind : Int32 { +enum struct UserRingKind : Int32 { kRingInvalid = 0, kRingStdUser = 444, kRingSuperUser = 666, diff --git a/src/kernel/NeKit/Config.h b/src/kernel/NeKit/Config.h index 071018eb..f8414069 100644 --- a/src/kernel/NeKit/Config.h +++ b/src/kernel/NeKit/Config.h @@ -79,7 +79,7 @@ using Lba = UInt64; using Char16 = char16_t; -enum class Endian : UInt8 { kEndianInvalid, kEndianBig, kEndianLittle, kEndianMixed, kEndianCount }; +enum struct Endian : UInt8 { kEndianInvalid, kEndianBig, kEndianLittle, kEndianMixed, kEndianCount }; /// @brief Forward object. /// @tparam Args the object type. diff --git a/src/kernel/NeKit/Variant.h b/src/kernel/NeKit/Variant.h index a7257805..bf2b53c4 100644 --- a/src/kernel/NeKit/Variant.h +++ b/src/kernel/NeKit/Variant.h @@ -15,7 +15,7 @@ namespace Kernel { class Variant final { public: - enum class VariantKind { + enum struct VariantKind { kInvalid = 0, kString = 200, kBlob, -- cgit v1.2.3