diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index e3291a465bc203..9a1b266f7803be 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -24,18 +24,36 @@ runs: set -e wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' + sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main' sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install ccache clang-18 clang++-18 clang-format-18 lld-18 gcc-13 g++-13 libstdc++-13-dev ninja-build unzip qt6-base-dev qt6-tools-dev-tools libqt6svg6-dev qt6-multimedia-dev libgl1-mesa-dev libpulse-dev libssl-dev libegl1-mesa-dev libclang-18-dev - sudo apt-get remove clang-{13,14,15} clang++-{13,14,15} libclang-{13,14,15}-dev llvm-{13,14,15} - sudo apt-get install clang-18 clang++-18 llvm-18 llvm-18-dev + sudo apt-get install ccache \ + clang++-19 \ + clang-19 \ + clang-format-19 \ + g++-13 \ + gcc-13 \ + libclang-19-dev \ + libegl1-mesa-dev \ + libgl1-mesa-dev \ + libpulse-dev \ + libqt6svg6-dev \ + libssl-dev \ + libstdc++-13-dev \ + lld-19 \ + llvm-19 \ + llvm-19-dev \ + ninja-build \ + qt6-base-dev \ + qt6-multimedia-dev \ + qt6-tools-dev-tools \ + unzip - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100 + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100 @@ -63,14 +81,31 @@ runs: set -e wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' + sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main' sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get remove clang-{13,14,15} clang++-{13,14,15} libclang-{13,14,15}-dev llvm-{13,14,15} - sudo apt-get install clang-format-18 ccache e2fsprogs gcc-13 g++-13 libstdc++-13-dev libmpfr-dev libmpc-dev ninja-build optipng qemu-utils qemu-system-i386 unzip generate-ninja libegl1-mesa-dev - sudo apt-get install clang-18 clang++-18 llvm-18 llvm-18-dev + sudo apt-get install ccache \ + clang++-19 \ + clang-19 \ + clang-format-19 \ + e2fsprogs \ + g++-13 \ + gcc-13 \ + generate-ninja \ + libegl1-mesa-dev \ + libmpc-dev \ + libmpfr-dev \ + libstdc++-13-dev \ + llvm-19 \ + llvm-19-dev \ + ninja-build \ + optipng \ + qemu-system-i386 \ + qemu-utils \ + unzip - name: Enable KVM group perms if: ${{ inputs.os == 'Serenity' }} @@ -86,4 +121,4 @@ runs: run: | set -e brew update - brew install coreutils bash ninja wabt ccache unzip qt llvm@18 + brew install coreutils bash ninja wabt ccache unzip qt llvm@19 diff --git a/.github/workflows/lagom-template.yml b/.github/workflows/lagom-template.yml index 4fe346d5818399..a09c2484ebf392 100644 --- a/.github/workflows/lagom-template.yml +++ b/.github/workflows/lagom-template.yml @@ -63,15 +63,15 @@ jobs: run: | if ${{ inputs.os_name == 'Linux' }} ; then if ${{ inputs.toolchain == 'Clang' }} ; then - echo "host_cc=clang-18" >> "$GITHUB_OUTPUT" - echo "host_cxx=clang++-18" >> "$GITHUB_OUTPUT" + echo "host_cc=clang-19" >> "$GITHUB_OUTPUT" + echo "host_cxx=clang++-19" >> "$GITHUB_OUTPUT" elif ${{ inputs.toolchain == 'GNU' }} ; then echo "host_cc=gcc-13" >> "$GITHUB_OUTPUT" echo "host_cxx=g++-13" >> "$GITHUB_OUTPUT" fi elif ${{ inputs.os_name == 'macOS' }} ; then - echo "host_cc=$(brew --prefix llvm@18)/bin/clang" >> "$GITHUB_OUTPUT" - echo "host_cxx=$(brew --prefix llvm@18)/bin/clang++" >> "$GITHUB_OUTPUT" + echo "host_cc=$(brew --prefix llvm@19)/bin/clang" >> "$GITHUB_OUTPUT" + echo "host_cxx=$(brew --prefix llvm@19)/bin/clang++" >> "$GITHUB_OUTPUT" fi # https://github.com/actions/runner-images/issues/9330 diff --git a/AK/DistinctNumeric.h b/AK/DistinctNumeric.h index 17b794e774e33c..540a1f6b5e461b 100644 --- a/AK/DistinctNumeric.h +++ b/AK/DistinctNumeric.h @@ -46,13 +46,13 @@ namespace AK { */ namespace DistinctNumericFeature { -enum Arithmetic {}; -enum CastToBool {}; -enum CastToUnderlying {}; -enum Comparison {}; -enum Flags {}; -enum Increment {}; -enum Shift {}; +enum Arithmetic { }; +enum CastToBool { }; +enum CastToUnderlying { }; +enum Comparison { }; +enum Flags { }; +enum Increment { }; +enum Shift { }; }; template diff --git a/AK/IntrusiveList.h b/AK/IntrusiveList.h index b671a7a11c046a..be4ba4045341fc 100644 --- a/AK/IntrusiveList.h +++ b/AK/IntrusiveList.h @@ -24,9 +24,9 @@ class IntrusiveListNode; struct ExtractIntrusiveListTypes { template - static V value(IntrusiveListNode T::*x); + static V value(IntrusiveListNode T::* x); template - static Container container(IntrusiveListNode T::*x); + static Container container(IntrusiveListNode T::* x); }; template> @@ -37,14 +37,14 @@ class IntrusiveListStorage { private: friend class IntrusiveListNode; - template T_::*member> + template T_::* member> friend class IntrusiveList; SubstitutedIntrusiveListNode* m_first { nullptr }; SubstitutedIntrusiveListNode* m_last { nullptr }; }; -template T::*member> +template T::* member> class IntrusiveList { AK_MAKE_NONCOPYABLE(IntrusiveList); AK_MAKE_NONMOVABLE(IntrusiveList); @@ -166,7 +166,7 @@ class IntrusiveListNode { // to be of equal types. so for now, just make the members public on clang. #if !defined(AK_COMPILER_CLANG) private: - template T_::*member> + template T_::* member> friend class ::AK::Detail::IntrusiveList; #endif @@ -176,7 +176,7 @@ class IntrusiveListNode { [[no_unique_address]] SelfReferenceIfNeeded m_self; }; -template T::*member> +template T::* member> inline typename IntrusiveList::Iterator& IntrusiveList::Iterator::erase() { auto old = m_value; @@ -185,26 +185,26 @@ inline typename IntrusiveList::Iterator& IntrusiveList T::*member> +template T::* member> inline IntrusiveList::~IntrusiveList() { clear(); } -template T::*member> +template T::* member> inline void IntrusiveList::clear() { while (m_storage.m_first) m_storage.m_first->remove(); } -template T::*member> +template T::* member> inline bool IntrusiveList::is_empty() const { return m_storage.m_first == nullptr; } -template T::*member> +template T::* member> inline size_t IntrusiveList::size_slow() const { size_t size = 0; @@ -215,7 +215,7 @@ inline size_t IntrusiveList::size_slow() const return size; } -template T::*member> +template T::* member> inline void IntrusiveList::append(T& n) { remove(n); @@ -234,7 +234,7 @@ inline void IntrusiveList::append(T& n) m_storage.m_first = &nnode; } -template T::*member> +template T::* member> inline void IntrusiveList::prepend(T& n) { remove(n); @@ -253,7 +253,7 @@ inline void IntrusiveList::prepend(T& n) m_storage.m_last = &nnode; } -template T::*member> +template T::* member> inline void IntrusiveList::insert_before(T& bn, T& n) { remove(n); @@ -275,7 +275,7 @@ inline void IntrusiveList::insert_before(T& bn, T& n) new_node.m_self.reference = &n; } -template T::*member> +template T::* member> inline void IntrusiveList::remove(T& n) { auto& nnode = n.*member; @@ -283,20 +283,20 @@ inline void IntrusiveList::remove(T& n) nnode.remove(); } -template T::*member> +template T::* member> inline bool IntrusiveList::contains(T const& n) const { auto& nnode = n.*member; return nnode.m_storage == &m_storage; } -template T::*member> +template T::* member> inline Container IntrusiveList::first() const { return m_storage.m_first ? node_to_value(*m_storage.m_first) : nullptr; } -template T::*member> +template T::* member> inline Container IntrusiveList::take_first() { if (Container ptr = first()) { @@ -306,7 +306,7 @@ inline Container IntrusiveList::take_first() return nullptr; } -template T::*member> +template T::* member> inline Container IntrusiveList::take_last() { if (Container ptr = last()) { @@ -316,13 +316,13 @@ inline Container IntrusiveList::take_last() return nullptr; } -template T::*member> +template T::* member> inline Container IntrusiveList::last() const { return m_storage.m_last ? node_to_value(*m_storage.m_last) : nullptr; } -template T::*member> +template T::* member> inline T const* IntrusiveList::next(T const* current) { auto& nextnode = (current->*member).m_next; @@ -330,7 +330,7 @@ inline T const* IntrusiveList::next(T const* current) return nextstruct; } -template T::*member> +template T::* member> inline T const* IntrusiveList::prev(T const* current) { auto& prevnode = (current->*member).m_prev; @@ -338,7 +338,7 @@ inline T const* IntrusiveList::prev(T const* current) return prevstruct; } -template T::*member> +template T::* member> inline T* IntrusiveList::next(T* current) { auto& nextnode = (current->*member).m_next; @@ -346,7 +346,7 @@ inline T* IntrusiveList::next(T* current) return nextstruct; } -template T::*member> +template T::* member> inline T* IntrusiveList::prev(T* current) { auto& prevnode = (current->*member).m_prev; @@ -354,25 +354,25 @@ inline T* IntrusiveList::prev(T* current) return prevstruct; } -template T::*member> +template T::* member> inline typename IntrusiveList::Iterator IntrusiveList::begin() { return m_storage.m_first ? Iterator(node_to_value(*m_storage.m_first)) : Iterator(); } -template T::*member> +template T::* member> inline typename IntrusiveList::ReverseIterator IntrusiveList::rbegin() { return m_storage.m_last ? ReverseIterator(node_to_value(*m_storage.m_last)) : ReverseIterator(); } -template T::*member> +template T::* member> inline typename IntrusiveList::ConstIterator IntrusiveList::begin() const { return m_storage.m_first ? ConstIterator(node_to_value(*m_storage.m_first)) : ConstIterator(); } -template T::*member> +template T::* member> inline T* IntrusiveList::node_to_value(SubstitutedIntrusiveListNode& node) { // Note: A data member pointer is a 32-bit offset in the Windows ABI (both x86 and x86_64), @@ -426,7 +426,7 @@ inline bool IntrusiveListNode::is_in_list() const // By default, intrusive lists cannot contain null entries anyway, so switch to RefPtr // and just make the user-facing functions deref the pointers. -template> T::*member> +template> T::* member> class IntrusiveList, member> : public IntrusiveList, member> { public: [[nodiscard]] NonnullRefPtr first() const { return *IntrusiveList, member>::first(); } @@ -441,7 +441,7 @@ class IntrusiveList, member> : public IntrusiveList> T::*member> +template> T::* member> class IntrusiveList, member> : public IntrusiveList, member> { public: [[nodiscard]] NonnullLockRefPtr first() const { return *IntrusiveList, member>::first(); } diff --git a/AK/IntrusiveListRelaxedConst.h b/AK/IntrusiveListRelaxedConst.h index 7faef434e62b08..1fc5d5935141be 100644 --- a/AK/IntrusiveListRelaxedConst.h +++ b/AK/IntrusiveListRelaxedConst.h @@ -11,7 +11,7 @@ namespace AK { namespace Detail { -template T::*member> +template T::* member> class IntrusiveListRelaxedConst : public IntrusiveList { AK_MAKE_NONCOPYABLE(IntrusiveListRelaxedConst); AK_MAKE_NONMOVABLE(IntrusiveListRelaxedConst); diff --git a/AK/IntrusiveRedBlackTree.h b/AK/IntrusiveRedBlackTree.h index ae20c16f02ca52..fb2db6b92e1bef 100644 --- a/AK/IntrusiveRedBlackTree.h +++ b/AK/IntrusiveRedBlackTree.h @@ -16,17 +16,17 @@ class IntrusiveRedBlackTreeNode; struct ExtractIntrusiveRedBlackTreeTypes { template - static K key(IntrusiveRedBlackTreeNode T::*x); + static K key(IntrusiveRedBlackTreeNode T::* x); template - static V value(IntrusiveRedBlackTreeNode T::*x); + static V value(IntrusiveRedBlackTreeNode T::* x); template - static Container container(IntrusiveRedBlackTreeNode T::*x); + static Container container(IntrusiveRedBlackTreeNode T::* x); }; template> using SubstitutedIntrusiveRedBlackTreeNode = IntrusiveRedBlackTreeNode::Type>; -template V::*member> +template V::* member> class IntrusiveRedBlackTree : public BaseRedBlackTree { public: @@ -200,7 +200,7 @@ class IntrusiveRedBlackTreeNode : public BaseRedBlackTree::Node { #if !defined(AK_COMPILER_CLANG) private: - template TV::*member> + template TV::* member> friend class ::AK::Detail::IntrusiveRedBlackTree; #endif @@ -211,7 +211,7 @@ class IntrusiveRedBlackTreeNode : public BaseRedBlackTree::Node { // Specialise IntrusiveRedBlackTree for NonnullRefPtr // By default, red black trees cannot contain null entries anyway, so switch to RefPtr // and just make the user-facing functions deref the pointers. -template> V::*member> +template> V::* member> class IntrusiveRedBlackTree, member> : public IntrusiveRedBlackTree, member> { public: [[nodiscard]] NonnullRefPtr find(K key) const { return IntrusiveRedBlackTree, member>::find(key).release_nonnull(); } diff --git a/AK/Memory.h b/AK/Memory.h index 6b5bd69608fe82..57e1bf431f94ae 100644 --- a/AK/Memory.h +++ b/AK/Memory.h @@ -48,8 +48,7 @@ inline void secure_zero(void* ptr, size_t size) __builtin_memset(ptr, 0, size); // The memory barrier is here to avoid the compiler optimizing // away the memset when we rely on it for wiping secrets. - asm volatile("" :: - : "memory"); + asm volatile("" ::: "memory"); } // Naive implementation of a constant time buffer comparison function. diff --git a/AK/RedBlackTree.h b/AK/RedBlackTree.h index 54aea2c74df3a2..5a4d2c3d48419b 100644 --- a/AK/RedBlackTree.h +++ b/AK/RedBlackTree.h @@ -42,7 +42,7 @@ class BaseRedBlackTree { Node() { } - virtual ~Node() {}; + virtual ~Node() { } }; protected: diff --git a/AK/Result.h b/AK/Result.h index 9deaed962064b9..a7830b2e3ae13f 100644 --- a/AK/Result.h +++ b/AK/Result.h @@ -94,8 +94,8 @@ class [[nodiscard]] Result { ~Result() = default; // For compatibility with TRY(). - void value() {}; - void release_value() {}; + void value() { } + void release_value() { } ErrorType& error() { diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index 1757c9737918f3..80d39f91552e09 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -171,8 +171,7 @@ ALWAYS_INLINE constexpr void taint_for_optimizer(T& value) requires(IsIntegral) { if (!is_constant_evaluated()) { - asm volatile("" - : "+r"(value)); + asm volatile("" : "+r"(value)); } } @@ -182,9 +181,9 @@ requires(!IsIntegral) { if (!is_constant_evaluated()) { asm volatile("" - : - : "m"(value) - : "memory"); + : + : "m"(value) + : "memory"); } } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 52d128232326a7..f20a70a8493f2d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,7 @@ Nobody is perfect, and sometimes we mess things up. That said, here are some goo **Do:** - Write in idiomatic SerenityOS C++23, using the `AK` containers in all code. -- Conform to the project coding style found in [CodingStyle.md](https://github.com/SerenityOS/serenity/blob/master/Documentation/CodingStyle.md). Use `clang-format` (version 18 or later) to automatically format C++ files. See [AdvancedBuildInstructions.md](https://github.com/SerenityOS/serenity/blob/master/Documentation/AdvancedBuildInstructions.md#clang-format-updates) for instructions on how to get an up-to-date version if your OS distribution does not ship clang-format-18. +- Conform to the project coding style found in [CodingStyle.md](https://github.com/SerenityOS/serenity/blob/master/Documentation/CodingStyle.md). Use `clang-format` (version 19) to automatically format C++ files. See [AdvancedBuildInstructions.md](https://github.com/SerenityOS/serenity/blob/master/Documentation/AdvancedBuildInstructions.md#clang-format-updates) for instructions on how to get an up-to-date version if your OS distribution does not ship clang-format-19. - Choose expressive variable, function and class names. Make it as obvious as possible what the code is doing. - Split your changes into separate, atomic commits (i.e. A commit per feature or fix, where the build, tests and the system are all functioning). - Make sure your commits are rebased on the master branch. diff --git a/Documentation/CodingStyle.md b/Documentation/CodingStyle.md index 0de5532eaacaa0..66341bd7df833f 100644 --- a/Documentation/CodingStyle.md +++ b/Documentation/CodingStyle.md @@ -2,7 +2,7 @@ For low-level styling (spaces, parentheses, brace placement, etc), all code should follow the format specified in `.clang-format` in the project root. -**Important: Make sure you use `clang-format` version 18 or later!** +**Important: Make sure you use `clang-format` version 19!** This document describes the coding style used for C++ code in the Serenity Operating System project. All new code should conform to this style. diff --git a/Documentation/QtCreatorConfiguration.md b/Documentation/QtCreatorConfiguration.md index d5d0dd41ccaa9f..6b7175b7752a99 100644 --- a/Documentation/QtCreatorConfiguration.md +++ b/Documentation/QtCreatorConfiguration.md @@ -51,7 +51,7 @@ Qt Creator should be set up correctly now, go ahead and explore the project and ## Auto-Formatting -You can use `clang-format` to help you with the [style guide](CodingStyle.md). Before you proceed, check that you're actually using clang-format version 18, as some OSes will ship older clang-format versions by default. +You can use `clang-format` to help you with the [style guide](CodingStyle.md). Before you proceed, check that you're actually using clang-format version 19, as some OSes will ship older clang-format versions by default. - In QtCreator, go to "Help > About Plugins…" - Find the `Beautifier (experimental)` row (for example, by typing `beau` into the search) @@ -64,9 +64,6 @@ You can use `clang-format` to help you with the [style guide](CodingStyle.md). B - In the "Beautifier > General" tab, check "Enable auto format on file save" - Select the tool "ClangFormat" if not already selected, and click "OK" -Note that not the entire project is clang-format-clean (yet), so sometimes you will see large diffs. -Use your own judgement whether you want to include such changes. Generally speaking, if it's a few lines then it's a good idea; if it's the entire file then maybe there's a better way to do it, like doing a separate commit, or just ignoring the clang-format changes. - You may want to read up what `git add -p` does (or `git checkout -p`, to undo). QtCreator tends to interpret IPC definitions as C++ headers, and then tries to format them. This is not useful. One way to avoid that is telling QtCreator that IPC definitions are not C++ headers. diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h index 69e523b3ba1316..697c786c6bf505 100644 --- a/Kernel/API/Syscall.h +++ b/Kernel/API/Syscall.h @@ -570,25 +570,25 @@ inline uintptr_t invoke(Function function) # if ARCH(X86_64) uintptr_t result; asm volatile("syscall" - : "=a"(result) - : "a"(function) - : "rcx", "r11", "memory"); + : "=a"(result) + : "a"(function) + : "rcx", "r11", "memory"); # elif ARCH(AARCH64) uintptr_t result; register uintptr_t x0 asm("x0"); register uintptr_t x8 asm("x8") = function; asm volatile("svc #0" - : "=r"(x0) - : "r"(x8) - : "memory"); + : "=r"(x0) + : "r"(x8) + : "memory"); result = x0; # elif ARCH(RISCV64) register uintptr_t a7 asm("a7") = function; register uintptr_t result asm("a0"); asm volatile("ecall" - : "=r"(result) - : "r"(a7) - : "memory"); + : "=r"(result) + : "r"(a7) + : "memory"); # endif return result; } @@ -599,27 +599,27 @@ inline uintptr_t invoke(Function function, T1 arg1) # if ARCH(X86_64) uintptr_t result; asm volatile("syscall" - : "=a"(result) - : "a"(function), "d"((uintptr_t)arg1) - : "rcx", "r11", "memory"); + : "=a"(result) + : "a"(function), "d"((uintptr_t)arg1) + : "rcx", "r11", "memory"); # elif ARCH(AARCH64) uintptr_t result; register uintptr_t x0 asm("x0"); register uintptr_t x1 asm("x1") = arg1; register uintptr_t x8 asm("x8") = function; asm volatile("svc #0" - : "=r"(x0) - : "r"(x1), "r"(x8) - : "memory"); + : "=r"(x0) + : "r"(x1), "r"(x8) + : "memory"); result = x0; # elif ARCH(RISCV64) register uintptr_t a0 asm("a0") = arg1; register uintptr_t a7 asm("a7") = function; register uintptr_t result asm("a0"); asm volatile("ecall" - : "=r"(result) - : "0"(a0), "r"(a7) - : "memory"); + : "=r"(result) + : "0"(a0), "r"(a7) + : "memory"); # endif return result; } @@ -630,9 +630,9 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2) # if ARCH(X86_64) uintptr_t result; asm volatile("syscall" - : "=a"(result) - : "a"(function), "d"((uintptr_t)arg1), "D"((uintptr_t)arg2) - : "rcx", "r11", "memory"); + : "=a"(result) + : "a"(function), "d"((uintptr_t)arg1), "D"((uintptr_t)arg2) + : "rcx", "r11", "memory"); # elif ARCH(AARCH64) uintptr_t result; register uintptr_t x0 asm("x0"); @@ -640,9 +640,9 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2) register uintptr_t x2 asm("x2") = arg2; register uintptr_t x8 asm("x8") = function; asm volatile("svc #0" - : "=r"(x0) - : "r"(x1), "r"(x2), "r"(x8) - : "memory"); + : "=r"(x0) + : "r"(x1), "r"(x2), "r"(x8) + : "memory"); result = x0; # elif ARCH(RISCV64) register uintptr_t a0 asm("a0") = arg1; @@ -650,9 +650,9 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2) register uintptr_t a7 asm("a7") = function; register uintptr_t result asm("a0"); asm volatile("ecall" - : "=r"(result) - : "0"(a0), "r"(a1), "r"(a7) - : "memory"); + : "=r"(result) + : "0"(a0), "r"(a1), "r"(a7) + : "memory"); # endif return result; } @@ -663,9 +663,9 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2, T3 arg3) # if ARCH(X86_64) uintptr_t result; asm volatile("syscall" - : "=a"(result) - : "a"(function), "d"((uintptr_t)arg1), "D"((uintptr_t)arg2), "b"((uintptr_t)arg3) - : "rcx", "r11", "memory"); + : "=a"(result) + : "a"(function), "d"((uintptr_t)arg1), "D"((uintptr_t)arg2), "b"((uintptr_t)arg3) + : "rcx", "r11", "memory"); # elif ARCH(AARCH64) uintptr_t result; register uintptr_t x0 asm("x0"); @@ -674,9 +674,9 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2, T3 arg3) register uintptr_t x3 asm("x3") = arg3; register uintptr_t x8 asm("x8") = function; asm volatile("svc #0" - : "=r"(x0) - : "r"(x1), "r"(x2), "r"(x3), "r"(x8) - : "memory"); + : "=r"(x0) + : "r"(x1), "r"(x2), "r"(x3), "r"(x8) + : "memory"); result = x0; # elif ARCH(RISCV64) register uintptr_t a0 asm("a0") = arg1; @@ -685,9 +685,9 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2, T3 arg3) register uintptr_t a7 asm("a7") = function; register uintptr_t result asm("a0"); asm volatile("ecall" - : "=r"(result) - : "0"(a0), "r"(a1), "r"(a2), "r"(a7) - : "memory"); + : "=r"(result) + : "0"(a0), "r"(a1), "r"(a2), "r"(a7) + : "memory"); # endif return result; } @@ -698,9 +698,9 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2, T3 arg3, T4 arg4) # if ARCH(X86_64) uintptr_t result; asm volatile("syscall" - : "=a"(result) - : "a"(function), "d"((uintptr_t)arg1), "D"((uintptr_t)arg2), "b"((uintptr_t)arg3), "S"((uintptr_t)arg4) - : "rcx", "r11", "memory"); + : "=a"(result) + : "a"(function), "d"((uintptr_t)arg1), "D"((uintptr_t)arg2), "b"((uintptr_t)arg3), "S"((uintptr_t)arg4) + : "rcx", "r11", "memory"); # elif ARCH(AARCH64) uintptr_t result; register uintptr_t x0 asm("x0"); @@ -710,9 +710,9 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2, T3 arg3, T4 arg4) register uintptr_t x4 asm("x4") = arg4; register uintptr_t x8 asm("x8") = function; asm volatile("svc #0" - : "=r"(x0) - : "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x8) - : "memory"); + : "=r"(x0) + : "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x8) + : "memory"); result = x0; # elif ARCH(RISCV64) register uintptr_t a0 asm("a0") = arg1; @@ -722,9 +722,9 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2, T3 arg3, T4 arg4) register uintptr_t a7 asm("a7") = function; register uintptr_t result asm("a0"); asm volatile("ecall" - : "=r"(result) - : "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a7) - : "memory"); + : "=r"(result) + : "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a7) + : "memory"); # endif return result; } diff --git a/Kernel/Arch/aarch64/ASM_wrapper.h b/Kernel/Arch/aarch64/ASM_wrapper.h index 1e0b922ee83b18..9dbbc39b2cc70b 100644 --- a/Kernel/Arch/aarch64/ASM_wrapper.h +++ b/Kernel/Arch/aarch64/ASM_wrapper.h @@ -28,7 +28,7 @@ inline FlatPtr get_ttbr0_el1() { FlatPtr ttbr0_el1; asm volatile("mrs %[value], ttbr0_el1\n" - : [value] "=r"(ttbr0_el1)); + : [value] "=r"(ttbr0_el1)); return ttbr0_el1; } @@ -67,7 +67,7 @@ inline ExceptionLevel get_current_exception_level() u64 current_exception_level; asm volatile("mrs %[value], CurrentEL" - : [value] "=r"(current_exception_level)); + : [value] "=r"(current_exception_level)); current_exception_level = (current_exception_level >> 2) & 0x3; return static_cast(current_exception_level); @@ -129,7 +129,7 @@ inline FlatPtr get_cache_line_size() { FlatPtr ctr_el0; asm volatile("mrs %[value], ctr_el0" - : [value] "=r"(ctr_el0)); + : [value] "=r"(ctr_el0)); auto log2_size = (ctr_el0 >> 16) & 0xF; return 1 << log2_size; } @@ -139,9 +139,9 @@ inline void flush_data_cache(FlatPtr start, size_t size) auto const cache_size = get_cache_line_size(); for (FlatPtr addr = align_down_to(start, cache_size); addr < start + size; addr += cache_size) asm volatile("dc civac, %[addr]" ::[addr] "r"(addr) - : "memory"); + : "memory"); asm volatile("dsb sy" :: - : "memory"); + : "memory"); } } diff --git a/Kernel/Arch/aarch64/MainIdRegister.cpp b/Kernel/Arch/aarch64/MainIdRegister.cpp index 0ffec21116e33f..2ad25a3bcd69f1 100644 --- a/Kernel/Arch/aarch64/MainIdRegister.cpp +++ b/Kernel/Arch/aarch64/MainIdRegister.cpp @@ -12,7 +12,7 @@ MainIdRegister::MainIdRegister() { unsigned int mrs; asm volatile("mrs %x0, MIDR_EL1" - : "=r"(mrs)); + : "=r"(mrs)); m_value = mrs; } diff --git a/Kernel/Arch/aarch64/Registers.h b/Kernel/Arch/aarch64/Registers.h index e8b3d985ee9322..872ae669836e02 100644 --- a/Kernel/Arch/aarch64/Registers.h +++ b/Kernel/Arch/aarch64/Registers.h @@ -39,7 +39,7 @@ struct alignas(u64) ID_AA64ISAR0_EL1 { ID_AA64ISAR0_EL1 feature_register; asm volatile("mrs %[value], ID_AA64ISAR0_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -71,7 +71,7 @@ struct alignas(u64) ID_AA64ISAR1_EL1 { ID_AA64ISAR1_EL1 feature_register; asm volatile("mrs %[value], ID_AA64ISAR1_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -102,7 +102,7 @@ struct alignas(u64) ID_AA64ISAR2_EL1 { ID_AA64ISAR2_EL1 feature_register; asm volatile("mrs %[value], ID_AA64ISAR2_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -134,7 +134,7 @@ struct alignas(u64) ID_AA64PFR0_EL1 { ID_AA64PFR0_EL1 feature_register; asm volatile("mrs %[value], ID_AA64PFR0_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -166,7 +166,7 @@ struct alignas(u64) ID_AA64PFR1_EL1 { ID_AA64PFR1_EL1 feature_register; asm volatile("mrs %[value], ID_AA64PFR1_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -187,7 +187,7 @@ struct alignas(u64) ID_AA64PFR2_EL1 { ID_AA64PFR2_EL1 feature_register; asm volatile("mrs %[value], s3_0_c0_c4_2" // encoded ID_AA64PFR2_EL1 register - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -212,7 +212,7 @@ struct alignas(u64) MPIDR_EL1 { MPIDR_EL1 affinity_register; asm volatile("mrs %[value], MPIDR_EL1" - : [value] "=r"(affinity_register)); + : [value] "=r"(affinity_register)); return affinity_register; } @@ -243,7 +243,7 @@ struct alignas(u64) ID_AA64MMFR0_EL1 { ID_AA64MMFR0_EL1 feature_register; asm volatile("mrs %[value], ID_AA64MMFR0_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -275,7 +275,7 @@ struct alignas(u64) ID_AA64MMFR1_EL1 { ID_AA64MMFR1_EL1 feature_register; asm volatile("mrs %[value], ID_AA64MMFR1_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -307,7 +307,7 @@ struct alignas(u64) ID_AA64MMFR2_EL1 { ID_AA64MMFR2_EL1 feature_register; asm volatile("mrs %[value], ID_AA64MMFR2_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -339,7 +339,7 @@ struct alignas(u64) ID_AA64MMFR3_EL1 { ID_AA64MMFR3_EL1 feature_register; asm volatile("mrs %[value], s3_0_c0_c7_3" // encoded ID_AA64MMFR3_EL1 register - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -359,7 +359,7 @@ struct alignas(u64) ID_AA64MMFR4_EL1 { ID_AA64MMFR4_EL1 feature_register; asm volatile("mrs %[value], s3_0_c0_c7_4" // encoded ID_AA64MMFR4_EL1 register - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -391,7 +391,7 @@ struct alignas(u64) ID_AA64SMFR0_EL1 { ID_AA64SMFR0_EL1 feature_register; asm volatile("mrs %[value], s3_0_c0_c4_5" // encoded ID_AA64SMFR0_EL1 register - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -422,7 +422,7 @@ struct alignas(u64) ID_AA64ZFR0_EL1 { ID_AA64ZFR0_EL1 feature_register; asm volatile("mrs %[value], s3_0_c0_c4_4" // encoded ID_AA64ZFR0_EL1 register - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -454,7 +454,7 @@ struct alignas(u64) ID_AA64DFR0_EL1 { ID_AA64DFR0_EL1 feature_register; asm volatile("mrs %[value], ID_AA64DFR0_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -481,7 +481,7 @@ struct alignas(u64) ID_AA64DFR1_EL1 { ID_AA64DFR1_EL1 feature_register; asm volatile("mrs %[value], ID_AA64DFR1_EL1" - : [value] "=r"(feature_register)); + : [value] "=r"(feature_register)); return feature_register; } @@ -499,7 +499,7 @@ struct alignas(u64) CNTFRQ_EL0 { CNTFRQ_EL0 frequency; asm volatile("mrs %[value], CNTFRQ_EL0" - : [value] "=r"(frequency)); + : [value] "=r"(frequency)); return frequency; } @@ -605,7 +605,7 @@ struct alignas(u64) TCR_EL1 { TCR_EL1 tcr_el1; asm volatile("mrs %[value], tcr_el1" - : [value] "=r"(tcr_el1)); + : [value] "=r"(tcr_el1)); return tcr_el1; } @@ -680,7 +680,7 @@ struct alignas(u64) SCTLR_EL1 { SCTLR_EL1 sctlr; asm volatile("mrs %[value], sctlr_el1" - : [value] "=r"(sctlr)); + : [value] "=r"(sctlr)); return sctlr; } @@ -719,7 +719,7 @@ struct alignas(u64) MIDR_EL1 { MIDR_EL1 main_id_register; asm volatile("mrs %[value], MIDR_EL1" - : [value] "=r"(main_id_register)); + : [value] "=r"(main_id_register)); return main_id_register; } @@ -736,7 +736,7 @@ struct alignas(u64) AIDR_EL1 { AIDR_EL1 auxiliary_id_register; asm volatile("mrs %[value], AIDR_EL1" - : [value] "=r"(auxiliary_id_register)); + : [value] "=r"(auxiliary_id_register)); return auxiliary_id_register; } @@ -801,7 +801,7 @@ struct alignas(u64) HCR_EL2 { HCR_EL2 spsr; asm volatile("mrs %[value], hcr_el2" - : [value] "=r"(spsr)); + : [value] "=r"(spsr)); return spsr; } @@ -857,7 +857,7 @@ struct alignas(u64) SCR_EL3 { SCR_EL3 scr; asm volatile("mrs %[value], scr_el3" - : [value] "=r"(scr)); + : [value] "=r"(scr)); return scr; } @@ -905,7 +905,7 @@ struct alignas(u64) SPSR_EL1 { SPSR_EL1 spsr; asm volatile("mrs %[value], spsr_el1" - : [value] "=r"(spsr)); + : [value] "=r"(spsr)); return spsr; } @@ -954,7 +954,7 @@ struct alignas(u64) SPSR_EL2 { SPSR_EL2 spsr; asm volatile("mrs %[value], spsr_el2" - : [value] "=r"(spsr)); + : [value] "=r"(spsr)); return spsr; } @@ -1003,7 +1003,7 @@ struct alignas(u64) SPSR_EL3 { SPSR_EL3 spsr; asm volatile("mrs %[value], spsr_el3" - : [value] "=r"(spsr)); + : [value] "=r"(spsr)); return spsr; } @@ -1037,7 +1037,7 @@ struct ESR_EL1 { ESR_EL1 esr_el1; asm volatile("mrs %[value], esr_el1" - : [value] "=r"(esr_el1)); + : [value] "=r"(esr_el1)); return esr_el1; } @@ -1053,7 +1053,7 @@ struct FAR_EL1 { FAR_EL1 far_el1; asm volatile("mrs %[value], far_el1" - : [value] "=r"(far_el1)); + : [value] "=r"(far_el1)); return far_el1; } @@ -1295,7 +1295,7 @@ struct DAIF { DAIF daif; asm volatile("mrs %[value], daif" - : [value] "=r"(daif)); + : [value] "=r"(daif)); return daif; } @@ -1304,14 +1304,14 @@ struct DAIF { static inline void clear_I() { asm volatile("msr daifclr, #2" :: - :); + :); } // Setting the I bit, causes interrupts to be disabled. static inline void set_I() { asm volatile("msr daifset, #2" :: - :); + :); } }; static_assert(sizeof(DAIF) == 8); @@ -1330,7 +1330,7 @@ struct alignas(u64) NZCV { { NZCV nzcv; asm volatile("mrs %[value], nzcv" - : [value] "=r"(nzcv)); + : [value] "=r"(nzcv)); return nzcv; } }; @@ -1345,7 +1345,7 @@ struct alignas(u64) PMCCNTR_EL0 { { PMCCNTR_EL0 pmccntr_el0; asm volatile("mrs %[value], pmccntr_el0" - : [value] "=r"(pmccntr_el0)); + : [value] "=r"(pmccntr_el0)); return pmccntr_el0; } }; diff --git a/Kernel/Arch/riscv64/CSR.h b/Kernel/Arch/riscv64/CSR.h index 7b05bdff790dd9..12bd444ee74772 100644 --- a/Kernel/Arch/riscv64/CSR.h +++ b/Kernel/Arch/riscv64/CSR.h @@ -38,8 +38,8 @@ ALWAYS_INLINE FlatPtr read(Address address) { FlatPtr ret; asm volatile("csrr %0, %1" - : "=r"(ret) - : "i"(address)); + : "=r"(ret) + : "i"(address)); return ret; } @@ -52,8 +52,8 @@ ALWAYS_INLINE FlatPtr read_and_set_bits(Address address, FlatPtr bit_mask) { FlatPtr ret; asm volatile("csrrs %0, %1, %2" - : "=r"(ret) - : "i"(address), "Kr"(bit_mask)); + : "=r"(ret) + : "i"(address), "Kr"(bit_mask)); return ret; } diff --git a/Kernel/Arch/riscv64/Processor.cpp b/Kernel/Arch/riscv64/Processor.cpp index 759875c7681c94..d4472a505f4560 100644 --- a/Kernel/Arch/riscv64/Processor.cpp +++ b/Kernel/Arch/riscv64/Processor.cpp @@ -142,9 +142,9 @@ void ProcessorBase::flush_tlb_local(VirtualAddress vaddr, size_t page_count) auto addr = vaddr.get(); while (page_count > 0) { asm volatile("sfence.vma %0" - : - : "r"(addr) - : "memory"); + : + : "r"(addr) + : "memory"); addr += PAGE_SIZE; page_count--; } diff --git a/Kernel/Arch/riscv64/SBI.cpp b/Kernel/Arch/riscv64/SBI.cpp index d321647bf5e0d1..66522a7850c3ce 100644 --- a/Kernel/Arch/riscv64/SBI.cpp +++ b/Kernel/Arch/riscv64/SBI.cpp @@ -19,9 +19,9 @@ static SBIErrorOr sbi_ecall0(EID extension_id, u32 function_id) register unsigned long a6 asm("a6") = function_id; register unsigned long a7 asm("a7") = to_underlying(extension_id); asm volatile("ecall" - : "=r"(a0), "=r"(a1) - : "r"(a6), "r"(a7) - : "memory"); + : "=r"(a0), "=r"(a1) + : "r"(a6), "r"(a7) + : "memory"); if (a0 == to_underlying(SBIError::Success)) return static_cast(a1); @@ -35,9 +35,9 @@ static SBIErrorOr sbi_ecall1(EID extension_id, u32 function_id, unsigned l register unsigned long a6 asm("a6") = function_id; register unsigned long a7 asm("a7") = to_underlying(extension_id); asm volatile("ecall" - : "+r"(a0), "=r"(a1) - : "r"(a0), "r"(a6), "r"(a7) - : "memory"); + : "+r"(a0), "=r"(a1) + : "r"(a0), "r"(a6), "r"(a7) + : "memory"); if (a0 == to_underlying(SBIError::Success)) return static_cast(a1); @@ -51,9 +51,9 @@ static SBIErrorOr sbi_ecall2(EID extension_id, u32 function_id, unsigned l register unsigned long a6 asm("a6") = function_id; register unsigned long a7 asm("a7") = to_underlying(extension_id); asm volatile("ecall" - : "+r"(a0), "+r"(a1) - : "r"(a0), "r"(a1), "r"(a6), "r"(a7) - : "memory"); + : "+r"(a0), "+r"(a1) + : "r"(a0), "r"(a1), "r"(a6), "r"(a7) + : "memory"); if (a0 == to_underlying(SBIError::Success)) return static_cast(a1); @@ -107,9 +107,9 @@ static long sbi_legacy_ecall0(LegacyEID extension_id) register unsigned long a0 asm("a0"); register unsigned long a7 asm("a7") = to_underlying(extension_id); asm volatile("ecall" - : "=r"(a0) - : "r"(a7) - : "memory"); + : "=r"(a0) + : "r"(a7) + : "memory"); return static_cast(a0); } @@ -118,9 +118,9 @@ static long sbi_legacy_ecall1(LegacyEID extension_id, unsigned long arg0) register unsigned long a0 asm("a0") = arg0; register unsigned long a7 asm("a7") = to_underlying(extension_id); asm volatile("ecall" - : "+r"(a0) - : "r"(a0), "r"(a7) - : "memory"); + : "+r"(a0) + : "r"(a0), "r"(a7) + : "memory"); return static_cast(a0); } diff --git a/Kernel/Arch/riscv64/SafeMem.cpp b/Kernel/Arch/riscv64/SafeMem.cpp index 5f6affa711f193..bfacf623df67af 100644 --- a/Kernel/Arch/riscv64/SafeMem.cpp +++ b/Kernel/Arch/riscv64/SafeMem.cpp @@ -162,9 +162,9 @@ NEVER_INLINE FLATTEN Optional safe_atomic_compare_exchange_relaxed(u32 vol .global safe_atomic_compare_exchange_relaxed_faulted safe_atomic_compare_exchange_relaxed_faulted: )" - : [result] "=&r"(result), "+r"(error) - : [var_ptr] "r"(var), [expected_ptr] "r"(&expected), [desired] "r"(desired) - : "memory", "t0", "t1", "t2"); + : [result] "=&r"(result), "+r"(error) + : [var_ptr] "r"(var), [expected_ptr] "r"(&expected), [desired] "r"(desired) + : "memory", "t0", "t1", "t2"); if (error != 0) return {}; return static_cast(result); @@ -182,9 +182,9 @@ NEVER_INLINE FLATTEN Optional safe_atomic_load_relaxed(u32 volatile* var) .global safe_atomic_load_relaxed_faulted safe_atomic_load_relaxed_faulted: )" - : [result] "=r"(result), "+r"(error) - : [var_ptr] "r"(var) - : "memory"); + : [result] "=r"(result), "+r"(error) + : [var_ptr] "r"(var) + : "memory"); if (error != 0) return {}; return result; @@ -202,9 +202,9 @@ NEVER_INLINE FLATTEN Optional safe_atomic_fetch_add_relaxed(u32 volatile* v .global safe_atomic_fetch_add_relaxed_faulted safe_atomic_fetch_add_relaxed_faulted: )" - : [result] "=r"(result), "+r"(error) - : [val] "r"(val), [var_ptr] "r"(var) - : "memory"); + : [result] "=r"(result), "+r"(error) + : [val] "r"(val), [var_ptr] "r"(var) + : "memory"); if (error != 0) return {}; return result; @@ -222,9 +222,9 @@ NEVER_INLINE FLATTEN Optional safe_atomic_exchange_relaxed(u32 volatile* va .global safe_atomic_exchange_relaxed_faulted safe_atomic_exchange_relaxed_faulted: )" - : [result] "=r"(result), "+r"(error) - : [desired] "r"(desired), [var_ptr] "r"(var) - : "memory"); + : [result] "=r"(result), "+r"(error) + : [desired] "r"(desired), [var_ptr] "r"(var) + : "memory"); if (error != 0) return {}; return result; @@ -241,9 +241,9 @@ NEVER_INLINE FLATTEN bool safe_atomic_store_relaxed(u32 volatile* var, u32 desir .global safe_atomic_store_relaxed_faulted safe_atomic_store_relaxed_faulted: )" - : "+r"(error) - : [desired] "r"(desired), [var_ptr] "r"(var) - : "memory"); + : "+r"(error) + : [desired] "r"(desired), [var_ptr] "r"(var) + : "memory"); return error == 0; } diff --git a/Kernel/Arch/x86_64/ASM_wrapper.cpp b/Kernel/Arch/x86_64/ASM_wrapper.cpp index e406f9910f6ef6..5957366b7e86a6 100644 --- a/Kernel/Arch/x86_64/ASM_wrapper.cpp +++ b/Kernel/Arch/x86_64/ASM_wrapper.cpp @@ -18,8 +18,8 @@ UNMAP_AFTER_INIT u64 read_xcr0() { u32 eax, edx; asm volatile("xgetbv" - : "=a"(eax), "=d"(edx) - : "c"(XCR_XFEATURE_ENABLED_MASK)); + : "=a"(eax), "=d"(edx) + : "c"(XCR_XFEATURE_ENABLED_MASK)); return eax + ((u64)edx << 32); } @@ -34,16 +34,14 @@ void stac() { if (!Processor::current().has_feature(CPUFeature::SMAP)) return; - asm volatile("stac" :: - : "cc"); + asm volatile("stac" ::: "cc"); } void clac() { if (!Processor::current().has_feature(CPUFeature::SMAP)) return; - asm volatile("clac" :: - : "cc"); + asm volatile("clac" ::: "cc"); } UNMAP_AFTER_INIT void write_cr0(FlatPtr value) @@ -83,7 +81,7 @@ void write_cr3(FlatPtr cr3) { // NOTE: If you're here from a GPF crash, it's very likely that a PDPT entry is incorrect, not this! asm volatile("mov %%rax, %%cr3" ::"a"(cr3) - : "memory"); + : "memory"); } FlatPtr read_cr4() diff --git a/Kernel/Arch/x86_64/ASM_wrapper.h b/Kernel/Arch/x86_64/ASM_wrapper.h index 9fb013fcf67faa..ad3bc476065fdb 100644 --- a/Kernel/Arch/x86_64/ASM_wrapper.h +++ b/Kernel/Arch/x86_64/ASM_wrapper.h @@ -15,13 +15,11 @@ namespace Kernel { ALWAYS_INLINE void cli() { - asm volatile("cli" :: - : "memory"); + asm volatile("cli" ::: "memory"); } ALWAYS_INLINE void sti() { - asm volatile("sti" :: - : "memory"); + asm volatile("sti" ::: "memory"); } ALWAYS_INLINE NO_SANITIZE_COVERAGE FlatPtr cpu_flags() { @@ -108,7 +106,7 @@ void write_dr7(FlatPtr); ALWAYS_INLINE void read_tsc(u32& lsw, u32& msw) { asm volatile("rdtsc" - : "=d"(msw), "=a"(lsw)); + : "=d"(msw), "=a"(lsw)); } ALWAYS_INLINE u64 read_tsc() diff --git a/Kernel/Arch/x86_64/CPUID.h b/Kernel/Arch/x86_64/CPUID.h index fc3038be43a9a0..9f65380c396dfe 100644 --- a/Kernel/Arch/x86_64/CPUID.h +++ b/Kernel/Arch/x86_64/CPUID.h @@ -21,8 +21,8 @@ class CPUID { explicit CPUID(u32 function, u32 ecx = 0) { asm volatile("cpuid" - : "=a"(m_eax), "=b"(m_ebx), "=c"(m_ecx), "=d"(m_edx) - : "a"(function), "c"(ecx)); + : "=a"(m_eax), "=b"(m_ebx), "=c"(m_ecx), "=d"(m_edx) + : "a"(function), "c"(ecx)); } u32 eax() const { return m_eax; } diff --git a/Kernel/Arch/x86_64/Hypervisor/VMWareBackdoor.cpp b/Kernel/Arch/x86_64/Hypervisor/VMWareBackdoor.cpp index 34810ff8368cf8..0c8468f7477854 100644 --- a/Kernel/Arch/x86_64/Hypervisor/VMWareBackdoor.cpp +++ b/Kernel/Arch/x86_64/Hypervisor/VMWareBackdoor.cpp @@ -38,7 +38,7 @@ inline void vmware_out(VMWareCommand& command) command.si = 0; command.di = 0; asm volatile("in %%dx, %0" - : "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di)); + : "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di)); } inline void vmware_high_bandwidth_send(VMWareCommand& command) @@ -47,7 +47,7 @@ inline void vmware_high_bandwidth_send(VMWareCommand& command) command.port = VMWARE_PORT_HIGHBANDWIDTH; asm volatile("cld; rep; outsb" - : "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di)); + : "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di)); } inline void vmware_high_bandwidth_get(VMWareCommand& command) @@ -55,7 +55,7 @@ inline void vmware_high_bandwidth_get(VMWareCommand& command) command.magic = VMWARE_MAGIC; command.port = VMWARE_PORT_HIGHBANDWIDTH; asm volatile("cld; rep; insb" - : "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di)); + : "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di)); } class VMWareBackdoorDetector { diff --git a/Kernel/Arch/x86_64/IO.h b/Kernel/Arch/x86_64/IO.h index 79a7b92a4c8fb2..9aaff9435f6dbd 100644 --- a/Kernel/Arch/x86_64/IO.h +++ b/Kernel/Arch/x86_64/IO.h @@ -23,8 +23,8 @@ inline u8 in8(u16 port) { u8 value; asm volatile("inb %1, %0" - : "=a"(value) - : "Nd"(port)); + : "=a"(value) + : "Nd"(port)); return value; } @@ -32,8 +32,8 @@ inline u16 in16(u16 port) { u16 value; asm volatile("inw %1, %0" - : "=a"(value) - : "Nd"(port)); + : "=a"(value) + : "Nd"(port)); return value; } @@ -41,8 +41,8 @@ inline u32 in32(u16 port) { u32 value; asm volatile("inl %1, %0" - : "=a"(value) - : "Nd"(port)); + : "=a"(value) + : "Nd"(port)); return value; } diff --git a/Kernel/Arch/x86_64/MSR.h b/Kernel/Arch/x86_64/MSR.h index ff2810d62e7a18..fc9b7a9d477f14 100644 --- a/Kernel/Arch/x86_64/MSR.h +++ b/Kernel/Arch/x86_64/MSR.h @@ -37,8 +37,8 @@ class MSR { { u32 low, high; asm volatile("rdmsr" - : "=a"(low), "=d"(high) - : "c"(m_msr)); + : "=a"(low), "=d"(high) + : "c"(m_msr)); return ((u64)high << 32) | low; } diff --git a/Kernel/Arch/x86_64/Processor.cpp b/Kernel/Arch/x86_64/Processor.cpp index 2037a4c10ce4c3..36124b8395a060 100644 --- a/Kernel/Arch/x86_64/Processor.cpp +++ b/Kernel/Arch/x86_64/Processor.cpp @@ -654,14 +654,14 @@ UNMAP_AFTER_INIT void ProcessorBase::initialize(u32 cpu) // Initialize AVX state if (has_feature(CPUFeature::XSAVE | CPUFeature::AVX)) { asm volatile("xsave %0\n" - : "=m"(s_clean_fpu_state) - : "a"(static_cast(SIMD::StateComponent::AVX | SIMD::StateComponent::SSE | SIMD::StateComponent::X87)), "d"(0u)); + : "=m"(s_clean_fpu_state) + : "a"(static_cast(SIMD::StateComponent::AVX | SIMD::StateComponent::SSE | SIMD::StateComponent::X87)), "d"(0u)); } else if (has_feature(CPUFeature::FXSR)) { asm volatile("fxsave %0" - : "=m"(s_clean_fpu_state)); + : "=m"(s_clean_fpu_state)); } else { asm volatile("fnsave %0" - : "=m"(s_clean_fpu_state)); + : "=m"(s_clean_fpu_state)); } if (has_feature(CPUFeature::HYPERVISOR)) @@ -750,7 +750,7 @@ void Processor::flush_gdt() m_gdtr.address = m_gdt; m_gdtr.limit = (m_gdt_length * 8) - 1; asm volatile("lgdt %0" ::"m"(m_gdtr) - : "memory"); + : "memory"); } DescriptorTablePointer const& Processor::get_gdtr() @@ -830,9 +830,9 @@ void ProcessorBase::flush_tlb_local(VirtualAddress vaddr, size_t page_count) auto ptr = vaddr.as_ptr(); while (page_count > 0) { asm volatile("invlpg %0" - : - : "m"(*ptr) - : "memory"); + : + : "m"(*ptr) + : "memory"); ptr += PAGE_SIZE; page_count--; } @@ -1246,14 +1246,14 @@ extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread) // The specific state components saved correspond to the bits set in the requested-feature bitmap (RFBM), which is the logical-AND of EDX:EAX and XCR0. // https://www.moritz.systems/blog/how-debuggers-work-getting-and-setting-x86-registers-part-2/ asm volatile("xsave %0\n" - : "=m"(from_thread->fpu_state()) - : "a"(static_cast(SIMD::StateComponent::AVX | SIMD::StateComponent::SSE | SIMD::StateComponent::X87)), "d"(0u)); + : "=m"(from_thread->fpu_state()) + : "a"(static_cast(SIMD::StateComponent::AVX | SIMD::StateComponent::SSE | SIMD::StateComponent::X87)), "d"(0u)); } else if (has_fxsr) { asm volatile("fxsave %0" - : "=m"(from_thread->fpu_state())); + : "=m"(from_thread->fpu_state())); } else { asm volatile("fnsave %0" - : "=m"(from_thread->fpu_state())); + : "=m"(from_thread->fpu_state())); } if (from_thread->process().is_traced()) diff --git a/Kernel/Devices/HID/USB/MouseDevice.h b/Kernel/Devices/HID/USB/MouseDevice.h index dad964f6772a18..5548246ccc56c7 100644 --- a/Kernel/Devices/HID/USB/MouseDevice.h +++ b/Kernel/Devices/HID/USB/MouseDevice.h @@ -24,7 +24,7 @@ class USBMouseDevice final : public MouseDevice { public: static ErrorOr> try_create_instance(USB::Device const&, size_t max_packet_size, NonnullOwnPtr pipe); - virtual ~USBMouseDevice() override {}; + virtual ~USBMouseDevice() override { } USB::Device const& device() const { return *m_attached_usb_device; } diff --git a/Kernel/Devices/Storage/NVMe/NVMeInterruptQueue.h b/Kernel/Devices/Storage/NVMe/NVMeInterruptQueue.h index 984fd72daea695..fa46459f0f1d24 100644 --- a/Kernel/Devices/Storage/NVMe/NVMeInterruptQueue.h +++ b/Kernel/Devices/Storage/NVMe/NVMeInterruptQueue.h @@ -16,7 +16,7 @@ class NVMeInterruptQueue : public NVMeQueue public: static ErrorOr> try_create(PCI::Device& device, NonnullOwnPtr rw_dma_region, NonnullRefPtr rw_dma_page, u16 qid, u8 irq, u32 q_depth, OwnPtr cq_dma_region, OwnPtr sq_dma_region, Doorbell db_regs); void submit_sqe(NVMeSubmission& submission) override; - virtual ~NVMeInterruptQueue() override {}; + virtual ~NVMeInterruptQueue() override { } virtual StringView purpose() const override { return "NVMe"sv; } void initialize_interrupt_queue(); diff --git a/Kernel/Devices/Storage/NVMe/NVMePollQueue.h b/Kernel/Devices/Storage/NVMe/NVMePollQueue.h index 5c6ccad8304c32..4209509844ece5 100644 --- a/Kernel/Devices/Storage/NVMe/NVMePollQueue.h +++ b/Kernel/Devices/Storage/NVMe/NVMePollQueue.h @@ -14,7 +14,7 @@ class NVMePollQueue : public NVMeQueue { public: static ErrorOr> try_create(NonnullOwnPtr rw_dma_region, NonnullRefPtr rw_dma_page, u16 qid, u32 q_depth, OwnPtr cq_dma_region, OwnPtr sq_dma_region, Doorbell db_regs); void submit_sqe(NVMeSubmission& submission) override; - virtual ~NVMePollQueue() override {}; + virtual ~NVMePollQueue() override { } protected: NVMePollQueue(NonnullOwnPtr rw_dma_region, NonnullRefPtr rw_dma_page, u16 qid, u32 q_depth, OwnPtr cq_dma_region, OwnPtr sq_dma_region, Doorbell db_regs); diff --git a/Kernel/FileSystem/SysFS/Component.h b/Kernel/FileSystem/SysFS/Component.h index c3b0c212f4abd3..132ecf1ebd1901 100644 --- a/Kernel/FileSystem/SysFS/Component.h +++ b/Kernel/FileSystem/SysFS/Component.h @@ -92,7 +92,7 @@ class SysFSDirectory : public SysFSComponent { protected: virtual bool is_root_directory() const { return false; } - SysFSDirectory() {}; + SysFSDirectory() { } explicit SysFSDirectory(SysFSDirectory const& parent_directory); ChildList m_child_components {}; }; diff --git a/Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceAttribute.h b/Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceAttribute.h index e361c28c1371ba..bbddd423fc223d 100644 --- a/Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceAttribute.h +++ b/Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceAttribute.h @@ -18,7 +18,7 @@ class PCIDeviceAttributeSysFSComponent : public SysFSComponent { static NonnullRefPtr create(PCIDeviceSysFSDirectory const& device, PCI::RegisterOffset offset, size_t field_bytes_width); virtual ErrorOr read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override; - virtual ~PCIDeviceAttributeSysFSComponent() {}; + virtual ~PCIDeviceAttributeSysFSComponent() { } virtual StringView name() const override; diff --git a/Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceExpansionROM.h b/Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceExpansionROM.h index bd5d946a72493e..86cd0ca2cedde4 100644 --- a/Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceExpansionROM.h +++ b/Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceExpansionROM.h @@ -18,7 +18,7 @@ class PCIDeviceExpansionROMSysFSComponent : public SysFSComponent { static NonnullRefPtr create(PCIDeviceSysFSDirectory const& device); virtual ErrorOr read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override; - virtual ~PCIDeviceExpansionROMSysFSComponent() {}; + virtual ~PCIDeviceExpansionROMSysFSComponent() { } virtual StringView name() const override { return "rom"sv; } diff --git a/Kernel/FileSystem/SysFS/Subsystems/Devices/Graphics/DisplayConnector/DeviceAttribute.h b/Kernel/FileSystem/SysFS/Subsystems/Devices/Graphics/DisplayConnector/DeviceAttribute.h index 959a8d742a4437..2ee3c13859e865 100644 --- a/Kernel/FileSystem/SysFS/Subsystems/Devices/Graphics/DisplayConnector/DeviceAttribute.h +++ b/Kernel/FileSystem/SysFS/Subsystems/Devices/Graphics/DisplayConnector/DeviceAttribute.h @@ -28,7 +28,7 @@ class DisplayConnectorAttributeSysFSComponent : public SysFSComponent { static NonnullRefPtr must_create(DisplayConnectorSysFSDirectory const& device_directory, Type); virtual ErrorOr read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override; - virtual ~DisplayConnectorAttributeSysFSComponent() {}; + virtual ~DisplayConnectorAttributeSysFSComponent() { } virtual StringView name() const override; diff --git a/Kernel/FileSystem/SysFS/Subsystems/Devices/Storage/DeviceAttribute.h b/Kernel/FileSystem/SysFS/Subsystems/Devices/Storage/DeviceAttribute.h index 31d92101330acd..cb4c9d90e50652 100644 --- a/Kernel/FileSystem/SysFS/Subsystems/Devices/Storage/DeviceAttribute.h +++ b/Kernel/FileSystem/SysFS/Subsystems/Devices/Storage/DeviceAttribute.h @@ -24,7 +24,7 @@ class StorageDeviceAttributeSysFSComponent : public SysFSComponent { static NonnullRefPtr must_create(StorageDeviceSysFSDirectory const& device_directory, Type); virtual ErrorOr read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override; - virtual ~StorageDeviceAttributeSysFSComponent() {}; + virtual ~StorageDeviceAttributeSysFSComponent() { } virtual StringView name() const override; diff --git a/Kernel/Heap/kmalloc.h b/Kernel/Heap/kmalloc.h index bc75b33e8b07a4..7fc8e29edded73 100644 --- a/Kernel/Heap/kmalloc.h +++ b/Kernel/Heap/kmalloc.h @@ -40,7 +40,7 @@ struct nothrow_t { extern nothrow_t const nothrow; -enum class align_val_t : size_t {}; +enum class align_val_t : size_t { }; }; void kmalloc_init(); diff --git a/Kernel/Net/IP/SocketTuple.h b/Kernel/Net/IP/SocketTuple.h index c76cd2112a2f7d..b96dc92951d490 100644 --- a/Kernel/Net/IP/SocketTuple.h +++ b/Kernel/Net/IP/SocketTuple.h @@ -22,7 +22,9 @@ class IPv4SocketTuple { : m_local_address(local_address) , m_local_port(local_port) , m_peer_address(peer_address) - , m_peer_port(peer_port) {}; + , m_peer_port(peer_port) + { + } IPv4Address local_address() const { return m_local_address; } u16 local_port() const { return m_local_port; } diff --git a/Kernel/Net/TCP.h b/Kernel/Net/TCP.h index e78e9fa82886e1..a677f65560b3c9 100644 --- a/Kernel/Net/TCP.h +++ b/Kernel/Net/TCP.h @@ -39,7 +39,9 @@ class [[gnu::packed]] TCPOption { protected: TCPOption(TCPOptionKind kind, u8 length) : m_kind(kind) - , m_length(length) {}; + , m_length(length) + { + } private: TCPOptionKind m_kind { TCPOptionKind::End }; diff --git a/Kernel/Syscalls/SyscallHandler.cpp b/Kernel/Syscalls/SyscallHandler.cpp index 408c38ac1d039f..e3444dd965db6e 100644 --- a/Kernel/Syscalls/SyscallHandler.cpp +++ b/Kernel/Syscalls/SyscallHandler.cpp @@ -140,7 +140,7 @@ NEVER_INLINE void syscall_handler(TrapFrame* trap) auto* ptr = (char*)__builtin_alloca(lsw & 0xff); asm volatile("" - : "=m"(*ptr)); + : "=m"(*ptr)); constexpr FlatPtr iopl_mask = 3u << 12; diff --git a/Ladybird/AppKit/UI/TabController.mm b/Ladybird/AppKit/UI/TabController.mm index a921d12a58a189..2a185fb72b11b8 100644 --- a/Ladybird/AppKit/UI/TabController.mm +++ b/Ladybird/AppKit/UI/TabController.mm @@ -200,7 +200,7 @@ - (void)createNewTab:(id)sender self.tab.titlebarAppearsTransparent = NO; - [delegate createNewTab:OptionalNone {} + [delegate createNewTab:OptionalNone { } fromTab:[self tab] activateTab:Web::HTML::ActivateTab::Yes]; diff --git a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm index 68439b2a09ccf2..a0540133e8de0c 100644 --- a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm +++ b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm @@ -197,7 +197,7 @@ - (IBAction)showGoToPageDialog:(id)sender - (void)pageChanged { [self.window setSubtitle: - [NSString stringWithFormat:@"Page %d of %d", [_pdfView page], _pdfDocument.pdf->get_page_count()]]; + [NSString stringWithFormat:@"Page %d of %d", [_pdfView page], _pdfDocument.pdf->get_page_count()]]; } #pragma mark - NSToolbarDelegate diff --git a/Meta/Lagom/Fuzzers/FuzzTar.cpp b/Meta/Lagom/Fuzzers/FuzzTar.cpp index 33b9c6a2bba9b1..9a817161509234 100644 --- a/Meta/Lagom/Fuzzers/FuzzTar.cpp +++ b/Meta/Lagom/Fuzzers/FuzzTar.cpp @@ -38,7 +38,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) switch (header.type_flag()) { case Archive::TarFileType::GlobalExtendedHeader: case Archive::TarFileType::ExtendedHeader: { - auto result = tar_stream->for_each_extended_header([&](StringView, StringView) {}); + auto result = tar_stream->for_each_extended_header([&](StringView, StringView) { }); if (result.is_error()) return 0; break; diff --git a/Meta/lint-clang-format.sh b/Meta/lint-clang-format.sh index d582402af6e9f3..9ce227351f5eaa 100755 --- a/Meta/lint-clang-format.sh +++ b/Meta/lint-clang-format.sh @@ -30,21 +30,21 @@ fi if (( ${#files[@]} )); then TOOLCHAIN_DIR=Toolchain/Local/clang/bin CLANG_FORMAT=false - if command -v clang-format-18 >/dev/null 2>&1 ; then - CLANG_FORMAT=clang-format-18 - elif command -v brew >/dev/null 2>&1 && command -v "$(brew --prefix llvm@18)"/bin/clang-format >/dev/null 2>&1 ; then - CLANG_FORMAT="$(brew --prefix llvm@18)"/bin/clang-format - elif command -v $TOOLCHAIN_DIR/clang-format >/dev/null 2>&1 && $TOOLCHAIN_DIR/clang-format --version | grep -qF ' 18.' ; then + if command -v clang-format-19 >/dev/null 2>&1 ; then + CLANG_FORMAT=clang-format-19 + elif command -v brew >/dev/null 2>&1 && command -v "$(brew --prefix llvm@19)"/bin/clang-format >/dev/null 2>&1 ; then + CLANG_FORMAT="$(brew --prefix llvm@19)"/bin/clang-format + elif command -v $TOOLCHAIN_DIR/clang-format >/dev/null 2>&1 && $TOOLCHAIN_DIR/clang-format --version | grep -qF ' 19.' ; then CLANG_FORMAT=$TOOLCHAIN_DIR/clang-format elif command -v clang-format >/dev/null 2>&1 ; then CLANG_FORMAT=clang-format - if ! "${CLANG_FORMAT}" --version | awk '{ if (substr($NF, 1, index($NF, ".") - 1) < 18) exit 1; }'; then - echo "You are using '$("${CLANG_FORMAT}" --version)', which appears to not be clang-format 18 or later." + if ! "${CLANG_FORMAT}" --version | awk '{ if (substr($NF, 1, index($NF, ".") - 1) < 19) exit 1; }'; then + echo "You are using '$("${CLANG_FORMAT}" --version)', which appears to not be clang-format 19 or later." echo "It is very likely that the resulting changes are not what you wanted." fi else - echo "clang-format-18 is not available, but C or C++ files need linting! Either skip this script, or install clang-format-18." - echo "(If you install a package 'clang-format', please make sure it's version 18 or later.)" + echo "clang-format-19 is not available, but C or C++ files need linting! Either skip this script, or install clang-format-19." + echo "(If you install a package 'clang-format', please make sure it's version 19 or later.)" exit 1 fi diff --git a/Tests/Kernel/TestSigHandler.cpp b/Tests/Kernel/TestSigHandler.cpp index ebb97f1d64d88d..b79672355776a7 100644 --- a/Tests/Kernel/TestSigHandler.cpp +++ b/Tests/Kernel/TestSigHandler.cpp @@ -18,7 +18,7 @@ static void signal_handler(int) TEST_CASE(default_handlers) { - struct sigaction current_action { }; + struct sigaction current_action {}; int rc = sigaction(SIGUSR2, nullptr, ¤t_action); @@ -37,7 +37,7 @@ TEST_CASE(handlers_after_fork) pid_t pid = fork(); if (pid == 0) { - struct sigaction current_action { }; + struct sigaction current_action {}; rc = sigaction(SIGUSR2, nullptr, ¤t_action); EXPECT_EQ(rc, 0); EXPECT_EQ(current_action.sa_handler, signal_handler); diff --git a/Userland/Applications/CertificateSettings/CertificateStoreWidget.h b/Userland/Applications/CertificateSettings/CertificateStoreWidget.h index b952783793c293..31abe749691185 100644 --- a/Userland/Applications/CertificateSettings/CertificateStoreWidget.h +++ b/Userland/Applications/CertificateSettings/CertificateStoreWidget.h @@ -25,7 +25,9 @@ class CertificateStoreProxyModel : public GUI::SortingProxyModel { private: CertificateStoreProxyModel(NonnullRefPtr source, NonnullRefPtr view) : SortingProxyModel(move(source)) - , m_parent_table_view(move(view)) {}; + , m_parent_table_view(move(view)) + { + } NonnullRefPtr m_parent_table_view; }; @@ -60,7 +62,7 @@ class CertificateStoreWidget : public GUI::SettingsWindow::Tab { virtual ~CertificateStoreWidget() override = default; static ErrorOr> try_create(); ErrorOr initialize(); - virtual void apply_settings() override {}; + virtual void apply_settings() override { } private: CertificateStoreWidget() = default; diff --git a/Userland/Applications/Debugger/main.cpp b/Userland/Applications/Debugger/main.cpp index 889e5b39498aeb..5a21e894b33626 100644 --- a/Userland/Applications/Debugger/main.cpp +++ b/Userland/Applications/Debugger/main.cpp @@ -233,8 +233,7 @@ ErrorOr serenity_main(Main::Arguments arguments) g_debug_session = create_debug_session(command, pid_to_debug); - struct sigaction sa { - }; + struct sigaction sa {}; sa.sa_handler = handle_sigint; TRY(Core::System::sigaction(SIGINT, &sa, nullptr)); diff --git a/Userland/Applications/Help/ManualModel.h b/Userland/Applications/Help/ManualModel.h index a555cbdfe880c1..e1717d45721923 100644 --- a/Userland/Applications/Help/ManualModel.h +++ b/Userland/Applications/Help/ManualModel.h @@ -19,7 +19,7 @@ class ManualModel final : public GUI::Model { return adopt_nonnull_ref_or_enomem(new (nothrow) ManualModel); } - virtual ~ManualModel() override {}; + virtual ~ManualModel() override { } Optional index_from_path(StringView) const; diff --git a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp index 937c50cad4e579..903713998cc31c 100644 --- a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp +++ b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp @@ -115,7 +115,7 @@ class KeymapSelectionDialog final : public GUI::Dialog { class KeymapModel final : public GUI::Model { public: - KeymapModel() {}; + KeymapModel() { } int row_count(GUI::ModelIndex const&) const override { return m_data.size(); } int column_count(GUI::ModelIndex const&) const override { return 1; } diff --git a/Userland/Applications/PixelPaint/Filters/Bloom.h b/Userland/Applications/PixelPaint/Filters/Bloom.h index 68b258458f88b0..d61bf4d5d6abe7 100644 --- a/Userland/Applications/PixelPaint/Filters/Bloom.h +++ b/Userland/Applications/PixelPaint/Filters/Bloom.h @@ -19,7 +19,9 @@ class Bloom final : public InplaceFilter { virtual StringView filter_name() const override { return "Bloom Filter"sv; } Bloom(ImageEditor* editor) - : InplaceFilter(editor) {}; + : InplaceFilter(editor) + { + } private: int m_luma_lower { 128 }; diff --git a/Userland/Applications/PixelPaint/Filters/BoxBlur3.h b/Userland/Applications/PixelPaint/Filters/BoxBlur3.h index 2491501a6fc91d..7384fd97df54c7 100644 --- a/Userland/Applications/PixelPaint/Filters/BoxBlur3.h +++ b/Userland/Applications/PixelPaint/Filters/BoxBlur3.h @@ -16,7 +16,9 @@ class BoxBlur3 final : public Filter { virtual StringView filter_name() const override { return "Box Blur (3x3)"sv; } BoxBlur3(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } }; } diff --git a/Userland/Applications/PixelPaint/Filters/BoxBlur5.h b/Userland/Applications/PixelPaint/Filters/BoxBlur5.h index 214f4cf39617e0..5516acdc4bbfca 100644 --- a/Userland/Applications/PixelPaint/Filters/BoxBlur5.h +++ b/Userland/Applications/PixelPaint/Filters/BoxBlur5.h @@ -16,7 +16,9 @@ class BoxBlur5 final : public Filter { virtual StringView filter_name() const override { return "Box Blur (5x5)"sv; } BoxBlur5(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } }; } diff --git a/Userland/Applications/PixelPaint/Filters/FastBoxBlur.h b/Userland/Applications/PixelPaint/Filters/FastBoxBlur.h index 9461539acf86bd..a1a7b3c1a79cfc 100644 --- a/Userland/Applications/PixelPaint/Filters/FastBoxBlur.h +++ b/Userland/Applications/PixelPaint/Filters/FastBoxBlur.h @@ -20,7 +20,9 @@ class FastBoxBlur final : public InplaceFilter { virtual StringView filter_name() const override { return "Fast Box Blur (& Gauss)"sv; } FastBoxBlur(ImageEditor* editor) - : InplaceFilter(editor) {}; + : InplaceFilter(editor) + { + } private: size_t m_radius { 5 }; diff --git a/Userland/Applications/PixelPaint/Filters/Filter.h b/Userland/Applications/PixelPaint/Filters/Filter.h index de25a68e21efa6..58846dba9a9a49 100644 --- a/Userland/Applications/PixelPaint/Filters/Filter.h +++ b/Userland/Applications/PixelPaint/Filters/Filter.h @@ -26,7 +26,7 @@ class Filter : public RefCounted { virtual StringView filter_name() const = 0; - virtual ~Filter() {}; + virtual ~Filter() { } Filter(ImageEditor* editor); diff --git a/Userland/Applications/PixelPaint/Filters/GaussBlur3.h b/Userland/Applications/PixelPaint/Filters/GaussBlur3.h index 1ef65a68b2eb38..52de2bc23db46c 100644 --- a/Userland/Applications/PixelPaint/Filters/GaussBlur3.h +++ b/Userland/Applications/PixelPaint/Filters/GaussBlur3.h @@ -17,7 +17,9 @@ class GaussBlur3 final : public Filter { virtual StringView filter_name() const override { return "Gaussian Blur (3x3)"sv; } GaussBlur3(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } }; } diff --git a/Userland/Applications/PixelPaint/Filters/GaussBlur5.h b/Userland/Applications/PixelPaint/Filters/GaussBlur5.h index 2825e6e97789de..b4dc5b60b6bf93 100644 --- a/Userland/Applications/PixelPaint/Filters/GaussBlur5.h +++ b/Userland/Applications/PixelPaint/Filters/GaussBlur5.h @@ -16,7 +16,9 @@ class GaussBlur5 final : public Filter { virtual StringView filter_name() const override { return "Gaussian Blur (5x5)"sv; } GaussBlur5(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } }; } diff --git a/Userland/Applications/PixelPaint/Filters/Grayscale.h b/Userland/Applications/PixelPaint/Filters/Grayscale.h index 8af67513e6e84f..b13493a726b331 100644 --- a/Userland/Applications/PixelPaint/Filters/Grayscale.h +++ b/Userland/Applications/PixelPaint/Filters/Grayscale.h @@ -16,7 +16,9 @@ class Grayscale final : public Filter { virtual StringView filter_name() const override { return "Grayscale"sv; } Grayscale(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } }; } diff --git a/Userland/Applications/PixelPaint/Filters/HueAndSaturation.h b/Userland/Applications/PixelPaint/Filters/HueAndSaturation.h index eefc94ca78e944..c0aacbfb3fd724 100644 --- a/Userland/Applications/PixelPaint/Filters/HueAndSaturation.h +++ b/Userland/Applications/PixelPaint/Filters/HueAndSaturation.h @@ -18,7 +18,9 @@ class HueAndSaturation final : public InplaceFilter { virtual StringView filter_name() const override { return "Hue/Saturation"sv; } HueAndSaturation(ImageEditor* editor) - : InplaceFilter(editor) {}; + : InplaceFilter(editor) + { + } private: float m_hue { 0 }; diff --git a/Userland/Applications/PixelPaint/Filters/Invert.h b/Userland/Applications/PixelPaint/Filters/Invert.h index 32cf1160f2a386..2078079b243742 100644 --- a/Userland/Applications/PixelPaint/Filters/Invert.h +++ b/Userland/Applications/PixelPaint/Filters/Invert.h @@ -16,7 +16,9 @@ class Invert final : public Filter { virtual StringView filter_name() const override { return "Invert"sv; } Invert(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } }; } diff --git a/Userland/Applications/PixelPaint/Filters/LaplaceCardinal.h b/Userland/Applications/PixelPaint/Filters/LaplaceCardinal.h index a2317603858624..c0fd0bf99f060f 100644 --- a/Userland/Applications/PixelPaint/Filters/LaplaceCardinal.h +++ b/Userland/Applications/PixelPaint/Filters/LaplaceCardinal.h @@ -16,7 +16,9 @@ class LaplaceCardinal final : public Filter { virtual StringView filter_name() const override { return "Laplacian Cardinal"sv; } LaplaceCardinal(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } }; } diff --git a/Userland/Applications/PixelPaint/Filters/LaplaceDiagonal.h b/Userland/Applications/PixelPaint/Filters/LaplaceDiagonal.h index 9efc9cec8c43a3..54ee8a8dcc841c 100644 --- a/Userland/Applications/PixelPaint/Filters/LaplaceDiagonal.h +++ b/Userland/Applications/PixelPaint/Filters/LaplaceDiagonal.h @@ -16,7 +16,9 @@ class LaplaceDiagonal final : public Filter { virtual StringView filter_name() const override { return "Laplacian Diagonal"sv; } LaplaceDiagonal(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } }; } diff --git a/Userland/Applications/PixelPaint/Filters/Sepia.h b/Userland/Applications/PixelPaint/Filters/Sepia.h index 50487c298a7fa3..5678c44860bd94 100644 --- a/Userland/Applications/PixelPaint/Filters/Sepia.h +++ b/Userland/Applications/PixelPaint/Filters/Sepia.h @@ -18,7 +18,9 @@ class Sepia final : public Filter { virtual StringView filter_name() const override { return "Sepia"sv; } Sepia(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } private: float m_amount { 1.0f }; diff --git a/Userland/Applications/PixelPaint/Filters/Sharpen.h b/Userland/Applications/PixelPaint/Filters/Sharpen.h index 855976da4686be..e5c80e3f80c4fe 100644 --- a/Userland/Applications/PixelPaint/Filters/Sharpen.h +++ b/Userland/Applications/PixelPaint/Filters/Sharpen.h @@ -16,7 +16,9 @@ class Sharpen final : public Filter { virtual StringView filter_name() const override { return "Sharpen"sv; } Sharpen(ImageEditor* editor) - : Filter(editor) {}; + : Filter(editor) + { + } }; } diff --git a/Userland/Applications/PixelPaint/MainWidget.h b/Userland/Applications/PixelPaint/MainWidget.h index 33fd2b728b2301..0b25b327cd7283 100644 --- a/Userland/Applications/PixelPaint/MainWidget.h +++ b/Userland/Applications/PixelPaint/MainWidget.h @@ -37,7 +37,7 @@ class MainWidget : public GUI::Widget { C_OBJECT(MainWidget); public: - virtual ~MainWidget() {}; + virtual ~MainWidget() { } ErrorOr initialize_menubar(GUI::Window&); diff --git a/Userland/Applications/SpaceAnalyzer/Tree.cpp b/Userland/Applications/SpaceAnalyzer/Tree.cpp index 2e010f7f0fb998..d7af2dc756e6f2 100644 --- a/Userland/Applications/SpaceAnalyzer/Tree.cpp +++ b/Userland/Applications/SpaceAnalyzer/Tree.cpp @@ -42,7 +42,9 @@ void TreeNode::sort_children_by_area() const struct QueueEntry { QueueEntry(ByteString path, TreeNode* node) : path(move(path)) - , node(node) {}; + , node(node) + { + } ByteString path; TreeNode* node { nullptr }; }; diff --git a/Userland/Applications/SpaceAnalyzer/Tree.h b/Userland/Applications/SpaceAnalyzer/Tree.h index 34e0913a782285..90a881f8c85bf3 100644 --- a/Userland/Applications/SpaceAnalyzer/Tree.h +++ b/Userland/Applications/SpaceAnalyzer/Tree.h @@ -19,7 +19,9 @@ struct MountInfo { class TreeNode final { public: TreeNode(ByteString name) - : m_name(move(name)) {}; + : m_name(move(name)) + { + } ByteString name() const { return m_name; } i64 area() const { return m_area; } @@ -49,7 +51,7 @@ class Tree { { return adopt_nonnull_own_or_enomem(new (nothrow) Tree(move(root_name))); } - ~Tree() {}; + ~Tree() { } TreeNode& root() { @@ -58,6 +60,8 @@ class Tree { private: Tree(ByteString root_name) - : m_root(move(root_name)) {}; + : m_root(move(root_name)) + { + } TreeNode m_root; }; diff --git a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp index a03fefa586c6c2..87b9eb960989d0 100644 --- a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp +++ b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp @@ -393,7 +393,7 @@ ErrorOr VideoPlayerWidget::initialize_menubar(GUI::Window& window) // FIXME: Maybe seek mode should be in an options dialog instead. The playback menu may get crowded. // For now, leave it here for convenience. - m_use_fast_seeking = GUI::Action::create_checkable("&Fast Seeking", [&](auto&) {}); + m_use_fast_seeking = GUI::Action::create_checkable("&Fast Seeking", [&](auto&) { }); playback_menu->add_action(*m_use_fast_seeking); set_seek_mode(Media::PlaybackManager::DEFAULT_SEEK_MODE); diff --git a/Userland/DevTools/HackStudio/ClassViewWidget.h b/Userland/DevTools/HackStudio/ClassViewWidget.h index bd717a67b2e52b..dae99396d3f2a0 100644 --- a/Userland/DevTools/HackStudio/ClassViewWidget.h +++ b/Userland/DevTools/HackStudio/ClassViewWidget.h @@ -36,7 +36,9 @@ struct ClassViewNode { ClassViewNode* parent { nullptr }; explicit ClassViewNode(StringView name) - : name(name) {}; + : name(name) + { + } }; class ClassViewModel final : public GUI::Model { diff --git a/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp b/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp index 831abe43c7d56c..edbcf92c733a2c 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp +++ b/Userland/DevTools/HackStudio/LanguageServers/FileDB.cpp @@ -88,13 +88,13 @@ ErrorOr> FileDB::create_from_fd(int fd) const class DefaultDocumentClient final : public GUI::TextDocument::Client { public: virtual ~DefaultDocumentClient() override = default; - virtual void document_did_append_line() override {}; - virtual void document_did_insert_line(size_t) override {}; - virtual void document_did_remove_line(size_t) override {}; - virtual void document_did_remove_all_lines() override {}; + virtual void document_did_append_line() override { } + virtual void document_did_insert_line(size_t) override { } + virtual void document_did_remove_line(size_t) override { } + virtual void document_did_remove_all_lines() override { } virtual void document_did_change(GUI::AllowCallback) override {}; virtual void document_did_set_text(GUI::AllowCallback) override {}; - virtual void document_did_set_cursor(const GUI::TextPosition&) override {}; + virtual void document_did_set_cursor(const GUI::TextPosition&) override { } virtual void document_did_update_undo_stack() override { } virtual bool is_automatic_indentation_enabled() const override { return false; } diff --git a/Userland/DevTools/Profiler/FilesystemEventModel.h b/Userland/DevTools/Profiler/FilesystemEventModel.h index 80e4569377103a..fb3b6925929ea3 100644 --- a/Userland/DevTools/Profiler/FilesystemEventModel.h +++ b/Userland/DevTools/Profiler/FilesystemEventModel.h @@ -53,7 +53,9 @@ class FileEventNode : public RefCounted { private: FileEventNode(ByteString const& path, FileEventNode* parent = nullptr) : m_path(path) - , m_parent(parent) {}; + , m_parent(parent) + { + } ByteString m_path; diff --git a/Userland/Libraries/LibArchive/TarStream.h b/Userland/Libraries/LibArchive/TarStream.h index 2ff3b8c5dd0878..c3c505f0bc4b60 100644 --- a/Userland/Libraries/LibArchive/TarStream.h +++ b/Userland/Libraries/LibArchive/TarStream.h @@ -22,7 +22,7 @@ class TarFileStream : public Stream { virtual ErrorOr write_some(ReadonlyBytes) override; virtual bool is_eof() const override; virtual bool is_open() const override { return true; } - virtual void close() override {}; + virtual void close() override { } private: TarFileStream(TarInputStream& stream); diff --git a/Userland/Libraries/LibAudio/ConnectionToServer.cpp b/Userland/Libraries/LibAudio/ConnectionToServer.cpp index 1634db6233a08c..b5c9a1542ca066 100644 --- a/Userland/Libraries/LibAudio/ConnectionToServer.cpp +++ b/Userland/Libraries/LibAudio/ConnectionToServer.cpp @@ -35,7 +35,7 @@ ConnectionToServer::ConnectionToServer(NonnullOwnPtr socket) Threading::MutexLocker const locker(m_enqueuer_loop_destruction); m_enqueuer_loop = nullptr; } - return (intptr_t) nullptr; + return (intptr_t)nullptr; })) { update_good_sleep_time(); diff --git a/Userland/Libraries/LibC/arch/riscv64/fenv.cpp b/Userland/Libraries/LibC/arch/riscv64/fenv.cpp index 68e7bcea02d1ff..8e80529ad65349 100644 --- a/Userland/Libraries/LibC/arch/riscv64/fenv.cpp +++ b/Userland/Libraries/LibC/arch/riscv64/fenv.cpp @@ -74,7 +74,7 @@ static RoundingMode get_rounding_mode() { size_t rounding_mode; asm volatile("frrm %0" - : "=r"(rounding_mode)); + : "=r"(rounding_mode)); return static_cast(rounding_mode); } @@ -84,8 +84,8 @@ static RoundingMode set_rounding_mode(RoundingMode frm) size_t old_rounding_mode; size_t const new_rounding_mode = to_underlying(frm); asm volatile("fsrm %0, %1" - : "=r"(old_rounding_mode) - : "r"(new_rounding_mode)); + : "=r"(old_rounding_mode) + : "r"(new_rounding_mode)); return static_cast(old_rounding_mode); } @@ -145,7 +145,7 @@ static AccruedExceptions get_accrued_exceptions() { size_t fflags; asm volatile("frflags %0" - : "=r"(fflags)); + : "=r"(fflags)); return static_cast(fflags); } @@ -155,8 +155,8 @@ static AccruedExceptions set_accrued_exceptions(AccruedExceptions exceptions) size_t old_exceptions; size_t const new_exceptions = to_underlying(exceptions); asm volatile("fsflags %0, %1" - : "=r"(old_exceptions) - : "r"(new_exceptions)); + : "=r"(old_exceptions) + : "r"(new_exceptions)); return static_cast(old_exceptions); } @@ -174,7 +174,7 @@ int fegetenv(fenv_t* env) FlatPtr fcsr; asm volatile("csrr %0, fcsr" - : "=r"(fcsr)); + : "=r"(fcsr)); env->fcsr = fcsr; return 0; diff --git a/Userland/Libraries/LibC/arch/x86_64/fenv.cpp b/Userland/Libraries/LibC/arch/x86_64/fenv.cpp index 55d70cf5c36ca9..ef84093cfc0887 100644 --- a/Userland/Libraries/LibC/arch/x86_64/fenv.cpp +++ b/Userland/Libraries/LibC/arch/x86_64/fenv.cpp @@ -14,7 +14,7 @@ static u16 read_status_register() { u16 status_register; asm volatile("fnstsw %0" - : "=m"(status_register)); + : "=m"(status_register)); return status_register; } @@ -22,7 +22,7 @@ static u16 read_control_word() { u16 control_word; asm volatile("fnstcw %0" - : "=m"(control_word)); + : "=m"(control_word)); return control_word; } @@ -35,7 +35,7 @@ static u32 read_mxcsr() { u32 mxcsr; asm volatile("stmxcsr %0" - : "=m"(mxcsr)); + : "=m"(mxcsr)); return mxcsr; } @@ -54,7 +54,7 @@ int fegetenv(fenv_t* env) return 1; asm volatile("fnstenv %0" - : "=m"(env->__x87_fpu_env)::"memory"); + : "=m"(env->__x87_fpu_env)::"memory"); env->__mxcsr = read_mxcsr(); return 0; @@ -72,7 +72,7 @@ int fesetenv(fenv_t const* env) } asm volatile("fldenv %0" ::"m"(env->__x87_fpu_env) - : "memory"); + : "memory"); set_mxcsr(env->__mxcsr); return 0; diff --git a/Userland/Libraries/LibC/unistd.cpp b/Userland/Libraries/LibC/unistd.cpp index ca44459aaad1e5..a8125fe3c2c392 100644 --- a/Userland/Libraries/LibC/unistd.cpp +++ b/Userland/Libraries/LibC/unistd.cpp @@ -1068,7 +1068,7 @@ char* getpass(char const* prompt) close(tty); }); - struct termios backup { }; + struct termios backup {}; if (tcgetattr(tty, &backup) < 0) return nullptr; diff --git a/Userland/Libraries/LibCodeComprehension/CodeComprehensionEngine.h b/Userland/Libraries/LibCodeComprehension/CodeComprehensionEngine.h index b708cf410f3738..ff60716d95be2c 100644 --- a/Userland/Libraries/LibCodeComprehension/CodeComprehensionEngine.h +++ b/Userland/Libraries/LibCodeComprehension/CodeComprehensionEngine.h @@ -27,8 +27,8 @@ class CodeComprehensionEngine { virtual Vector get_suggestions(ByteString const& file, GUI::TextPosition const& autocomplete_position) = 0; // TODO: In the future we can pass the range that was edited and only re-parse what we have to. - virtual void on_edit([[maybe_unused]] ByteString const& file) {}; - virtual void file_opened([[maybe_unused]] ByteString const& file) {}; + virtual void on_edit([[maybe_unused]] ByteString const& file) { } + virtual void file_opened([[maybe_unused]] ByteString const& file) { } virtual Optional find_declaration_of(ByteString const&, GUI::TextPosition const&) { return {}; } diff --git a/Userland/Libraries/LibCompress/Brotli.h b/Userland/Libraries/LibCompress/Brotli.h index 484b1c82aa6523..402c710143df22 100644 --- a/Userland/Libraries/LibCompress/Brotli.h +++ b/Userland/Libraries/LibCompress/Brotli.h @@ -20,7 +20,9 @@ class CanonicalCode { CanonicalCode() = default; CanonicalCode(Vector codes, Vector values) : m_symbol_codes(move(codes)) - , m_symbol_values(move(values)) {}; + , m_symbol_values(move(values)) + { + } static ErrorOr read_prefix_code(LittleEndianInputBitStream&, size_t alphabet_size); static ErrorOr read_simple_prefix_code(LittleEndianInputBitStream&, size_t alphabet_size); diff --git a/Userland/Libraries/LibCompress/Gzip.h b/Userland/Libraries/LibCompress/Gzip.h index 0b1fa9160b5282..60fe34ae54c6f9 100644 --- a/Userland/Libraries/LibCompress/Gzip.h +++ b/Userland/Libraries/LibCompress/Gzip.h @@ -49,7 +49,7 @@ class GzipDecompressor final : public Stream { virtual ErrorOr write_some(ReadonlyBytes) override; virtual bool is_eof() const override; virtual bool is_open() const override { return true; } - virtual void close() override {}; + virtual void close() override { } static ErrorOr decompress_all(ReadonlyBytes); diff --git a/Userland/Libraries/LibCore/Command.cpp b/Userland/Libraries/LibCore/Command.cpp index 579669102ddb7b..8f98ddc995ea85 100644 --- a/Userland/Libraries/LibCore/Command.cpp +++ b/Userland/Libraries/LibCore/Command.cpp @@ -73,7 +73,7 @@ ErrorOr Command::write_lines(Span lines) // It's possible the process dies before we can write everything to the // stdin. So make sure that we don't crash but just stop writing. - struct sigaction action_handler { }; + struct sigaction action_handler {}; action_handler.sa_handler = SIG_IGN; struct sigaction old_action_handler; diff --git a/Userland/Libraries/LibCore/Process.cpp b/Userland/Libraries/LibCore/Process.cpp index 41a2ea24faaa60..73ea9c096be957 100644 --- a/Userland/Libraries/LibCore/Process.cpp +++ b/Userland/Libraries/LibCore/Process.cpp @@ -284,7 +284,7 @@ ErrorOr Process::is_being_debugged() if (sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0) < 0) return Error::from_syscall("sysctl"sv, -errno); - // We're being debugged if the P_TRACED flag is set. + // We're being debugged if the P_TRACED flag is set. # if defined(AK_OS_MACOS) return ((info.kp_proc.p_flag & P_TRACED) != 0); # elif defined(AK_OS_FREEBSD) diff --git a/Userland/Libraries/LibCore/ThreadedPromise.h b/Userland/Libraries/LibCore/ThreadedPromise.h index faaf9db9667a1f..0246d31092bf34 100644 --- a/Userland/Libraries/LibCore/ThreadedPromise.h +++ b/Userland/Libraries/LibCore/ThreadedPromise.h @@ -112,7 +112,7 @@ class ThreadedPromise // Set the callback to be called when the promise is rejected. Setting this callback // will cause the promise fulfillment to be ready to be handled. template RejectedHandler> - ThreadedPromise& when_rejected(RejectedHandler when_rejected = [](ErrorType&) {}) + ThreadedPromise& when_rejected(RejectedHandler when_rejected = [](ErrorType&) { }) { Threading::MutexLocker locker { m_mutex }; VERIFY(!m_rejection_handler); diff --git a/Userland/Libraries/LibCoredump/Inspector.cpp b/Userland/Libraries/LibCoredump/Inspector.cpp index d9d4423fa77ed3..e369ba2bc6f8ee 100644 --- a/Userland/Libraries/LibCoredump/Inspector.cpp +++ b/Userland/Libraries/LibCoredump/Inspector.cpp @@ -68,7 +68,7 @@ PtraceRegisters Inspector::get_registers() const return registers; } -void Inspector::set_registers(PtraceRegisters const&) {}; +void Inspector::set_registers(PtraceRegisters const&) { } void Inspector::for_each_loaded_library(Function func) const { diff --git a/Userland/Libraries/LibCrypto/BigFraction/BigFraction.cpp b/Userland/Libraries/LibCrypto/BigFraction/BigFraction.cpp index 0c42059c912ab6..24b388869b3018 100644 --- a/Userland/Libraries/LibCrypto/BigFraction/BigFraction.cpp +++ b/Userland/Libraries/LibCrypto/BigFraction/BigFraction.cpp @@ -194,8 +194,8 @@ ByteString BigFraction::to_byte_string(unsigned rounding_threshold) const auto const number_of_digits = [](auto integer) { unsigned size = 1; for (auto division_result = integer.divided_by(UnsignedBigInteger { 10 }); - division_result.remainder == UnsignedBigInteger { 0 } && division_result.quotient != UnsignedBigInteger { 0 }; - division_result = division_result.quotient.divided_by(UnsignedBigInteger { 10 })) { + division_result.remainder == UnsignedBigInteger { 0 } && division_result.quotient != UnsignedBigInteger { 0 }; + division_result = division_result.quotient.divided_by(UnsignedBigInteger { 10 })) { ++size; } return size; diff --git a/Userland/Libraries/LibCrypto/Cipher/AES.h b/Userland/Libraries/LibCrypto/Cipher/AES.h index ef87043b60381a..587130f9c1f7fc 100644 --- a/Userland/Libraries/LibCrypto/Cipher/AES.h +++ b/Userland/Libraries/LibCrypto/Cipher/AES.h @@ -99,8 +99,8 @@ struct AESCipherKey : public CipherKey { template void expand_decrypt_key_impl(ReadonlyBytes user_key, size_t bits); - static void (AESCipherKey::*const expand_encrypt_key_dispatched)(ReadonlyBytes user_key, size_t bits); - static void (AESCipherKey::*const expand_decrypt_key_dispatched)(ReadonlyBytes user_key, size_t bits); + static void (AESCipherKey::* const expand_encrypt_key_dispatched)(ReadonlyBytes user_key, size_t bits); + static void (AESCipherKey::* const expand_decrypt_key_dispatched)(ReadonlyBytes user_key, size_t bits); static constexpr size_t MAX_ROUND_COUNT = 14; u32 m_rd_keys[(MAX_ROUND_COUNT + 1) * 4] { 0 }; @@ -144,8 +144,8 @@ class AESCipher final : public Cipher { template void decrypt_block_impl(BlockType const& in, BlockType& out); - static void (AESCipher::*const encrypt_block_dispatched)(BlockType const& in, BlockType& out); - static void (AESCipher::*const decrypt_block_dispatched)(BlockType const& in, BlockType& out); + static void (AESCipher::* const encrypt_block_dispatched)(BlockType const& in, BlockType& out); + static void (AESCipher::* const decrypt_block_dispatched)(BlockType const& in, BlockType& out); }; } diff --git a/Userland/Libraries/LibCrypto/Hash/SHA1.cpp b/Userland/Libraries/LibCrypto/Hash/SHA1.cpp index d1ba8666554579..7637e90fdbc412 100644 --- a/Userland/Libraries/LibCrypto/Hash/SHA1.cpp +++ b/Userland/Libraries/LibCrypto/Hash/SHA1.cpp @@ -146,10 +146,12 @@ template<> decltype(SHA1::transform_dispatched) SHA1::transform_dispatched = [] { CPUFeatures features = detect_cpu_features(); + // clang-format off if constexpr (is_valid_feature(CPUFeatures::X86_SHA | CPUFeatures::X86_SSE42)) { if (has_flag(features, CPUFeatures::X86_SHA | CPUFeatures::X86_SSE42)) return &SHA1::transform_impl; } + // clang-format on return &SHA1::transform_impl; }(); diff --git a/Userland/Libraries/LibCrypto/Hash/SHA1.h b/Userland/Libraries/LibCrypto/Hash/SHA1.h index b750212f42843e..c53d2a822df07f 100644 --- a/Userland/Libraries/LibCrypto/Hash/SHA1.h +++ b/Userland/Libraries/LibCrypto/Hash/SHA1.h @@ -71,7 +71,7 @@ class SHA1 final : public HashFunction<512, 160> { template void transform_impl(); - static void (SHA1::*const transform_dispatched)(); + static void (SHA1::* const transform_dispatched)(); void transform() { return (this->*transform_dispatched)(); } u8 m_data_buffer[BlockSize] {}; diff --git a/Userland/Libraries/LibCrypto/Hash/SHA2.cpp b/Userland/Libraries/LibCrypto/Hash/SHA2.cpp index 0bf3457d4b86aa..684bf6437af9c6 100644 --- a/Userland/Libraries/LibCrypto/Hash/SHA2.cpp +++ b/Userland/Libraries/LibCrypto/Hash/SHA2.cpp @@ -130,10 +130,12 @@ template<> decltype(SHA256::transform_dispatched) SHA256::transform_dispatched = [] { CPUFeatures features = detect_cpu_features(); + // clang-format off if constexpr (is_valid_feature(CPUFeatures::X86_SHA | CPUFeatures::X86_SSE42)) { if (has_flag(features, CPUFeatures::X86_SHA | CPUFeatures::X86_SSE42)) return &SHA256::transform_impl; } + // clang-format on return &SHA256::transform_impl; }(); diff --git a/Userland/Libraries/LibCrypto/Hash/SHA2.h b/Userland/Libraries/LibCrypto/Hash/SHA2.h index 3a0837780762e0..a9b193fce1c1a0 100644 --- a/Userland/Libraries/LibCrypto/Hash/SHA2.h +++ b/Userland/Libraries/LibCrypto/Hash/SHA2.h @@ -119,7 +119,7 @@ class SHA256 final : public HashFunction<512, 256> { template void transform_impl(); - static void (SHA256::*const transform_dispatched)(); + static void (SHA256::* const transform_dispatched)(); void transform() { return (this->*transform_dispatched)(); } u8 m_data_buffer[BlockSize] {}; diff --git a/Userland/Libraries/LibFileSystem/FileSystem.cpp b/Userland/Libraries/LibFileSystem/FileSystem.cpp index da8bdd25533c37..0a10c20d614b27 100644 --- a/Userland/Libraries/LibFileSystem/FileSystem.cpp +++ b/Userland/Libraries/LibFileSystem/FileSystem.cpp @@ -427,7 +427,7 @@ bool can_delete_or_move(StringView path) auto stat_or_empty = [](StringView path) { auto stat_or_error = Core::System::stat(path); if (stat_or_error.is_error()) { - struct stat stat { }; + struct stat stat {}; return stat; } return stat_or_error.release_value(); diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h index aca5b93eefe505..6c47908af09e4d 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h @@ -85,7 +85,7 @@ class AbstractScrollableWidget : public Frame { virtual void resize_event(ResizeEvent&) override; virtual void mousewheel_event(MouseEvent&) override; virtual void did_scroll() { } - virtual void automatic_scrolling_timer_did_fire() {}; + virtual void automatic_scrolling_timer_did_fire() { } void set_content_size(Gfx::IntSize); void set_min_content_size(Gfx::IntSize); void set_size_occupied_by_fixed_elements(Gfx::IntSize); diff --git a/Userland/Libraries/LibGUI/AbstractThemePreview.h b/Userland/Libraries/LibGUI/AbstractThemePreview.h index d9249eea03f2b9..285dd2ee0485b8 100644 --- a/Userland/Libraries/LibGUI/AbstractThemePreview.h +++ b/Userland/Libraries/LibGUI/AbstractThemePreview.h @@ -50,7 +50,7 @@ class AbstractThemePreview : public GUI::Frame { return *m_inactive_window_icon; } - virtual void palette_changed() {}; + virtual void palette_changed() { } private: virtual void paint_preview(GUI::PaintEvent&) = 0; diff --git a/Userland/Libraries/LibGUI/Button.h b/Userland/Libraries/LibGUI/Button.h index e0e0e9901959be..b7b119b35a740d 100644 --- a/Userland/Libraries/LibGUI/Button.h +++ b/Userland/Libraries/LibGUI/Button.h @@ -91,7 +91,7 @@ class DialogButton final : public Button { C_OBJECT(DialogButton); public: - virtual ~DialogButton() override {}; + virtual ~DialogButton() override { } explicit DialogButton(String text = {}) : Button(move(text)) { diff --git a/Userland/Libraries/LibGUI/DynamicWidgetContainer.h b/Userland/Libraries/LibGUI/DynamicWidgetContainer.h index fdcfd6c6395e83..727e3ae4246379 100644 --- a/Userland/Libraries/LibGUI/DynamicWidgetContainer.h +++ b/Userland/Libraries/LibGUI/DynamicWidgetContainer.h @@ -50,7 +50,7 @@ class DynamicWidgetContainer : public Frame { protected: explicit DynamicWidgetContainer(Gfx::Orientation = Gfx::Orientation::Vertical); - virtual void paint_event(PaintEvent&) override {}; + virtual void paint_event(PaintEvent&) override { } virtual void second_paint_event(PaintEvent&) override; virtual void resize_event(ResizeEvent&) override; virtual void child_event(Core::ChildEvent&) override; diff --git a/Userland/Libraries/LibGfx/BitmapMixer.h b/Userland/Libraries/LibGfx/BitmapMixer.h index bd895d7ff57dc8..ce9b2612900994 100644 --- a/Userland/Libraries/LibGfx/BitmapMixer.h +++ b/Userland/Libraries/LibGfx/BitmapMixer.h @@ -18,7 +18,9 @@ class BitmapMixer { }; BitmapMixer(Bitmap& bitmap) - : m_bitmap(bitmap) {}; + : m_bitmap(bitmap) + { + } void mix_with(Bitmap&, MixingMethod); diff --git a/Userland/Libraries/LibGfx/Filters/Filter.h b/Userland/Libraries/LibGfx/Filters/Filter.h index 9231c24f33c8f1..a888ddc25fc4d2 100644 --- a/Userland/Libraries/LibGfx/Filters/Filter.h +++ b/Userland/Libraries/LibGfx/Filters/Filter.h @@ -24,8 +24,8 @@ class Filter { virtual StringView class_name() const = 0; - virtual void apply(Bitmap&, IntRect const&, Bitmap const&, IntRect const&, Parameters const&) {}; - virtual void apply(Bitmap&, IntRect const&, Bitmap const&, IntRect const&) {}; + virtual void apply(Bitmap&, IntRect const&, Bitmap const&, IntRect const&, Parameters const&) { } + virtual void apply(Bitmap&, IntRect const&, Bitmap const&, IntRect const&) { } protected: Filter() = default; diff --git a/Userland/Libraries/LibGfx/Filters/LumaFilter.h b/Userland/Libraries/LibGfx/Filters/LumaFilter.h index 7f907f9ef68cb1..251d8e694d9e6a 100644 --- a/Userland/Libraries/LibGfx/Filters/LumaFilter.h +++ b/Userland/Libraries/LibGfx/Filters/LumaFilter.h @@ -13,7 +13,9 @@ namespace Gfx { class LumaFilter { public: LumaFilter(Bitmap& bitmap) - : m_bitmap(bitmap) {}; + : m_bitmap(bitmap) + { + } void apply(u8 lower_bound, u8 upper_bound); diff --git a/Userland/Libraries/LibGfx/Font/Font.h b/Userland/Libraries/LibGfx/Font/Font.h index f5108dd09d5bd6..e9cb30065bd293 100644 --- a/Userland/Libraries/LibGfx/Font/Font.h +++ b/Userland/Libraries/LibGfx/Font/Font.h @@ -154,7 +154,7 @@ class Font : public RefCounted { virtual NonnullRefPtr clone() const = 0; virtual ErrorOr> try_clone() const = 0; - virtual ~Font() {}; + virtual ~Font() { } virtual FontPixelMetrics pixel_metrics() const = 0; diff --git a/Userland/Libraries/LibGfx/ImageFormats/ImageDecoder.h b/Userland/Libraries/LibGfx/ImageFormats/ImageDecoder.h index 9c7fe476729bb7..6b838bf330e890 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/ImageDecoder.h +++ b/Userland/Libraries/LibGfx/ImageFormats/ImageDecoder.h @@ -48,7 +48,7 @@ class Metadata { } protected: - virtual void fill_main_tags() const {}; + virtual void fill_main_tags() const { } mutable HashMap m_main_tags; }; diff --git a/Userland/Libraries/LibGfx/ImageFormats/WebPSharedLossless.h b/Userland/Libraries/LibGfx/ImageFormats/WebPSharedLossless.h index 43b466c2d0d4c9..25ec33f0ca7b61 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/WebPSharedLossless.h +++ b/Userland/Libraries/LibGfx/ImageFormats/WebPSharedLossless.h @@ -41,7 +41,7 @@ class CanonicalCode { ALWAYS_INLINE ErrorOr CanonicalCode::write_symbol(LittleEndianOutputBitStream& bit_stream, u32 symbol) const { TRY(m_code.visit( - [&](u32 single_code) __attribute__((always_inline))->ErrorOr { VERIFY(symbol == single_code); return {}; }, + [&](u32 single_code) __attribute__((always_inline)) -> ErrorOr { VERIFY(symbol == single_code); return {}; }, [&](Compress::CanonicalCode const& code) __attribute__((always_inline)) { return code.write_symbol(bit_stream, symbol); })); return {}; } diff --git a/Userland/Libraries/LibGfx/Path.h b/Userland/Libraries/LibGfx/Path.h index 12dc20af3da727..ae982b2ddfa3fd 100644 --- a/Userland/Libraries/LibGfx/Path.h +++ b/Userland/Libraries/LibGfx/Path.h @@ -64,7 +64,9 @@ class PathSegment { PathSegment(Command command, ReadonlySpan points) : m_command(command) - , m_points(points) {}; + , m_points(points) + { + } private: Command m_command; diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index e13f272782cc4c..e447aacaff5d23 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -720,7 +720,7 @@ class FunctionNode { virtual bool has_name() const = 0; virtual Value instantiate_ordinary_function_expression(VM&, DeprecatedFlyString given_name) const = 0; - virtual ~FunctionNode() {}; + virtual ~FunctionNode() { } protected: FunctionNode(RefPtr name, ByteString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, FunctionParsingInsights parsing_insights, bool is_arrow_function, Vector local_variables_names) @@ -780,7 +780,7 @@ class FunctionDeclaration final bool has_name() const override { return true; } Value instantiate_ordinary_function_expression(VM&, DeprecatedFlyString) const override { VERIFY_NOT_REACHED(); } - virtual ~FunctionDeclaration() {}; + virtual ~FunctionDeclaration() { } private: bool m_is_hoisted { false }; @@ -807,7 +807,7 @@ class FunctionExpression final Value instantiate_ordinary_function_expression(VM&, DeprecatedFlyString given_name) const override; - virtual ~FunctionExpression() {}; + virtual ~FunctionExpression() { } private: virtual bool is_function_expression() const override { return true; } diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp index 8b7786720ad7d7..ab2b39948354bc 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp @@ -98,7 +98,7 @@ ThrowCompletionOr> ErrorConstructor::construct(FunctionObje auto message = vm.argument(0); \ auto options = vm.argument(1); \ \ - /* 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, "%NativeError.prototype%", « [[ErrorData]] »). */ \ + /* 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, "%NativeError.prototype%", « [[ErrorData]] »). */ \ auto error = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::snake_name##_prototype)); \ \ /* 3. If message is not undefined, then */ \ diff --git a/Userland/Libraries/LibJS/Runtime/IndexedProperties.h b/Userland/Libraries/LibJS/Runtime/IndexedProperties.h index d0ea58daf0c80c..96af3b25b8920a 100644 --- a/Userland/Libraries/LibJS/Runtime/IndexedProperties.h +++ b/Userland/Libraries/LibJS/Runtime/IndexedProperties.h @@ -48,7 +48,9 @@ class IndexedPropertyStorage { protected: explicit IndexedPropertyStorage(IsSimpleStorage is_simple_storage) - : m_is_simple_storage(is_simple_storage == IsSimpleStorage::Yes) {}; + : m_is_simple_storage(is_simple_storage == IsSimpleStorage::Yes) + { + } private: bool m_is_simple_storage { false }; @@ -57,7 +59,9 @@ class IndexedPropertyStorage { class SimpleIndexedPropertyStorage final : public IndexedPropertyStorage { public: SimpleIndexedPropertyStorage() - : IndexedPropertyStorage(IsSimpleStorage::Yes) {}; + : IndexedPropertyStorage(IsSimpleStorage::Yes) + { + } explicit SimpleIndexedPropertyStorage(Vector&& initial_values); virtual bool has_index(u32 index) const override; @@ -99,7 +103,9 @@ class GenericIndexedPropertyStorage final : public IndexedPropertyStorage { public: explicit GenericIndexedPropertyStorage(SimpleIndexedPropertyStorage&&); explicit GenericIndexedPropertyStorage() - : IndexedPropertyStorage(IsSimpleStorage::No) {}; + : IndexedPropertyStorage(IsSimpleStorage::No) + { + } virtual bool has_index(u32 index) const override; virtual Optional get(u32 index) const override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h index 2eb5df9dbb67c0..bd0d20f2f71a79 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h @@ -189,7 +189,7 @@ class DurationFormat final : public Object { }; struct DurationInstanceComponent { - double Temporal::DurationRecord::*value_slot; + double Temporal::DurationRecord::* value_slot; DurationFormat::ValueStyle (DurationFormat::*get_style_slot)() const; void (DurationFormat::*set_style_slot)(StringView); DurationFormat::Display (DurationFormat::*get_display_slot)() const; diff --git a/Userland/Libraries/LibJS/Runtime/PromiseCapability.h b/Userland/Libraries/LibJS/Runtime/PromiseCapability.h index 4280b0d0902b83..d7e2a3aee64e33 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseCapability.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseCapability.h @@ -44,7 +44,7 @@ class PromiseCapability final : public Cell { auto&& _temporary_try_or_reject_result = (expression); \ /* 1. If value is an abrupt completion, then */ \ if (_temporary_try_or_reject_result.is_error()) { \ - /* a. Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »). */ \ + /* a. Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »). */ \ CALL_CHECK(JS::call(vm, *(capability)->reject(), js_undefined(), *_temporary_try_or_reject_result.release_error().value())); \ \ /* b. Return capability.[[Promise]]. */ \ @@ -70,7 +70,7 @@ class PromiseCapability final : public Cell { auto&& _temporary_try_or_reject_result = (expression); \ /* 1. If value is an abrupt completion, then */ \ if (_temporary_try_or_reject_result.is_error()) { \ - /* a. Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »). */ \ + /* a. Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »). */ \ TRY(JS::call(vm, *(capability)->reject(), js_undefined(), *_temporary_try_or_reject_result.release_error().value())); \ \ /* b. Return capability.[[Promise]]. */ \ diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h index c2a75e24676ca8..d5208a851cfe64 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h @@ -116,7 +116,7 @@ struct RoundedDuration { template struct TemporalDurationRecordField { - ValueT StructT::*field_name { nullptr }; + ValueT StructT::* field_name { nullptr }; PropertyKey property_name; }; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h index 363a02c652a556..37c9fa346fdf57 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h @@ -69,7 +69,7 @@ struct TemporalTimeLikeRecord { template struct TemporalTimeLikeRecordField { - ValueT StructT::*field_name { nullptr }; + ValueT StructT::* field_name { nullptr }; PropertyKey property_name; }; diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 70a9c33df116ee..f8e14a5699414a 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -2372,8 +2372,8 @@ ThrowCompletionOr is_less_than(VM& vm, Value lhs, Value rhs, bool left // b. Let ly be the length of py. // c. For each integer i such that 0 ≤ i < min(lx, ly), in ascending order, do for (auto k = x_code_points.begin(), l = y_code_points.begin(); - k != x_code_points.end() && l != y_code_points.end(); - ++k, ++l) { + k != x_code_points.end() && l != y_code_points.end(); + ++k, ++l) { // i. Let cx be the integer that is the numeric value of the code unit at index i within px. // ii. Let cy be the integer that is the numeric value of the code unit at index i within py. if (*k != *l) { diff --git a/Userland/Libraries/LibJS/SourceTextModule.cpp b/Userland/Libraries/LibJS/SourceTextModule.cpp index b50c671ca21f76..4941e27541edc6 100644 --- a/Userland/Libraries/LibJS/SourceTextModule.cpp +++ b/Userland/Libraries/LibJS/SourceTextModule.cpp @@ -176,7 +176,7 @@ Result, Vector> SourceTextModule::pa [&](ImportEntry const& import_entry) { return import_entry.local_name == entry.local_or_import_name; }) - .is_end()); + .is_end()); default_export = export_statement; } diff --git a/Userland/Libraries/LibLine/Editor.h b/Userland/Libraries/LibLine/Editor.h index 3282442e37971e..7d7572323230b6 100644 --- a/Userland/Libraries/LibLine/Editor.h +++ b/Userland/Libraries/LibLine/Editor.h @@ -468,10 +468,8 @@ class Editor : public Core::EventReceiver { KeyCallbackMachine m_callback_machine; - struct termios m_termios { - }; - struct termios m_default_termios { - }; + struct termios m_termios {}; + struct termios m_default_termios {}; bool m_was_interrupted { false }; bool m_previous_interrupt_was_handled_as_interrupt { true }; bool m_was_resized { false }; diff --git a/Userland/Libraries/LibLine/KeyCallbackMachine.h b/Userland/Libraries/LibLine/KeyCallbackMachine.h index a18814b0197eef..fbc9a55807ea9b 100644 --- a/Userland/Libraries/LibLine/KeyCallbackMachine.h +++ b/Userland/Libraries/LibLine/KeyCallbackMachine.h @@ -25,7 +25,9 @@ struct Key { Key(unsigned c) : modifiers(None) - , key(c) {}; + , key(c) + { + } Key(unsigned c, int modifiers) : modifiers(modifiers) diff --git a/Userland/Libraries/LibMedia/VideoDecoder.h b/Userland/Libraries/LibMedia/VideoDecoder.h index 578b9c1e80c19f..90fd419d125c84 100644 --- a/Userland/Libraries/LibMedia/VideoDecoder.h +++ b/Userland/Libraries/LibMedia/VideoDecoder.h @@ -16,7 +16,7 @@ namespace Media { class VideoDecoder { public: - virtual ~VideoDecoder() {}; + virtual ~VideoDecoder() { } virtual DecoderErrorOr receive_sample(Duration timestamp, ReadonlyBytes sample) = 0; DecoderErrorOr receive_sample(Duration timestamp, ByteBuffer const& sample) { return receive_sample(timestamp, sample.span()); } diff --git a/Userland/Libraries/LibPDF/DocumentParser.cpp b/Userland/Libraries/LibPDF/DocumentParser.cpp index e3ba3e1a515554..fb8328a4fb411c 100644 --- a/Userland/Libraries/LibPDF/DocumentParser.cpp +++ b/Userland/Libraries/LibPDF/DocumentParser.cpp @@ -702,7 +702,7 @@ PDFErrorOr> DocumentParser::par auto bits_required_for_greatest_shared_obj_identifier = hint_table.bits_required_for_greatest_shared_obj_identifier; auto bits_required_for_fraction_numerator = hint_table.bits_required_for_fraction_numerator; - auto parse_int_entry = [&](u32 PageOffsetHintTableEntry::*field, u32 bit_size) -> ErrorOr { + auto parse_int_entry = [&](u32 PageOffsetHintTableEntry::* field, u32 bit_size) -> ErrorOr { if (bit_size <= 0) return {}; @@ -714,7 +714,7 @@ PDFErrorOr> DocumentParser::par return {}; }; - auto parse_vector_entry = [&](Vector PageOffsetHintTableEntry::*field, u32 bit_size) -> ErrorOr { + auto parse_vector_entry = [&](Vector PageOffsetHintTableEntry::* field, u32 bit_size) -> ErrorOr { if (bit_size <= 0) return {}; diff --git a/Userland/Libraries/LibShell/Parser.cpp b/Userland/Libraries/LibShell/Parser.cpp index 90b553f8e56a9a..aafd8aa1cba13d 100644 --- a/Userland/Libraries/LibShell/Parser.cpp +++ b/Userland/Libraries/LibShell/Parser.cpp @@ -18,10 +18,10 @@ #define TRY_OR_THROW_PARSE_ERROR(expr) ({ \ /* Ignore -Wshadow to allow nesting the macro. */ \ AK_IGNORE_DIAGNOSTIC("-Wshadow", \ - auto&& _value_or_error = expr;) \ + auto&& _value_or_error = expr;) \ if (_value_or_error.is_error()) { \ AK_IGNORE_DIAGNOSTIC("-Wshadow", \ - auto _error = _value_or_error.release_error();) \ + auto _error = _value_or_error.release_error();) \ if (_error.is_errno() && _error.code() == ENOMEM) \ return create("OOM"_string); \ return create(MUST(String::formatted("Error: {}", _error))); \ @@ -32,11 +32,11 @@ #define TRY_OR_RESOLVE_TO_ERROR_STRING(expr) ({ \ /* Ignore -Wshadow to allow nesting the macro. */ \ AK_IGNORE_DIAGNOSTIC("-Wshadow", \ - auto&& _value_or_error = expr; \ - String _string_value;) \ + auto&& _value_or_error = expr; \ + String _string_value;) \ if (_value_or_error.is_error()) { \ AK_IGNORE_DIAGNOSTIC("-Wshadow", \ - auto _error = _value_or_error.release_error();) \ + auto _error = _value_or_error.release_error();) \ if (_error.is_errno() && _error.code() == ENOMEM) \ _string_value = "OOM"_string; \ else \ @@ -45,16 +45,16 @@ _value_or_error.is_error() ? _string_value : _value_or_error.release_value(); \ }) -#define TRY_OR(expr, catch_expr) ({ \ - /* Ignore -Wshadow to allow nesting the macro. */ \ - AK_IGNORE_DIAGNOSTIC("-Wshadow", \ - auto&& _value_or_error = expr;) \ - if (_value_or_error.is_error()) { \ - AK_IGNORE_DIAGNOSTIC("-Wshadow", \ - auto _error = _value_or_error.release_error();) \ - catch_expr; \ - } \ - _value_or_error.release_value(); \ +#define TRY_OR(expr, catch_expr) ({ \ + /* Ignore -Wshadow to allow nesting the macro. */ \ + AK_IGNORE_DIAGNOSTIC("-Wshadow", \ + auto&& _value_or_error = expr;) \ + if (_value_or_error.is_error()) { \ + AK_IGNORE_DIAGNOSTIC("-Wshadow", \ + auto _error = _value_or_error.release_error();) \ + catch_expr; \ + } \ + _value_or_error.release_value(); \ }) namespace Shell { diff --git a/Userland/Libraries/LibShell/PosixParser.cpp b/Userland/Libraries/LibShell/PosixParser.cpp index ac550255c14222..9311681edf62d6 100644 --- a/Userland/Libraries/LibShell/PosixParser.cpp +++ b/Userland/Libraries/LibShell/PosixParser.cpp @@ -13,10 +13,10 @@ #define TRY_OR_THROW_PARSE_ERROR_AT(expr, position) ({ \ /* Ignore -Wshadow to allow nesting the macro. */ \ AK_IGNORE_DIAGNOSTIC("-Wshadow", \ - auto&& _value_or_error = expr;) \ + auto&& _value_or_error = expr;) \ if (_value_or_error.is_error()) { \ AK_IGNORE_DIAGNOSTIC("-Wshadow", \ - auto _error = _value_or_error.release_error();) \ + auto _error = _value_or_error.release_error();) \ if (_error.is_errno() && _error.code() == ENOMEM) \ return make_ref_counted(position, "OOM"_string); \ return make_ref_counted(position, MUST(String::formatted("Error: {}", _error))); \ diff --git a/Userland/Libraries/LibTLS/TLSv12.h b/Userland/Libraries/LibTLS/TLSv12.h index 5591d6dd0a3ad5..8ebff364a7a354 100644 --- a/Userland/Libraries/LibTLS/TLSv12.h +++ b/Userland/Libraries/LibTLS/TLSv12.h @@ -190,8 +190,8 @@ struct Options { OPTION_WITH_DEFAULTS(bool, validate_certificates, true) OPTION_WITH_DEFAULTS(bool, allow_self_signed_certificates, false) OPTION_WITH_DEFAULTS(Optional>, root_certificates, ) - OPTION_WITH_DEFAULTS(Function, alert_handler, [](auto) {}) - OPTION_WITH_DEFAULTS(Function, finish_callback, [] {}) + OPTION_WITH_DEFAULTS(Function, alert_handler, [](auto) { }) + OPTION_WITH_DEFAULTS(Function, finish_callback, [] { }) OPTION_WITH_DEFAULTS(Function()>, certificate_provider, [] { return Vector {}; }) OPTION_WITH_DEFAULTS(bool, enable_extended_master_secret, true) diff --git a/Userland/Libraries/LibWeb/CSS/BackdropFilter.h b/Userland/Libraries/LibWeb/CSS/BackdropFilter.h index 5dd1e5be8da90a..67121f0e77c8b1 100644 --- a/Userland/Libraries/LibWeb/CSS/BackdropFilter.h +++ b/Userland/Libraries/LibWeb/CSS/BackdropFilter.h @@ -16,7 +16,9 @@ class BackdropFilter { public: BackdropFilter() = default; BackdropFilter(FilterValueListStyleValue const& filter_value_list) - : m_filter_value_list { filter_value_list } {}; + : m_filter_value_list { filter_value_list } + { + } static inline BackdropFilter make_none() { diff --git a/Userland/Libraries/LibWeb/CSS/ColumnCount.h b/Userland/Libraries/LibWeb/CSS/ColumnCount.h index 4723bae035d8dd..954cffe5a0e342 100644 --- a/Userland/Libraries/LibWeb/CSS/ColumnCount.h +++ b/Userland/Libraries/LibWeb/CSS/ColumnCount.h @@ -34,7 +34,7 @@ class ColumnCount { , m_value(value) { } - ColumnCount() {}; + ColumnCount() { } Type m_type { Type::Auto }; Optional m_value; diff --git a/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.h b/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.h index 025269dd843691..a6d3c966bf2500 100644 --- a/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.h +++ b/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.h @@ -71,11 +71,17 @@ class GridTrackPlacement { }; GridTrackPlacement() - : m_value(Auto {}) {}; + : m_value(Auto {}) + { + } GridTrackPlacement(AreaOrLine value) - : m_value(value) {}; + : m_value(value) + { + } GridTrackPlacement(Span value) - : m_value(value) {}; + : m_value(value) + { + } Variant m_value; }; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/AbstractImageStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/AbstractImageStyleValue.h index 1327198b4cb08f..1ef84ff1e2af80 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/AbstractImageStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/AbstractImageStyleValue.h @@ -32,8 +32,8 @@ class AbstractImageStyleValue : public StyleValue { return {}; } - virtual void load_any_resources(DOM::Document&) {}; - virtual void resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const&, CSSPixelSize) const {}; + virtual void load_any_resources(DOM::Document&) { } + virtual void resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const&, CSSPixelSize) const { } virtual bool is_paintable() const = 0; virtual void paint(PaintContext& context, DevicePixelRect const& dest_rect, ImageRendering, Vector const& clip_paths = {}) const = 0; diff --git a/Userland/Libraries/LibWeb/DOM/ElementFactory.cpp b/Userland/Libraries/LibWeb/DOM/ElementFactory.cpp index aed7fd79a662ca..00dc978d4d5baf 100644 --- a/Userland/Libraries/LibWeb/DOM/ElementFactory.cpp +++ b/Userland/Libraries/LibWeb/DOM/ElementFactory.cpp @@ -255,10 +255,10 @@ bool is_unknown_html_element(FlyString const& tag_name) if (tag_name.is_one_of(HTML::TagNames::applet, HTML::TagNames::bgsound, HTML::TagNames::blink, HTML::TagNames::isindex, HTML::TagNames::keygen, HTML::TagNames::multicol, HTML::TagNames::nextid, HTML::TagNames::spacer)) return true; - // 2. If name is acronym, basefont, big, center, nobr, noembed, noframes, plaintext, rb, rtc, strike, or tt, then return HTMLElement. - // 3. If name is listing or xmp, then return HTMLPreElement. - // 4. Otherwise, if this specification defines an interface appropriate for the element type corresponding to the local name name, then return that interface. - // 5. If other applicable specifications define an appropriate interface for name, then return the interface they define. + // 2. If name is acronym, basefont, big, center, nobr, noembed, noframes, plaintext, rb, rtc, strike, or tt, then return HTMLElement. + // 3. If name is listing or xmp, then return HTMLPreElement. + // 4. Otherwise, if this specification defines an interface appropriate for the element type corresponding to the local name name, then return that interface. + // 5. If other applicable specifications define an appropriate interface for name, then return the interface they define. #define __ENUMERATE_HTML_TAG(name) \ if (tag_name == HTML::TagNames::name) \ return false; diff --git a/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp b/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp index d38a2a2dafc20c..092f793a60cf9c 100644 --- a/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp +++ b/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp @@ -300,8 +300,8 @@ WebIDL::ExceptionOr URLSearchParams::sort() return true; for (auto k = a_code_points.begin(), l = b_code_points.begin(); - k != a_code_points.end() && l != b_code_points.end(); - ++k, ++l) { + k != a_code_points.end() && l != b_code_points.end(); + ++k, ++l) { if (*k != *l) { return *k < *l; } diff --git a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h index 61dbb83cb61834..af122b96ae1873 100644 --- a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h +++ b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h @@ -85,7 +85,7 @@ class FormAssociatedElement { virtual HTMLElement& form_associated_element_to_html_element() = 0; // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-form-reset-control - virtual void reset_algorithm() {}; + virtual void reset_algorithm() { } protected: FormAssociatedElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index 72aa8bda17ee5b..c0c905b9c1a05d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -1051,7 +1051,7 @@ WebIDL::ExceptionOr HTMLMediaElement::fetch_resource(URL::URL const& url_r // 5. Otherwise, incrementally read response's body given updateMedia, processEndOfMedia, an empty algorithm, and global. VERIFY(response->body()); - auto empty_algorithm = JS::create_heap_function(heap(), [](JS::Value) {}); + auto empty_algorithm = JS::create_heap_function(heap(), [](JS::Value) { }); // FIXME: We are "fully" reading the response here, rather than "incrementally". Memory concerns aside, this should be okay for now as we are // always setting byteRange to "entire resource". However, we should switch to incremental reads when that is implemented, and then diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index fb9bcd753bbeb5..6447a1848427f3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp @@ -203,7 +203,7 @@ WebIDL::ExceptionOr HTMLVideoElement::determine_element_poster_frame(Optio }); VERIFY(response->body()); - auto empty_algorithm = JS::create_heap_function(heap(), [](JS::Value) {}); + auto empty_algorithm = JS::create_heap_function(heap(), [](JS::Value) { }); response->body()->fully_read(realm, on_image_data_read, empty_algorithm, JS::NonnullGCPtr { global }); }; diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.h b/Userland/Libraries/LibWeb/HTML/Navigable.h index b209b990800e77..9baac84dd94b12 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.h +++ b/Userland/Libraries/LibWeb/HTML/Navigable.h @@ -129,7 +129,7 @@ class Navigable : public JS::Cell { NavigationParamsVariant navigation_params = Empty {}, CSPNavigationType csp_navigation_type = CSPNavigationType::Other, bool allow_POST = false, - JS::SafeFunction completion_steps = [] {}); + JS::SafeFunction completion_steps = [] { }); struct NavigateParams { URL::URL const& url; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp index 934abce3ab7c7a..e6612f748bdbfe 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp @@ -172,14 +172,11 @@ namespace Web::HTML { #define SWITCH_TO_AND_EMIT_CURRENT_CHARACTER(new_state) \ SWITCH_TO_AND_EMIT_CHARACTER(current_input_character.value(), new_state) -// clang-format-18 handles the `state:` label rather badly. -// clang-format off #define BEGIN_STATE(state) \ state: \ case State::state: { \ { \ { -// clang-format on #define END_STATE \ VERIFY_NOT_REACHED(); \ diff --git a/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp b/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp index fdfdf837f91fc7..e25167eed6a21f 100644 --- a/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/TraversableNavigable.cpp @@ -648,8 +648,8 @@ TraversableNavigable::HistoryStepResult TraversableNavigable::apply_the_history_ // that is synchronous navigation steps with a target navigable not contained in navigablesThatMustWaitBeforeHandlingSyncNavigation. // 2. Remove steps from traversable's session history traversal queue's algorithm set. for (auto entry = m_session_history_traversal_queue->first_synchronous_navigation_steps_with_target_navigable_not_contained_in(navigables_that_must_wait_before_handling_sync_navigation); - entry; - entry = m_session_history_traversal_queue->first_synchronous_navigation_steps_with_target_navigable_not_contained_in(navigables_that_must_wait_before_handling_sync_navigation)) { + entry; + entry = m_session_history_traversal_queue->first_synchronous_navigation_steps_with_target_navigable_not_contained_in(navigables_that_must_wait_before_handling_sync_navigation)) { // 3. Set traversable's running nested apply history step to true. m_running_nested_apply_history_step = true; diff --git a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.h b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.h index 719c8914f5417d..4f9b83887343bc 100644 --- a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.h @@ -65,7 +65,7 @@ class OccupationGrid { m_max_column_index = max(0, columns_count - 1); m_max_row_index = max(0, rows_count - 1); } - OccupationGrid() {}; + OccupationGrid() { } void set_occupied(int column_start, int column_end, int row_start, int row_end); diff --git a/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp index 74d84ee1916b3f..e0b9dce6d83ad0 100644 --- a/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp @@ -210,9 +210,9 @@ void SVGFormattingContext::run(Box const& box, LayoutMode, AvailableSpace const& CSSPixelPoint offset = viewbox_offset_and_scale.offset; m_current_viewbox_transform = Gfx::AffineTransform { m_current_viewbox_transform }.multiply(Gfx::AffineTransform {} - .translate(offset.to_type()) - .scale(viewbox_offset_and_scale.scale_factor_x, viewbox_offset_and_scale.scale_factor_y) - .translate({ -viewbox->min_x, -viewbox->min_y })); + .translate(offset.to_type()) + .scale(viewbox_offset_and_scale.scale_factor_x, viewbox_offset_and_scale.scale_factor_y) + .translate({ -viewbox->min_x, -viewbox->min_y })); } if (svg_box_state.has_definite_width() && svg_box_state.has_definite_height()) { diff --git a/Userland/Libraries/LibWeb/Painting/AffineDisplayListPlayerCPU.h b/Userland/Libraries/LibWeb/Painting/AffineDisplayListPlayerCPU.h index 7f9a267324f47c..c6ff10cb784b9c 100644 --- a/Userland/Libraries/LibWeb/Painting/AffineDisplayListPlayerCPU.h +++ b/Userland/Libraries/LibWeb/Painting/AffineDisplayListPlayerCPU.h @@ -45,12 +45,12 @@ class AffineDisplayListPlayerCPU : public DisplayListPlayer { bool would_be_fully_clipped_by_painter(Gfx::IntRect) const override; bool needs_prepare_glyphs_texture() const override { return false; } - void prepare_glyph_texture(HashMap> const&) override {}; + void prepare_glyph_texture(HashMap> const&) override { } virtual void prepare_to_execute(size_t) override { } bool needs_update_immutable_bitmap_texture_cache() const override { return false; } - void update_immutable_bitmap_texture_cache(HashMap&) override {}; + void update_immutable_bitmap_texture_cache(HashMap&) override { } AffineDisplayListPlayerCPU(Gfx::Bitmap& bitmap, Gfx::AffineTransform transform, Gfx::IntRect clip); virtual ~AffineDisplayListPlayerCPU() override = default; diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.h b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.h index 1041e49af088f5..4677baf0cc325f 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.h +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.h @@ -46,12 +46,12 @@ class DisplayListPlayerCPU : public DisplayListPlayer { bool would_be_fully_clipped_by_painter(Gfx::IntRect) const override; bool needs_prepare_glyphs_texture() const override { return false; } - void prepare_glyph_texture(HashMap> const&) override {}; + void prepare_glyph_texture(HashMap> const&) override { } virtual void prepare_to_execute(size_t corner_clip_max_depth) override; bool needs_update_immutable_bitmap_texture_cache() const override { return false; } - void update_immutable_bitmap_texture_cache(HashMap&) override {}; + void update_immutable_bitmap_texture_cache(HashMap&) override { } DisplayListPlayerCPU(Gfx::Bitmap& bitmap, bool enable_affine_command_executor = false); ~DisplayListPlayerCPU(); diff --git a/Userland/Libraries/LibWeb/Painting/PaintStyle.h b/Userland/Libraries/LibWeb/Painting/PaintStyle.h index dde375a95828d8..b11d40b2111abe 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintStyle.h +++ b/Userland/Libraries/LibWeb/Painting/PaintStyle.h @@ -51,7 +51,7 @@ class SVGGradientPaintStyle : public RefCounted { ReadonlySpan color_stops() const { return m_color_stops; } Optional repeat_length() const { return m_repeat_length; } - virtual ~SVGGradientPaintStyle() {}; + virtual ~SVGGradientPaintStyle() { } protected: Vector m_color_stops; diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.h b/Userland/Libraries/LibWeb/Painting/Paintable.h index 1e8d1dd434d158..8373bb296bf27d 100644 --- a/Userland/Libraries/LibWeb/Painting/Paintable.h +++ b/Userland/Libraries/LibWeb/Painting/Paintable.h @@ -215,7 +215,7 @@ class Paintable Gfx::AffineTransform compute_combined_css_transform() const; - virtual void resolve_paint_properties() {}; + virtual void resolve_paint_properties() { } protected: explicit Paintable(Layout::Node const&); diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedTransformList.cpp b/Userland/Libraries/LibWeb/SVG/SVGAnimatedTransformList.cpp index 092156d26ac876..3508d30eda66f1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedTransformList.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedTransformList.cpp @@ -20,7 +20,9 @@ JS::NonnullGCPtr SVGAnimatedTransformList::create(JS:: SVGAnimatedTransformList::SVGAnimatedTransformList(JS::Realm& realm, JS::NonnullGCPtr base_val, JS::NonnullGCPtr anim_val) : PlatformObject(realm) , m_base_val(base_val) - , m_anim_val(anim_val) {}; + , m_anim_val(anim_val) +{ +} SVGAnimatedTransformList::~SVGAnimatedTransformList() = default; diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h index c3b53e9b336af7..1e0af3aac6702c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h @@ -77,8 +77,8 @@ class SVGSVGElement final : public SVGGraphicsElement { (void)suspend_handle_id; } - void unsuspend_redraw_all() const {}; - void force_redraw() const {}; + void unsuspend_redraw_all() const { } + void force_redraw() const { } private: SVGSVGElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/SVG/SVGTransform.cpp b/Userland/Libraries/LibWeb/SVG/SVGTransform.cpp index 0c773786f1dfd3..e5d3e728ce6276 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTransform.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTransform.cpp @@ -19,7 +19,9 @@ JS::NonnullGCPtr SVGTransform::create(JS::Realm& realm) } SVGTransform::SVGTransform(JS::Realm& realm) - : PlatformObject(realm) {}; + : PlatformObject(realm) +{ +} SVGTransform::~SVGTransform() = default; diff --git a/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp b/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp index 0548d7724e0869..3d539e1e03fe7a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp @@ -21,7 +21,9 @@ JS::NonnullGCPtr SVGTransformList::create(JS::Realm& realm) SVGTransformList::~SVGTransformList() = default; SVGTransformList::SVGTransformList(JS::Realm& realm) - : PlatformObject(realm) {}; + : PlatformObject(realm) +{ +} // https://svgwg.org/svg2-draft/single-page.html#types-__svg__SVGNameList__length WebIDL::UnsignedLong SVGTransformList::length() diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequestEventTarget.h b/Userland/Libraries/LibWeb/XHR/XMLHttpRequestEventTarget.h index 67aceed7f14583..0cab035f6a80f0 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequestEventTarget.h +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequestEventTarget.h @@ -24,7 +24,7 @@ class XMLHttpRequestEventTarget : public DOM::EventTarget { WEB_PLATFORM_OBJECT(XMLHttpRequestEventTarget, DOM::EventTarget); public: - virtual ~XMLHttpRequestEventTarget() override {}; + virtual ~XMLHttpRequestEventTarget() override { } #undef __ENUMERATE #define __ENUMERATE(attribute_name, event_name) \ diff --git a/Userland/Libraries/LibWebView/ProcessManager.cpp b/Userland/Libraries/LibWebView/ProcessManager.cpp index e915d68941b523..30a35bce50cf0e 100644 --- a/Userland/Libraries/LibWebView/ProcessManager.cpp +++ b/Userland/Libraries/LibWebView/ProcessManager.cpp @@ -71,7 +71,7 @@ void ProcessManager::initialize() // FIXME: Should we change this to call EventLoop::register_signal? // Note that only EventLoopImplementationUnix has a working register_signal - struct sigaction action { }; + struct sigaction action {}; action.sa_flags = SA_RESTART; action.sa_sigaction = [](int, auto*, auto) { s_received_sigchld = 1; diff --git a/Userland/Services/WebWorker/PageHost.h b/Userland/Services/WebWorker/PageHost.h index 32336f756412c4..5e2f4aa96653f5 100644 --- a/Userland/Services/WebWorker/PageHost.h +++ b/Userland/Services/WebWorker/PageHost.h @@ -31,10 +31,10 @@ class PageHost final : public Web::PageClient { virtual Web::CSS::PreferredColorScheme preferred_color_scheme() const override; virtual Web::CSS::PreferredContrast preferred_contrast() const override; virtual Web::CSS::PreferredMotion preferred_motion() const override; - virtual void paint_next_frame() override {}; + virtual void paint_next_frame() override { } virtual void paint(Web::DevicePixelRect const&, Gfx::Bitmap&, Web::PaintOptions = {}) override; virtual void request_file(Web::FileRequest) override; - virtual void schedule_repaint() override {}; + virtual void schedule_repaint() override { } virtual bool is_ready_to_paint() const override { return true; } virtual Web::DisplayListPlayerType display_list_player_type() const override { VERIFY_NOT_REACHED(); } diff --git a/Userland/Services/WindowServer/Overlays.h b/Userland/Services/WindowServer/Overlays.h index b9d2a8cdafa9e3..c82bf78800047b 100644 --- a/Userland/Services/WindowServer/Overlays.h +++ b/Userland/Services/WindowServer/Overlays.h @@ -57,7 +57,7 @@ class Overlay { void set_rect(Gfx::IntRect const&); - virtual void rect_changed(Gfx::IntRect const&) {}; + virtual void rect_changed(Gfx::IntRect const&) { } private: [[nodiscard]] bool apply_render_rect() diff --git a/Userland/Shell/main.cpp b/Userland/Shell/main.cpp index ee02cfb2335af8..8fefcba10b5954 100644 --- a/Userland/Shell/main.cpp +++ b/Userland/Shell/main.cpp @@ -32,8 +32,8 @@ ErrorOr serenity_main(Main::Arguments arguments) s_shell->kill_job(s_shell->current_job(), SIGWINCH); }); - Core::EventLoop::register_signal(SIGTTIN, [](int) {}); - Core::EventLoop::register_signal(SIGTTOU, [](int) {}); + Core::EventLoop::register_signal(SIGTTIN, [](int) { }); + Core::EventLoop::register_signal(SIGTTOU, [](int) { }); Core::EventLoop::register_signal(SIGHUP, [](int) { for (auto& it : s_shell->jobs) diff --git a/Userland/Utilities/expr.cpp b/Userland/Utilities/expr.cpp index daf96704632c4a..de41188f46fd38 100644 --- a/Userland/Utilities/expr.cpp +++ b/Userland/Utilities/expr.cpp @@ -75,7 +75,7 @@ class ValueExpression : public Expression { { } - virtual ~ValueExpression() {}; + virtual ~ValueExpression() { } private: virtual bool truth() const override diff --git a/Userland/Utilities/find.cpp b/Userland/Utilities/find.cpp index bf0286a9921f98..64c4d2d526e976 100644 --- a/Userland/Utilities/find.cpp +++ b/Userland/Utilities/find.cpp @@ -56,8 +56,7 @@ struct FileData { // The file's basename, relative to the directory. char const* basename { nullptr }; // Optionally, cached information as returned by stat/lstat/fstatat. - struct stat stat { - }; + struct stat stat {}; bool stat_is_valid : 1 { false }; // File type as returned from readdir(), or DT_UNKNOWN. unsigned char d_type { DT_UNKNOWN }; diff --git a/Userland/Utilities/ls.cpp b/Userland/Utilities/ls.cpp index 7e26880c7593d9..aeb82d1aceebed 100644 --- a/Userland/Utilities/ls.cpp +++ b/Userland/Utilities/ls.cpp @@ -39,8 +39,7 @@ struct FileMetadata { ByteString name; ByteString path; ino_t raw_inode_number; - struct stat stat { - }; + struct stat stat {}; }; enum class FieldToSortBy { @@ -429,8 +428,7 @@ static bool print_filesystem_metadata_object(FileMetadata const& file) static int do_file_system_object_long(ByteString const& path) { if (flag_list_directories_only) { - struct stat stat { - }; + struct stat stat {}; int rc = lstat(path.characters(), &stat); if (rc < 0) perror("lstat"); @@ -452,8 +450,7 @@ static int do_file_system_object_long(ByteString const& path) if (di.has_error()) { auto error = di.error(); if (error.code() == ENOTDIR) { - struct stat stat { - }; + struct stat stat {}; int rc = lstat(path.characters(), &stat); if (rc < 0) perror("lstat"); diff --git a/Userland/Utilities/shot.cpp b/Userland/Utilities/shot.cpp index 5443ef8f68ce79..a2fc05fee72ae0 100644 --- a/Userland/Utilities/shot.cpp +++ b/Userland/Utilities/shot.cpp @@ -27,7 +27,7 @@ class SelectableLayover final : public GUI::Widget { C_OBJECT(SelectableLayover) public: - virtual ~SelectableLayover() override {}; + virtual ~SelectableLayover() override { } Gfx::IntRect region() const {