luna: Add a new idiomatic way to mark unused parameters as used while keeping their names
Just call ignore(...)
This commit is contained in:
parent
39042cbbd4
commit
635437a4a4
@ -1,6 +1,7 @@
|
|||||||
#include "arch/PCI.h"
|
#include "arch/PCI.h"
|
||||||
#include "arch/x86_64/IO.h"
|
#include "arch/x86_64/IO.h"
|
||||||
#include <luna/Check.h>
|
#include <luna/Check.h>
|
||||||
|
#include <luna/Ignore.h>
|
||||||
|
|
||||||
#define PCI_ADDRESS_PORT 0xCF8
|
#define PCI_ADDRESS_PORT 0xCF8
|
||||||
#define PCI_VALUE_PORT 0xCFC
|
#define PCI_VALUE_PORT 0xCFC
|
||||||
@ -30,18 +31,21 @@ namespace PCI
|
|||||||
return IO::inl(PCI_VALUE_PORT);
|
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();
|
todo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void write16(const Device::Address&, u32, u16)
|
void write16(const Device::Address& address, u32 field, u8 value)
|
||||||
{
|
{
|
||||||
|
ignore(address, field, value);
|
||||||
todo();
|
todo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void write32(const Device::Address&, u32, u32)
|
void write32(const Device::Address& address, u32 field, u8 value)
|
||||||
{
|
{
|
||||||
|
ignore(address, field, value);
|
||||||
todo();
|
todo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
5
luna/include/luna/Ignore.h
Normal file
5
luna/include/luna/Ignore.h
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
template <class... Args> constexpr void ignore(Args...)
|
||||||
|
{
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user