summaryrefslogtreecommitdiff
path: root/py/objfun.c
diff options
context:
space:
mode:
authorJun Wu <quark@lihdd.net>2019-05-04 20:29:43 -0700
committerDamien George <damien.p.george@gmail.com>2019-05-06 18:28:28 +1000
commit089c9b71d10bd66549858254cc10803cba45453a (patch)
treee1f28ec6f5630e76eba8f5789977ff69e584f1e7 /py/objfun.c
parent32ba679924b8f5c8a81cff905e6bd295c6bb4df8 (diff)
py: remove "if (0)" and "if (false)" branches.
Prior to this commit, building the unix port with `DEBUG=1` and `-finstrument-functions` the compilation would fail with an error like "control reaches end of non-void function". This change fixes this by removing the problematic "if (0)" branches. Not all branches affect compilation, but they are all removed for consistency.
Diffstat (limited to 'py/objfun.c')
-rw-r--r--py/objfun.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objfun.c b/py/objfun.c
index d50b7fa25..d96c79ede 100644
--- a/py/objfun.c
+++ b/py/objfun.c
@@ -458,13 +458,13 @@ STATIC mp_uint_t convert_obj_for_inline_asm(mp_obj_t obj) {
return (mp_uint_t)mp_obj_str_get_data(obj, &l);
} else {
mp_obj_type_t *type = mp_obj_get_type(obj);
- if (0) {
#if MICROPY_PY_BUILTINS_FLOAT
- } else if (type == &mp_type_float) {
+ if (type == &mp_type_float) {
// convert float to int (could also pass in float registers)
return (mp_int_t)mp_obj_float_get(obj);
+ } else
#endif
- } else if (type == &mp_type_tuple || type == &mp_type_list) {
+ if (type == &mp_type_tuple || type == &mp_type_list) {
// pointer to start of tuple (could pass length, but then could use len(x) for that)
size_t len;
mp_obj_t *items;