mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-16 06:08:16 +00:00
vfs: make 'File_io_service::read_ready' const
... and replace pointer argument to const reference. Issue #4706
This commit is contained in:
committed by
Christian Helmuth
parent
1b1a9ca95c
commit
ca0d3757cc
@ -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
|
||||
|
Reference in New Issue
Block a user