diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h index 65ba418f4a..ea498d9ce8 100644 --- a/AK/ByteBuffer.h +++ b/AK/ByteBuffer.h @@ -325,12 +325,6 @@ inline NonnullRefPtr ByteBufferImpl::copy(const void* data, size return ::adopt(*new ByteBufferImpl(data, size)); } -inline const LogStream& operator<<(const LogStream& stream, const ByteBuffer& value) -{ - stream.write((const char*)value.data(), value.size()); - return stream; -} - } using AK::ByteBuffer; diff --git a/AK/Format.cpp b/AK/Format.cpp index 698b839728..ee328d86dc 100644 --- a/AK/Format.cpp +++ b/AK/Format.cpp @@ -28,8 +28,13 @@ #include #include #include +#include #include +#if defined(__serenity__) && !defined(KERNEL) +# include +#endif + #ifdef KERNEL # include # include @@ -416,12 +421,6 @@ void vformat(StringBuilder& builder, StringView fmtstr, TypeErasedFormatParams p vformat_impl(params, fmtbuilder, parser); } -void vformat(const LogStream& stream, StringView fmtstr, TypeErasedFormatParams params) -{ - StringBuilder builder; - vformat(builder, fmtstr, params); - stream << builder.to_string(); -} void StandardFormatter::parse(TypeErasedFormatParams& params, FormatParser& parser) { diff --git a/AK/Format.h b/AK/Format.h index c7b5400e30..8da01d3b26 100644 --- a/AK/Format.h +++ b/AK/Format.h @@ -364,7 +364,6 @@ struct Formatter : Formatter { }; void vformat(StringBuilder&, StringView fmtstr, TypeErasedFormatParams); -void vformat(const LogStream& stream, StringView fmtstr, TypeErasedFormatParams); #ifndef KERNEL void vout(FILE*, StringView fmtstr, TypeErasedFormatParams, bool newline = false); diff --git a/AK/Forward.h b/AK/Forward.h index dd4bf6dc7f..a12bca8e56 100644 --- a/AK/Forward.h +++ b/AK/Forward.h @@ -32,12 +32,10 @@ namespace AK { class Bitmap; class ByteBuffer; -class DebugLogStream; class IPv4Address; class JsonArray; class JsonObject; class JsonValue; -class LogStream; class StackInfo; class String; class StringBuilder; @@ -143,7 +141,6 @@ using AK::ByteBuffer; using AK::Bytes; using AK::CircularDuplexStream; using AK::CircularQueue; -using AK::DebugLogStream; using AK::DoublyLinkedList; using AK::DuplexMemoryStream; using AK::FlyString; @@ -158,7 +155,6 @@ using AK::IPv4Address; using AK::JsonArray; using AK::JsonObject; using AK::JsonValue; -using AK::LogStream; using AK::NonnullOwnPtr; using AK::NonnullOwnPtrVector; using AK::NonnullRefPtr; diff --git a/AK/HashTable.h b/AK/HashTable.h index 3c5007ad6b..d0e5df44b3 100644 --- a/AK/HashTable.h +++ b/AK/HashTable.h @@ -27,7 +27,6 @@ #pragma once #include -#include #include #include #include diff --git a/AK/IDAllocator.h b/AK/IDAllocator.h index 068aa7046e..796c35f164 100644 --- a/AK/IDAllocator.h +++ b/AK/IDAllocator.h @@ -26,6 +26,7 @@ #pragma once +#include #include namespace AK { diff --git a/AK/IPv4Address.h b/AK/IPv4Address.h index 8f81130904..e64d8efb6b 100644 --- a/AK/IPv4Address.h +++ b/AK/IPv4Address.h @@ -27,7 +27,6 @@ #pragma once #include -#include #include #include #include @@ -143,11 +142,6 @@ struct Traits : public GenericTraits { static constexpr unsigned hash(const IPv4Address& address) { return int_hash(address.to_u32()); } }; -inline const LogStream& operator<<(const LogStream& stream, const IPv4Address& value) -{ - return stream << value.to_string(); -} - template<> struct Formatter : Formatter { void format(FormatBuilder& builder, IPv4Address value) diff --git a/AK/LogStream.cpp b/AK/LogStream.cpp index 7837050e42..e69de29bb2 100644 --- a/AK/LogStream.cpp +++ b/AK/LogStream.cpp @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2018-2020, Andreas Kling - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include - -#ifdef KERNEL -# include -# include -#endif - -namespace AK { - -const LogStream& operator<<(const LogStream& stream, const String& value) -{ - stream.write(value.characters(), value.length()); - return stream; -} - -const LogStream& operator<<(const LogStream& stream, const FlyString& value) -{ - return stream << value.view(); -} - -const LogStream& operator<<(const LogStream& stream, const StringView& value) -{ - stream.write(value.characters_without_null_termination(), value.length()); - return stream; -} - -const LogStream& operator<<(const LogStream& stream, int value) -{ - char buffer[32]; - snprintf(buffer, sizeof(buffer), "%d", value); - return stream << buffer; -} - -const LogStream& operator<<(const LogStream& stream, long value) -{ - char buffer[32]; - snprintf(buffer, sizeof(buffer), "%ld", value); - return stream << buffer; -} - -const LogStream& operator<<(const LogStream& stream, long long value) -{ - char buffer[32]; - snprintf(buffer, sizeof(buffer), "%lld", value); - return stream << buffer; -} - -const LogStream& operator<<(const LogStream& stream, unsigned value) -{ - char buffer[32]; - snprintf(buffer, sizeof(buffer), "%u", value); - return stream << buffer; -} - -const LogStream& operator<<(const LogStream& stream, unsigned long long value) -{ - char buffer[32]; - snprintf(buffer, sizeof(buffer), "%llu", value); - return stream << buffer; -} - -const LogStream& operator<<(const LogStream& stream, unsigned long value) -{ - char buffer[32]; - snprintf(buffer, sizeof(buffer), "%lu", value); - return stream << buffer; -} - -const LogStream& operator<<(const LogStream& stream, const void* value) -{ - char buffer[32]; - snprintf(buffer, sizeof(buffer), "%p", value); - return stream << buffer; -} - -#if defined(__serenity__) && !defined(KERNEL) -static TriState got_process_name = TriState::Unknown; -static char process_name_buffer[256]; -#endif - -DebugLogStream dbg() -{ - DebugLogStream stream; - - // FIXME: This logic is redundant with the stuff in Format.cpp. -#if defined(__serenity__) && !defined(KERNEL) - if (got_process_name == TriState::Unknown) { - if (get_process_name(process_name_buffer, sizeof(process_name_buffer)) == 0) - got_process_name = TriState::True; - else - got_process_name = TriState::False; - } - if (got_process_name == TriState::True) - stream << "\033[33;1m" << process_name_buffer << '(' << getpid() << ")\033[0m: "; -#endif -#if defined(__serenity__) && defined(KERNEL) - if (Kernel::Processor::is_initialized() && Kernel::Thread::current()) - stream << "\033[34;1m[#" << Kernel::Processor::id() << " " << *Kernel::Thread::current() << "]\033[0m: "; - else - stream << "\033[36;1m[Kernel]\033[0m: "; -#endif - return stream; -} - -#ifdef KERNEL -KernelLogStream klog() -{ - KernelLogStream stream; - if (Kernel::Processor::is_initialized() && Kernel::Thread::current()) - stream << "\033[34;1m[#" << Kernel::Processor::id() << " " << *Kernel::Thread::current() << "]\033[0m: "; - else - stream << "\033[36;1m[Kernel]\033[0m: "; - return stream; -} -#else -DebugLogStream klog() -{ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" - return dbg(); -# pragma GCC diagnostic pop -} -#endif - -#ifdef KERNEL -KernelLogStream::~KernelLogStream() -{ - if (!empty()) { - char newline = '\n'; - write(&newline, 1); - kernelputstr(reinterpret_cast(data()), size()); - } -} -#endif - -DebugLogStream::~DebugLogStream() -{ - if (!empty() && s_enabled) { - char newline = '\n'; - write(&newline, 1); - dbgputstr(reinterpret_cast(data()), size()); - } -} - -void DebugLogStream::set_enabled(bool enabled) -{ - s_enabled = enabled; -} - -bool DebugLogStream::is_enabled() -{ - return s_enabled; -} - -bool DebugLogStream::s_enabled = true; - -#ifndef KERNEL -const LogStream& operator<<(const LogStream& stream, double value) -{ - return stream << String::format("%.4f", value); -} - -const LogStream& operator<<(const LogStream& stream, float value) -{ - return stream << String::format("%.4f", value); -} -#endif - -void dump_bytes(ReadonlyBytes bytes) -{ - StringBuilder builder; - - u8 buffered_byte = 0; - size_t nrepeat = 0; - const char* prefix = ""; - - auto flush = [&]() { - if (nrepeat > 0) { - if (nrepeat == 1) - builder.appendff("{}{:#02x}", prefix, static_cast(buffered_byte)); - else - builder.appendff("{}{} * {:#02x}", prefix, nrepeat, static_cast(buffered_byte)); - - nrepeat = 0; - prefix = ", "; - } - }; - - builder.append("{ "); - - for (auto byte : bytes) { - if (nrepeat > 0) { - if (byte != buffered_byte) - flush(); - - buffered_byte = byte; - nrepeat++; - } else { - buffered_byte = byte; - nrepeat = 1; - } - } - flush(); - - builder.append(" }"); - - dbgln("{}", builder.string_view()); -} - -} diff --git a/AK/LogStream.h b/AK/LogStream.h index 9d6a0900bf..e69de29bb2 100644 --- a/AK/LogStream.h +++ b/AK/LogStream.h @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2018-2020, Andreas Kling - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#pragma once - -#include -#include -#include -#include -#include - -#if !defined(KERNEL) -# include -# include -# include -# include -#endif - -namespace AK { - -class LogStream { -public: - LogStream() -#if !defined(KERNEL) - : m_errno_restorer(errno) -#endif - { - } - virtual ~LogStream() = default; - - virtual void write(const char*, int) const = 0; - -private: -#if !defined(KERNEL) - ScopedValueRollback m_errno_restorer; -#endif -}; - -class BufferedLogStream : public LogStream { - mutable size_t m_size { 0 }; - mutable size_t m_capacity { 128 }; - union { - mutable u8* m_buffer { nullptr }; - mutable u8 m_local_buffer[128]; - } u; - - void grow(size_t bytes_needed) const - { - size_t new_capacity = (m_size + bytes_needed + 0x7F) & ~0x7F; - u8* new_data = static_cast(kmalloc(new_capacity)); - if (m_capacity <= sizeof(u.m_local_buffer)) { - __builtin_memcpy(new_data, u.m_local_buffer, m_size); - } else if (u.m_buffer) { - __builtin_memcpy(new_data, u.m_buffer, m_size); - kfree(u.m_buffer); - } - u.m_buffer = new_data; - m_capacity = new_capacity; - } - -protected: - u8* data() const - { - if (m_capacity <= sizeof(u.m_local_buffer)) - return u.m_local_buffer; - return u.m_buffer; - } - - size_t size() const { return m_size; } - - bool empty() const { return m_size == 0; } - -public: - BufferedLogStream() = default; - - virtual ~BufferedLogStream() override - { - if (m_capacity > sizeof(u.m_local_buffer)) - kfree(u.m_buffer); - } - - virtual void write(const char* str, int len) const override - { - size_t new_size = m_size + len; - if (new_size > m_capacity) - grow(len); - __builtin_memcpy(data() + m_size, str, len); - m_size = new_size; - } -}; - -class DebugLogStream final : public BufferedLogStream { -public: - DebugLogStream() = default; - virtual ~DebugLogStream() override; - - // DebugLogStream only checks `enabled` and possibly generates output while the destructor runs. - static void set_enabled(bool); - static bool is_enabled(); - -private: - static bool s_enabled; -}; - -#ifdef KERNEL -class KernelLogStream final : public BufferedLogStream { -public: - KernelLogStream() = default; - virtual ~KernelLogStream() override; -}; -#endif - -inline const LogStream& operator<<(const LogStream& stream, const char* value) -{ - if (!value) - return stream << "(null)"; - int length = 0; - const char* p = value; - while (*(p++)) - ++length; - stream.write(value, length); - return stream; -} - -const LogStream& operator<<(const LogStream&, const FlyString&); -const LogStream& operator<<(const LogStream&, const String&); -const LogStream& operator<<(const LogStream&, const StringView&); -const LogStream& operator<<(const LogStream&, int); -const LogStream& operator<<(const LogStream&, long); -const LogStream& operator<<(const LogStream&, unsigned); -const LogStream& operator<<(const LogStream&, long long); -const LogStream& operator<<(const LogStream&, unsigned long); -const LogStream& operator<<(const LogStream&, unsigned long long); - -#if !defined(KERNEL) -const LogStream& operator<<(const LogStream&, double); -const LogStream& operator<<(const LogStream&, float); -#endif - -template -const LogStream& operator<<(const LogStream& stream, Span span) -{ - return stream << "{ " << span.data() << ", " << span.size() << " }"; -} - -const LogStream& operator<<(const LogStream&, const void*); - -inline const LogStream& operator<<(const LogStream& stream, char value) -{ - stream.write(&value, 1); - return stream; -} - -inline const LogStream& operator<<(const LogStream& stream, bool value) -{ - return stream << (value ? "true" : "false"); -} - -[[deprecated("Plase use dbgln in AK/Format.h instead.")]] DebugLogStream dbg(); - -#ifdef KERNEL -KernelLogStream klog(); -#else -DebugLogStream klog(); -#endif - -void dump_bytes(ReadonlyBytes); - -} - -using AK::dbg; -using AK::klog; -using AK::LogStream; diff --git a/AK/MappedFile.cpp b/AK/MappedFile.cpp index cd10ef3b0c..5a935746de 100644 --- a/AK/MappedFile.cpp +++ b/AK/MappedFile.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index 1b4e4c8ac2..e2d43a6fa7 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -27,7 +27,7 @@ #pragma once #include -#include +#include #include #include #include @@ -183,12 +183,6 @@ struct Traits> : public GenericTraits> { static bool equals(const NonnullOwnPtr& a, const NonnullOwnPtr& b) { return a.ptr() == b.ptr(); } }; -template -inline const LogStream& operator<<(const LogStream& stream, const NonnullOwnPtr& value) -{ - return stream << value.ptr(); -} - template inline void swap(NonnullOwnPtr& a, NonnullOwnPtr& b) { diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h index 69499c54ee..d289547500 100644 --- a/AK/NonnullRefPtr.h +++ b/AK/NonnullRefPtr.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #ifdef KERNEL # include @@ -339,12 +339,6 @@ inline NonnullRefPtr adopt(T& object) return NonnullRefPtr(NonnullRefPtr::Adopt, object); } -template -inline const LogStream& operator<<(const LogStream& stream, const NonnullRefPtr& value) -{ - return stream << value.ptr(); -} - template struct Formatter> : Formatter { void format(FormatBuilder& builder, const NonnullRefPtr& value) diff --git a/AK/OSError.h b/AK/OSError.h index 0586645694..9150561f2d 100644 --- a/AK/OSError.h +++ b/AK/OSError.h @@ -27,6 +27,7 @@ #pragma once #include +#include #include namespace AK { diff --git a/AK/OwnPtr.h b/AK/OwnPtr.h index 6da0b67592..7a2741f565 100644 --- a/AK/OwnPtr.h +++ b/AK/OwnPtr.h @@ -218,12 +218,6 @@ struct Traits> : public GenericTraits> { static bool equals(const OwnPtr& a, const OwnPtr& b) { return a.ptr() == b.ptr(); } }; -template -inline const LogStream& operator<<(const LogStream& stream, const OwnPtr& value) -{ - return stream << value.ptr(); -} - } using AK::OwnPtr; diff --git a/AK/Platform.h b/AK/Platform.h index e1a15f78eb..4c063e54b0 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -61,6 +61,7 @@ #define FLATTEN [[gnu::flatten]] #ifndef __serenity__ +# include # define PAGE_SIZE sysconf(_SC_PAGESIZE) #endif diff --git a/AK/RefPtr.h b/AK/RefPtr.h index eb5b4afff9..0c8bafd525 100644 --- a/AK/RefPtr.h +++ b/AK/RefPtr.h @@ -27,7 +27,7 @@ #pragma once #include -#include +#include #include #include #include @@ -461,12 +461,6 @@ private: mutable Atomic m_bits { PtrTraits::default_null_value }; }; -template> -inline const LogStream& operator<<(const LogStream& stream, const RefPtr& value) -{ - return stream << value.ptr(); -} - template struct Formatter> : Formatter { void format(FormatBuilder& builder, const RefPtr& value) diff --git a/AK/Time.cpp b/AK/Time.cpp index 30b550c33f..3e2f2cd9a4 100644 --- a/AK/Time.cpp +++ b/AK/Time.cpp @@ -26,7 +26,6 @@ #include #include -#include #include // Make a reasonable guess as to which timespec/timeval definition to use. diff --git a/AK/URL.h b/AK/URL.h index 6d68162e01..ab3a5e3903 100644 --- a/AK/URL.h +++ b/AK/URL.h @@ -105,11 +105,6 @@ private: String m_data_payload; }; -inline const LogStream& operator<<(const LogStream& stream, const URL& value) -{ - return stream << value.to_string(); -} - template<> struct Formatter : Formatter { void format(FormatBuilder& builder, const URL& value) diff --git a/AK/Utf8View.cpp b/AK/Utf8View.cpp index eb0143d567..d28be5e425 100644 --- a/AK/Utf8View.cpp +++ b/AK/Utf8View.cpp @@ -25,7 +25,7 @@ */ #include -#include +#include #include namespace AK { diff --git a/AK/WeakPtr.h b/AK/WeakPtr.h index 332d97bf76..59bffa273a 100644 --- a/AK/WeakPtr.h +++ b/AK/WeakPtr.h @@ -26,7 +26,6 @@ #pragma once -#include #include namespace AK { @@ -236,17 +235,6 @@ inline WeakPtr Weakable::make_weak_ptr() const return weak_ptr; } -template -inline const LogStream& operator<<(const LogStream& stream, const WeakPtr& value) -{ -#ifdef KERNEL - auto ref = value.strong_ref(); - return stream << ref.ptr(); -#else - return stream << value.ptr(); -#endif -} - template struct Formatter> : Formatter { void format(FormatBuilder& builder, const WeakPtr& value) diff --git a/AK/kstdio.h b/AK/kstdio.h index de1a7e1267..51620086e0 100644 --- a/AK/kstdio.h +++ b/AK/kstdio.h @@ -33,21 +33,20 @@ # include # include extern "C" { -int dbgputstr(const char*, ssize_t); +void dbgputstr(const char*, size_t); int sprintf(char* buf, const char* fmt, ...) __attribute__((format(printf, 2, 3))); int snprintf(char* buffer, size_t, const char* fmt, ...) __attribute__((format(printf, 3, 4))); } # endif #else # include -inline int dbgputstr(const char* characters, ssize_t length) +inline void dbgputstr(const char* characters, size_t length) { fwrite(characters, 1, length, stderr); - return 0; } #endif template -inline int dbgputstr(const char (&array)[N]) +inline void dbgputstr(const char (&array)[N]) { return ::dbgputstr(array, N); } diff --git a/Kernel/ACPI/Parser.cpp b/Kernel/ACPI/Parser.cpp index fff0b6fcab..8f198cb49b 100644 --- a/Kernel/ACPI/Parser.cpp +++ b/Kernel/ACPI/Parser.cpp @@ -25,6 +25,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include namespace Kernel { diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 24e6b08053..efb30c6a23 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -243,7 +243,6 @@ set(AK_SOURCES ../AK/JsonParser.cpp ../AK/JsonValue.cpp ../AK/LexicalPath.cpp - ../AK/LogStream.cpp ../AK/String.cpp ../AK/StringBuilder.cpp ../AK/StringImpl.cpp diff --git a/Kernel/DMI.cpp b/Kernel/DMI.cpp index 51091c3012..1c9f6f51a0 100644 --- a/Kernel/DMI.cpp +++ b/Kernel/DMI.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include namespace Kernel { diff --git a/Kernel/Devices/BXVGADevice.cpp b/Kernel/Devices/BXVGADevice.cpp index 2fffc01bd5..54765c44c4 100644 --- a/Kernel/Devices/BXVGADevice.cpp +++ b/Kernel/Devices/BXVGADevice.cpp @@ -25,6 +25,7 @@ */ #include +#include #include #include #include diff --git a/Kernel/FileSystem/InodeIdentifier.h b/Kernel/FileSystem/InodeIdentifier.h index b869be5469..6244349b94 100644 --- a/Kernel/FileSystem/InodeIdentifier.h +++ b/Kernel/FileSystem/InodeIdentifier.h @@ -72,12 +72,6 @@ private: InodeIndex m_index { 0 }; }; -inline const LogStream& operator<<(const LogStream& stream, const InodeIdentifier& value) -{ - stream << value.fsid() << ':' << value.index().value(); - return stream; -} - } template<> diff --git a/Kernel/IO.h b/Kernel/IO.h index e21b224f19..80e11625d1 100644 --- a/Kernel/IO.h +++ b/Kernel/IO.h @@ -27,7 +27,6 @@ #pragma once #include -#include #include #include #include @@ -157,11 +156,6 @@ private: u16 m_address { 0 }; }; -inline const LogStream& operator<<(const LogStream& stream, IOAddress value) -{ - return stream << "IO " << String::formatted("{:x}", value.get()); -} - template<> struct AK::Formatter : AK::Formatter { void format(FormatBuilder& builder, IOAddress value) diff --git a/Kernel/KBuffer.h b/Kernel/KBuffer.h index 5d1b4aa661..8d5a0aeed0 100644 --- a/Kernel/KBuffer.h +++ b/Kernel/KBuffer.h @@ -38,7 +38,6 @@ #include #include -#include #include #include #include @@ -175,9 +174,4 @@ private: RefPtr m_impl; }; -inline const LogStream& operator<<(const LogStream& stream, const KBuffer& value) -{ - return stream << StringView(value.data(), value.size()); -} - } diff --git a/Kernel/Modules/TestModule.cpp b/Kernel/Modules/TestModule.cpp index fbfdbc7416..2e61e76c96 100644 --- a/Kernel/Modules/TestModule.cpp +++ b/Kernel/Modules/TestModule.cpp @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include extern "C" const char module_name[] = "TestModule"; diff --git a/Kernel/Net/IPv4.h b/Kernel/Net/IPv4.h index 39f671a572..281a29b9bf 100644 --- a/Kernel/Net/IPv4.h +++ b/Kernel/Net/IPv4.h @@ -123,7 +123,6 @@ private: }; static_assert(sizeof(IPv4Packet) == 20); -const LogStream& operator<<(const LogStream& stream, const IPv4Packet& packet); inline NetworkOrdered internet_checksum(const void* ptr, size_t count) { diff --git a/Kernel/PCI/Definitions.h b/Kernel/PCI/Definitions.h index 9fa64779bf..23d3cf0da0 100644 --- a/Kernel/PCI/Definitions.h +++ b/Kernel/PCI/Definitions.h @@ -27,7 +27,6 @@ #pragma once #include -#include #include #include #include @@ -84,10 +83,7 @@ struct ID { return vendor_id != other.vendor_id || device_id != other.device_id; } }; -inline const LogStream& operator<<(const LogStream& stream, const ID value) -{ - return stream << String::formatted("({:04x}:{:04x})", value.vendor_id, value.device_id); -} + struct Address { public: Address() = default; @@ -141,11 +137,6 @@ protected: u8 m_function { 0 }; }; -inline const LogStream& operator<<(const LogStream& stream, const Address value) -{ - return stream << "PCI [" << String::formatted("{:04x}:{:02x}:{:02x}:{:02x}", value.seg(), value.bus(), value.device(), value.function()) << "]"; -} - struct ChangeableAddress : public Address { ChangeableAddress() : Address(0) diff --git a/Kernel/PhysicalAddress.h b/Kernel/PhysicalAddress.h index f68cbffc53..9d2a280158 100644 --- a/Kernel/PhysicalAddress.h +++ b/Kernel/PhysicalAddress.h @@ -26,7 +26,7 @@ #pragma once -#include +#include #include class PhysicalAddress { @@ -61,11 +61,6 @@ private: FlatPtr m_address { 0 }; }; -inline const LogStream& operator<<(const LogStream& stream, PhysicalAddress value) -{ - return stream << 'P' << value.as_ptr(); -} - template<> struct AK::Formatter : AK::Formatter { void format(FormatBuilder& builder, PhysicalAddress value) diff --git a/Kernel/Process.h b/Kernel/Process.h index 3b043d4b3e..c27bf874a2 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -719,11 +719,6 @@ inline ProcessID Thread::pid() const return m_process->pid(); } -inline const LogStream& operator<<(const LogStream& stream, const Process& process) -{ - return stream << process.name() << '(' << process.pid().value() << ')'; -} - #define REQUIRE_NO_PROMISES \ do { \ if (Process::current()->has_promises()) { \ diff --git a/Kernel/RTC.cpp b/Kernel/RTC.cpp index 22143c47aa..b1eb739a51 100644 --- a/Kernel/RTC.cpp +++ b/Kernel/RTC.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index de43256138..a1c28f5f37 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -1027,11 +1027,6 @@ KResult Thread::make_thread_specific_region(Badge) return KSuccess; } -const LogStream& operator<<(const LogStream& stream, const Thread& value) -{ - return stream << value.process().name() << "(" << value.pid().value() << ":" << value.tid().value() << ")"; -} - RefPtr Thread::from_tid(ThreadID tid) { RefPtr found_thread; diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 19176e136c..67c83ca7d9 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -1298,8 +1298,6 @@ inline IterationDecision Thread::for_each_in_state(State state, Callback callbac return IterationDecision::Continue; } -const LogStream& operator<<(const LogStream&, const Thread&); - } template<> diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp index 73ee9d2389..d5935ee7de 100644 --- a/Kernel/VM/MemoryManager.cpp +++ b/Kernel/VM/MemoryManager.cpp @@ -475,7 +475,7 @@ PageFaultResponse MemoryManager::handle_page_fault(const PageFault& fault) dbgln_if(PAGE_FAULT_DEBUG, "MM: CPU[{}] handle_page_fault({:#04x}) at {}", Processor::id(), fault.code(), fault.vaddr()); auto* region = find_region_from_vaddr(fault.vaddr()); if (!region) { - dmesgln("CPU[{}] NP(error) fault at invalid address {}", Processor::id(), fault.vaddr()); + Process::current()->space().dump_regions(); return PageFaultResponse::ShouldCrash; } diff --git a/Kernel/VirtualAddress.h b/Kernel/VirtualAddress.h index 4917e8c7d8..132bc6f16c 100644 --- a/Kernel/VirtualAddress.h +++ b/Kernel/VirtualAddress.h @@ -26,7 +26,7 @@ #pragma once -#include +#include #include class VirtualAddress { @@ -71,11 +71,6 @@ inline VirtualAddress operator-(const VirtualAddress& a, const VirtualAddress& b return VirtualAddress(a.get() - b.get()); } -inline const LogStream& operator<<(const LogStream& stream, VirtualAddress value) -{ - return stream << 'V' << value.as_ptr(); -} - template<> struct AK::Formatter : AK::Formatter { void format(FormatBuilder& builder, const VirtualAddress& value) diff --git a/Kernel/init.cpp b/Kernel/init.cpp index c17207468d..23d90cb7fa 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -72,6 +72,7 @@ #include #include #include +#include // Defined in the linker script typedef void (*ctor_func_t)(); @@ -337,7 +338,7 @@ void init_stage2(void*) UNMAP_AFTER_INIT void setup_serial_debug() { - // serial_debug will output all the klog() and dbgln() data to COM1 at + // serial_debug will output all the dbgln() data to COM1 at // 8-N-1 57600 baud. this is particularly useful for debugging the boot // process on live hardware. if (StringView(kernel_cmdline).contains("serial_debug")) { diff --git a/Kernel/kprintf.cpp b/Kernel/kprintf.cpp index 8f173e7350..4e19fc3473 100644 --- a/Kernel/kprintf.cpp +++ b/Kernel/kprintf.cpp @@ -36,7 +36,7 @@ static bool serial_debug; // A recursive spinlock allows us to keep writing in the case where a -// page fault happens in the middle of a dbgln(), klog(), etc +// page fault happens in the middle of a dbgln(), etc static RecursiveSpinLock s_log_lock; void set_serial_debug(bool on_or_off) @@ -148,22 +148,20 @@ static void debugger_out(char ch) IO::out8(0xe9, ch); } -extern "C" int dbgputstr(const char* characters, int length) +extern "C" void dbgputstr(const char* characters, size_t length) { if (!characters) - return 0; + return; ScopedSpinLock lock(s_log_lock); - for (int i = 0; i < length; ++i) + for (size_t i = 0; i < length; ++i) debugger_out(characters[i]); - return 0; } -extern "C" int kernelputstr(const char* characters, int length) +extern "C" void kernelputstr(const char* characters, size_t length) { if (!characters) - return 0; + return; ScopedSpinLock lock(s_log_lock); - for (int i = 0; i < length; ++i) + for (size_t i = 0; i < length; ++i) console_out(characters[i]); - return 0; } diff --git a/Kernel/kstdio.h b/Kernel/kstdio.h index 067ba8edc0..c00ef11127 100644 --- a/Kernel/kstdio.h +++ b/Kernel/kstdio.h @@ -29,8 +29,8 @@ #include extern "C" { -int dbgputstr(const char*, int); -int kernelputstr(const char*, int); +void dbgputstr(const char*, size_t); +void kernelputstr(const char*, size_t); int snprintf(char* buf, size_t, const char* fmt, ...) __attribute__((format(printf, 3, 4))); void set_serial_debug(bool on_or_off); int get_serial_debug(); diff --git a/Userland/Applications/About/main.cpp b/Userland/Applications/About/main.cpp index 8b03c00f42..803905dc8c 100644 --- a/Userland/Applications/About/main.cpp +++ b/Userland/Applications/About/main.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp index 0440597cae..77a11934d2 100644 --- a/Userland/Applications/Browser/main.cpp +++ b/Userland/Applications/Browser/main.cpp @@ -26,7 +26,6 @@ #include "BookmarksBarWidget.h" #include "Browser.h" -#include "InspectorWidget.h" #include "Tab.h" #include "WindowActions.h" #include @@ -47,6 +46,7 @@ #include #include #include +#include namespace Browser { diff --git a/Userland/Applications/Calculator/main.cpp b/Userland/Applications/Calculator/main.cpp index 91ee969d23..79aaab58a4 100644 --- a/Userland/Applications/Calculator/main.cpp +++ b/Userland/Applications/Calculator/main.cpp @@ -34,6 +34,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/Calendar/main.cpp b/Userland/Applications/Calendar/main.cpp index be1a23f7b3..8406927b7f 100644 --- a/Userland/Applications/Calendar/main.cpp +++ b/Userland/Applications/Calendar/main.cpp @@ -38,9 +38,9 @@ #include #include #include -#include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index 00029f8d22..e1a02b2874 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -48,6 +48,7 @@ #include #include #include +#include struct TitleAndText { String title; diff --git a/Userland/Applications/Debugger/main.cpp b/Userland/Applications/Debugger/main.cpp index fe91440b87..fa2ec66e67 100644 --- a/Userland/Applications/Debugger/main.cpp +++ b/Userland/Applications/Debugger/main.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/Userland/Applications/DisplaySettings/main.cpp b/Userland/Applications/DisplaySettings/main.cpp index f2dbcc2b33..a7a7a6de7d 100644 --- a/Userland/Applications/DisplaySettings/main.cpp +++ b/Userland/Applications/DisplaySettings/main.cpp @@ -32,10 +32,10 @@ #include #include #include -#include #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/FontEditor/main.cpp b/Userland/Applications/FontEditor/main.cpp index 8a370160bd..61d14248dd 100644 --- a/Userland/Applications/FontEditor/main.cpp +++ b/Userland/Applications/FontEditor/main.cpp @@ -41,6 +41,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/Help/main.cpp b/Userland/Applications/Help/main.cpp index 02089b1d59..50d2d816ae 100644 --- a/Userland/Applications/Help/main.cpp +++ b/Userland/Applications/Help/main.cpp @@ -50,6 +50,7 @@ #include #include #include +#include int main(int argc, char* argv[]) { diff --git a/Userland/Applications/HexEditor/main.cpp b/Userland/Applications/HexEditor/main.cpp index 5c4a22b20a..f9217af243 100644 --- a/Userland/Applications/HexEditor/main.cpp +++ b/Userland/Applications/HexEditor/main.cpp @@ -29,6 +29,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/IRCClient/IRCClient.cpp b/Userland/Applications/IRCClient/IRCClient.cpp index 2eb7c03705..910acf91cc 100644 --- a/Userland/Applications/IRCClient/IRCClient.cpp +++ b/Userland/Applications/IRCClient/IRCClient.cpp @@ -39,6 +39,7 @@ #include #include #include +#include enum IRCNumeric { RPL_WELCOME = 1, diff --git a/Userland/Applications/IRCClient/main.cpp b/Userland/Applications/IRCClient/main.cpp index 2cd00843fa..9455089970 100644 --- a/Userland/Applications/IRCClient/main.cpp +++ b/Userland/Applications/IRCClient/main.cpp @@ -30,6 +30,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/KeyboardMapper/main.cpp b/Userland/Applications/KeyboardMapper/main.cpp index 654eb44fd5..ad719dcbf3 100644 --- a/Userland/Applications/KeyboardMapper/main.cpp +++ b/Userland/Applications/KeyboardMapper/main.cpp @@ -32,6 +32,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/PixelPaint/main.cpp b/Userland/Applications/PixelPaint/main.cpp index e7c88d3849..c8efb94830 100644 --- a/Userland/Applications/PixelPaint/main.cpp +++ b/Userland/Applications/PixelPaint/main.cpp @@ -44,14 +44,13 @@ #include #include #include -#include #include #include -#include #include #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/Run/main.cpp b/Userland/Applications/Run/main.cpp index 706215a49c..3513da9d11 100644 --- a/Userland/Applications/Run/main.cpp +++ b/Userland/Applications/Run/main.cpp @@ -24,14 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include -#include -#include - #include "RunWindow.h" +#include +#include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/Serendipity/main.cpp b/Userland/Applications/Serendipity/main.cpp index b176dd12f6..f25bd052cb 100644 --- a/Userland/Applications/Serendipity/main.cpp +++ b/Userland/Applications/Serendipity/main.cpp @@ -28,6 +28,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp index 9cd199e2a1..50d06bea1d 100644 --- a/Userland/Applications/SpaceAnalyzer/main.cpp +++ b/Userland/Applications/SpaceAnalyzer/main.cpp @@ -43,6 +43,7 @@ #include #include #include +#include static const char* APP_NAME = "Space Analyzer"; diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp index 48bdbc5e97..1ce8c0d3b6 100644 --- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp +++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp @@ -40,6 +40,7 @@ #include #include #include +#include namespace Spreadsheet { diff --git a/Userland/Applications/Spreadsheet/main.cpp b/Userland/Applications/Spreadsheet/main.cpp index f306531645..805b843365 100644 --- a/Userland/Applications/Spreadsheet/main.cpp +++ b/Userland/Applications/Spreadsheet/main.cpp @@ -33,11 +33,11 @@ #include #include #include -#include #include #include #include #include +#include int main(int argc, char* argv[]) { diff --git a/Userland/Applications/TextEditor/main.cpp b/Userland/Applications/TextEditor/main.cpp index f549c0564a..0bf5c5c8a5 100644 --- a/Userland/Applications/TextEditor/main.cpp +++ b/Userland/Applications/TextEditor/main.cpp @@ -29,6 +29,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp index 4daa17488e..2f503e1f4b 100644 --- a/Userland/Applications/ThemeEditor/main.cpp +++ b/Userland/Applications/ThemeEditor/main.cpp @@ -32,6 +32,7 @@ #include #include #include +#include class ColorRoleModel final : public GUI::Model { public: diff --git a/Userland/Demos/Cube/Cube.cpp b/Userland/Demos/Cube/Cube.cpp index 6e0fb1e8b5..30088c9607 100644 --- a/Userland/Demos/Cube/Cube.cpp +++ b/Userland/Demos/Cube/Cube.cpp @@ -37,10 +37,9 @@ #include #include #include -#include #include #include -#include +#include const int WIDTH = 200; const int HEIGHT = 200; diff --git a/Userland/Demos/Eyes/main.cpp b/Userland/Demos/Eyes/main.cpp index 3db722a882..5b120ae260 100644 --- a/Userland/Demos/Eyes/main.cpp +++ b/Userland/Demos/Eyes/main.cpp @@ -32,6 +32,7 @@ #include #include #include +#include int main(int argc, char* argv[]) { diff --git a/Userland/Demos/Fire/Fire.cpp b/Userland/Demos/Fire/Fire.cpp index 03986dea01..c76b3e8bd4 100644 --- a/Userland/Demos/Fire/Fire.cpp +++ b/Userland/Demos/Fire/Fire.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #define FIRE_WIDTH 320 #define FIRE_HEIGHT 168 diff --git a/Userland/Demos/LibGfxDemo/main.cpp b/Userland/Demos/LibGfxDemo/main.cpp index 8d40798e30..2122d40a1a 100644 --- a/Userland/Demos/LibGfxDemo/main.cpp +++ b/Userland/Demos/LibGfxDemo/main.cpp @@ -30,10 +30,10 @@ #include #include #include -#include #include #include #include +#include const int WIDTH = 780; const int HEIGHT = 600; diff --git a/Userland/Demos/LibGfxScaleDemo/main.cpp b/Userland/Demos/LibGfxScaleDemo/main.cpp index 9a60b911d1..e7763b3e65 100644 --- a/Userland/Demos/LibGfxScaleDemo/main.cpp +++ b/Userland/Demos/LibGfxScaleDemo/main.cpp @@ -31,12 +31,12 @@ #include #include #include -#include #include #include #include #include #include +#include const int WIDTH = 300; const int HEIGHT = 200; diff --git a/Userland/Demos/Mouse/main.cpp b/Userland/Demos/Mouse/main.cpp index 6cd3d20289..547c510469 100644 --- a/Userland/Demos/Mouse/main.cpp +++ b/Userland/Demos/Mouse/main.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include diff --git a/Userland/Demos/Screensaver/Screensaver.cpp b/Userland/Demos/Screensaver/Screensaver.cpp index 889106f8d7..bf6166a154 100644 --- a/Userland/Demos/Screensaver/Screensaver.cpp +++ b/Userland/Demos/Screensaver/Screensaver.cpp @@ -33,6 +33,7 @@ #include #include #include +#include class Screensaver final : public GUI::Widget { C_OBJECT(Screensaver) diff --git a/Userland/Demos/WidgetGallery/main.cpp b/Userland/Demos/WidgetGallery/main.cpp index 352b864e7e..63d3aa5a41 100644 --- a/Userland/Demos/WidgetGallery/main.cpp +++ b/Userland/Demos/WidgetGallery/main.cpp @@ -31,6 +31,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/DevTools/HackStudio/CursorTool.cpp b/Userland/DevTools/HackStudio/CursorTool.cpp index 04f74d526f..de6e74c31c 100644 --- a/Userland/DevTools/HackStudio/CursorTool.cpp +++ b/Userland/DevTools/HackStudio/CursorTool.cpp @@ -29,7 +29,6 @@ #include "FormWidget.h" #include "WidgetTreeModel.h" #include -#include #include namespace HackStudio { diff --git a/Userland/DevTools/HackStudio/Git/GitWidget.cpp b/Userland/DevTools/HackStudio/Git/GitWidget.cpp index e15583ff8d..c0ef18f00c 100644 --- a/Userland/DevTools/HackStudio/Git/GitWidget.cpp +++ b/Userland/DevTools/HackStudio/Git/GitWidget.cpp @@ -26,7 +26,6 @@ #include "GitWidget.h" #include "GitFilesModel.h" -#include #include #include #include diff --git a/Userland/DevTools/HackStudio/WidgetTool.cpp b/Userland/DevTools/HackStudio/WidgetTool.cpp index 73626ebbf8..a0073c8ede 100644 --- a/Userland/DevTools/HackStudio/WidgetTool.cpp +++ b/Userland/DevTools/HackStudio/WidgetTool.cpp @@ -25,7 +25,7 @@ */ #include "WidgetTool.h" -#include +#include namespace HackStudio { diff --git a/Userland/DevTools/Playground/main.cpp b/Userland/DevTools/Playground/main.cpp index e6f7871f5f..dc63bd47b6 100644 --- a/Userland/DevTools/Playground/main.cpp +++ b/Userland/DevTools/Playground/main.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -45,6 +44,7 @@ #include #include #include +#include namespace { diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.cpp b/Userland/DevTools/UserspaceEmulator/Emulator.cpp index 9ed37961e8..091e77a453 100644 --- a/Userland/DevTools/UserspaceEmulator/Emulator.cpp +++ b/Userland/DevTools/UserspaceEmulator/Emulator.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #if defined(__GNUC__) && !defined(__clang__) # pragma GCC optimize("O3") diff --git a/Userland/DevTools/UserspaceEmulator/MallocTracer.cpp b/Userland/DevTools/UserspaceEmulator/MallocTracer.cpp index 0c753d0fdd..2390d255ba 100644 --- a/Userland/DevTools/UserspaceEmulator/MallocTracer.cpp +++ b/Userland/DevTools/UserspaceEmulator/MallocTracer.cpp @@ -28,10 +28,10 @@ #include "Emulator.h" #include "MmapRegion.h" #include -#include #include #include #include +#include namespace UserspaceEmulator { diff --git a/Userland/DevTools/UserspaceEmulator/Report.h b/Userland/DevTools/UserspaceEmulator/Report.h index 96face8914..9d4a01011a 100644 --- a/Userland/DevTools/UserspaceEmulator/Report.h +++ b/Userland/DevTools/UserspaceEmulator/Report.h @@ -26,7 +26,7 @@ #pragma once -#include +#include extern bool g_report_to_debug; diff --git a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp index 62a975d8f5..3c4fb2fd41 100644 --- a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #if defined(__GNUC__) && !defined(__clang__) # pragma GCC optimize("O3") diff --git a/Userland/DevTools/UserspaceEmulator/main.cpp b/Userland/DevTools/UserspaceEmulator/main.cpp index 8fff65cd0f..f91d721b41 100644 --- a/Userland/DevTools/UserspaceEmulator/main.cpp +++ b/Userland/DevTools/UserspaceEmulator/main.cpp @@ -25,16 +25,13 @@ */ #include "Emulator.h" -#include "SoftCPU.h" #include #include -#include #include #include #include -#include -#include #include +#include #include bool g_report_to_debug = false; diff --git a/Userland/DynamicLoader/main.cpp b/Userland/DynamicLoader/main.cpp index 43545dcd48..0f3685b434 100644 --- a/Userland/DynamicLoader/main.cpp +++ b/Userland/DynamicLoader/main.cpp @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/Userland/DynamicLoader/misc.cpp b/Userland/DynamicLoader/misc.cpp index f8f172a7c6..9cc18cab8a 100644 --- a/Userland/DynamicLoader/misc.cpp +++ b/Userland/DynamicLoader/misc.cpp @@ -25,7 +25,7 @@ */ #include "misc.h" -#include "AK/LogStream.h" +#include extern "C" { const char* __cxa_demangle(const char*, void*, void*, int*) diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp index 7cf03fde35..d82e42c293 100644 --- a/Userland/Games/2048/main.cpp +++ b/Userland/Games/2048/main.cpp @@ -40,6 +40,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Games/Breakout/Game.cpp b/Userland/Games/Breakout/Game.cpp index c66f45d2b4..1d56509e3b 100644 --- a/Userland/Games/Breakout/Game.cpp +++ b/Userland/Games/Breakout/Game.cpp @@ -31,6 +31,7 @@ #include #include #include +#include namespace Breakout { diff --git a/Userland/Games/Breakout/main.cpp b/Userland/Games/Breakout/main.cpp index 560b7aeaec..c12a9d296f 100644 --- a/Userland/Games/Breakout/main.cpp +++ b/Userland/Games/Breakout/main.cpp @@ -31,6 +31,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Games/Chess/Engine.cpp b/Userland/Games/Chess/Engine.cpp index a0ccc72ba7..e709e319bf 100644 --- a/Userland/Games/Chess/Engine.cpp +++ b/Userland/Games/Chess/Engine.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include Engine::~Engine() { diff --git a/Userland/Games/Chess/main.cpp b/Userland/Games/Chess/main.cpp index 7f01004eaa..540cfe5587 100644 --- a/Userland/Games/Chess/main.cpp +++ b/Userland/Games/Chess/main.cpp @@ -36,6 +36,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Games/Conway/main.cpp b/Userland/Games/Conway/main.cpp index d266d3bfdb..f103cabfbb 100644 --- a/Userland/Games/Conway/main.cpp +++ b/Userland/Games/Conway/main.cpp @@ -31,6 +31,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Games/Minesweeper/main.cpp b/Userland/Games/Minesweeper/main.cpp index 3247194abc..2541234426 100644 --- a/Userland/Games/Minesweeper/main.cpp +++ b/Userland/Games/Minesweeper/main.cpp @@ -37,6 +37,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Games/Pong/main.cpp b/Userland/Games/Pong/main.cpp index 0af4776b45..34ebe0f239 100644 --- a/Userland/Games/Pong/main.cpp +++ b/Userland/Games/Pong/main.cpp @@ -32,6 +32,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Games/Snake/main.cpp b/Userland/Games/Snake/main.cpp index a3156c4c38..e48de628c3 100644 --- a/Userland/Games/Snake/main.cpp +++ b/Userland/Games/Snake/main.cpp @@ -35,6 +35,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Libraries/LibC/cxxabi.cpp b/Userland/Libraries/LibC/cxxabi.cpp index 073956c189..064c39d87d 100644 --- a/Userland/Libraries/LibC/cxxabi.cpp +++ b/Userland/Libraries/LibC/cxxabi.cpp @@ -25,12 +25,13 @@ */ #include -#include +#include #include #include #include #include #include +#include extern "C" { diff --git a/Userland/Libraries/LibC/dlfcn.cpp b/Userland/Libraries/LibC/dlfcn.cpp index 9565246406..df6d8680ef 100644 --- a/Userland/Libraries/LibC/dlfcn.cpp +++ b/Userland/Libraries/LibC/dlfcn.cpp @@ -29,13 +29,11 @@ #include #include #include -#include #include #include #include #include -#include -#include +#include // NOTE: The string here should never include a trailing newline (according to POSIX) String g_dlerror_msg; diff --git a/Userland/Libraries/LibC/locale.cpp b/Userland/Libraries/LibC/locale.cpp index d4c5401a24..7524d33e8b 100644 --- a/Userland/Libraries/LibC/locale.cpp +++ b/Userland/Libraries/LibC/locale.cpp @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/Userland/Libraries/LibC/malloc.cpp b/Userland/Libraries/LibC/malloc.cpp index 6115e6146a..5df71f1dc7 100644 --- a/Userland/Libraries/LibC/malloc.cpp +++ b/Userland/Libraries/LibC/malloc.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibC/scanf.cpp b/Userland/Libraries/LibC/scanf.cpp index 13f306d5aa..7e517c970c 100644 --- a/Userland/Libraries/LibC/scanf.cpp +++ b/Userland/Libraries/LibC/scanf.cpp @@ -25,8 +25,8 @@ */ #include +#include #include -#include #include #include #include diff --git a/Userland/Libraries/LibC/stdio.cpp b/Userland/Libraries/LibC/stdio.cpp index a4d4700818..56e74dd5cb 100644 --- a/Userland/Libraries/LibC/stdio.cpp +++ b/Userland/Libraries/LibC/stdio.cpp @@ -1048,10 +1048,9 @@ void dbgputch(char ch) syscall(SC_dbgputch, ch); } -int dbgputstr(const char* characters, ssize_t length) +void dbgputstr(const char* characters, size_t length) { - int rc = syscall(SC_dbgputstr, characters, length); - __RETURN_WITH_ERRNO(rc, rc, -1); + syscall(SC_dbgputstr, characters, length); } char* tmpnam(char*) diff --git a/Userland/Libraries/LibC/stdio.h b/Userland/Libraries/LibC/stdio.h index cc76741d0b..018c57fe47 100644 --- a/Userland/Libraries/LibC/stdio.h +++ b/Userland/Libraries/LibC/stdio.h @@ -94,7 +94,7 @@ int vsnprintf(char* buffer, size_t, const char* fmt, va_list) __attribute__((for int fprintf(FILE*, const char* fmt, ...) __attribute__((format(printf, 2, 3))); int printf(const char* fmt, ...) __attribute__((format(printf, 1, 2))); void dbgputch(char); -int dbgputstr(const char*, ssize_t); +void dbgputstr(const char*, size_t); int sprintf(char* buffer, const char* fmt, ...) __attribute__((format(printf, 2, 3))); int snprintf(char* buffer, size_t, const char* fmt, ...) __attribute__((format(printf, 3, 4))); int putchar(int ch); diff --git a/Userland/Libraries/LibC/sys/ptrace.cpp b/Userland/Libraries/LibC/sys/ptrace.cpp index f285ef5bb5..b53bb48465 100644 --- a/Userland/Libraries/LibC/sys/ptrace.cpp +++ b/Userland/Libraries/LibC/sys/ptrace.cpp @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include diff --git a/Userland/Libraries/LibChess/Chess.cpp b/Userland/Libraries/LibChess/Chess.cpp index 3bce22f647..bc88616055 100644 --- a/Userland/Libraries/LibChess/Chess.cpp +++ b/Userland/Libraries/LibChess/Chess.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include diff --git a/Userland/Libraries/LibCompress/Deflate.cpp b/Userland/Libraries/LibCompress/Deflate.cpp index 54f7911ec3..2340630033 100644 --- a/Userland/Libraries/LibCompress/Deflate.cpp +++ b/Userland/Libraries/LibCompress/Deflate.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp index efe0120033..1e999d6629 100644 --- a/Userland/Libraries/LibCore/Account.cpp +++ b/Userland/Libraries/LibCore/Account.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibCore/Command.cpp b/Userland/Libraries/LibCore/Command.cpp index d75a645777..ea5764bb01 100644 --- a/Userland/Libraries/LibCore/Command.cpp +++ b/Userland/Libraries/LibCore/Command.cpp @@ -26,7 +26,7 @@ #include "Command.h" #include -#include +#include #include #include #include diff --git a/Userland/Libraries/LibCore/DateTime.cpp b/Userland/Libraries/LibCore/DateTime.cpp index 804abac3de..4e9a8ec345 100644 --- a/Userland/Libraries/LibCore/DateTime.cpp +++ b/Userland/Libraries/LibCore/DateTime.cpp @@ -255,9 +255,4 @@ bool DateTime::is_before(const String& other) const return __builtin_strcasecmp(now_string.characters(), other.characters()) < 0; } -const LogStream& operator<<(const LogStream& stream, const DateTime& value) -{ - return stream << value.to_string(); -} - } diff --git a/Userland/Libraries/LibCore/DateTime.h b/Userland/Libraries/LibCore/DateTime.h index 15515cc0fd..9101a9306a 100644 --- a/Userland/Libraries/LibCore/DateTime.h +++ b/Userland/Libraries/LibCore/DateTime.h @@ -69,6 +69,4 @@ private: unsigned m_second { 0 }; }; -const LogStream& operator<<(const LogStream&, const DateTime&); - } diff --git a/Userland/Libraries/LibCore/DirIterator.cpp b/Userland/Libraries/LibCore/DirIterator.cpp index 3dbeecf24f..83d4f32786 100644 --- a/Userland/Libraries/LibCore/DirIterator.cpp +++ b/Userland/Libraries/LibCore/DirIterator.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace Core { diff --git a/Userland/Libraries/LibCore/FileWatcher.cpp b/Userland/Libraries/LibCore/FileWatcher.cpp index 70ed9928bc..46db6686d6 100644 --- a/Userland/Libraries/LibCore/FileWatcher.cpp +++ b/Userland/Libraries/LibCore/FileWatcher.cpp @@ -40,6 +40,7 @@ #include #include #include +#include namespace Core { diff --git a/Userland/Libraries/LibCore/GetPassword.cpp b/Userland/Libraries/LibCore/GetPassword.cpp index 88bb27345a..98c3ab0ed3 100644 --- a/Userland/Libraries/LibCore/GetPassword.cpp +++ b/Userland/Libraries/LibCore/GetPassword.cpp @@ -29,6 +29,7 @@ #include #include #include +#include namespace Core { diff --git a/Userland/Libraries/LibCore/Object.cpp b/Userland/Libraries/LibCore/Object.cpp index 800f557384..854467a356 100644 --- a/Userland/Libraries/LibCore/Object.cpp +++ b/Userland/Libraries/LibCore/Object.cpp @@ -262,9 +262,4 @@ void Object::register_property(const String& name, Function getter, m_properties.set(name, make(name, move(getter), move(setter))); } -const LogStream& operator<<(const LogStream& stream, const Object& object) -{ - return stream << object.class_name() << '{' << &object << '}'; -} - } diff --git a/Userland/Libraries/LibCore/Object.h b/Userland/Libraries/LibCore/Object.h index d5dcefd01f..6295d1d75b 100644 --- a/Userland/Libraries/LibCore/Object.h +++ b/Userland/Libraries/LibCore/Object.h @@ -223,8 +223,6 @@ T* Object::find_descendant_of_type_named(const String& name) requires IsBaseOf - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include - -namespace Core { - -const LogStream& operator<<(const LogStream& stream, const SocketAddress& value) -{ - return stream << value.to_string(); -} - -} diff --git a/Userland/Libraries/LibCore/SocketAddress.h b/Userland/Libraries/LibCore/SocketAddress.h index 695fa361aa..87f7d8b63e 100644 --- a/Userland/Libraries/LibCore/SocketAddress.h +++ b/Userland/Libraries/LibCore/SocketAddress.h @@ -110,8 +110,6 @@ private: String m_local_address; }; -const LogStream& operator<<(const LogStream&, const SocketAddress&); - } template<> diff --git a/Userland/Libraries/LibCore/SyscallUtils.h b/Userland/Libraries/LibCore/SyscallUtils.h index 9fd8009c8b..07ca9f0aa4 100644 --- a/Userland/Libraries/LibCore/SyscallUtils.h +++ b/Userland/Libraries/LibCore/SyscallUtils.h @@ -27,7 +27,6 @@ #pragma once #include -#include #include #include #include diff --git a/Userland/Libraries/LibCore/TCPServer.cpp b/Userland/Libraries/LibCore/TCPServer.cpp index 79fe6f468e..3d0cc97025 100644 --- a/Userland/Libraries/LibCore/TCPServer.cpp +++ b/Userland/Libraries/LibCore/TCPServer.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #ifndef SOCK_NONBLOCK # include diff --git a/Userland/Libraries/LibCore/UDPServer.cpp b/Userland/Libraries/LibCore/UDPServer.cpp index fd68490b77..c92aaec399 100644 --- a/Userland/Libraries/LibCore/UDPServer.cpp +++ b/Userland/Libraries/LibCore/UDPServer.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/Userland/Libraries/LibCpp/AST.cpp b/Userland/Libraries/LibCpp/AST.cpp index ffb7d6d70b..8c41c596d5 100644 --- a/Userland/Libraries/LibCpp/AST.cpp +++ b/Userland/Libraries/LibCpp/AST.cpp @@ -25,7 +25,6 @@ */ #include "AST.h" -#include "AK/LogStream.h" namespace Cpp { diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp index 7bbffe7276..6b923d4958 100644 --- a/Userland/Libraries/LibCpp/Parser.cpp +++ b/Userland/Libraries/LibCpp/Parser.cpp @@ -29,7 +29,6 @@ #endif #include "Parser.h" -#include "AK/LogStream.h" #include "AST.h" #include #include diff --git a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h index 753a27c47c..77ed86d634 100644 --- a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h +++ b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h @@ -141,20 +141,6 @@ struct SignedDivisionResult { } -inline const LogStream& -operator<<(const LogStream& stream, const Crypto::SignedBigInteger value) -{ - if (value.is_invalid()) { - stream << "Invalid BigInt"; - return stream; - } - if (value.is_negative()) - stream << "-"; - - stream << value.unsigned_value(); - return stream; -} - inline Crypto::SignedBigInteger operator""_sbigint(const char* string, size_t length) { diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index becae66749..51c1d9f776 100644 --- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -27,7 +27,6 @@ #pragma once #include -#include #include #include #include @@ -131,19 +130,6 @@ struct UnsignedDivisionResult { } -inline const LogStream& -operator<<(const LogStream& stream, const Crypto::UnsignedBigInteger& value) -{ - if (value.is_invalid()) { - stream << "Invalid BigInt"; - return stream; - } - for (int i = value.length() - 1; i >= 0; --i) { - stream << value.words()[i] << "|"; - } - return stream; -} - template<> struct AK::Formatter : Formatter { void format(FormatBuilder&, const Crypto::UnsignedBigInteger&); diff --git a/Userland/Libraries/LibCrypto/Checksum/CRC32.h b/Userland/Libraries/LibCrypto/Checksum/CRC32.h index df6d17ec16..a3a9b1150e 100644 --- a/Userland/Libraries/LibCrypto/Checksum/CRC32.h +++ b/Userland/Libraries/LibCrypto/Checksum/CRC32.h @@ -26,7 +26,6 @@ #pragma once -#include #include #include #include diff --git a/Userland/Libraries/LibELF/DynamicLinker.cpp b/Userland/Libraries/LibELF/DynamicLinker.cpp index 89fa43ac17..a598fe8c56 100644 --- a/Userland/Libraries/LibELF/DynamicLinker.cpp +++ b/Userland/Libraries/LibELF/DynamicLinker.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibELF/DynamicLoader.cpp b/Userland/Libraries/LibELF/DynamicLoader.cpp index 682da8642b..b019063911 100644 --- a/Userland/Libraries/LibELF/DynamicLoader.cpp +++ b/Userland/Libraries/LibELF/DynamicLoader.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #ifndef __serenity__ static void* mmap_with_name(void* addr, size_t length, int prot, int flags, int fd, off_t offset, const char*) diff --git a/Userland/Libraries/LibGUI/FileIconProvider.cpp b/Userland/Libraries/LibGUI/FileIconProvider.cpp index ed585e9dc2..a56d638699 100644 --- a/Userland/Libraries/LibGUI/FileIconProvider.cpp +++ b/Userland/Libraries/LibGUI/FileIconProvider.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -38,6 +37,7 @@ #include #include #include +#include namespace GUI { diff --git a/Userland/Libraries/LibGUI/ModelIndex.cpp b/Userland/Libraries/LibGUI/ModelIndex.cpp index 038974d1d4..bde5177596 100644 --- a/Userland/Libraries/LibGUI/ModelIndex.cpp +++ b/Userland/Libraries/LibGUI/ModelIndex.cpp @@ -39,11 +39,4 @@ Variant ModelIndex::data(ModelRole role) const return model()->data(*this, role); } -const LogStream& operator<<(const LogStream& stream, const ModelIndex& value) -{ - if (value.internal_data()) - return stream << String::formatted("ModelIndex({},{},{:p})", value.row(), value.column(), value.internal_data()); - return stream << String::formatted("ModelIndex({},{})", value.row(), value.column()); -} - } diff --git a/Userland/Libraries/LibGUI/ModelIndex.h b/Userland/Libraries/LibGUI/ModelIndex.h index 4d6d49a92b..9a1ff1d6fd 100644 --- a/Userland/Libraries/LibGUI/ModelIndex.h +++ b/Userland/Libraries/LibGUI/ModelIndex.h @@ -76,8 +76,6 @@ private: void* m_internal_data { nullptr }; }; -const LogStream& operator<<(const LogStream&, const ModelIndex&); - } namespace AK { diff --git a/Userland/Libraries/LibGUI/TextPosition.h b/Userland/Libraries/LibGUI/TextPosition.h index 47ccc71e47..c744307d93 100644 --- a/Userland/Libraries/LibGUI/TextPosition.h +++ b/Userland/Libraries/LibGUI/TextPosition.h @@ -26,7 +26,6 @@ #pragma once -#include #include namespace GUI { @@ -57,13 +56,6 @@ private: size_t m_column { 0xffffffff }; }; -inline const LogStream& operator<<(const LogStream& stream, const TextPosition& value) -{ - if (!value.is_valid()) - return stream << "GUI::TextPosition(Invalid)"; - return stream << String::formatted("({},{})", value.line(), value.column()); -} - } template<> diff --git a/Userland/Libraries/LibGUI/TextRange.h b/Userland/Libraries/LibGUI/TextRange.h index ea6918c0f4..55e5378d52 100644 --- a/Userland/Libraries/LibGUI/TextRange.h +++ b/Userland/Libraries/LibGUI/TextRange.h @@ -26,7 +26,6 @@ #pragma once -#include #include namespace GUI { @@ -85,13 +84,6 @@ private: TextPosition m_end; }; -inline const LogStream& operator<<(const LogStream& stream, const TextRange& value) -{ - if (!value.is_valid()) - return stream << "GUI::TextRange(Invalid)"; - return stream << value.start() << '-' << value.end(); -} - } template<> diff --git a/Userland/Libraries/LibGfx/AffineTransform.cpp b/Userland/Libraries/LibGfx/AffineTransform.cpp index 29236b83f0..0f4bca708e 100644 --- a/Userland/Libraries/LibGfx/AffineTransform.cpp +++ b/Userland/Libraries/LibGfx/AffineTransform.cpp @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include @@ -158,18 +157,4 @@ IntRect AffineTransform::map(const IntRect& rect) const return enclosing_int_rect(map(FloatRect(rect))); } -const LogStream& operator<<(const LogStream& stream, const AffineTransform& value) -{ - if (value.is_identity()) - return stream << "{ Identity }"; - - return stream << "{ " - << value.a() << ", " - << value.b() << ", " - << value.c() << ", " - << value.d() << ", " - << value.e() << ", " - << value.f() << " }"; -} - } diff --git a/Userland/Libraries/LibGfx/AffineTransform.h b/Userland/Libraries/LibGfx/AffineTransform.h index 41334eb138..3155009e91 100644 --- a/Userland/Libraries/LibGfx/AffineTransform.h +++ b/Userland/Libraries/LibGfx/AffineTransform.h @@ -27,7 +27,6 @@ #pragma once #include -#include #include namespace Gfx { @@ -76,6 +75,4 @@ private: float m_values[6] { 0 }; }; -const LogStream& operator<<(const LogStream&, const AffineTransform&); - } diff --git a/Userland/Libraries/LibGfx/Color.cpp b/Userland/Libraries/LibGfx/Color.cpp index 20265dc43f..482e0bc0ad 100644 --- a/Userland/Libraries/LibGfx/Color.cpp +++ b/Userland/Libraries/LibGfx/Color.cpp @@ -328,10 +328,6 @@ Optional Color::from_string(const StringView& string) return Color(r.value(), g.value(), b.value(), a.value()); } -const LogStream& operator<<(const LogStream& stream, Color value) -{ - return stream << value.to_string(); -} } bool IPC::encode(IPC::Encoder& encoder, const Color& color) diff --git a/Userland/Libraries/LibGfx/Color.h b/Userland/Libraries/LibGfx/Color.h index 671c8caf5d..befaa2ed77 100644 --- a/Userland/Libraries/LibGfx/Color.h +++ b/Userland/Libraries/LibGfx/Color.h @@ -404,8 +404,6 @@ inline constexpr Color::Color(NamedColor named) m_value = 0xff000000 | (rgb.r << 16) | (rgb.g << 8) | rgb.b; } -const LogStream& operator<<(const LogStream&, Color); - } using Gfx::Color; diff --git a/Userland/Libraries/LibGfx/Path.h b/Userland/Libraries/LibGfx/Path.h index 81ebf2ccfb..0baf79e308 100644 --- a/Userland/Libraries/LibGfx/Path.h +++ b/Userland/Libraries/LibGfx/Path.h @@ -212,9 +212,4 @@ private: Optional m_bounding_box; }; -inline const LogStream& operator<<(const LogStream& stream, const Path& path) -{ - return stream << path.to_string(); -} - } diff --git a/Userland/Libraries/LibGfx/Point.h b/Userland/Libraries/LibGfx/Point.h index be6a71e149..526cbf6279 100644 --- a/Userland/Libraries/LibGfx/Point.h +++ b/Userland/Libraries/LibGfx/Point.h @@ -228,12 +228,6 @@ private: T m_y { 0 }; }; -template -const LogStream& operator<<(const LogStream& stream, const Point& point) -{ - return stream << point.to_string(); -} - using IntPoint = Point; using FloatPoint = Point; diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h index 082b1f7800..4cba04fff0 100644 --- a/Userland/Libraries/LibGfx/Rect.h +++ b/Userland/Libraries/LibGfx/Rect.h @@ -478,12 +478,6 @@ private: Size m_size; }; -template -const LogStream& operator<<(const LogStream& stream, const Rect& rect) -{ - return stream << rect.to_string(); -} - using IntRect = Rect; using FloatRect = Rect; diff --git a/Userland/Libraries/LibGfx/Size.h b/Userland/Libraries/LibGfx/Size.h index 67321a4a2d..fd45dd51fb 100644 --- a/Userland/Libraries/LibGfx/Size.h +++ b/Userland/Libraries/LibGfx/Size.h @@ -150,12 +150,6 @@ private: T m_height { 0 }; }; -template -const LogStream& operator<<(const LogStream& stream, const Gfx::Size& size) -{ - return stream << size.to_string(); -} - using IntSize = Size; using FloatSize = Size; diff --git a/Userland/Libraries/LibGfx/Triangle.cpp b/Userland/Libraries/LibGfx/Triangle.cpp index d326b59f1c..d45bea096b 100644 --- a/Userland/Libraries/LibGfx/Triangle.cpp +++ b/Userland/Libraries/LibGfx/Triangle.cpp @@ -34,9 +34,4 @@ String Triangle::to_string() const return String::formatted("({},{},{})", m_a, m_b, m_c); } -const LogStream& operator<<(const LogStream& stream, const Triangle& value) -{ - return stream << value.to_string(); -} - } diff --git a/Userland/Libraries/LibGfx/Triangle.h b/Userland/Libraries/LibGfx/Triangle.h index 7d8e69e80d..294a7f914d 100644 --- a/Userland/Libraries/LibGfx/Triangle.h +++ b/Userland/Libraries/LibGfx/Triangle.h @@ -76,6 +76,4 @@ private: IntPoint m_c; }; -const LogStream& operator<<(const LogStream&, const Triangle&); - } diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index 15ec22f05d..aa92c3c73d 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibLine/InternalFunctions.cpp b/Userland/Libraries/LibLine/InternalFunctions.cpp index 162e01dbee..015754c0b0 100644 --- a/Userland/Libraries/LibLine/InternalFunctions.cpp +++ b/Userland/Libraries/LibLine/InternalFunctions.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include diff --git a/Userland/Libraries/LibRegex/RegexLexer.cpp b/Userland/Libraries/LibRegex/RegexLexer.cpp index c7bd1194c5..8b0b155da3 100644 --- a/Userland/Libraries/LibRegex/RegexLexer.cpp +++ b/Userland/Libraries/LibRegex/RegexLexer.cpp @@ -27,7 +27,6 @@ #include "RegexLexer.h" #include #include -#include #include namespace regex { diff --git a/Userland/Libraries/LibTLS/TLSv12.cpp b/Userland/Libraries/LibTLS/TLSv12.cpp index 587996f662..6b61234b30 100644 --- a/Userland/Libraries/LibTLS/TLSv12.cpp +++ b/Userland/Libraries/LibTLS/TLSv12.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #ifndef SOCK_NONBLOCK # include diff --git a/Userland/Libraries/LibTTF/Font.cpp b/Userland/Libraries/LibTTF/Font.cpp index 03c6c92cdd..67c85a7767 100644 --- a/Userland/Libraries/LibTTF/Font.cpp +++ b/Userland/Libraries/LibTTF/Font.cpp @@ -26,7 +26,6 @@ #include "AK/ByteBuffer.h" #include -#include #include #include #include diff --git a/Userland/Libraries/LibTar/TarStream.cpp b/Userland/Libraries/LibTar/TarStream.cpp index 30654dc607..ca4f60ada3 100644 --- a/Userland/Libraries/LibTar/TarStream.cpp +++ b/Userland/Libraries/LibTar/TarStream.cpp @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include namespace Tar { diff --git a/Userland/Libraries/LibWeb/CSS/Length.h b/Userland/Libraries/LibWeb/CSS/Length.h index 78ee24f5de..322d741227 100644 --- a/Userland/Libraries/LibWeb/CSS/Length.h +++ b/Userland/Libraries/LibWeb/CSS/Length.h @@ -173,9 +173,4 @@ private: float m_value { 0 }; }; -inline const LogStream& operator<<(const LogStream& stream, const Length& value) -{ - return stream << value.to_string(); -} - } diff --git a/Userland/Libraries/LibWeb/DumpLayoutTree/main.cpp b/Userland/Libraries/LibWeb/DumpLayoutTree/main.cpp index 2ce6a6bd71..10fe41f64a 100644 --- a/Userland/Libraries/LibWeb/DumpLayoutTree/main.cpp +++ b/Userland/Libraries/LibWeb/DumpLayoutTree/main.cpp @@ -30,6 +30,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/MenuApplets/ClipboardHistory/main.cpp b/Userland/MenuApplets/ClipboardHistory/main.cpp index 6275296745..f6f596cd53 100644 --- a/Userland/MenuApplets/ClipboardHistory/main.cpp +++ b/Userland/MenuApplets/ClipboardHistory/main.cpp @@ -32,6 +32,7 @@ #include #include #include +#include int main(int argc, char* argv[]) { diff --git a/Userland/MenuApplets/UserName/main.cpp b/Userland/MenuApplets/UserName/main.cpp index ac841ae21b..138d2bbc92 100644 --- a/Userland/MenuApplets/UserName/main.cpp +++ b/Userland/MenuApplets/UserName/main.cpp @@ -28,10 +28,10 @@ #include #include #include -#include #include #include #include +#include class UserNameWidget final : public GUI::Widget { C_OBJECT(UserNameWidget) diff --git a/Userland/Services/ChessEngine/main.cpp b/Userland/Services/ChessEngine/main.cpp index 14d7b729a1..aac15d7f71 100644 --- a/Userland/Services/ChessEngine/main.cpp +++ b/Userland/Services/ChessEngine/main.cpp @@ -27,6 +27,7 @@ #include "ChessEngine.h" #include #include +#include int main() { diff --git a/Userland/Services/DHCPClient/main.cpp b/Userland/Services/DHCPClient/main.cpp index 722cee2b2d..8def7ec954 100644 --- a/Userland/Services/DHCPClient/main.cpp +++ b/Userland/Services/DHCPClient/main.cpp @@ -35,6 +35,7 @@ #include #include #include +#include static u8 mac_part(const Vector& parts, size_t index) { diff --git a/Userland/Services/EchoServer/main.cpp b/Userland/Services/EchoServer/main.cpp index a4136c3df6..188240bbfa 100644 --- a/Userland/Services/EchoServer/main.cpp +++ b/Userland/Services/EchoServer/main.cpp @@ -30,9 +30,9 @@ #include #include #include -#include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Services/LookupServer/main.cpp b/Userland/Services/LookupServer/main.cpp index 4d566ca8a9..855f825a69 100644 --- a/Userland/Services/LookupServer/main.cpp +++ b/Userland/Services/LookupServer/main.cpp @@ -28,6 +28,7 @@ #include #include #include +#include int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) { diff --git a/Userland/Services/ProtocolServer/Protocol.cpp b/Userland/Services/ProtocolServer/Protocol.cpp index de4a4e8a49..8ff46138e6 100644 --- a/Userland/Services/ProtocolServer/Protocol.cpp +++ b/Userland/Services/ProtocolServer/Protocol.cpp @@ -26,8 +26,10 @@ #include #include +#include #include #include +#include namespace ProtocolServer { diff --git a/Userland/Services/Taskbar/main.cpp b/Userland/Services/Taskbar/main.cpp index e6ee5d2b25..f86c0a114b 100644 --- a/Userland/Services/Taskbar/main.cpp +++ b/Userland/Services/Taskbar/main.cpp @@ -30,6 +30,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Services/TelnetServer/main.cpp b/Userland/Services/TelnetServer/main.cpp index 3adda4b83a..ed7b778647 100644 --- a/Userland/Services/TelnetServer/main.cpp +++ b/Userland/Services/TelnetServer/main.cpp @@ -27,9 +27,7 @@ #include "Client.h" #include #include -#include #include -#include #include #include #include @@ -39,6 +37,7 @@ #include #include #include +#include static void run_command(int ptm_fd, String command) { diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index e86f204da8..1a9e46dee4 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -32,7 +32,6 @@ #include "MenuItem.h" #include "Screen.h" #include "Window.h" -#include #include #include #include diff --git a/Userland/Services/WindowServer/main.cpp b/Userland/Services/WindowServer/main.cpp index 6e5898f27c..28957ac75a 100644 --- a/Userland/Services/WindowServer/main.cpp +++ b/Userland/Services/WindowServer/main.cpp @@ -35,6 +35,7 @@ #include #include #include +#include int main(int, char**) { diff --git a/Userland/Shell/AST.cpp b/Userland/Shell/AST.cpp index e53c2151c1..02c873e241 100644 --- a/Userland/Shell/AST.cpp +++ b/Userland/Shell/AST.cpp @@ -28,13 +28,16 @@ #include "Shell.h" #include #include +#include #include #include #include #include #include +#include #include #include +#include void AK::Formatter::format(FormatBuilder& builder, const Shell::AST::Command& value) { diff --git a/Userland/Shell/Builtin.cpp b/Userland/Shell/Builtin.cpp index 1eada40364..1c79d056e6 100644 --- a/Userland/Shell/Builtin.cpp +++ b/Userland/Shell/Builtin.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Shell/Formatter.cpp b/Userland/Shell/Formatter.cpp index 43f6934011..2d7e0908d5 100644 --- a/Userland/Shell/Formatter.cpp +++ b/Userland/Shell/Formatter.cpp @@ -27,6 +27,7 @@ #include "Formatter.h" #include "AST.h" #include "Parser.h" +#include #include namespace Shell { diff --git a/Userland/Shell/Parser.cpp b/Userland/Shell/Parser.cpp index ab00dee599..c821400eb1 100644 --- a/Userland/Shell/Parser.cpp +++ b/Userland/Shell/Parser.cpp @@ -27,6 +27,7 @@ #include "Parser.h" #include "Shell.h" #include +#include #include #include #include diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index 2273482d12..8459593fa8 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Shell/SyntaxHighlighter.cpp b/Userland/Shell/SyntaxHighlighter.cpp index c0f89613a4..eade317208 100644 --- a/Userland/Shell/SyntaxHighlighter.cpp +++ b/Userland/Shell/SyntaxHighlighter.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include diff --git a/Userland/Shell/main.cpp b/Userland/Shell/main.cpp index 581edd93c1..d5eb1bcbb0 100644 --- a/Userland/Shell/main.cpp +++ b/Userland/Shell/main.cpp @@ -24,16 +24,17 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "Execution.h" #include "Shell.h" #include #include #include #include +#include #include #include #include #include +#include RefPtr editor; Shell::Shell* s_shell; diff --git a/Userland/Tests/Kernel/kill-pidtid-confusion.cpp b/Userland/Tests/Kernel/kill-pidtid-confusion.cpp index 0357ccdd23..e0fe32d414 100644 --- a/Userland/Tests/Kernel/kill-pidtid-confusion.cpp +++ b/Userland/Tests/Kernel/kill-pidtid-confusion.cpp @@ -25,11 +25,11 @@ */ #include -#include +#include #include -#include #include #include +#include #include /* diff --git a/Userland/Tests/Kernel/setpgid-across-sessions-without-leader.cpp b/Userland/Tests/Kernel/setpgid-across-sessions-without-leader.cpp index d13b83a478..540b39d6d3 100644 --- a/Userland/Tests/Kernel/setpgid-across-sessions-without-leader.cpp +++ b/Userland/Tests/Kernel/setpgid-across-sessions-without-leader.cpp @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include #include diff --git a/Userland/Tests/LibGfx/font.cpp b/Userland/Tests/LibGfx/font.cpp index a52e6c85eb..b4dfd692b4 100644 --- a/Userland/Tests/LibGfx/font.cpp +++ b/Userland/Tests/LibGfx/font.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include static void test_fontdatabase_get_by_name() { diff --git a/Userland/Utilities/adjtime.cpp b/Userland/Utilities/adjtime.cpp index 810421bc98..5f764f37c6 100644 --- a/Userland/Utilities/adjtime.cpp +++ b/Userland/Utilities/adjtime.cpp @@ -27,6 +27,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/base64.cpp b/Userland/Utilities/base64.cpp index 030990c286..b973b3e7dc 100644 --- a/Userland/Utilities/base64.cpp +++ b/Userland/Utilities/base64.cpp @@ -26,12 +26,11 @@ #include #include -#include #include #include #include -#include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/basename.cpp b/Userland/Utilities/basename.cpp index 65862f1072..5152ff847e 100644 --- a/Userland/Utilities/basename.cpp +++ b/Userland/Utilities/basename.cpp @@ -27,6 +27,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/bt.cpp b/Userland/Utilities/bt.cpp index ea6f7fde7d..c2c5f1161a 100644 --- a/Userland/Utilities/bt.cpp +++ b/Userland/Utilities/bt.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include diff --git a/Userland/Utilities/copy.cpp b/Userland/Utilities/copy.cpp index 2295703825..2ddeed72df 100644 --- a/Userland/Utilities/copy.cpp +++ b/Userland/Utilities/copy.cpp @@ -31,8 +31,7 @@ #include #include #include -#include -#include +#include struct Options { String data; diff --git a/Userland/Utilities/crash.cpp b/Userland/Utilities/crash.cpp index 1aacf79aa3..cf815442d5 100644 --- a/Userland/Utilities/crash.cpp +++ b/Userland/Utilities/crash.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #pragma GCC optimize("O0") diff --git a/Userland/Utilities/date.cpp b/Userland/Utilities/date.cpp index 057112a4c3..2be2adc29f 100644 --- a/Userland/Utilities/date.cpp +++ b/Userland/Utilities/date.cpp @@ -24,13 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include #include -#include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/ddate.cpp b/Userland/Utilities/ddate.cpp index 763a5a3493..8018365a9b 100644 --- a/Userland/Utilities/ddate.cpp +++ b/Userland/Utilities/ddate.cpp @@ -27,6 +27,7 @@ #include #include #include +#include class DiscordianDate { public: diff --git a/Userland/Utilities/disasm.cpp b/Userland/Utilities/disasm.cpp index 5f65c484be..b1dac22129 100644 --- a/Userland/Utilities/disasm.cpp +++ b/Userland/Utilities/disasm.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include @@ -33,7 +32,6 @@ #include #include #include -#include #include int main(int argc, char** argv) diff --git a/Userland/Utilities/expr.cpp b/Userland/Utilities/expr.cpp index f96a67c8fa..42df5c5785 100644 --- a/Userland/Utilities/expr.cpp +++ b/Userland/Utilities/expr.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include diff --git a/Userland/Utilities/fortune.cpp b/Userland/Utilities/fortune.cpp index cbd1ee3315..e911b2a6ed 100644 --- a/Userland/Utilities/fortune.cpp +++ b/Userland/Utilities/fortune.cpp @@ -35,6 +35,7 @@ #include #include #include +#include class Quote { public: diff --git a/Userland/Utilities/functrace.cpp b/Userland/Utilities/functrace.cpp index 8cad0b6c8c..1bcbdcbbdb 100644 --- a/Userland/Utilities/functrace.cpp +++ b/Userland/Utilities/functrace.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/Userland/Utilities/gml-format.cpp b/Userland/Utilities/gml-format.cpp index 79ce530a32..cc72fffa7d 100644 --- a/Userland/Utilities/gml-format.cpp +++ b/Userland/Utilities/gml-format.cpp @@ -27,6 +27,7 @@ #include #include #include +#include bool format_file(const StringView&, bool); diff --git a/Userland/Utilities/gron.cpp b/Userland/Utilities/gron.cpp index 38359d515d..5f529b76cb 100644 --- a/Userland/Utilities/gron.cpp +++ b/Userland/Utilities/gron.cpp @@ -32,6 +32,7 @@ #include #include #include +#include static bool use_color = false; static void print(const String& name, const JsonValue&, Vector& trail); diff --git a/Userland/Utilities/gunzip.cpp b/Userland/Utilities/gunzip.cpp index 8898cbae15..4f98f67b8e 100644 --- a/Userland/Utilities/gunzip.cpp +++ b/Userland/Utilities/gunzip.cpp @@ -27,6 +27,7 @@ #include #include #include +#include static void decompress_file(Buffered& input_stream, Buffered& output_stream) { diff --git a/Userland/Utilities/head.cpp b/Userland/Utilities/head.cpp index 132df61ee6..8ee9d050f1 100644 --- a/Userland/Utilities/head.cpp +++ b/Userland/Utilities/head.cpp @@ -28,8 +28,8 @@ #include #include #include -#include #include +#include int head(const String& filename, bool print_filename, int line_count, int char_count); diff --git a/Userland/Utilities/hexdump.cpp b/Userland/Utilities/hexdump.cpp index a4c4b04cb8..4547ceaa30 100644 --- a/Userland/Utilities/hexdump.cpp +++ b/Userland/Utilities/hexdump.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include diff --git a/Userland/Utilities/html.cpp b/Userland/Utilities/html.cpp index b6e2524474..ec4da58e4e 100644 --- a/Userland/Utilities/html.cpp +++ b/Userland/Utilities/html.cpp @@ -35,6 +35,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/ini.cpp b/Userland/Utilities/ini.cpp index 5ac2c445a3..72d8f76f3a 100644 --- a/Userland/Utilities/ini.cpp +++ b/Userland/Utilities/ini.cpp @@ -28,6 +28,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index 2601ccf5c4..659c5b8c8b 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -58,6 +58,7 @@ #include #include #include +#include RefPtr vm; Vector repl_statements; diff --git a/Userland/Utilities/lsirq.cpp b/Userland/Utilities/lsirq.cpp index 82402cc1b8..48cf0a9ed3 100644 --- a/Userland/Utilities/lsirq.cpp +++ b/Userland/Utilities/lsirq.cpp @@ -27,9 +27,9 @@ #include #include #include -#include #include #include +#include int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) { diff --git a/Userland/Utilities/lspci.cpp b/Userland/Utilities/lspci.cpp index 1055935c2e..e54e01c2e5 100644 --- a/Userland/Utilities/lspci.cpp +++ b/Userland/Utilities/lspci.cpp @@ -32,6 +32,7 @@ #include #include #include +#include static bool flag_show_numerical = false; diff --git a/Userland/Utilities/misbehaving-application.cpp b/Userland/Utilities/misbehaving-application.cpp index cee1ccab1c..1517b95597 100644 --- a/Userland/Utilities/misbehaving-application.cpp +++ b/Userland/Utilities/misbehaving-application.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include int main(int, char**) { diff --git a/Userland/Utilities/mktemp.cpp b/Userland/Utilities/mktemp.cpp index c1b627ffca..3b6b962690 100644 --- a/Userland/Utilities/mktemp.cpp +++ b/Userland/Utilities/mktemp.cpp @@ -29,6 +29,7 @@ #include #include #include +#include constexpr const char* default_template = "tmp.XXXXXXXXXX"; diff --git a/Userland/Utilities/mv.cpp b/Userland/Utilities/mv.cpp index 2e7973f84f..41e3b5025d 100644 --- a/Userland/Utilities/mv.cpp +++ b/Userland/Utilities/mv.cpp @@ -30,6 +30,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/pmap.cpp b/Userland/Utilities/pmap.cpp index b752ecb3cb..53fd6016e8 100644 --- a/Userland/Utilities/pmap.cpp +++ b/Userland/Utilities/pmap.cpp @@ -31,6 +31,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/readelf.cpp b/Userland/Utilities/readelf.cpp index 08bd2e6607..c778a408a7 100644 --- a/Userland/Utilities/readelf.cpp +++ b/Userland/Utilities/readelf.cpp @@ -33,6 +33,7 @@ #include #include #include +#include static const char* object_file_type_to_string(Elf32_Half type) { diff --git a/Userland/Utilities/readlink.cpp b/Userland/Utilities/readlink.cpp index de65e6212a..7edb372a19 100644 --- a/Userland/Utilities/readlink.cpp +++ b/Userland/Utilities/readlink.cpp @@ -27,6 +27,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/shuf.cpp b/Userland/Utilities/shuf.cpp index 953323f5a0..9a80f1cb10 100644 --- a/Userland/Utilities/shuf.cpp +++ b/Userland/Utilities/shuf.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) { diff --git a/Userland/Utilities/sort.cpp b/Userland/Utilities/sort.cpp index 34b528f96b..06d0b4ead4 100644 --- a/Userland/Utilities/sort.cpp +++ b/Userland/Utilities/sort.cpp @@ -31,6 +31,7 @@ #include #include #include +#include int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) { diff --git a/Userland/Utilities/strace.cpp b/Userland/Utilities/strace.cpp index c43f987e51..36188ba098 100644 --- a/Userland/Utilities/strace.cpp +++ b/Userland/Utilities/strace.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include diff --git a/Userland/Utilities/syscall.cpp b/Userland/Utilities/syscall.cpp index f5275f75be..381cc534be 100644 --- a/Userland/Utilities/syscall.cpp +++ b/Userland/Utilities/syscall.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/Userland/Utilities/tar.cpp b/Userland/Utilities/tar.cpp index a3ce48d49e..3e74e09042 100644 --- a/Userland/Utilities/tar.cpp +++ b/Userland/Utilities/tar.cpp @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include @@ -33,6 +32,7 @@ #include #include #include +#include constexpr size_t buffer_size = 4096; diff --git a/Userland/Utilities/test-bindtodevice.cpp b/Userland/Utilities/test-bindtodevice.cpp index d96d1e6b29..d9c4f1c24c 100644 --- a/Userland/Utilities/test-bindtodevice.cpp +++ b/Userland/Utilities/test-bindtodevice.cpp @@ -29,9 +29,9 @@ #include #include #include -#include #include #include +#include static void test_invalid(int); static void test_no_route(int); diff --git a/Userland/Utilities/test-js.cpp b/Userland/Utilities/test-js.cpp index fa763a87e4..09ef8a639e 100644 --- a/Userland/Utilities/test-js.cpp +++ b/Userland/Utilities/test-js.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -44,6 +43,7 @@ #include #include #include +#include #define TOP_LEVEL_TEST_NAME "__$$TOP_LEVEL$$__" diff --git a/Userland/Utilities/test-pthread.cpp b/Userland/Utilities/test-pthread.cpp index ba56367410..6e2d492e33 100644 --- a/Userland/Utilities/test-pthread.cpp +++ b/Userland/Utilities/test-pthread.cpp @@ -28,6 +28,7 @@ #include #include #include +#include static void test_once() { diff --git a/Userland/Utilities/test_efault.cpp b/Userland/Utilities/test_efault.cpp index ba46c8f3f0..fe7507c080 100644 --- a/Userland/Utilities/test_efault.cpp +++ b/Userland/Utilities/test_efault.cpp @@ -88,9 +88,6 @@ int main(int, char**) EXPECT_EFAULT(read, (void*)kernel_address, 1); } - char buffer[4096]; - EXPECT_EFAULT_NO_FD(dbgputstr, buffer, 0xffffff00); - // Test the page just below where the kernel VM begins. u8* jerk_page = (u8*)mmap((void*)(0xc0000000 - PAGE_SIZE), PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0, 0); VERIFY(jerk_page == (void*)(0xc0000000 - PAGE_SIZE)); diff --git a/Userland/Utilities/test_io.cpp b/Userland/Utilities/test_io.cpp index 404d76f2b9..7384ffa7b8 100644 --- a/Userland/Utilities/test_io.cpp +++ b/Userland/Utilities/test_io.cpp @@ -25,7 +25,6 @@ */ #include -#include #include #include #include diff --git a/Userland/Utilities/tree.cpp b/Userland/Utilities/tree.cpp index 6fdb2bd9f0..7733914d64 100644 --- a/Userland/Utilities/tree.cpp +++ b/Userland/Utilities/tree.cpp @@ -25,15 +25,16 @@ */ #include -#include #include #include #include #include #include #include +#include #include #include +#include static bool flag_show_hidden_files = false; static bool flag_show_only_directories = false; diff --git a/Userland/Utilities/uniq.cpp b/Userland/Utilities/uniq.cpp index 7ace26d21c..118490938e 100644 --- a/Userland/Utilities/uniq.cpp +++ b/Userland/Utilities/uniq.cpp @@ -30,6 +30,7 @@ #include #include #include +#include struct linebuf { char* buf = NULL; diff --git a/Userland/Utilities/utmpupdate.cpp b/Userland/Utilities/utmpupdate.cpp index 17db0f568e..ff9b284c51 100644 --- a/Userland/Utilities/utmpupdate.cpp +++ b/Userland/Utilities/utmpupdate.cpp @@ -30,6 +30,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/wc.cpp b/Userland/Utilities/wc.cpp index cf9fa62d35..912820f995 100644 --- a/Userland/Utilities/wc.cpp +++ b/Userland/Utilities/wc.cpp @@ -31,6 +31,7 @@ #include #include #include +#include struct Count { String name; diff --git a/Userland/Utilities/which.cpp b/Userland/Utilities/which.cpp index e902fae2e7..545addab07 100644 --- a/Userland/Utilities/which.cpp +++ b/Userland/Utilities/which.cpp @@ -27,6 +27,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/Userland/Utilities/xargs.cpp b/Userland/Utilities/xargs.cpp index 8bb7efaaa8..d455e9b897 100644 --- a/Userland/Utilities/xargs.cpp +++ b/Userland/Utilities/xargs.cpp @@ -34,6 +34,7 @@ #include #include #include +#include bool run_command(Vector&& child_argv, bool verbose, bool is_stdin, int devnull_fd);