diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-16 17:47:07 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-16 17:47:07 +0000 |
commit | 963a5a3e82ded7ee75adae72ae7cb14796fa150e (patch) | |
tree | 78402c85b98c1c8f1889d7af7dc6f4828a8f55a5 /py/builtinimport.c | |
parent | f12ea7c7ed1ef97ee48c4356dbbc808cc2bdee4a (diff) |
py, unix: Allow to compile with -Wsign-compare.
See issue #699.
Diffstat (limited to 'py/builtinimport.c')
-rw-r--r-- | py/builtinimport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c index 4dc02bdc2..7a9c0864b 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -203,7 +203,7 @@ mp_obj_t mp_builtin___import__(mp_uint_t n_args, const mp_obj_t *args) { nlr_raise(mp_obj_new_exception_msg(&mp_type_ImportError, "Invalid relative import")); } - uint new_mod_l = (mod_len == 0 ? p - this_name : p - this_name + 1 + mod_len); + uint new_mod_l = (mod_len == 0 ? (size_t)(p - this_name) : (size_t)(p - this_name) + 1 + mod_len); char *new_mod = alloca(new_mod_l); memcpy(new_mod, this_name, p - this_name); if (mod_len != 0) { |