summaryrefslogtreecommitdiff
path: root/py/repl.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-11-27 17:01:44 +0000
committerDamien George <damien.p.george@gmail.com>2015-11-29 14:25:35 +0000
commit999cedb90ff0827cdb9dfe0e4faa6ebc1739d271 (patch)
tree897eb07b82f1893cfd413b9ef7f625cd996f859d /py/repl.c
parentcbf7674025814797f5c537d6d1c195efe58ccaaf (diff)
py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR.
This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
Diffstat (limited to 'py/repl.c')
-rw-r--r--py/repl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/repl.c b/py/repl.c
index 440606996..182961b4b 100644
--- a/py/repl.c
+++ b/py/repl.c
@@ -169,11 +169,11 @@ mp_uint_t mp_repl_autocomplete(const char *str, mp_uint_t len, const mp_print_t
} else {
mp_obj_type_t *type;
if (MP_OBJ_IS_TYPE(obj, &mp_type_type)) {
- type = obj;
+ type = MP_OBJ_TO_PTR(obj);
} else {
type = mp_obj_get_type(obj);
}
- if (type->locals_dict != MP_OBJ_NULL && MP_OBJ_IS_TYPE(type->locals_dict, &mp_type_dict)) {
+ if (type->locals_dict != NULL && type->locals_dict->base.type == &mp_type_dict) {
dict = type->locals_dict;
} else {
// obj has no dict