mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:37:45 +00:00
Kernel: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
This commit is contained in:
parent
68f75ab98e
commit
190cf1507b
79 changed files with 102 additions and 309 deletions
|
@ -36,9 +36,7 @@ UNMAP_AFTER_INIT AC97::AC97(PCI::DeviceIdentifier const& pci_device_identifier)
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT AC97::~AC97()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT AC97::~AC97() = default;
|
||||
|
||||
bool AC97::handle_irq(RegisterState const&)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ class AudioChannel final
|
|||
|
||||
public:
|
||||
static NonnullRefPtr<AudioChannel> must_create(AudioController const&, size_t channel_index);
|
||||
virtual ~AudioChannel() override { }
|
||||
virtual ~AudioChannel() override = default;
|
||||
|
||||
// ^CharacterDevice
|
||||
virtual bool can_read(const OpenFileDescription&, u64) const override;
|
||||
|
|
|
@ -24,9 +24,7 @@ void AsyncBlockDeviceRequest::start()
|
|||
m_block_device.start_request(*this);
|
||||
}
|
||||
|
||||
BlockDevice::~BlockDevice()
|
||||
{
|
||||
}
|
||||
BlockDevice::~BlockDevice() = default;
|
||||
|
||||
bool BlockDevice::read_block(u64 index, UserOrKernelBuffer& buffer)
|
||||
{
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
CharacterDevice::~CharacterDevice()
|
||||
{
|
||||
}
|
||||
CharacterDevice::~CharacterDevice() = default;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,9 +28,7 @@ UNMAP_AFTER_INIT ConsoleDevice::ConsoleDevice()
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT ConsoleDevice::~ConsoleDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT ConsoleDevice::~ConsoleDevice() = default;
|
||||
|
||||
bool ConsoleDevice::can_read(const Kernel::OpenFileDescription&, u64) const
|
||||
{
|
||||
|
|
|
@ -27,9 +27,7 @@ UNMAP_AFTER_INIT DeviceControlDevice::DeviceControlDevice()
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT DeviceControlDevice::~DeviceControlDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT DeviceControlDevice::~DeviceControlDevice() = default;
|
||||
|
||||
ErrorOr<size_t> DeviceControlDevice::read(OpenFileDescription&, u64, UserOrKernelBuffer& buffer, size_t size)
|
||||
{
|
||||
|
|
|
@ -25,9 +25,7 @@ UNMAP_AFTER_INIT FullDevice::FullDevice()
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT FullDevice::~FullDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT FullDevice::~FullDevice() = default;
|
||||
|
||||
bool FullDevice::can_read(const OpenFileDescription&, u64) const
|
||||
{
|
||||
|
|
|
@ -276,9 +276,7 @@ UNMAP_AFTER_INIT KeyboardDevice::KeyboardDevice()
|
|||
|
||||
// FIXME: UNMAP_AFTER_INIT is fine for now, but for hot-pluggable devices
|
||||
// like USB keyboards, we need to remove this
|
||||
UNMAP_AFTER_INIT KeyboardDevice::~KeyboardDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT KeyboardDevice::~KeyboardDevice() = default;
|
||||
|
||||
bool KeyboardDevice::can_read(const OpenFileDescription&, u64) const
|
||||
{
|
||||
|
|
|
@ -14,9 +14,7 @@ MouseDevice::MouseDevice()
|
|||
{
|
||||
}
|
||||
|
||||
MouseDevice::~MouseDevice()
|
||||
{
|
||||
}
|
||||
MouseDevice::~MouseDevice() = default;
|
||||
|
||||
bool MouseDevice::can_read(const OpenFileDescription&, u64) const
|
||||
{
|
||||
|
|
|
@ -116,8 +116,6 @@ UNMAP_AFTER_INIT PS2KeyboardDevice::PS2KeyboardDevice(const I8042Controller& ps2
|
|||
|
||||
// FIXME: UNMAP_AFTER_INIT might not be correct, because in practice PS/2 devices
|
||||
// are hot pluggable.
|
||||
UNMAP_AFTER_INIT PS2KeyboardDevice::~PS2KeyboardDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT PS2KeyboardDevice::~PS2KeyboardDevice() = default;
|
||||
|
||||
}
|
||||
|
|
|
@ -26,9 +26,7 @@ UNMAP_AFTER_INIT PS2MouseDevice::PS2MouseDevice(const I8042Controller& ps2_contr
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT PS2MouseDevice::~PS2MouseDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT PS2MouseDevice::~PS2MouseDevice() = default;
|
||||
|
||||
bool PS2MouseDevice::handle_irq(const RegisterState&)
|
||||
{
|
||||
|
|
|
@ -57,8 +57,6 @@ VMWareMouseDevice::VMWareMouseDevice(const I8042Controller& ps2_controller)
|
|||
: PS2MouseDevice(ps2_controller)
|
||||
{
|
||||
}
|
||||
VMWareMouseDevice::~VMWareMouseDevice()
|
||||
{
|
||||
}
|
||||
VMWareMouseDevice::~VMWareMouseDevice() = default;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,9 +28,7 @@ UNMAP_AFTER_INIT MemoryDevice::MemoryDevice()
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT MemoryDevice::~MemoryDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT MemoryDevice::~MemoryDevice() = default;
|
||||
|
||||
ErrorOr<size_t> MemoryDevice::read(OpenFileDescription&, u64 offset, UserOrKernelBuffer& buffer, size_t length)
|
||||
{
|
||||
|
|
|
@ -24,9 +24,7 @@ UNMAP_AFTER_INIT NullDevice::NullDevice()
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT NullDevice::~NullDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT NullDevice::~NullDevice() = default;
|
||||
|
||||
bool NullDevice::can_read(const OpenFileDescription&, u64) const
|
||||
{
|
||||
|
|
|
@ -24,9 +24,7 @@ UNMAP_AFTER_INIT RandomDevice::RandomDevice()
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT RandomDevice::~RandomDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT RandomDevice::~RandomDevice() = default;
|
||||
|
||||
bool RandomDevice::can_read(const OpenFileDescription&, u64) const
|
||||
{
|
||||
|
|
|
@ -52,9 +52,7 @@ UNMAP_AFTER_INIT SerialDevice::SerialDevice(IOAddress base_addr, unsigned minor)
|
|||
initialize();
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT SerialDevice::~SerialDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT SerialDevice::~SerialDevice() = default;
|
||||
|
||||
bool SerialDevice::can_read(const OpenFileDescription&, u64) const
|
||||
{
|
||||
|
|
|
@ -24,9 +24,7 @@ UNMAP_AFTER_INIT ZeroDevice::ZeroDevice()
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT ZeroDevice::~ZeroDevice()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT ZeroDevice::~ZeroDevice() = default;
|
||||
|
||||
bool ZeroDevice::can_read(const OpenFileDescription&, u64) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue