Skip to content

Commit cbeeaa0

Browse files
committed
Change all size types to size_t
1 parent 88cc43f commit cbeeaa0

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

src/ObjectBase.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ size_t ObjectBase::readFlash(size_t offset, void* buffer, size_t count) const
3737
return flashmem_read(buffer, addr, count);
3838
}
3939

40-
uint32_t ObjectBase::length() const
40+
size_t ObjectBase::length() const
4141
{
4242
if(isNull()) {
4343
return 0;

src/include/FlashString/Object.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ template <class ObjectType, typename ElementType> class Object : public ObjectBa
7777
/**
7878
* @brief Get the length of the array in elements
7979
*/
80-
FSTR_INLINE uint32_t length() const
80+
FSTR_INLINE size_t length() const
8181
{
8282
return ObjectBase::length() / sizeof(ElementType);
8383
}

src/include/FlashString/ObjectBase.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ class ObjectBase
3131
/**
3232
* @brief Get the length of the object data in bytes
3333
*/
34-
uint32_t length() const;
34+
size_t length() const;
3535

3636
/**
3737
* @brief Get the object data size in bytes
3838
* @note Always an integer multiple of 4 bytes
3939
*/
40-
FSTR_INLINE uint32_t size() const
40+
FSTR_INLINE size_t size() const
4141
{
4242
return ALIGNUP(length());
4343
}

src/include/FlashString/String.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class String : public Object<String, char>
155155
* @brief Get the number of bytes used to store the String
156156
* @note Always an integer multiple of 4 bytes
157157
*/
158-
uint32_t size() const
158+
size_t size() const
159159
{
160160
return ALIGNUP(Object::length() + 1);
161161
}

todo.rst

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
TODO List
22
=========
33

4-
Change all sizes to size_t
5-
e.g. length()
6-
74
Missing methods
85
Behaviour of String should reflect WString. Review and add any missing methods.
96
Note that implementations for some are likely non-trivial since we cannot assume

0 commit comments

Comments
 (0)