Skip to content

bd: Fix missing const attributes on functions #3866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions features/filesystem/bd/BlockDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ class BlockDevice
*
* @return Size of the underlying device in bytes
*/
virtual bd_size_t size() = 0;
virtual bd_size_t size() const = 0;

/** Convenience function for checking block read validity
*
* @param addr Address of block to begin reading from
* @param size Size to read in bytes
* @return True if read is valid for underlying block device
*/
bool is_valid_read(bd_addr_t addr, bd_size_t size)
bool is_valid_read(bd_addr_t addr, bd_size_t size) const
{
return (
addr % get_read_size() == 0 &&
Expand All @@ -139,7 +139,7 @@ class BlockDevice
* @param size Size to write in bytes
* @return True if program is valid for underlying block device
*/
bool is_valid_program(bd_addr_t addr, bd_size_t size)
bool is_valid_program(bd_addr_t addr, bd_size_t size) const
{
return (
addr % get_program_size() == 0 &&
Expand All @@ -153,7 +153,7 @@ class BlockDevice
* @param size Size to erase in bytes
* @return True if erase is valid for underlying block device
*/
bool is_valid_erase(bd_addr_t addr, bd_size_t size)
bool is_valid_erase(bd_addr_t addr, bd_size_t size) const
{
return (
addr % get_erase_size() == 0 &&
Expand Down
2 changes: 1 addition & 1 deletion features/filesystem/bd/ChainingBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ bd_size_t ChainingBlockDevice::get_erase_size() const
return _erase_size;
}

bd_size_t ChainingBlockDevice::size()
bd_size_t ChainingBlockDevice::size() const
{
return _size;
}
2 changes: 1 addition & 1 deletion features/filesystem/bd/ChainingBlockDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class ChainingBlockDevice : public BlockDevice
*
* @return Size of the underlying device in bytes
*/
virtual bd_size_t size();
virtual bd_size_t size() const;

protected:
BlockDevice **_bds;
Expand Down
2 changes: 1 addition & 1 deletion features/filesystem/bd/HeapBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ bd_size_t HeapBlockDevice::get_erase_size() const
return _erase_size;
}

bd_size_t HeapBlockDevice::size()
bd_size_t HeapBlockDevice::size() const
{
return _count * _erase_size;
}
Expand Down
2 changes: 1 addition & 1 deletion features/filesystem/bd/HeapBlockDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class HeapBlockDevice : public BlockDevice
*
* @return Size of the underlying device in bytes
*/
virtual bd_size_t size();
virtual bd_size_t size() const;

private:
bd_size_t _read_size;
Expand Down
2 changes: 1 addition & 1 deletion features/filesystem/bd/SlicingBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ bd_size_t SlicingBlockDevice::get_erase_size() const
return _bd->get_erase_size();
}

bd_size_t SlicingBlockDevice::size()
bd_size_t SlicingBlockDevice::size() const
{
return _stop - _start;
}
2 changes: 1 addition & 1 deletion features/filesystem/bd/SlicingBlockDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class SlicingBlockDevice : public BlockDevice
*
* @return Size of the underlying device in bytes
*/
virtual bd_size_t size();
virtual bd_size_t size() const;

protected:
BlockDevice *_bd;
Expand Down