vfs: make 'File_io_service::read_ready' const

... and replace pointer argument to const reference.

Issue #4706
This commit is contained in:
Norman Feske
2022-12-07 17:12:21 +01:00
committed by Christian Helmuth
parent 1b1a9ca95c
commit ca0d3757cc
38 changed files with 113 additions and 130 deletions

View File

@ -48,7 +48,7 @@ class Vfs::Single_file_system : public File_system
return SYNC_OK;
}
virtual bool read_ready() = 0;
virtual bool read_ready() const = 0;
virtual bool write_ready() const = 0;
@ -132,8 +132,7 @@ class Vfs::Single_file_system : public File_system
return WRITE_ERR_INVALID;
}
bool read_ready() override { return true; }
bool read_ready() const override { return true; }
bool write_ready() const override { return true; }
};
@ -281,15 +280,12 @@ class Vfs::Single_file_system : public File_system
return WRITE_ERR_INVALID;
}
bool read_ready(Vfs_handle *vfs_handle) override
bool read_ready(Vfs_handle const &vfs_handle) const override
{
Single_vfs_handle *handle =
static_cast<Single_vfs_handle*>(vfs_handle);
Single_vfs_handle const &handle =
static_cast<Single_vfs_handle const &>(vfs_handle);
if (handle)
return handle->read_ready();
return false;
return handle.read_ready();
}
bool write_ready(Vfs_handle const &vfs_handle) const override