From 5f7f063919cfdbe0fd6fd47bf5657b1394b2250e Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 5 Jul 2021 18:08:48 +0200 Subject: [PATCH] Everywhere: Mark debug-only functions `[[maybe_unused]]` These functions are only used from within `dbgln_if` calls, so in certain build configurations, they go unused. Similarly to variables, we now signal to the compiler that we understand that these are not always in use. --- Kernel/Graphics/Console/TextModeConsole.cpp | 2 +- Kernel/Graphics/IntelNativeGraphicsAdapter.cpp | 2 +- Kernel/Time/PIT.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel/Graphics/Console/TextModeConsole.cpp b/Kernel/Graphics/Console/TextModeConsole.cpp index 568d6f6018..9c40da3e0b 100644 --- a/Kernel/Graphics/Console/TextModeConsole.cpp +++ b/Kernel/Graphics/Console/TextModeConsole.cpp @@ -45,7 +45,7 @@ enum VGAColor : u8 { White, }; -static inline VGAColor convert_standard_color_to_vga_color(Console::Color color) +[[maybe_unused]] static inline VGAColor convert_standard_color_to_vga_color(Console::Color color) { switch (color) { case Console::Color::Black: diff --git a/Kernel/Graphics/IntelNativeGraphicsAdapter.cpp b/Kernel/Graphics/IntelNativeGraphicsAdapter.cpp index af6b932865..cf418279da 100644 --- a/Kernel/Graphics/IntelNativeGraphicsAdapter.cpp +++ b/Kernel/Graphics/IntelNativeGraphicsAdapter.cpp @@ -217,7 +217,7 @@ void IntelNativeGraphicsAdapter::enable_vga_plane() VERIFY(m_modeset_lock.is_locked()); } -static inline const char* convert_register_index_to_string(IntelGraphics::RegisterIndex index) +[[maybe_unused]] static inline const char* convert_register_index_to_string(IntelGraphics::RegisterIndex index) { switch (index) { case IntelGraphics::RegisterIndex::PipeAConf: diff --git a/Kernel/Time/PIT.cpp b/Kernel/Time/PIT.cpp index 68ec1fde87..581c9a6afb 100644 --- a/Kernel/Time/PIT.cpp +++ b/Kernel/Time/PIT.cpp @@ -22,7 +22,7 @@ UNMAP_AFTER_INIT NonnullRefPtr PIT::initialize(Function