py: Fix mp_arg_parse_all.

pull/512/head
Damien George 2014-04-20 01:25:15 +01:00
rodzic 13c19c57a0
commit f87b35e779
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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);