From 49c47da8046e46348d43037c3a41059180eb280f Mon Sep 17 00:00:00 2001 From: stijn Date: Tue, 28 Oct 2014 17:20:52 +0100 Subject: Fix errors after enabling -Wpointer-arith --- py/objarray.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'py/objarray.c') diff --git a/py/objarray.c b/py/objarray.c index 2d210d915..614cbe10d 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -27,6 +27,7 @@ #include #include +#include #include "mpconfig.h" #include "nlr.h" @@ -292,7 +293,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value #endif } else { res = array_new(o->typecode, slice.stop - slice.start); - memcpy(res->items, o->items + slice.start * sz, (slice.stop - slice.start) * sz); + memcpy(res->items, (uint8_t*)o->items + slice.start * sz, (slice.stop - slice.start) * sz); } return res; #endif @@ -331,7 +332,7 @@ STATIC mp_int_t array_get_buffer(mp_obj_t o_in, mp_buffer_info_t *bufinfo, mp_ui // read-only memoryview return 1; } - bufinfo->buf += (mp_uint_t)o->free * sz; + bufinfo->buf = (uint8_t*)bufinfo->buf + (mp_uint_t)o->free * sz; } #endif return 0; -- cgit v1.2.3