Skip to content

Commit 7a04d58

Browse files
authored
Merge pull request ARMmbed#3866 from geky/bd-fix-const-missing
bd: Fix missing const attributes on functions
2 parents e9158f4 + 31e0875 commit 7a04d58

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

features/filesystem/bd/BlockDevice.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ class BlockDevice
117117
*
118118
* @return Size of the underlying device in bytes
119119
*/
120-
virtual bd_size_t size() = 0;
120+
virtual bd_size_t size() const = 0;
121121

122122
/** Convenience function for checking block read validity
123123
*
124124
* @param addr Address of block to begin reading from
125125
* @param size Size to read in bytes
126126
* @return True if read is valid for underlying block device
127127
*/
128-
bool is_valid_read(bd_addr_t addr, bd_size_t size)
128+
bool is_valid_read(bd_addr_t addr, bd_size_t size) const
129129
{
130130
return (
131131
addr % get_read_size() == 0 &&
@@ -139,7 +139,7 @@ class BlockDevice
139139
* @param size Size to write in bytes
140140
* @return True if program is valid for underlying block device
141141
*/
142-
bool is_valid_program(bd_addr_t addr, bd_size_t size)
142+
bool is_valid_program(bd_addr_t addr, bd_size_t size) const
143143
{
144144
return (
145145
addr % get_program_size() == 0 &&
@@ -153,7 +153,7 @@ class BlockDevice
153153
* @param size Size to erase in bytes
154154
* @return True if erase is valid for underlying block device
155155
*/
156-
bool is_valid_erase(bd_addr_t addr, bd_size_t size)
156+
bool is_valid_erase(bd_addr_t addr, bd_size_t size) const
157157
{
158158
return (
159159
addr % get_erase_size() == 0 &&

features/filesystem/bd/ChainingBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ bd_size_t ChainingBlockDevice::get_erase_size() const
190190
return _erase_size;
191191
}
192192

193-
bd_size_t ChainingBlockDevice::size()
193+
bd_size_t ChainingBlockDevice::size() const
194194
{
195195
return _size;
196196
}

features/filesystem/bd/ChainingBlockDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class ChainingBlockDevice : public BlockDevice
140140
*
141141
* @return Size of the underlying device in bytes
142142
*/
143-
virtual bd_size_t size();
143+
virtual bd_size_t size() const;
144144

145145
protected:
146146
BlockDevice **_bds;

features/filesystem/bd/HeapBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ bd_size_t HeapBlockDevice::get_erase_size() const
7777
return _erase_size;
7878
}
7979

80-
bd_size_t HeapBlockDevice::size()
80+
bd_size_t HeapBlockDevice::size() const
8181
{
8282
return _count * _erase_size;
8383
}

features/filesystem/bd/HeapBlockDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class HeapBlockDevice : public BlockDevice
119119
*
120120
* @return Size of the underlying device in bytes
121121
*/
122-
virtual bd_size_t size();
122+
virtual bd_size_t size() const;
123123

124124
private:
125125
bd_size_t _read_size;

features/filesystem/bd/SlicingBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ bd_size_t SlicingBlockDevice::get_erase_size() const
108108
return _bd->get_erase_size();
109109
}
110110

111-
bd_size_t SlicingBlockDevice::size()
111+
bd_size_t SlicingBlockDevice::size() const
112112
{
113113
return _stop - _start;
114114
}

features/filesystem/bd/SlicingBlockDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class SlicingBlockDevice : public BlockDevice
138138
*
139139
* @return Size of the underlying device in bytes
140140
*/
141-
virtual bd_size_t size();
141+
virtual bd_size_t size() const;
142142

143143
protected:
144144
BlockDevice *_bd;

0 commit comments

Comments
 (0)