1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +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:
Andreas Kling 2019-11-04 14:03:14 +01:00
parent e8fee92357
commit 1b2ef8582c
47 changed files with 97 additions and 91 deletions

View file

@ -68,7 +68,7 @@ ssize_t TTY::write(FileDescription&, const u8* buffer, ssize_t size)
return size;
}
bool TTY::can_read(FileDescription&) const
bool TTY::can_read(const FileDescription&) const
{
if (in_canonical_mode()) {
return m_available_lines > 0;
@ -76,7 +76,7 @@ bool TTY::can_read(FileDescription&) const
return !m_input_buffer.is_empty();
}
bool TTY::can_write(FileDescription&) const
bool TTY::can_write(const FileDescription&) const
{
return true;
}