diff --git a/AK/Function.h b/AK/Function.h index b6d28bf4369..90ec3c3752d 100644 --- a/AK/Function.h +++ b/AK/Function.h @@ -40,14 +40,15 @@ namespace Detail { template inline constexpr bool IsCallableWithArguments = requires(T t) { - { - t(declval()...) - } -> ConvertibleTo; - } || requires(T t) { - { - t(declval()...) - } -> SameAs; - }; + { + t(declval()...) + } -> ConvertibleTo; +} || requires(T t) { + { + t(declval()...) + } -> SameAs; +}; + } using Detail::IsCallableWithArguments; diff --git a/AK/Time.h b/AK/Time.h index 6f80075f338..57b60a45d1b 100644 --- a/AK/Time.h +++ b/AK/Time.h @@ -32,9 +32,9 @@ namespace AK { // Concept to detect types which look like timespec without requiring the type. template concept TimeSpecType = requires(T t) { - t.tv_sec; - t.tv_nsec; - }; + t.tv_sec; + t.tv_nsec; +}; constexpr bool is_leap_year(int year) { diff --git a/AK/Variant.h b/AK/Variant.h index 372854f361a..570a79f902a 100644 --- a/AK/Variant.h +++ b/AK/Variant.h @@ -220,8 +220,7 @@ struct Empty { }; template -concept NotLvalueReference = ! -IsLvalueReference; +concept NotLvalueReference = !IsLvalueReference; template struct Variant diff --git a/AK/Vector.h b/AK/Vector.h index a721fee8046..52db632ce18 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -31,13 +31,13 @@ struct CanBePlacedInsideVectorHelper; template struct CanBePlacedInsideVectorHelper { template - static constexpr bool value = requires(U && u) { StorageType { &u }; }; + static constexpr bool value = requires(U&& u) { StorageType { &u }; }; }; template struct CanBePlacedInsideVectorHelper { template - static constexpr bool value = requires(U && u) { StorageType(forward(u)); }; + static constexpr bool value = requires(U&& u) { StorageType(forward(u)); }; }; } diff --git a/Kernel/Arch/aarch64/Processor.h b/Kernel/Arch/aarch64/Processor.h index 9f96de5aa33..c8f018f07ac 100644 --- a/Kernel/Arch/aarch64/Processor.h +++ b/Kernel/Arch/aarch64/Processor.h @@ -31,8 +31,7 @@ enum class InterruptsState; // FIXME This needs to go behind some sort of platform abstraction // it is used between Thread and Processor. -struct [[gnu::aligned(16)]] FPUState -{ +struct [[gnu::aligned(16)]] FPUState { u8 buffer[512]; }; diff --git a/Kernel/Arch/x86_64/Processor.h b/Kernel/Arch/x86_64/Processor.h index 1bbe0042437..caca15aa0f0 100644 --- a/Kernel/Arch/x86_64/Processor.h +++ b/Kernel/Arch/x86_64/Processor.h @@ -45,8 +45,7 @@ extern "C" void thread_context_first_enter(void); extern "C" void exit_kernel_thread(void); extern "C" void do_assume_context(Thread* thread, u32 flags); -struct [[gnu::aligned(64), gnu::packed]] FPUState -{ +struct [[gnu::aligned(64), gnu::packed]] FPUState { SIMD::LegacyRegion legacy_region; SIMD::Header xsave_header; diff --git a/Kernel/Net/Routing.cpp b/Kernel/Net/Routing.cpp index 32858802130..acf19a576fd 100644 --- a/Kernel/Net/Routing.cpp +++ b/Kernel/Net/Routing.cpp @@ -71,7 +71,7 @@ protected: { VERIFY(b.blocker_type() == Thread::Blocker::Type::Routing); auto& blocker = static_cast(b); - auto maybe_mac_address = arp_table().with([&](auto const& table) -> auto{ + auto maybe_mac_address = arp_table().with([&](auto const& table) -> auto { return table.get(blocker.ip_address()); }); if (!maybe_mac_address.has_value()) @@ -95,7 +95,7 @@ bool ARPTableBlocker::setup_blocker() void ARPTableBlocker::will_unblock_immediately_without_blocking(UnblockImmediatelyReason) { - auto addr = arp_table().with([&](auto const& table) -> auto{ + auto addr = arp_table().with([&](auto const& table) -> auto { return table.get(ip_address()); }); @@ -297,11 +297,11 @@ RoutingDecision route_to(IPv4Address const& target, IPv4Address const& source, R if (adapter == NetworkingManagement::the().loopback_adapter()) return { adapter, adapter->mac_address() }; - if ((target_addr & IPv4Address { 240, 0, 0, 0 }.to_u32()) == IPv4Address { 224, 0, 0, 0 }.to_u32()) + if ((target_addr & (IPv4Address { 240, 0, 0, 0 }.to_u32())) == IPv4Address { 224, 0, 0, 0 }.to_u32()) return { adapter, multicast_ethernet_address(target) }; { - auto addr = arp_table().with([&](auto const& table) -> auto{ + auto addr = arp_table().with([&](auto const& table) -> auto { return table.get(next_hop_ip); }); if (addr.has_value()) { diff --git a/Kernel/Syscalls/SyscallHandler.cpp b/Kernel/Syscalls/SyscallHandler.cpp index c6130882cb0..ceb925633f5 100644 --- a/Kernel/Syscalls/SyscallHandler.cpp +++ b/Kernel/Syscalls/SyscallHandler.cpp @@ -20,8 +20,8 @@ namespace Kernel { namespace Syscall { -using Handler = auto(Process::*)(FlatPtr, FlatPtr, FlatPtr, FlatPtr) -> ErrorOr; -using HandlerWithRegisterState = auto(Process::*)(RegisterState&) -> ErrorOr; +using Handler = auto (Process::*)(FlatPtr, FlatPtr, FlatPtr, FlatPtr) -> ErrorOr; +using HandlerWithRegisterState = auto (Process::*)(RegisterState&) -> ErrorOr; struct HandlerMetadata { Handler handler; diff --git a/Userland/Libraries/LibCore/ArgsParser.cpp b/Userland/Libraries/LibCore/ArgsParser.cpp index 346a61ff1f7..00d3daa6491 100644 --- a/Userland/Libraries/LibCore/ArgsParser.cpp +++ b/Userland/Libraries/LibCore/ArgsParser.cpp @@ -771,7 +771,7 @@ void ArgsParser::autocomplete(FILE* file, StringView program_name, ReadonlySpan< // Look for a long option auto option_pattern = argument.substring_view(2); - auto it = m_options.find_if([&](auto& option) { return option.hide_mode != OptionHideMode::None && StringView { option.long_name, strlen(option.long_name) } == option_pattern; }); + auto it = m_options.find_if([&](auto& option) { return (option.hide_mode != OptionHideMode::None) && StringView { option.long_name, strlen(option.long_name) } == option_pattern; }); if (it.is_end()) continue; diff --git a/Userland/Libraries/LibCrypto/Checksum/CRC32.cpp b/Userland/Libraries/LibCrypto/Checksum/CRC32.cpp index e8ee7fd578c..e837611d465 100644 --- a/Userland/Libraries/LibCrypto/Checksum/CRC32.cpp +++ b/Userland/Libraries/LibCrypto/Checksum/CRC32.cpp @@ -43,7 +43,7 @@ void CRC32::update(ReadonlyBytes span) } }; - // FIXME: On Intel, use _mm_crc32_u8 / _mm_crc32_u64 if available (SSE 4.2). +// FIXME: On Intel, use _mm_crc32_u8 / _mm_crc32_u64 if available (SSE 4.2). #else diff --git a/Userland/Libraries/LibCrypto/Hash/PBKDF2.h b/Userland/Libraries/LibCrypto/Hash/PBKDF2.h index 766ee1728e6..d10d161edd9 100644 --- a/Userland/Libraries/LibCrypto/Hash/PBKDF2.h +++ b/Userland/Libraries/LibCrypto/Hash/PBKDF2.h @@ -17,8 +17,8 @@ public: template static ErrorOr derive_key(ReadonlyBytes password, ReadonlyBytes salt, u32 iterations, u32 key_length_bytes) requires requires(PRF t) { - t.digest_size(); - } + t.digest_size(); + } { PRF prf(password); diff --git a/Userland/Libraries/LibGUI/ItemListModel.h b/Userland/Libraries/LibGUI/ItemListModel.h index ef49320e74d..cf11a5db961 100644 --- a/Userland/Libraries/LibGUI/ItemListModel.h +++ b/Userland/Libraries/LibGUI/ItemListModel.h @@ -17,10 +17,10 @@ template, typename ColumnNameListType class ItemListModel : public Model { public: static constexpr auto IsTwoDimensional = requires(Container data) { - requires !IsVoid; - data.at(0).at(0); - data.at(0).size(); - }; + requires !IsVoid; + data.at(0).at(0); + data.at(0).size(); + }; // Substitute 'void' for a dummy u8. using ColumnNamesT = Conditional, u8, ColumnNameListType>; diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index b033e5b7834..b70fe9eca6c 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -241,11 +241,11 @@ private: template concept ThrowCompletionOrVoidFunction = requires(Func func, Args... args) { - { - func(args...) - } - -> SameAs>; - }; + { + func(args...) + } + -> SameAs>; +}; template class ThrowCompletionOrVoidCallback : public Function(Args...)> { diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index 7d68d9fa231..8b1b10cc7bd 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -560,7 +560,7 @@ void Editor::initialize() m_configuration.set(Configuration::NonInteractive); } else { auto* term = getenv("TERM"); - if (term != NULL && StringView { term, strlen(term) }.starts_with("xterm"sv)) + if ((term != NULL) && StringView { term, strlen(term) }.starts_with("xterm"sv)) m_configuration.set(Configuration::Full); else m_configuration.set(Configuration::NoEscapeSequences); diff --git a/Userland/Libraries/LibWasm/Printer/Printer.cpp b/Userland/Libraries/LibWasm/Printer/Printer.cpp index 4f3ce671cf7..0432d1c4159 100644 --- a/Userland/Libraries/LibWasm/Printer/Printer.cpp +++ b/Userland/Libraries/LibWasm/Printer/Printer.cpp @@ -402,15 +402,16 @@ void Printer::print(Wasm::ImportSection::Import const& import) { TemporaryChange change { m_indent, m_indent + 1 }; import.description().visit( - [this](auto const& type) { print(type); - }, + [this](auto const& type) { + print(type); + }, [this](TypeIndex const& index) { - print_indent(); - print("(type index {})\n", index.value()); + print_indent(); + print("(type index {})\n", index.value()); }); -} -print_indent(); -print(")\n"); + } + print_indent(); + print(")\n"); } void Printer::print(Wasm::Instruction const& instruction) diff --git a/Userland/Libraries/LibWasm/WASI/Wasi.cpp b/Userland/Libraries/LibWasm/WASI/Wasi.cpp index a70a99df46d..eeb6d323613 100644 --- a/Userland/Libraries/LibWasm/WASI/Wasi.cpp +++ b/Userland/Libraries/LibWasm/WASI/Wasi.cpp @@ -930,11 +930,9 @@ struct InvocationOf { return HostFunction( [&self, function_name](Configuration& configuration, Vector& arguments) -> Wasm::Result { - Tuple args = [&](IndexSequence) - { + Tuple args = [&](IndexSequence) { return Tuple { ABI::deserialize(ABI::to_compatible_value(arguments[Is]))... }; - } - .template operator()(MakeIndexSequence()); + }.template operator()(MakeIndexSequence()); auto result = args.apply_as_args([&](auto&&... impl_args) { return (self.*impl)(configuration, impl_args...); }); dbgln_if(WASI_DEBUG, "WASI: {}({}) = {}", function_name, arguments, result); @@ -948,8 +946,7 @@ struct InvocationOf { if constexpr (!IsVoid) { // Return values are passed as pointers, after the arguments if constexpr (requires { &R::serialize_into; }) { - constexpr auto ResultCount = [](void(R::*)(Array) const) { return N; } - (&R::serialize_into); + constexpr auto ResultCount = [](void (R::*)(Array) const) { return N; }(&R::serialize_into); ABI::serialize(*value.result(), address_spans(arguments.span().slice(sizeof...(Args)), configuration)); } else { ABI::serialize(*value.result(), address_spans<1>(arguments.span().slice(sizeof...(Args)), configuration)); diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 92744672b07..36518d89f50 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -6246,8 +6246,7 @@ ErrorOr> Parser::parse_filter_value_list_value(Vector auto& - { + auto next_token = [&]() -> auto& { auto& token = tokens.next_token(); tokens.skip_whitespace(); return token;