summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorsommersoft <sommersoft@gmail.com>2019-08-29 22:14:53 -0500
committersommersoft <sommersoft@gmail.com>2019-08-29 22:14:53 -0500
commit8120f5cdad2d249a4cec9e37db73be6b240bacc3 (patch)
tree13ece9c4fbc43dd4625bd97df798cf24479068be /lib/utils
parent6a68d0b4d00c0021aa46fe236cba8a6bdfa36437 (diff)
parent2b5ce666be90de7738ed434ba1dde13f67fc30de (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.c4
-rw-r--r--lib/utils/buffer_helper.h3
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