瀏覽代碼

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.
Daniel Bertalan 4 年之前
父節點
當前提交
5f7f063919

+ 1 - 1
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:

+ 1 - 1
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:

+ 1 - 1
Kernel/Time/PIT.cpp

@@ -22,7 +22,7 @@ UNMAP_AFTER_INIT NonnullRefPtr<PIT> PIT::initialize(Function<void(const Register
     return adopt_ref(*new PIT(move(callback)));
 }
 
-inline static void reset_countdown(u16 timer_reload)
+[[maybe_unused]] inline static void reset_countdown(u16 timer_reload)
 {
     IO::out8(PIT_CTL, TIMER0_SELECT | WRITE_WORD | MODE_COUNTDOWN);
     IO::out8(TIMER0_CTL, LSB(timer_reload));

+ 1 - 1
Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp

@@ -17,7 +17,7 @@
 
 namespace Web::SVG {
 
-static void print_instruction(const PathInstruction& instruction)
+[[maybe_unused]] static void print_instruction(const PathInstruction& instruction)
 {
     VERIFY(PATH_DEBUG);