luna: Add a new idiomatic way to mark unused parameters as used while keeping their names

Just call ignore(...)
This commit is contained in:
apio 2023-01-25 21:14:44 +01:00
parent 39042cbbd4
commit 635437a4a4
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,7 @@
#include "arch/PCI.h"
#include "arch/x86_64/IO.h"
#include <luna/Check.h>
#include <luna/Ignore.h>
#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();
}
}

View File

@ -0,0 +1,5 @@
#pragma once
template <class... Args> constexpr void ignore(Args...)
{
}