diff options
| author | sommersoft <sommersoft@gmail.com> | 2019-08-29 22:14:53 -0500 |
|---|---|---|
| committer | sommersoft <sommersoft@gmail.com> | 2019-08-29 22:14:53 -0500 |
| commit | 8120f5cdad2d249a4cec9e37db73be6b240bacc3 (patch) | |
| tree | 13ece9c4fbc43dd4625bd97df798cf24479068be /lib/utils | |
| parent | 6a68d0b4d00c0021aa46fe236cba8a6bdfa36437 (diff) | |
| parent | 2b5ce666be90de7738ed434ba1dde13f67fc30de (diff) | |
Merge branch 'master' of https://github.com/adafruit/circuitpython into mixer_voice
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 |
