summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-03-31 14:19:52 +0200
committerDamien George <damien.p.george@gmail.com>2020-04-18 22:42:19 +1000
commitdc4d119d3d96799bf848c6488b2ac49b933ab7cb (patch)
tree1deccc73a72522c31f68d2597c3972fe2c9a1ca8
parent7fb9edf43653d35d389a4604d7402c85540511a2 (diff)
py/objarray: Fix sign mismatch in comparison.
Found when compiling with clang and -Wsign-compare.
-rw-r--r--py/objarray.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objarray.c b/py/objarray.c
index 20232040e..4947f7590 100644
--- a/py/objarray.c
+++ b/py/objarray.c
@@ -445,7 +445,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value
}
#endif
if (len_adj > 0) {
- if (len_adj > o->free) {
+ if ((size_t)len_adj > o->free) {
// TODO: alloc policy; at the moment we go conservative
o->items = m_renew(byte, o->items, (o->len + o->free) * item_sz, (o->len + len_adj) * item_sz);
o->free = len_adj;