mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-16 17:00:35 +03:00
Everywhere: Remove unused includes of LibC/stdlib.h
These instances were detected by searching for files that include stdlib.h, but don't match the regex: \\b(_abort|abort|abs|aligned_alloc|arc4random|arc4random_buf|arc4random_ uniform|atexit|atof|atoi|atol|atoll|bsearch|calloc|clearenv|div|div_t|ex it|_Exit|EXIT_FAILURE|EXIT_SUCCESS|free|getenv|getprogname|grantpt|labs| ldiv|ldiv_t|llabs|lldiv|lldiv_t|malloc|malloc_good_size|malloc_size|mble n|mbstowcs|mbtowc|mkdtemp|mkstemp|mkstemps|mktemp|posix_memalign|posix_o penpt|ptsname|ptsname_r|putenv|qsort|qsort_r|rand|RAND_MAX|random|reallo c|realpath|secure_getenv|serenity_dump_malloc_stats|serenity_setenv|sete nv|setprogname|srand|srandom|strtod|strtof|strtol|strtold|strtoll|strtou l|strtoull|system|unlockpt|unsetenv|wcstombs|wctomb)\\b (Without the linebreaks.) This regex is pessimistic, so there might be more files that don't actually use anything from the stdlib. In theory, one might use LibCPP to detect things like this automatically, but let's do this one step after another.
This commit is contained in:
parent
f07847e099
commit
6b7ce19161
Notes:
sideshowbarker
2024-07-17 02:16:24 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/6b7ce19161 Pull-request: https://github.com/SerenityOS/serenity/pull/16783 Reviewed-by: https://github.com/bgianfo ✅
@ -12,7 +12,6 @@
|
||||
#if defined(KERNEL)
|
||||
# include <Kernel/StdLib.h>
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int, char**)
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <utime.h>
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef long double longdouble;
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <LibGfx/PPMLoader.h>
|
||||
#include <LibTest/TestCase.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
TEST_CASE(test_bmp)
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
static void write8(void* ptr) { *(uint8_t volatile*)ptr = 1; }
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibGfx/StylePainter.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
REGISTER_WIDGET(SystemMonitor, MemoryStatsWidget)
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <LibGfx/Vector3.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int const WIDTH = 200;
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "RemoteObject.h"
|
||||
#include "RemoteObjectGraphModel.h"
|
||||
#include "RemoteObjectPropertyModel.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Inspector {
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <AK/Types.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/internals.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <AK/ScopeGuard.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <errno_codes.h>
|
||||
#include <grp.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(AK_COMPILER_CLANG)
|
||||
# pragma clang diagnostic push
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <errno.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <errno.h>
|
||||
#include <shadow.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/times.h>
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <LibCore/GetPassword.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <AK/MemoryStream.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace DNS {
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <LaunchServer/LaunchServerEndpoint.h>
|
||||
#include <LibDesktop/Launcher.h>
|
||||
#include <LibIPC/ConnectionToServer.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Desktop {
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <LibGUI/Toolbar.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Font/Emoji.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <LibIPC/Decoder.h>
|
||||
#include <LibIPC/Encoder.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <LibGfx/Font/OpenType/Font.h>
|
||||
#include <LibGfx/Font/Typeface.h>
|
||||
#include <LibGfx/Font/WOFF/Font.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibGfx/Point.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <LibJS/Runtime/Temporal/PlainTime.h>
|
||||
#include <LibJS/Runtime/Temporal/TimeZone.h>
|
||||
#include <LibJS/Runtime/Temporal/ZonedDateTime.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace JS::Temporal {
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Line {
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <AK/Forward.h>
|
||||
#include <LibLine/StringMetrics.h>
|
||||
#include <LibLine/SuggestionManager.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Line {
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <AK/Utf32View.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <LibLine/Style.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Line {
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <LibWeb/Layout/BlockContainer.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
#include <LibWeb/Layout/Progress.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
namespace AudioServer {
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <AK/Format.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <LibCore/System.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <LibCore/Stream.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <netinet/in.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
|
Loading…
Reference in New Issue
Block a user