From 966a48b23a985154ff691a09de72013e2eac2512 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 27 Aug 2019 12:49:46 -0700 Subject: More size_t usage --- lib/utils/buffer_helper.c | 4 ++-- lib/utils/buffer_helper.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/utils') 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 +#include -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 -- cgit v1.2.3