diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-08-27 12:49:46 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-08-27 12:49:46 -0700 |
| commit | 966a48b23a985154ff691a09de72013e2eac2512 (patch) | |
| tree | 0081ffc3fe1ac0c62e1852fa19a8fe24f6e709b6 /lib/utils | |
| parent | d956b3b3599e995c0201fe540dd22d1d11876a64 (diff) | |
More size_t usage
Diffstat (limited to 'lib/utils')
| -rw-r--r-- | lib/utils/buffer_helper.c | 4 | ||||
| -rw-r--r-- | lib/utils/buffer_helper.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/utils/buffer_helper.c b/lib/utils/buffer_helper.c index f6eb8bf1e..694952e3d 100644 --- a/lib/utils/buffer_helper.c +++ b/lib/utils/buffer_helper.c @@ -26,10 +26,10 @@ #include "lib/utils/buffer_helper.h" -void normalize_buffer_bounds(int32_t* start, int32_t end, uint32_t* length) { +void normalize_buffer_bounds(int32_t* start, int32_t end, size_t* length) { if (end < 0) { end += *length; - } else if (((uint32_t) end) > *length) { + } else if (((size_t) end) > *length) { end = *length; } if (*start < 0) { diff --git a/lib/utils/buffer_helper.h b/lib/utils/buffer_helper.h index 47042e7ef..7487b9df5 100644 --- a/lib/utils/buffer_helper.h +++ b/lib/utils/buffer_helper.h @@ -28,7 +28,8 @@ #define MICROPY_INCLUDED_LIB_UTILS_BUFFER_HELPER_H #include <stdint.h> +#include <string.h> -void normalize_buffer_bounds(int32_t* start, int32_t end, uint32_t* length); +void normalize_buffer_bounds(int32_t* start, int32_t end, size_t* length); #endif // MICROPY_INCLUDED_LIB_UTILS_BUFFER_HELPER_H |
