bd: Fix missing const attributes on functions

pull/3866/head
Christopher Haster 2017-03-01 16:11:40 -06:00
parent 3a27568a50
commit 31e0875cd1
7 changed files with 10 additions and 10 deletions

View File

@ -117,7 +117,7 @@ public:
* *
* @return Size of the underlying device in bytes * @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 /** Convenience function for checking block read validity
* *
@ -125,7 +125,7 @@ public:
* @param size Size to read in bytes * @param size Size to read in bytes
* @return True if read is valid for underlying block device * @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 ( return (
addr % get_read_size() == 0 && addr % get_read_size() == 0 &&
@ -139,7 +139,7 @@ public:
* @param size Size to write in bytes * @param size Size to write in bytes
* @return True if program is valid for underlying block device * @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 ( return (
addr % get_program_size() == 0 && addr % get_program_size() == 0 &&
@ -153,7 +153,7 @@ public:
* @param size Size to erase in bytes * @param size Size to erase in bytes
* @return True if erase is valid for underlying block device * @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 ( return (
addr % get_erase_size() == 0 && addr % get_erase_size() == 0 &&

View File

@ -190,7 +190,7 @@ bd_size_t ChainingBlockDevice::get_erase_size() const
return _erase_size; return _erase_size;
} }
bd_size_t ChainingBlockDevice::size() bd_size_t ChainingBlockDevice::size() const
{ {
return _size; return _size;
} }

View File

@ -140,7 +140,7 @@ public:
* *
* @return Size of the underlying device in bytes * @return Size of the underlying device in bytes
*/ */
virtual bd_size_t size(); virtual bd_size_t size() const;
protected: protected:
BlockDevice **_bds; BlockDevice **_bds;

View File

@ -77,7 +77,7 @@ bd_size_t HeapBlockDevice::get_erase_size() const
return _erase_size; return _erase_size;
} }
bd_size_t HeapBlockDevice::size() bd_size_t HeapBlockDevice::size() const
{ {
return _count * _erase_size; return _count * _erase_size;
} }

View File

@ -119,7 +119,7 @@ public:
* *
* @return Size of the underlying device in bytes * @return Size of the underlying device in bytes
*/ */
virtual bd_size_t size(); virtual bd_size_t size() const;
private: private:
bd_size_t _read_size; bd_size_t _read_size;

View File

@ -108,7 +108,7 @@ bd_size_t SlicingBlockDevice::get_erase_size() const
return _bd->get_erase_size(); return _bd->get_erase_size();
} }
bd_size_t SlicingBlockDevice::size() bd_size_t SlicingBlockDevice::size() const
{ {
return _stop - _start; return _stop - _start;
} }

View File

@ -138,7 +138,7 @@ public:
* *
* @return Size of the underlying device in bytes * @return Size of the underlying device in bytes
*/ */
virtual bd_size_t size(); virtual bd_size_t size() const;
protected: protected:
BlockDevice *_bd; BlockDevice *_bd;