From c94c15d45cbcca4e753c94665d698bb09d96313c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 7 Aug 2021 21:34:11 +0200 Subject: [PATCH] Everywhere: Replace AK::Singleton => Singleton --- AK/FlyString.cpp | 2 +- Kernel/ConsoleDevice.cpp | 2 +- Kernel/Devices/Device.cpp | 2 +- Kernel/Devices/HID/HIDManagement.cpp | 2 +- Kernel/Devices/NullDevice.cpp | 2 +- Kernel/Devices/SB16.cpp | 2 +- Kernel/Devices/VMWareBackdoor.cpp | 2 +- Kernel/FileSystem/DevPtsFS.cpp | 2 +- Kernel/FileSystem/FIFO.cpp | 2 +- Kernel/FileSystem/FileSystem.cpp | 2 +- Kernel/FileSystem/Inode.cpp | 2 +- Kernel/FileSystem/ProcFS.cpp | 2 +- Kernel/FileSystem/SysFS.cpp | 2 +- Kernel/FileSystem/VirtualFileSystem.cpp | 2 +- Kernel/Graphics/GraphicsManagement.cpp | 2 +- Kernel/Interrupts/APIC.cpp | 2 +- Kernel/Memory/MemoryManager.cpp | 4 ++-- Kernel/Memory/PageDirectory.cpp | 2 +- Kernel/Net/IPv4Socket.cpp | 2 +- Kernel/Net/LocalSocket.cpp | 2 +- Kernel/Net/NetworkingManagement.cpp | 2 +- Kernel/Net/Routing.cpp | 4 ++-- Kernel/Net/TCPSocket.cpp | 6 +++--- Kernel/Net/UDPSocket.cpp | 2 +- Kernel/Process.cpp | 4 ++-- Kernel/ProcessGroup.cpp | 2 +- Kernel/Random.cpp | 2 +- Kernel/Syscalls/futex.cpp | 2 +- Kernel/TTY/ConsoleManagement.cpp | 2 +- Kernel/TTY/PTYMultiplexer.cpp | 2 +- Kernel/Time/TimeManagement.cpp | 2 +- Kernel/TimerQueue.cpp | 2 +- Userland/Libraries/LibCore/EventLoop.cpp | 2 +- Userland/Libraries/LibTLS/Certificate.h | 2 +- Userland/Libraries/LibTLS/TLSv12.cpp | 2 +- 35 files changed, 40 insertions(+), 40 deletions(-) diff --git a/AK/FlyString.cpp b/AK/FlyString.cpp index aa6a3e79ca..ecf3a31df8 100644 --- a/AK/FlyString.cpp +++ b/AK/FlyString.cpp @@ -24,7 +24,7 @@ struct FlyStringImplTraits : public Traits { } }; -static AK::Singleton> s_table; +static Singleton> s_table; static HashTable& fly_impls() { diff --git a/Kernel/ConsoleDevice.cpp b/Kernel/ConsoleDevice.cpp index f1454008f2..6ff530e2a8 100644 --- a/Kernel/ConsoleDevice.cpp +++ b/Kernel/ConsoleDevice.cpp @@ -14,7 +14,7 @@ // Output bytes to kernel debug port 0xE9 (Bochs console). It's very handy. #define CONSOLE_OUT_TO_BOCHS_DEBUG_PORT -static AK::Singleton s_the; +static Singleton s_the; static Kernel::SpinLock g_console_lock; UNMAP_AFTER_INIT void ConsoleDevice::initialize() diff --git a/Kernel/Devices/Device.cpp b/Kernel/Devices/Device.cpp index 4d04e8e111..55136ea5d5 100644 --- a/Kernel/Devices/Device.cpp +++ b/Kernel/Devices/Device.cpp @@ -10,7 +10,7 @@ namespace Kernel { -static AK::Singleton> s_all_devices; +static Singleton> s_all_devices; HashMap& Device::all_devices() { diff --git a/Kernel/Devices/HID/HIDManagement.cpp b/Kernel/Devices/HID/HIDManagement.cpp index 67c2073007..3461e3f7d6 100644 --- a/Kernel/Devices/HID/HIDManagement.cpp +++ b/Kernel/Devices/HID/HIDManagement.cpp @@ -14,7 +14,7 @@ namespace Kernel { Atomic g_caps_lock_remapped_to_ctrl; -static AK::Singleton s_the; +static Singleton s_the; // clang-format off static constexpr Keyboard::CharacterMapData DEFAULT_CHARACTER_MAP = diff --git a/Kernel/Devices/NullDevice.cpp b/Kernel/Devices/NullDevice.cpp index d0b915c2a5..f7093c4bb8 100644 --- a/Kernel/Devices/NullDevice.cpp +++ b/Kernel/Devices/NullDevice.cpp @@ -10,7 +10,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; UNMAP_AFTER_INIT void NullDevice::initialize() { diff --git a/Kernel/Devices/SB16.cpp b/Kernel/Devices/SB16.cpp index c390c19082..f3b7955dcd 100644 --- a/Kernel/Devices/SB16.cpp +++ b/Kernel/Devices/SB16.cpp @@ -58,7 +58,7 @@ void SB16::set_sample_rate(uint16_t hz) dsp_write((u8)hz); } -static AK::Singleton s_the; +static Singleton s_the; UNMAP_AFTER_INIT SB16::SB16() : IRQHandler(SB16_DEFAULT_IRQ) diff --git a/Kernel/Devices/VMWareBackdoor.cpp b/Kernel/Devices/VMWareBackdoor.cpp index 17e61bed08..f4b31cb516 100644 --- a/Kernel/Devices/VMWareBackdoor.cpp +++ b/Kernel/Devices/VMWareBackdoor.cpp @@ -86,7 +86,7 @@ private: OwnPtr m_backdoor; }; -static AK::Singleton s_vmware_backdoor; +static Singleton s_vmware_backdoor; VMWareBackdoor* VMWareBackdoor::the() { diff --git a/Kernel/FileSystem/DevPtsFS.cpp b/Kernel/FileSystem/DevPtsFS.cpp index 45ae20fcb4..80fc243211 100644 --- a/Kernel/FileSystem/DevPtsFS.cpp +++ b/Kernel/FileSystem/DevPtsFS.cpp @@ -25,7 +25,7 @@ DevPtsFS::~DevPtsFS() { } -static AK::Singleton> s_ptys; +static Singleton> s_ptys; bool DevPtsFS::initialize() { diff --git a/Kernel/FileSystem/FIFO.cpp b/Kernel/FileSystem/FIFO.cpp index ed1daea882..95da205a4e 100644 --- a/Kernel/FileSystem/FIFO.cpp +++ b/Kernel/FileSystem/FIFO.cpp @@ -17,7 +17,7 @@ namespace Kernel { -static AK::Singleton>> s_table; +static Singleton>> s_table; static ProtectedValue>& all_fifos() { diff --git a/Kernel/FileSystem/FileSystem.cpp b/Kernel/FileSystem/FileSystem.cpp index 74cb86acce..75247ef647 100644 --- a/Kernel/FileSystem/FileSystem.cpp +++ b/Kernel/FileSystem/FileSystem.cpp @@ -16,7 +16,7 @@ namespace Kernel { static u32 s_lastFileSystemID; -static AK::Singleton> s_file_system_map; +static Singleton> s_file_system_map; static HashMap& all_file_systems() { diff --git a/Kernel/FileSystem/Inode.cpp b/Kernel/FileSystem/Inode.cpp index 9db65ef1dd..2b0943a238 100644 --- a/Kernel/FileSystem/Inode.cpp +++ b/Kernel/FileSystem/Inode.cpp @@ -23,7 +23,7 @@ namespace Kernel { static SpinLock s_all_inodes_lock; -static AK::Singleton s_list; +static Singleton s_list; static Inode::List& all_with_lock() { diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index 7edb447407..bda413bdf7 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -18,7 +18,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; ProcFSComponentRegistry& ProcFSComponentRegistry::the() { diff --git a/Kernel/FileSystem/SysFS.cpp b/Kernel/FileSystem/SysFS.cpp index af0328b967..677ba4baee 100644 --- a/Kernel/FileSystem/SysFS.cpp +++ b/Kernel/FileSystem/SysFS.cpp @@ -11,7 +11,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; SysFSComponentRegistry& SysFSComponentRegistry::the() { diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index f2f69b0b1d..6e2d1acaf4 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -21,7 +21,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; static constexpr int symlink_recursion_limit { 5 }; // FIXME: increase? static constexpr int root_mount_flags = MS_NODEV | MS_NOSUID | MS_RDONLY; diff --git a/Kernel/Graphics/GraphicsManagement.cpp b/Kernel/Graphics/GraphicsManagement.cpp index 5e5fd7df9d..4981641920 100644 --- a/Kernel/Graphics/GraphicsManagement.cpp +++ b/Kernel/Graphics/GraphicsManagement.cpp @@ -19,7 +19,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; GraphicsManagement& GraphicsManagement::the() { diff --git a/Kernel/Interrupts/APIC.cpp b/Kernel/Interrupts/APIC.cpp index b34f9b86f0..9d21d5daa7 100644 --- a/Kernel/Interrupts/APIC.cpp +++ b/Kernel/Interrupts/APIC.cpp @@ -54,7 +54,7 @@ namespace Kernel { -static AK::Singleton s_apic; +static Singleton s_apic; class APICIPIInterruptHandler final : public GenericInterruptHandler { public: diff --git a/Kernel/Memory/MemoryManager.cpp b/Kernel/Memory/MemoryManager.cpp index fd60716e36..507ec3b00f 100644 --- a/Kernel/Memory/MemoryManager.cpp +++ b/Kernel/Memory/MemoryManager.cpp @@ -42,9 +42,9 @@ __attribute__((section(".super_pages"))) static u8 super_pages[1 * MiB]; namespace Kernel::Memory { -// NOTE: We can NOT use AK::Singleton for this class, because +// NOTE: We can NOT use Singleton for this class, because // MemoryManager::initialize is called *before* global constructors are -// run. If we do, then AK::Singleton would get re-initialized, causing +// run. If we do, then Singleton would get re-initialized, causing // the memory manager to be initialized twice! static MemoryManager* s_the; RecursiveSpinLock s_mm_lock; diff --git a/Kernel/Memory/PageDirectory.cpp b/Kernel/Memory/PageDirectory.cpp index 4d8cf94e88..138e0faa72 100644 --- a/Kernel/Memory/PageDirectory.cpp +++ b/Kernel/Memory/PageDirectory.cpp @@ -17,7 +17,7 @@ extern u8 end_of_kernel_image[]; namespace Kernel::Memory { -static AK::Singleton> s_cr3_map; +static Singleton> s_cr3_map; static HashMap& cr3_map() { diff --git a/Kernel/Net/IPv4Socket.cpp b/Kernel/Net/IPv4Socket.cpp index d22ef9992d..4ccabe7022 100644 --- a/Kernel/Net/IPv4Socket.cpp +++ b/Kernel/Net/IPv4Socket.cpp @@ -26,7 +26,7 @@ namespace Kernel { -static AK::Singleton>> s_table; +static Singleton>> s_table; using BlockFlags = Thread::FileDescriptionBlocker::BlockFlags; diff --git a/Kernel/Net/LocalSocket.cpp b/Kernel/Net/LocalSocket.cpp index 0656952ff2..5e8dc330f5 100644 --- a/Kernel/Net/LocalSocket.cpp +++ b/Kernel/Net/LocalSocket.cpp @@ -19,7 +19,7 @@ namespace Kernel { -static AK::Singleton> s_list; +static Singleton> s_list; static ProtectedValue& all_sockets() { diff --git a/Kernel/Net/NetworkingManagement.cpp b/Kernel/Net/NetworkingManagement.cpp index a01be93f82..e1aada237e 100644 --- a/Kernel/Net/NetworkingManagement.cpp +++ b/Kernel/Net/NetworkingManagement.cpp @@ -20,7 +20,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; NetworkingManagement& NetworkingManagement::the() { diff --git a/Kernel/Net/Routing.cpp b/Kernel/Net/Routing.cpp index 47793f528c..e9f5e5111f 100644 --- a/Kernel/Net/Routing.cpp +++ b/Kernel/Net/Routing.cpp @@ -16,7 +16,7 @@ namespace Kernel { -static AK::Singleton>> s_arp_table; +static Singleton>> s_arp_table; class ARPTableBlocker : public Thread::Blocker { public: @@ -80,7 +80,7 @@ protected: } }; -static AK::Singleton s_arp_table_block_condition; +static Singleton s_arp_table_block_condition; ARPTableBlocker::ARPTableBlocker(IPv4Address ip_addr, Optional& addr) : m_ip_addr(ip_addr) diff --git a/Kernel/Net/TCPSocket.cpp b/Kernel/Net/TCPSocket.cpp index c9af9da414..c03e631509 100644 --- a/Kernel/Net/TCPSocket.cpp +++ b/Kernel/Net/TCPSocket.cpp @@ -54,14 +54,14 @@ void TCPSocket::set_state(State new_state) evaluate_block_conditions(); } -static AK::Singleton>>> s_socket_closing; +static Singleton>>> s_socket_closing; ProtectedValue>>& TCPSocket::closing_sockets() { return *s_socket_closing; } -static AK::Singleton>> s_socket_tuples; +static Singleton>> s_socket_tuples; ProtectedValue>& TCPSocket::sockets_by_tuple() { @@ -512,7 +512,7 @@ KResult TCPSocket::close() return result; } -static AK::Singleton>> s_sockets_for_retransmit; +static Singleton>> s_sockets_for_retransmit; ProtectedValue>& TCPSocket::sockets_for_retransmit() { diff --git a/Kernel/Net/UDPSocket.cpp b/Kernel/Net/UDPSocket.cpp index ef5783137f..fc6217ebf2 100644 --- a/Kernel/Net/UDPSocket.cpp +++ b/Kernel/Net/UDPSocket.cpp @@ -22,7 +22,7 @@ void UDPSocket::for_each(Function callback) }); } -static AK::Singleton>> s_map; +static Singleton>> s_map; ProtectedValue>& UDPSocket::sockets_by_port() { diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 06c9d3475b..33a24a5abc 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -45,11 +45,11 @@ static void create_signal_trampoline(); RecursiveSpinLock g_profiling_lock; static Atomic next_pid; -static AK::Singleton> s_processes; +static Singleton> s_processes; READONLY_AFTER_INIT HashMap>* g_modules; READONLY_AFTER_INIT Memory::Region* g_signal_trampoline_region; -static AK::Singleton> s_hostname; +static Singleton> s_hostname; ProtectedValue& hostname() { diff --git a/Kernel/ProcessGroup.cpp b/Kernel/ProcessGroup.cpp index 8de61719a0..0f90ffd4c0 100644 --- a/Kernel/ProcessGroup.cpp +++ b/Kernel/ProcessGroup.cpp @@ -10,7 +10,7 @@ namespace Kernel { -static AK::Singleton> s_process_groups; +static Singleton> s_process_groups; SpinLockProtectedValue& process_groups() { diff --git a/Kernel/Random.cpp b/Kernel/Random.cpp index 4323f55af3..71955912e1 100644 --- a/Kernel/Random.cpp +++ b/Kernel/Random.cpp @@ -16,7 +16,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; static Atomic s_next_random_value = 1; KernelRng& KernelRng::the() diff --git a/Kernel/Syscalls/futex.cpp b/Kernel/Syscalls/futex.cpp index 5ca6d4b42a..808599477d 100644 --- a/Kernel/Syscalls/futex.cpp +++ b/Kernel/Syscalls/futex.cpp @@ -12,7 +12,7 @@ namespace Kernel { static SpinLock g_global_futex_lock; -static AK::Singleton> g_global_futex_queues; +static Singleton> g_global_futex_queues; FutexQueue::FutexQueue(FlatPtr user_address_or_offset, Memory::VMObject* vmobject) : m_user_address_or_offset(user_address_or_offset) diff --git a/Kernel/TTY/ConsoleManagement.cpp b/Kernel/TTY/ConsoleManagement.cpp index 01dbb46aa5..9315607000 100644 --- a/Kernel/TTY/ConsoleManagement.cpp +++ b/Kernel/TTY/ConsoleManagement.cpp @@ -14,7 +14,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; void ConsoleManagement::resolution_was_changed() { diff --git a/Kernel/TTY/PTYMultiplexer.cpp b/Kernel/TTY/PTYMultiplexer.cpp index 4dce9e9764..d786d74462 100644 --- a/Kernel/TTY/PTYMultiplexer.cpp +++ b/Kernel/TTY/PTYMultiplexer.cpp @@ -14,7 +14,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; PTYMultiplexer& PTYMultiplexer::the() { diff --git a/Kernel/Time/TimeManagement.cpp b/Kernel/Time/TimeManagement.cpp index d0ca68a76e..b7a56a6f8e 100644 --- a/Kernel/Time/TimeManagement.cpp +++ b/Kernel/Time/TimeManagement.cpp @@ -25,7 +25,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; TimeManagement& TimeManagement::the() { diff --git a/Kernel/TimerQueue.cpp b/Kernel/TimerQueue.cpp index 9f3214bf68..ffa04fa481 100644 --- a/Kernel/TimerQueue.cpp +++ b/Kernel/TimerQueue.cpp @@ -13,7 +13,7 @@ namespace Kernel { -static AK::Singleton s_the; +static Singleton s_the; static SpinLock g_timerqueue_lock; Time Timer::remaining() const diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index 886f5c8ab2..ed7611dd65 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -109,7 +109,7 @@ struct SignalHandlersInfo { int next_signal_id { 0 }; }; -static AK::Singleton s_signals; +static Singleton s_signals; template inline SignalHandlersInfo* signals_info() { diff --git a/Userland/Libraries/LibTLS/Certificate.h b/Userland/Libraries/LibTLS/Certificate.h index 2810b3ac4f..e1694c72a3 100644 --- a/Userland/Libraries/LibTLS/Certificate.h +++ b/Userland/Libraries/LibTLS/Certificate.h @@ -67,7 +67,7 @@ public: static DefaultRootCACertificates& the() { return s_the; } private: - static AK::Singleton s_the; + static Singleton s_the; Vector m_ca_certificates; }; diff --git a/Userland/Libraries/LibTLS/TLSv12.cpp b/Userland/Libraries/LibTLS/TLSv12.cpp index eb28a890d4..ff372f308f 100644 --- a/Userland/Libraries/LibTLS/TLSv12.cpp +++ b/Userland/Libraries/LibTLS/TLSv12.cpp @@ -344,7 +344,7 @@ bool TLSv12::add_client_key(ReadonlyBytes certificate_pem_buffer, ReadonlyBytes return add_client_key(certificate); } -AK::Singleton DefaultRootCACertificates::s_the; +Singleton DefaultRootCACertificates::s_the; DefaultRootCACertificates::DefaultRootCACertificates() { // FIXME: This might not be the best format, find a better way to represent CA certificates.