From 5a0cdb15b07ef87cbab6203fad8c0dcea3634f67 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Thu, 9 Sep 2021 16:30:59 +0430 Subject: AK+Everywhere: Reduce the number of template parameters of IntrusiveList This makes the user-facing type only take the node member pointer, and lets the compiler figure out the other needed types from that. --- Userland/Libraries/LibC/mallocdefs.h | 2 +- Userland/Libraries/LibCore/Object.cpp | 4 ++-- Userland/Libraries/LibCore/Object.h | 2 +- Userland/Libraries/LibGUI/MouseTracker.h | 2 +- Userland/Libraries/LibJS/Heap/CellAllocator.h | 2 +- Userland/Libraries/LibJS/Heap/Handle.h | 2 +- Userland/Libraries/LibJS/Runtime/MarkedValueList.h | 2 +- Userland/Libraries/LibJS/Runtime/WeakContainer.h | 2 +- Userland/Services/WindowServer/Compositor.h | 2 +- Userland/Services/WindowServer/Window.h | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibC/mallocdefs.h b/Userland/Libraries/LibC/mallocdefs.h index a4aad0e132..da4c8c61a5 100644 --- a/Userland/Libraries/LibC/mallocdefs.h +++ b/Userland/Libraries/LibC/mallocdefs.h @@ -75,5 +75,5 @@ struct ChunkedBlock : public CommonHeader { size_t used_chunks() const { return chunk_capacity() - m_free_chunks; } size_t chunk_capacity() const { return (block_size - sizeof(ChunkedBlock)) / m_size; } - using List = IntrusiveList, &ChunkedBlock::m_list_node>; + using List = IntrusiveList<&ChunkedBlock::m_list_node>; }; diff --git a/Userland/Libraries/LibCore/Object.cpp b/Userland/Libraries/LibCore/Object.cpp index 088c465515..8df07836c0 100644 --- a/Userland/Libraries/LibCore/Object.cpp +++ b/Userland/Libraries/LibCore/Object.cpp @@ -14,9 +14,9 @@ namespace Core { -IntrusiveList, &Object::m_all_objects_list_node>& Object::all_objects() +IntrusiveList<&Object::m_all_objects_list_node>& Object::all_objects() { - static IntrusiveList, &Object::m_all_objects_list_node> objects; + static IntrusiveList<&Object::m_all_objects_list_node> objects; return objects; } diff --git a/Userland/Libraries/LibCore/Object.h b/Userland/Libraries/LibCore/Object.h index 01b12e509b..6fbbf1918d 100644 --- a/Userland/Libraries/LibCore/Object.h +++ b/Userland/Libraries/LibCore/Object.h @@ -137,7 +137,7 @@ public: JsonValue property(String const& name) const; const HashMap>& properties() const { return m_properties; } - static IntrusiveList, &Object::m_all_objects_list_node>& all_objects(); + static IntrusiveList<&Object::m_all_objects_list_node>& all_objects(); void dispatch_event(Core::Event&, Object* stay_within = nullptr); diff --git a/Userland/Libraries/LibGUI/MouseTracker.h b/Userland/Libraries/LibGUI/MouseTracker.h index 0897106248..f22e60f1f9 100644 --- a/Userland/Libraries/LibGUI/MouseTracker.h +++ b/Userland/Libraries/LibGUI/MouseTracker.h @@ -26,7 +26,7 @@ protected: private: IntrusiveListNode m_list_node; - using List = IntrusiveList, &MouseTracker::m_list_node>; + using List = IntrusiveList<&MouseTracker::m_list_node>; static List s_trackers; }; diff --git a/Userland/Libraries/LibJS/Heap/CellAllocator.h b/Userland/Libraries/LibJS/Heap/CellAllocator.h index 9ce1488601..43edfe69ff 100644 --- a/Userland/Libraries/LibJS/Heap/CellAllocator.h +++ b/Userland/Libraries/LibJS/Heap/CellAllocator.h @@ -43,7 +43,7 @@ public: private: const size_t m_cell_size; - using BlockList = IntrusiveList, &HeapBlock::m_list_node>; + using BlockList = IntrusiveList<&HeapBlock::m_list_node>; BlockList m_full_blocks; BlockList m_usable_blocks; }; diff --git a/Userland/Libraries/LibJS/Heap/Handle.h b/Userland/Libraries/LibJS/Heap/Handle.h index b9eab8a225..07d01941ab 100644 --- a/Userland/Libraries/LibJS/Heap/Handle.h +++ b/Userland/Libraries/LibJS/Heap/Handle.h @@ -35,7 +35,7 @@ private: IntrusiveListNode m_list_node; public: - using List = IntrusiveList, &HandleImpl::m_list_node>; + using List = IntrusiveList<&HandleImpl::m_list_node>; }; template diff --git a/Userland/Libraries/LibJS/Runtime/MarkedValueList.h b/Userland/Libraries/LibJS/Runtime/MarkedValueList.h index 86419255b1..a3ec8bf9db 100644 --- a/Userland/Libraries/LibJS/Runtime/MarkedValueList.h +++ b/Userland/Libraries/LibJS/Runtime/MarkedValueList.h @@ -39,7 +39,7 @@ private: IntrusiveListNode m_list_node; public: - using List = IntrusiveList, &MarkedValueList::m_list_node>; + using List = IntrusiveList<&MarkedValueList::m_list_node>; }; } diff --git a/Userland/Libraries/LibJS/Runtime/WeakContainer.h b/Userland/Libraries/LibJS/Runtime/WeakContainer.h index 4ac251279f..8e469fb9ed 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakContainer.h +++ b/Userland/Libraries/LibJS/Runtime/WeakContainer.h @@ -27,7 +27,7 @@ private: IntrusiveListNode m_list_node; public: - using List = IntrusiveList, &WeakContainer::m_list_node>; + using List = IntrusiveList<&WeakContainer::m_list_node>; }; } diff --git a/Userland/Services/WindowServer/Compositor.h b/Userland/Services/WindowServer/Compositor.h index 4d7f9a4d7f..bb11f73056 100644 --- a/Userland/Services/WindowServer/Compositor.h +++ b/Userland/Services/WindowServer/Compositor.h @@ -220,7 +220,7 @@ private: bool m_invalidated_cursor { false }; bool m_overlay_rects_changed { false }; - IntrusiveList, &Overlay::m_list_node> m_overlay_list; + IntrusiveList<&Overlay::m_list_node> m_overlay_list; Gfx::DisjointRectSet m_overlay_rects; Gfx::DisjointRectSet m_dirty_screen_rects; Gfx::DisjointRectSet m_opaque_wallpaper_rects; diff --git a/Userland/Services/WindowServer/Window.h b/Userland/Services/WindowServer/Window.h index 4d5c7771be..edf8669095 100644 --- a/Userland/Services/WindowServer/Window.h +++ b/Userland/Services/WindowServer/Window.h @@ -469,7 +469,7 @@ private: RefPtr m_animation; public: - using List = IntrusiveList, &Window::m_list_node>; + using List = IntrusiveList<&Window::m_list_node>; }; } -- cgit v1.2.3