Skip to content

Commit

Permalink
Everywhere: Remove unused includes of AK/StdLibExtras.h
Browse files Browse the repository at this point in the history
These instances were detected by searching for files that include
AK/StdLibExtras.h, but don't match the regex:

\\b(abs|AK_REPLACED_STD_NAMESPACE|array_size|ceil_div|clamp|exchange|for
ward|is_constant_evaluated|is_power_of_two|max|min|mix|move|_RawPtr|RawP
tr|round_up_to_power_of_two|swap|to_underlying)\\b

(Without the linebreaks.)

This regex is pessimistic, so there might be more files that don't
actually use any "extra stdlib" functions.

In theory, one might use LibCPP to detect things like this
automatically, but let's do this one step after another.
  • Loading branch information
BenWiederhake authored and trflynn89 committed Jan 3, 2023
1 parent 0bde4e6 commit c2a900b
Show file tree
Hide file tree
Showing 25 changed files with 1 addition and 25 deletions.
1 change: 0 additions & 1 deletion AK/AtomicRefCounted.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <AK/Checked.h>
#include <AK/Noncopyable.h>
#include <AK/Platform.h>
#include <AK/StdLibExtras.h>

namespace AK {

Expand Down
1 change: 0 additions & 1 deletion AK/CheckedFormatString.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <AK/AllOf.h>
#include <AK/AnyOf.h>
#include <AK/Array.h>
#include <AK/StdLibExtras.h>
#include <AK/StringView.h>

#ifdef ENABLE_COMPILETIME_FORMAT_CHECK
Expand Down
2 changes: 1 addition & 1 deletion AK/EnumBits.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#pragma once

#include <AK/StdLibExtras.h>
#include <AK/StdLibExtraDetails.h>

// Enables bitwise operators for the specified Enum type.
//
Expand Down
1 change: 0 additions & 1 deletion AK/RefCounted.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <AK/Checked.h>
#include <AK/Noncopyable.h>
#include <AK/Platform.h>
#include <AK/StdLibExtras.h>

namespace AK {

Expand Down
1 change: 0 additions & 1 deletion AK/StringBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <AK/ByteBuffer.h>
#include <AK/Checked.h>
#include <AK/PrintfImplementation.h>
#include <AK/StdLibExtras.h>
#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <AK/StringView.h>
Expand Down
1 change: 0 additions & 1 deletion AK/StringImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <AK/FlyString.h>
#include <AK/HashTable.h>
#include <AK/Memory.h>
#include <AK/StdLibExtras.h>
#include <AK/StringHash.h>
#include <AK/StringImpl.h>
#include <AK/kmalloc.h>
Expand Down
1 change: 0 additions & 1 deletion AK/TypeCasts.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <AK/Assertions.h>
#include <AK/Forward.h>
#include <AK/Platform.h>
#include <AK/StdLibExtras.h>

namespace AK {

Expand Down
1 change: 0 additions & 1 deletion AK/Userspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#pragma once

#include <AK/Assertions.h>
#include <AK/StdLibExtras.h>
#include <AK/Types.h>

#ifdef KERNEL
Expand Down
1 change: 0 additions & 1 deletion Kernel/Arch/x86_64/DescriptorTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#pragma once

#include <AK/StdLibExtras.h>
#include <AK/Types.h>
#include <Kernel/VirtualAddress.h>

Expand Down
1 change: 0 additions & 1 deletion Kernel/Devices/MemoryDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#include <AK/Memory.h>
#include <AK/StdLibExtras.h>
#include <Kernel/Devices/DeviceManagement.h>
#include <Kernel/Devices/MemoryDevice.h>
#include <Kernel/Memory/AnonymousVMObject.h>
Expand Down
1 change: 0 additions & 1 deletion Kernel/Net/TCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#pragma once

#include <AK/StdLibExtras.h>
#include <Kernel/Net/IPv4.h>

namespace Kernel {
Expand Down
1 change: 0 additions & 1 deletion Tests/AK/TestSpan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <AK/Checked.h>
#include <AK/Span.h>
#include <AK/StdLibExtras.h>
#include <string.h>

TEST_CASE(constexpr_default_constructor_is_empty)
Expand Down
1 change: 0 additions & 1 deletion Tests/AK/TestTypeTraits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <LibTest/TestCase.h>

#include <AK/StdLibExtras.h>
#include <AK/TypeList.h>

#define STATIC_EXPECT_EQ(lhs, rhs) \
Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibC/pthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <AK/Debug.h>
#include <AK/Format.h>
#include <AK/SinglyLinkedList.h>
#include <AK/StdLibExtras.h>
#include <Kernel/API/Syscall.h>
#include <LibSystem/syscall.h>
#include <bits/pthread_cancel.h>
Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibC/scanf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <AK/Assertions.h>
#include <AK/Format.h>
#include <AK/GenericLexer.h>
#include <AK/StdLibExtras.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibCrypto/Cipher/Mode/Mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <AK/ByteBuffer.h>
#include <AK/Span.h>
#include <AK/StdLibExtras.h>
#include <LibCrypto/Cipher/Cipher.h>

namespace Crypto {
Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibGfx/Filters/SepiaFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#pragma once

#include <AK/StdLibExtras.h>
#include <AK/StringView.h>
#include <LibGfx/Filters/ColorFilter.h>
#include <math.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#pragma once

#include "GenericConvolutionFilter.h"
#include <AK/StdLibExtras.h>
#include <AK/StringView.h>

namespace Gfx {
Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibGfx/Line.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <AK/DeprecatedString.h>
#include <AK/Format.h>
#include <AK/Optional.h>
#include <AK/StdLibExtras.h>
#include <LibGfx/Forward.h>
#include <LibGfx/Point.h>
#include <LibGfx/Rect.h>
Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibGfx/Rect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#include <AK/DeprecatedString.h>
#include <AK/StdLibExtras.h>
#include <AK/Vector.h>
#include <LibGfx/Line.h>
#include <LibGfx/Rect.h>
Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibPDF/Forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#pragma once

#include <AK/Forward.h>
#include <AK/StdLibExtras.h>

namespace PDF {

Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#pragma once

#include <AK/Optional.h>
#include <AK/StdLibExtras.h>
#include <LibJS/Runtime/VM.h>
#include <LibWeb/WebIDL/ExceptionOr.h>

Expand Down
1 change: 0 additions & 1 deletion Userland/Libraries/LibWeb/HighResolutionTime/Performance.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#pragma once

#include <AK/StdLibExtras.h>
#include <LibCore/ElapsedTimer.h>
#include <LibWeb/DOM/EventTarget.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#pragma once

#include <AK/StdLibExtras.h>
#include <LibWeb/HTML/Window.h>

namespace Web::NavigationTiming {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#pragma once

#include <AK/StdLibExtras.h>
#include <LibWeb/Bindings/PlatformObject.h>

namespace Web::RequestIdleCallback {
Expand Down

0 comments on commit c2a900b

Please sign in to comment.