mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +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
|
@ -15,9 +15,7 @@ AnonymousFile::AnonymousFile(NonnullRefPtr<Memory::AnonymousVMObject> vmobject)
|
|||
{
|
||||
}
|
||||
|
||||
AnonymousFile::~AnonymousFile()
|
||||
{
|
||||
}
|
||||
AnonymousFile::~AnonymousFile() = default;
|
||||
|
||||
ErrorOr<Memory::Region*> AnonymousFile::mmap(Process& process, OpenFileDescription&, Memory::VirtualRange const& range, u64 offset, int prot, bool shared)
|
||||
{
|
||||
|
|
|
@ -114,9 +114,7 @@ BlockBasedFileSystem::BlockBasedFileSystem(OpenFileDescription& file_description
|
|||
VERIFY(file_description.file().is_seekable());
|
||||
}
|
||||
|
||||
BlockBasedFileSystem::~BlockBasedFileSystem()
|
||||
{
|
||||
}
|
||||
BlockBasedFileSystem::~BlockBasedFileSystem() = default;
|
||||
|
||||
ErrorOr<void> BlockBasedFileSystem::initialize()
|
||||
{
|
||||
|
|
|
@ -47,9 +47,7 @@ Custody::Custody(Custody* parent, NonnullOwnPtr<KString> name, Inode& inode, int
|
|||
{
|
||||
}
|
||||
|
||||
Custody::~Custody()
|
||||
{
|
||||
}
|
||||
Custody::~Custody() = default;
|
||||
|
||||
ErrorOr<NonnullOwnPtr<KString>> Custody::try_serialize_absolute_path() const
|
||||
{
|
||||
|
|
|
@ -17,13 +17,8 @@ ErrorOr<NonnullRefPtr<DevPtsFS>> DevPtsFS::try_create()
|
|||
return adopt_nonnull_ref_or_enomem(new (nothrow) DevPtsFS);
|
||||
}
|
||||
|
||||
DevPtsFS::DevPtsFS()
|
||||
{
|
||||
}
|
||||
|
||||
DevPtsFS::~DevPtsFS()
|
||||
{
|
||||
}
|
||||
DevPtsFS::DevPtsFS() = default;
|
||||
DevPtsFS::~DevPtsFS() = default;
|
||||
|
||||
ErrorOr<void> DevPtsFS::initialize()
|
||||
{
|
||||
|
@ -81,9 +76,7 @@ DevPtsFSInode::DevPtsFSInode(DevPtsFS& fs, InodeIndex index, SlavePTY* pty)
|
|||
m_pty = *pty;
|
||||
}
|
||||
|
||||
DevPtsFSInode::~DevPtsFSInode()
|
||||
{
|
||||
}
|
||||
DevPtsFSInode::~DevPtsFSInode() = default;
|
||||
|
||||
ErrorOr<size_t> DevPtsFSInode::read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const
|
||||
{
|
||||
|
|
|
@ -16,9 +16,7 @@ ErrorOr<NonnullRefPtr<DevTmpFS>> DevTmpFS::try_create()
|
|||
return adopt_nonnull_ref_or_enomem(new (nothrow) DevTmpFS);
|
||||
}
|
||||
|
||||
DevTmpFS::DevTmpFS()
|
||||
{
|
||||
}
|
||||
DevTmpFS::DevTmpFS() = default;
|
||||
|
||||
size_t DevTmpFS::allocate_inode_index()
|
||||
{
|
||||
|
@ -28,9 +26,7 @@ size_t DevTmpFS::allocate_inode_index()
|
|||
return 1 + m_next_inode_index.value();
|
||||
}
|
||||
|
||||
DevTmpFS::~DevTmpFS()
|
||||
{
|
||||
}
|
||||
DevTmpFS::~DevTmpFS() = default;
|
||||
|
||||
ErrorOr<void> DevTmpFS::initialize()
|
||||
{
|
||||
|
@ -167,9 +163,7 @@ StringView DevTmpFSLinkInode::name() const
|
|||
return m_name->view();
|
||||
}
|
||||
|
||||
DevTmpFSLinkInode::~DevTmpFSLinkInode()
|
||||
{
|
||||
}
|
||||
DevTmpFSLinkInode::~DevTmpFSLinkInode() = default;
|
||||
|
||||
DevTmpFSLinkInode::DevTmpFSLinkInode(DevTmpFS& fs, NonnullOwnPtr<KString> name)
|
||||
: DevTmpFSInode(fs)
|
||||
|
@ -206,9 +200,7 @@ DevTmpFSDirectoryInode::DevTmpFSDirectoryInode(DevTmpFS& fs, NonnullOwnPtr<KStri
|
|||
, m_name(move(name))
|
||||
{
|
||||
}
|
||||
DevTmpFSDirectoryInode::~DevTmpFSDirectoryInode()
|
||||
{
|
||||
}
|
||||
DevTmpFSDirectoryInode::~DevTmpFSDirectoryInode() = default;
|
||||
|
||||
ErrorOr<void> DevTmpFSDirectoryInode::traverse_as_directory(Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback) const
|
||||
{
|
||||
|
@ -286,9 +278,7 @@ DevTmpFSRootDirectoryInode::DevTmpFSRootDirectoryInode(DevTmpFS& fs)
|
|||
{
|
||||
m_mode = 0555;
|
||||
}
|
||||
DevTmpFSRootDirectoryInode::~DevTmpFSRootDirectoryInode()
|
||||
{
|
||||
}
|
||||
DevTmpFSRootDirectoryInode::~DevTmpFSRootDirectoryInode() = default;
|
||||
ErrorOr<void> DevTmpFSRootDirectoryInode::chmod(mode_t)
|
||||
{
|
||||
return EPERM;
|
||||
|
@ -306,9 +296,7 @@ DevTmpFSDeviceInode::DevTmpFSDeviceInode(DevTmpFS& fs, MajorNumber major_number,
|
|||
{
|
||||
}
|
||||
|
||||
DevTmpFSDeviceInode::~DevTmpFSDeviceInode()
|
||||
{
|
||||
}
|
||||
DevTmpFSDeviceInode::~DevTmpFSDeviceInode() = default;
|
||||
|
||||
StringView DevTmpFSDeviceInode::name() const
|
||||
{
|
||||
|
|
|
@ -59,9 +59,7 @@ Ext2FS::Ext2FS(OpenFileDescription& file_description)
|
|||
{
|
||||
}
|
||||
|
||||
Ext2FS::~Ext2FS()
|
||||
{
|
||||
}
|
||||
Ext2FS::~Ext2FS() = default;
|
||||
|
||||
ErrorOr<void> Ext2FS::flush_super_block()
|
||||
{
|
||||
|
|
|
@ -71,9 +71,7 @@ FIFO::FIFO(UserID uid, NonnullOwnPtr<DoubleBuffer> buffer)
|
|||
});
|
||||
}
|
||||
|
||||
FIFO::~FIFO()
|
||||
{
|
||||
}
|
||||
FIFO::~FIFO() = default;
|
||||
|
||||
void FIFO::attach(Direction direction)
|
||||
{
|
||||
|
|
|
@ -12,13 +12,8 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
File::File()
|
||||
{
|
||||
}
|
||||
|
||||
File::~File()
|
||||
{
|
||||
}
|
||||
File::File() = default;
|
||||
File::~File() = default;
|
||||
|
||||
ErrorOr<NonnullRefPtr<OpenFileDescription>> File::open(int options)
|
||||
{
|
||||
|
|
|
@ -13,8 +13,6 @@ FileBackedFileSystem::FileBackedFileSystem(OpenFileDescription& file_description
|
|||
{
|
||||
}
|
||||
|
||||
FileBackedFileSystem::~FileBackedFileSystem()
|
||||
{
|
||||
}
|
||||
FileBackedFileSystem::~FileBackedFileSystem() = default;
|
||||
|
||||
}
|
||||
|
|
|
@ -180,9 +180,7 @@ ISO9660FS::ISO9660FS(OpenFileDescription& description)
|
|||
m_logical_block_size = logical_sector_size;
|
||||
}
|
||||
|
||||
ISO9660FS::~ISO9660FS()
|
||||
{
|
||||
}
|
||||
ISO9660FS::~ISO9660FS() = default;
|
||||
|
||||
ErrorOr<void> ISO9660FS::initialize()
|
||||
{
|
||||
|
@ -553,9 +551,7 @@ ISO9660Inode::ISO9660Inode(ISO9660FS& fs, ISO::DirectoryRecordHeader const& reco
|
|||
create_metadata();
|
||||
}
|
||||
|
||||
ISO9660Inode::~ISO9660Inode()
|
||||
{
|
||||
}
|
||||
ISO9660Inode::~ISO9660Inode() = default;
|
||||
|
||||
ErrorOr<NonnullRefPtr<ISO9660Inode>> ISO9660Inode::try_create_from_directory_record(ISO9660FS& fs, ISO::DirectoryRecordHeader const& record, StringView name)
|
||||
{
|
||||
|
|
|
@ -22,9 +22,7 @@ InodeFile::InodeFile(NonnullRefPtr<Inode>&& inode)
|
|||
{
|
||||
}
|
||||
|
||||
InodeFile::~InodeFile()
|
||||
{
|
||||
}
|
||||
InodeFile::~InodeFile() = default;
|
||||
|
||||
ErrorOr<size_t> InodeFile::read(OpenFileDescription& description, u64 offset, UserOrKernelBuffer& buffer, size_t count)
|
||||
{
|
||||
|
|
|
@ -399,9 +399,7 @@ Plan9FS::ReceiveCompletion::ReceiveCompletion(u16 tag)
|
|||
{
|
||||
}
|
||||
|
||||
Plan9FS::ReceiveCompletion::~ReceiveCompletion()
|
||||
{
|
||||
}
|
||||
Plan9FS::ReceiveCompletion::~ReceiveCompletion() = default;
|
||||
|
||||
bool Plan9FS::Blocker::unblock(u16 tag)
|
||||
{
|
||||
|
|
|
@ -42,13 +42,8 @@ ErrorOr<NonnullRefPtr<ProcFS>> ProcFS::try_create()
|
|||
return adopt_nonnull_ref_or_enomem(new (nothrow) ProcFS());
|
||||
}
|
||||
|
||||
ProcFS::ProcFS()
|
||||
{
|
||||
}
|
||||
|
||||
ProcFS::~ProcFS()
|
||||
{
|
||||
}
|
||||
ProcFS::ProcFS() = default;
|
||||
ProcFS::~ProcFS() = default;
|
||||
|
||||
ErrorOr<void> ProcFS::initialize()
|
||||
{
|
||||
|
@ -66,9 +61,7 @@ ProcFSInode::ProcFSInode(const ProcFS& fs, InodeIndex index)
|
|||
{
|
||||
}
|
||||
|
||||
ProcFSInode::~ProcFSInode()
|
||||
{
|
||||
}
|
||||
ProcFSInode::~ProcFSInode() = default;
|
||||
|
||||
ErrorOr<void> ProcFSInode::flush_metadata()
|
||||
{
|
||||
|
@ -185,9 +178,7 @@ ProcFSDirectoryInode::ProcFSDirectoryInode(const ProcFS& fs, const ProcFSExposed
|
|||
{
|
||||
}
|
||||
|
||||
ProcFSDirectoryInode::~ProcFSDirectoryInode()
|
||||
{
|
||||
}
|
||||
ProcFSDirectoryInode::~ProcFSDirectoryInode() = default;
|
||||
InodeMetadata ProcFSDirectoryInode::metadata() const
|
||||
{
|
||||
MutexLocker locker(m_inode_lock);
|
||||
|
|
|
@ -73,13 +73,8 @@ ErrorOr<NonnullRefPtr<SysFS>> SysFS::try_create()
|
|||
return adopt_nonnull_ref_or_enomem(new (nothrow) SysFS);
|
||||
}
|
||||
|
||||
SysFS::SysFS()
|
||||
{
|
||||
}
|
||||
|
||||
SysFS::~SysFS()
|
||||
{
|
||||
}
|
||||
SysFS::SysFS() = default;
|
||||
SysFS::~SysFS() = default;
|
||||
|
||||
ErrorOr<void> SysFS::initialize()
|
||||
{
|
||||
|
@ -202,9 +197,7 @@ SysFSDirectoryInode::SysFSDirectoryInode(SysFS const& fs, SysFSComponent const&
|
|||
{
|
||||
}
|
||||
|
||||
SysFSDirectoryInode::~SysFSDirectoryInode()
|
||||
{
|
||||
}
|
||||
SysFSDirectoryInode::~SysFSDirectoryInode() = default;
|
||||
|
||||
InodeMetadata SysFSDirectoryInode::metadata() const
|
||||
{
|
||||
|
|
|
@ -15,13 +15,8 @@ ErrorOr<NonnullRefPtr<TmpFS>> TmpFS::try_create()
|
|||
return adopt_nonnull_ref_or_enomem(new (nothrow) TmpFS);
|
||||
}
|
||||
|
||||
TmpFS::TmpFS()
|
||||
{
|
||||
}
|
||||
|
||||
TmpFS::~TmpFS()
|
||||
{
|
||||
}
|
||||
TmpFS::TmpFS() = default;
|
||||
TmpFS::~TmpFS() = default;
|
||||
|
||||
ErrorOr<void> TmpFS::initialize()
|
||||
{
|
||||
|
@ -50,9 +45,7 @@ TmpFSInode::TmpFSInode(TmpFS& fs, const InodeMetadata& metadata, WeakPtr<TmpFSIn
|
|||
m_metadata.inode = identifier();
|
||||
}
|
||||
|
||||
TmpFSInode::~TmpFSInode()
|
||||
{
|
||||
}
|
||||
TmpFSInode::~TmpFSInode() = default;
|
||||
|
||||
ErrorOr<NonnullRefPtr<TmpFSInode>> TmpFSInode::try_create(TmpFS& fs, InodeMetadata const& metadata, WeakPtr<TmpFSInode> parent)
|
||||
{
|
||||
|
|
|
@ -40,9 +40,7 @@ UNMAP_AFTER_INIT VirtualFileSystem::VirtualFileSystem()
|
|||
{
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT VirtualFileSystem::~VirtualFileSystem()
|
||||
{
|
||||
}
|
||||
UNMAP_AFTER_INIT VirtualFileSystem::~VirtualFileSystem() = default;
|
||||
|
||||
InodeIdentifier VirtualFileSystem::root_inode_id() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue