From 635437a4a4ca1bfc1aca4f4b916e4826fa614012 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 25 Jan 2023 21:14:44 +0100 Subject: [PATCH] luna: Add a new idiomatic way to mark unused parameters as used while keeping their names Just call ignore(...) --- kernel/src/arch/x86_64/PCI.cpp | 10 +++++++--- luna/include/luna/Ignore.h | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 luna/include/luna/Ignore.h diff --git a/kernel/src/arch/x86_64/PCI.cpp b/kernel/src/arch/x86_64/PCI.cpp index c8458297..0ce6d920 100644 --- a/kernel/src/arch/x86_64/PCI.cpp +++ b/kernel/src/arch/x86_64/PCI.cpp @@ -1,6 +1,7 @@ #include "arch/PCI.h" #include "arch/x86_64/IO.h" #include +#include #define PCI_ADDRESS_PORT 0xCF8 #define PCI_VALUE_PORT 0xCFC @@ -30,18 +31,21 @@ namespace PCI return IO::inl(PCI_VALUE_PORT); } - void write8(const Device::Address&, u32, u8) + void write8(const Device::Address& address, u32 field, u8 value) { + ignore(address, field, value); todo(); } - void write16(const Device::Address&, u32, u16) + void write16(const Device::Address& address, u32 field, u8 value) { + ignore(address, field, value); todo(); } - void write32(const Device::Address&, u32, u32) + void write32(const Device::Address& address, u32 field, u8 value) { + ignore(address, field, value); todo(); } } diff --git a/luna/include/luna/Ignore.h b/luna/include/luna/Ignore.h new file mode 100644 index 00000000..2a314f1c --- /dev/null +++ b/luna/include/luna/Ignore.h @@ -0,0 +1,5 @@ +#pragma once + +template constexpr void ignore(Args...) +{ +}