From 1badc40a4ae6df82109096af9b846d2290682e04 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 7 Dec 2022 11:40:02 +0100 Subject: [PATCH] Run include-what-you-use everywhere --- kernel/src/arch/Serial.cpp | 3 ++- kernel/src/arch/x86_64/CPU.cpp | 4 +++- kernel/src/arch/x86_64/CPU.h | 1 - kernel/src/arch/x86_64/MMU.cpp | 1 + kernel/src/boot/Init.cpp | 2 +- kernel/src/main.cpp | 1 + kernel/src/memory/MemoryMap.cpp | 2 ++ kernel/src/video/TextConsole.cpp | 2 ++ luna/src/Format.cpp | 3 +++ luna/src/Units.cpp | 3 ++- 10 files changed, 17 insertions(+), 5 deletions(-) diff --git a/kernel/src/arch/Serial.cpp b/kernel/src/arch/Serial.cpp index 2282d157..1f0d59ea 100644 --- a/kernel/src/arch/Serial.cpp +++ b/kernel/src/arch/Serial.cpp @@ -1,6 +1,7 @@ #include "arch/Serial.h" -#include "arch/CPU.h" +#include #include +#include namespace Serial { diff --git a/kernel/src/arch/x86_64/CPU.cpp b/kernel/src/arch/x86_64/CPU.cpp index fa1b86b8..e3ef18a2 100644 --- a/kernel/src/arch/x86_64/CPU.cpp +++ b/kernel/src/arch/x86_64/CPU.cpp @@ -1,12 +1,14 @@ +#include "arch/CPU.h" #include "arch/x86_64/CPU.h" #include "Log.h" -#include "arch/Serial.h" #include "arch/Timer.h" #include "arch/x86_64/IO.h" #include #include #include #include +#include +#include extern "C" void enable_sse(); extern "C" void enable_write_protect(); diff --git a/kernel/src/arch/x86_64/CPU.h b/kernel/src/arch/x86_64/CPU.h index a4e8d52f..9e81fd41 100644 --- a/kernel/src/arch/x86_64/CPU.h +++ b/kernel/src/arch/x86_64/CPU.h @@ -1,4 +1,3 @@ -#include "arch/CPU.h" #include struct Registers // Saved CPU registers for x86-64 diff --git a/kernel/src/arch/x86_64/MMU.cpp b/kernel/src/arch/x86_64/MMU.cpp index d4088c1f..7d76da52 100644 --- a/kernel/src/arch/x86_64/MMU.cpp +++ b/kernel/src/arch/x86_64/MMU.cpp @@ -2,6 +2,7 @@ #include "memory/MemoryManager.h" #include #include +#include #pragma GCC push_options #pragma GCC diagnostic ignored "-Wconversion" diff --git a/kernel/src/boot/Init.cpp b/kernel/src/boot/Init.cpp index 11537b84..870d385e 100644 --- a/kernel/src/boot/Init.cpp +++ b/kernel/src/boot/Init.cpp @@ -1,11 +1,11 @@ #include "boot/Init.h" #include "Log.h" #include "arch/CPU.h" -#include "arch/Serial.h" #include "boot/bootboot.h" #include "memory/MemoryManager.h" #include "video/Framebuffer.h" #include +#include extern const BOOTBOOT bootboot; diff --git a/kernel/src/main.cpp b/kernel/src/main.cpp index dd05b26f..6bc1c5b6 100644 --- a/kernel/src/main.cpp +++ b/kernel/src/main.cpp @@ -5,6 +5,7 @@ #include "config.h" #include "memory/MemoryManager.h" #include +#include Result init() { diff --git a/kernel/src/memory/MemoryMap.cpp b/kernel/src/memory/MemoryMap.cpp index 4aa24521..f4917633 100644 --- a/kernel/src/memory/MemoryMap.cpp +++ b/kernel/src/memory/MemoryMap.cpp @@ -1,4 +1,6 @@ #include "memory/MemoryMap.h" +#include +#include extern const BOOTBOOT bootboot; diff --git a/kernel/src/video/TextConsole.cpp b/kernel/src/video/TextConsole.cpp index b49588bf..80565daf 100644 --- a/kernel/src/video/TextConsole.cpp +++ b/kernel/src/video/TextConsole.cpp @@ -3,6 +3,8 @@ #include "video/Framebuffer.h" #include #include +#include +#include extern const BOOTBOOT bootboot; diff --git a/luna/src/Format.cpp b/luna/src/Format.cpp index 0080475c..6547a7d0 100644 --- a/luna/src/Format.cpp +++ b/luna/src/Format.cpp @@ -1,6 +1,9 @@ #include #include #include +#include +#include +#include extern "C" usize strlen(const char*); diff --git a/luna/src/Units.cpp b/luna/src/Units.cpp index fa2a0e1b..d0362a75 100644 --- a/luna/src/Units.cpp +++ b/luna/src/Units.cpp @@ -1,7 +1,8 @@ #include #include +#include -Result to_dynamic_unit(usize value, char* buffer, size_t max) +Result to_dynamic_unit(usize value, char* buffer, usize max) { if (value < 1024) { return string_format(buffer, max, "%u bytes", value); }