1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 17:28:10 +00:00

Kernel: Add distinct InodeIndex type

Use the DistinctNumeric mechanism to make InodeIndex a strongly typed
integer type.
This commit is contained in:
Andreas Kling 2021-02-12 09:18:47 +01:00
parent c8a90a31b6
commit e44c1792a7
17 changed files with 63 additions and 56 deletions

View file

@ -61,13 +61,13 @@ bool DevPtsFS::initialize()
return true;
}
static unsigned inode_index_to_pty_index(unsigned inode_index)
static unsigned inode_index_to_pty_index(InodeIndex inode_index)
{
ASSERT(inode_index > 1);
return inode_index - 2;
return inode_index.value() - 2;
}
static unsigned pty_index_to_inode_index(unsigned pty_index)
static InodeIndex pty_index_to_inode_index(unsigned pty_index)
{
return pty_index + 2;
}
@ -109,7 +109,7 @@ void DevPtsFS::unregister_slave_pty(SlavePTY& slave_pty)
s_ptys->remove(slave_pty.index());
}
DevPtsFSInode::DevPtsFSInode(DevPtsFS& fs, unsigned index, SlavePTY* pty)
DevPtsFSInode::DevPtsFSInode(DevPtsFS& fs, InodeIndex index, SlavePTY* pty)
: Inode(fs, index)
{
if (pty)