diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-20 01:25:15 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-20 01:25:15 +0100 |
commit | f87b35e7798f51acf48ecf9b2cbb25c607f16db6 (patch) | |
tree | f3f06d52597059a5e1976fcad3be35e5e3128666 /py/argcheck.c | |
parent | 13c19c57a02c7f157ed062821b7446edf691be06 (diff) | |
download | micropython-f87b35e7798f51acf48ecf9b2cbb25c607f16db6.tar.gz micropython-f87b35e7798f51acf48ecf9b2cbb25c607f16db6.zip |
py: Fix mp_arg_parse_all.
Diffstat (limited to 'py/argcheck.c')
-rw-r--r-- | py/argcheck.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/argcheck.c b/py/argcheck.c index 5a0bb84116..5c5ea1bf80 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -57,11 +57,11 @@ void mp_arg_parse_all(uint n_pos, const mp_obj_t *pos, mp_map_t *kws, uint n_all given_arg = kw->value; } } - if (allowed[i].flags == MP_ARG_PARSE_BOOL) { + if ((allowed[i].flags & MP_ARG_PARSE_KIND_MASK) == MP_ARG_PARSE_BOOL) { out_vals[i].u_bool = mp_obj_is_true(given_arg); - } else if (allowed[i].flags == MP_ARG_PARSE_INT) { + } else if ((allowed[i].flags & MP_ARG_PARSE_KIND_MASK) == MP_ARG_PARSE_INT) { out_vals[i].u_int = mp_obj_get_int(given_arg); - } else if (allowed[i].flags == MP_ARG_PARSE_OBJ) { + } else if ((allowed[i].flags & MP_ARG_PARSE_KIND_MASK) == MP_ARG_PARSE_OBJ) { out_vals[i].u_obj = given_arg; } else { assert(0); |