diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h index 65ba418f4ab293..ea498d9ce899cd 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 698b83972887e5..ee328d86dc6c35 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 c7b5400e30fe96..8da01d3b26ecba 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 dd4bf6dc7ffaeb..a12bca8e56ae05 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 3c5007ad6bdf6e..d0e5df44b3b091 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 068aa7046ecaf0..796c35f1643e0d 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 8f81130904fcd4..e64d8efb6b7a7e 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 7837050e42e32c..e69de29bb2d1d6 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 9d6a0900bf6e57..e69de29bb2d1d6 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 cd10ef3b0ca7bd..5a935746deafff 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 1b4e4c8ac29ecd..e2d43a6fa79c72 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 69499c54ee90bb..d289547500752e 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 0586645694f99d..9150561f2d7ea5 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 6da0b675926dbd..7a2741f565e2bd 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 e1a15f78ebb93a..4c063e54b0433c 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 eb5b4afff946fc..0c8bafd525f6b5 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 @@ class RefPtr { 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 30b550c33f4a20..3e2f2cd9a45173 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 6d68162e01fd26..ab3a5e39032491 100644 --- a/AK/URL.h +++ b/AK/URL.h @@ -105,11 +105,6 @@ class URL { 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 eb0143d567fea5..d28be5e425d4b4 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 332d97bf76ec4f..59bffa273acbcc 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 de1a7e12678dfa..51620086e04e1c 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 fff0b6fcab4451..8f198cb49babaf 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 24e6b08053f468..efb30c6a2344d5 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 51091c3012a4a0..1c9f6f51a0d595 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 2fffc01bd5b4ad..54765c44c48bc9 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 b869be54699beb..6244349b943092 100644 --- a/Kernel/FileSystem/InodeIdentifier.h +++ b/Kernel/FileSystem/InodeIdentifier.h @@ -72,12 +72,6 @@ class InodeIdentifier { 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 e21b224f19acdf..80e11625d1a5dd 100644 --- a/Kernel/IO.h +++ b/Kernel/IO.h @@ -27,7 +27,6 @@ #pragma once #include -#include #include #include #include @@ -157,11 +156,6 @@ class IOAddress { 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 5d1b4aa661423f..8d5a0aeed0e59f 100644 --- a/Kernel/KBuffer.h +++ b/Kernel/KBuffer.h @@ -38,7 +38,6 @@ #include #include -#include #include #include #include @@ -175,9 +174,4 @@ class [[nodiscard]] KBuffer { 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 fbfdbc741634de..2e61e76c965493 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 39f671a572b724..281a29b9bf973e 100644 --- a/Kernel/Net/IPv4.h +++ b/Kernel/Net/IPv4.h @@ -123,7 +123,6 @@ class [[gnu::packed]] IPv4Packet { }; 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 9fa64779bf95f4..23d3cf0da021f6 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 @@ struct Address { 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 f68cbffc534e57..9d2a2801587ce1 100644 --- a/Kernel/PhysicalAddress.h +++ b/Kernel/PhysicalAddress.h @@ -26,7 +26,7 @@ #pragma once -#include +#include #include class PhysicalAddress { @@ -61,11 +61,6 @@ class PhysicalAddress { 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 3b043d4b3e2391..c27bf874a2329f 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 22143c47aaf7e9..b1eb739a51888c 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 de432561389519..a1c28f5f37d338 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 19176e136c82e9..67c83ca7d98814 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 73ee9d2389e7b3..d5935ee7de6801 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 4917e8c7d819eb..132bc6f16cc462 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 c17207468d62cc..23d90cb7fa4e24 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 8f173e7350b468..4e19fc34731d13 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 067ba8edc035e8..c00ef111271ec3 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 8b03c00f42ded9..803905dc8c58b9 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 0440597caeac33..77a11934d2fabd 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 91ee969d231482..79aaab58a4d3e5 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 be1a23f7b31c40..8406927b7f43be 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 00029f8d22894b..e1a02b28743b9c 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 fe91440b87f812..fa2ec66e671e4b 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 f2dbcc2b3330af..a7a7a6de7da7ad 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 8a370160bd22f0..61d14248dd656c 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 02089b1d59dfb3..50d2d816ae1cc7 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 5c4a22b20a2bdf..f9217af2432048 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 2eb7c037051c44..910acf91cc9ba5 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 2cd00843faa300..94550899704e80 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 654eb44fd52577..ad719dcbf3f729 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 e7c88d38498ed6..c8efb948303451 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 706215a49cc935..3513da9d11fbcc 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 "RunWindow.h" #include -#include -#include #include -#include - -#include "RunWindow.h" +#include int main(int argc, char** argv) { diff --git a/Userland/Applications/Serendipity/main.cpp b/Userland/Applications/Serendipity/main.cpp index b176dd12f640bf..f25bd052cbef6b 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 9cd199e2a1af73..50d06bea1dec54 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 48bdbc5e977732..1ce8c0d3b6b78a 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 f3065316455335..805b84336509d7 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 f549c0564a86b8..0bf5c5c8a50e08 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 4daa17488ef0e1..2f503e1f4bfb7c 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 6e0fb1e8b58cae..30088c9607492b 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 3db722a882bc8c..5b120ae2603e4e 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 03986dea01eca9..c76b3e8bd44454 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 8d40798e308158..2122d40a1a09f7 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 9a60b911d17133..e7763b3e65e3c3 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 6cd3d20289336a..547c5104697ed4 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 889106f8d7d7af..bf6166a1547de8 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 352b864e7e13e7..63d3aa5a416956 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 04f74d526fd7e0..de6e74c31c8bb1 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 e15583ff8da303..c0ef18f00c18a1 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 73626ebbf88209..a0073c8ede26b6 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 e6f7871f5fa97c..dc63bd47b6db29 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 9ed37961e8c3fd..091e77a45373e6 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 0c753d0fdd03d8..2390d255baff7d 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 96face8914a156..9d4a01011aaee3 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 62a975d8f50735..3c4fb2fd417ecc 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 8fff65cd0f2cb4..f91d721b411eeb 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 43545dcd483dea..0f3685b434dcbc 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 f8f172a7c6f7d0..9cc18cab8a51fc 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 7cf03fde35628d..d82e42c29370be 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 c66f45d2b41c8b..1d56509e3b1681 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 560b7aeaec65f0..c12a9d296f0521 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 a0ccc72ba7af91..e709e319bfe608 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 7f01004eaafed6..540cfe558785e5 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 d266d3bfdb6575..f103cabfbbc171 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 3247194abc9c4c..2541234426a927 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 0af4776b45d8c6..34ebe0f2392adf 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 a3156c4c385441..e48de628c33c4d 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 073956c1896667..064c39d87dd9c6 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 95652464067b43..df6d8680efa100 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 d4c5401a24f76f..7524d33e8b159a 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 6115e6146a110b..5df71f1dc7b6b0 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 13f306d5aa8da3..7e517c970c0096 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 a4d47008188eeb..56e74dd5cb7459 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 cc76741d0b56a4..018c57fe474d72 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 f285ef5bb580fd..b53bb4846513d6 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 3bce22f647781c..bc886160554d72 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 54f7911ec388d7..23406300337076 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 efe012003382ff..1e999d6629aacf 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 d75a6457777546..ea5764bb01c96f 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 804abac3de1b5d..4e9a8ec3454a8c 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 15515cc0fda798..9101a9306ac740 100644 --- a/Userland/Libraries/LibCore/DateTime.h +++ b/Userland/Libraries/LibCore/DateTime.h @@ -69,6 +69,4 @@ class DateTime { 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 3dbeecf24ff6a8..83d4f32786d60b 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 70ed9928bc6abd..46db6686d69cc2 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 88bb27345a3ccd..98c3ab0ed34fc3 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 800f5573841495..854467a35669bf 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 d5dcefd01f1d1c..6295d1d75b0b0b 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 695fa361aa6df2..87f7d8b63e5aa0 100644 --- a/Userland/Libraries/LibCore/SocketAddress.h +++ b/Userland/Libraries/LibCore/SocketAddress.h @@ -110,8 +110,6 @@ class SocketAddress { 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 9fd8009c8be0b9..07ca9f0aa4145b 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 79fe6f468eb325..3d0cc970253265 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 fd68490b7714ab..c92aaec3997c3c 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 ffb7d6d70bc69e..8c41c596d57530 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 7bbffe7276458c..6b923d4958051e 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 753a27c47c146a..77ed86d634cd6f 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 becae66749d5c6..51c1d9f7767a9f 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 df6d17ec164a2c..a3a9b1150e797f 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 89fa43ac1773a5..a598fe8c56b876 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 682da8642bd3e7..b0190639111aa9 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 ed585e9dc2b118..a56d6386995dea 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 038974d1d4913b..bde5177596dece 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 4d6d49a92b6713..9a1ff1d6fda05a 100644 --- a/Userland/Libraries/LibGUI/ModelIndex.h +++ b/Userland/Libraries/LibGUI/ModelIndex.h @@ -76,8 +76,6 @@ class ModelIndex { 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 47ccc71e47e9a9..c744307d933d9d 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 @@ class TextPosition { 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 ea6918c0f49237..55e5378d521afd 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 @@ class TextRange { 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 29236b83f0c38b..0f4bca708e2369 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 41334eb1388bbf..3155009e91ffe9 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 @@ class AffineTransform { 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 20265dc43fcbd3..482e0bc0ad13b0 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 671c8caf5d9b01..befaa2ed7703ef 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 81ebf2ccfbba35..0baf79e308705e 100644 --- a/Userland/Libraries/LibGfx/Path.h +++ b/Userland/Libraries/LibGfx/Path.h @@ -212,9 +212,4 @@ class Path { 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 be6a71e14922b4..526cbf62790744 100644 --- a/Userland/Libraries/LibGfx/Point.h +++ b/Userland/Libraries/LibGfx/Point.h @@ -228,12 +228,6 @@ class Point { 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 082b1f78008c89..4cba04fff0e090 100644 --- a/Userland/Libraries/LibGfx/Rect.h +++ b/Userland/Libraries/LibGfx/Rect.h @@ -478,12 +478,6 @@ class Rect { 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 67321a4a2da683..fd45dd51fbdadb 100644 --- a/Userland/Libraries/LibGfx/Size.h +++ b/Userland/Libraries/LibGfx/Size.h @@ -150,12 +150,6 @@ class Size { 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 d326b59f1c1528..d45bea096b1844 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 7d8e69e80d803c..294a7f914d290b 100644 --- a/Userland/Libraries/LibGfx/Triangle.h +++ b/Userland/Libraries/LibGfx/Triangle.h @@ -76,6 +76,4 @@ class Triangle { 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 15ec22f05d01c0..aa92c3c73d43ea 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 162e01dbee79a0..015754c0b05b78 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 c7bd1194c5a3d7..8b0b155da31c7b 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 587996f662b0ed..6b61234b3039e8 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 03c6c92cdd77da..67c85a776771ef 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 30654dc607e828..ca4f60ada311d9 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 78ee24f5de4aed..322d741227df7c 100644 --- a/Userland/Libraries/LibWeb/CSS/Length.h +++ b/Userland/Libraries/LibWeb/CSS/Length.h @@ -173,9 +173,4 @@ class Length { 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 2ce6a6bd7135bb..10fe41f64a3af6 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 62752967451fdc..f6f596cd535db5 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 ac841ae21b2306..138d2bbc929e38 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 14d7b729a111cf..aac15d7f714050 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 722cee2b2db7c0..8def7ec95472c7 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 a4136c3df6c54c..188240bbfa0ce9 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 4d566ca8a9c2eb..855f825a694388 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 de4a4e8a497250..8ff46138e65162 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 e6ee5d2b256521..f86c0a114b0383 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 3adda4b83a80ad..ed7b7786472073 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 e86f204da810b6..1a9e46dee4ce4c 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 6e5898f27cb252..28957ac75a8081 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 e53c2151c1a407..02c873e2416370 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 1eada403649d8c..1c79d056e669c3 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 43f69340117903..2d7e0908d588f5 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 ab00dee599f37a..c821400eb1b672 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 2273482d12f35d..8459593fa8eb0b 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 c0f89613a4c1ee..eade3172088f85 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 581edd93c1465b..d5eb1bcbb0f6be 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 0357ccdd235820..e0fe32d414cb5d 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 d13b83a4787d13..540b39d6d3c9b5 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 a52e6c85eb47b4..b4dfd692b4d0c8 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 810421bc983ecb..5f764f37c67592 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 030990c286aa73..b973b3e7dcf66f 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 65862f1072fdab..5152ff847e77ea 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 ea6f7fde7dc47d..c2c5f1161a334a 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 22957038255803..2ddeed72df7325 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 1aacf79aa35307..cf815442d52fce 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 057112a4c35456..2be2adc29f05d1 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 763a5a349304b3..8018365a9b7f48 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 5f65c484bedb4e..b1dac221291be3 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 f96a67c8fa94c4..42df5c578513aa 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 cbd1ee33155695..e911b2a6edac0e 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 8cad0b6c8cf0bd..1bcbdcbbdb4475 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 79ce530a327d17..cc72fffa7dd242 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 38359d515dad5f..5f529b76cbd78c 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 8898cbae158428..4f98f67b8e9565 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 132df61ee6550d..8ee9d050f180bd 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 a4c4b04cb8e191..4547ceaa30f5cf 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 b6e25244748398..ec4da58e4e53cb 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 5ac2c445a3e697..72d8f76f3a1ac4 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 2601ccf5c4b9ed..659c5b8c8b1a84 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 82402cc1b81ee9..48cf0a9ed3ac3a 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 1055935c2e2ea6..e54e01c2e54595 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 cee1ccab1cfce6..1517b9559765df 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 c1b627ffca7e51..3b6b962690f619 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 2e7973f84fa657..41e3b5025d7d3b 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 b752ecb3cb4404..53fd6016e8a0a8 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 08bd2e66076f29..c778a408a74fb1 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 de65e6212a4e33..7edb372a19b861 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 953323f5a0a707..9a80f1cb1074d5 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 34b528f96b069e..06d0b4ead43a47 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 c43f987e519eae..36188ba098e789 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 f5275f75be05de..381cc534be567c 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 a3ce48d49ee818..3e74e0904262c8 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 d96d1e6b29ed4c..d9c4f1c24cc7ce 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 fa763a87e43ca9..09ef8a639e7f49 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 ba563674109485..6e2d492e332417 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 ba46c8f3f0ea46..fe7507c080f79b 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 404d76f2b96ab5..7384ffa7b8e83f 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 6fdb2bd9f002d6..7733914d640c67 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 7ace26d21cf4de..118490938ebc51 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 17db0f568eb6b8..ff9b284c51086a 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 cf9fa62d35929c..912820f995717c 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 e902fae2e75586..545addab07e004 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 8bb7efaaa85467..d455e9b897b302 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);