From d97b40bdaaeb96920541e57f6d299fb0c84a7bfd Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 16 Dec 2019 15:42:17 +1100 Subject: py: Introduce MP_ROM_FALSE/MP_ROM_TRUE for ROM to refer to bool objects. This helps to prevent mistakes, and allows easily changing the ROM value of False/True if needed. --- extmod/vfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'extmod') diff --git a/extmod/vfs.c b/extmod/vfs.c index e459287d4..8e3a0f18c 100644 --- a/extmod/vfs.c +++ b/extmod/vfs.c @@ -201,8 +201,8 @@ STATIC mp_obj_t mp_vfs_autodetect(mp_obj_t bdev_obj) { mp_obj_t mp_vfs_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_readonly, ARG_mkfs }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_readonly, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_false_obj)} }, - { MP_QSTR_mkfs, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_false_obj)} }, + { MP_QSTR_readonly, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_FALSE} }, + { MP_QSTR_mkfs, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_FALSE} }, }; // parse args -- cgit v1.2.3