mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
Kernel: Make File's can_read/can_write take a const FileDescription&
Asking a File if we could possibly read or write it will never mutate the asking FileDescription&, so it should be const.
This commit is contained in:
parent
e8fee92357
commit
1b2ef8582c
47 changed files with 97 additions and 91 deletions
|
@ -121,14 +121,12 @@ ssize_t FileDescription::write(const u8* data, ssize_t size)
|
|||
|
||||
bool FileDescription::can_write() const
|
||||
{
|
||||
// FIXME: Remove this const_cast.
|
||||
return m_file->can_write(const_cast<FileDescription&>(*this));
|
||||
return m_file->can_write(*this);
|
||||
}
|
||||
|
||||
bool FileDescription::can_read() const
|
||||
{
|
||||
// FIXME: Remove this const_cast.
|
||||
return m_file->can_read(const_cast<FileDescription&>(*this));
|
||||
return m_file->can_read(*this);
|
||||
}
|
||||
|
||||
ByteBuffer FileDescription::read_entire_file()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue