diff options
author | Tom Collins <tom.collins@digi.com> | 2017-06-30 16:23:29 -0700 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-07-07 11:32:22 +1000 |
commit | 145796f037715e180b441b38c1ec1ba45ff77797 (patch) | |
tree | c709871f107f103dfdccd7c6975cd4f07a006477 /py/runtime.c | |
parent | ed52955c6bb05d2a08c009ed24ab3214c88c6fb1 (diff) |
py,extmod: Some casts and minor refactors to quiet compiler warnings.
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/py/runtime.c b/py/runtime.c index 0a3a4b12d..a8a1f73fa 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1410,16 +1410,13 @@ mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_i NORETURN void *m_malloc_fail(size_t num_bytes) { DEBUG_printf("memory allocation failed, allocating %u bytes\n", (uint)num_bytes); - if (0) { - // dummy #if MICROPY_ENABLE_GC - } else if (gc_is_locked()) { + if (gc_is_locked()) { mp_raise_msg(&mp_type_MemoryError, "memory allocation failed, heap is locked"); - #endif - } else { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_MemoryError, - "memory allocation failed, allocating %u bytes", (uint)num_bytes)); } + #endif + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_MemoryError, + "memory allocation failed, allocating %u bytes", (uint)num_bytes)); } NORETURN void mp_raise_msg(const mp_obj_type_t *exc_type, const char *msg) { |