summaryrefslogtreecommitdiffstatshomepage
path: root/py/builtinhelp.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-01-09 11:01:14 +1100
committerDamien George <damien.p.george@gmail.com>2020-01-09 11:25:26 +1100
commitbfbd94401d9cf658fc50b2e45896aba300a7af71 (patch)
tree21aec2207f432658083a26ed5172f9ce0e57ee43 /py/builtinhelp.c
parente3187b052f14872fdb5e2d2338d359013a544fae (diff)
downloadmicropython-bfbd94401d9cf658fc50b2e45896aba300a7af71.tar.gz
micropython-bfbd94401d9cf658fc50b2e45896aba300a7af71.zip
py: Make mp_obj_get_type() return a const ptr to mp_obj_type_t.
Most types are in rodata/ROM, and mp_obj_base_t.type is a constant pointer, so enforce this const-ness throughout the code base. If a type ever needs to be modified (eg a user type) then a simple cast can be used.
Diffstat (limited to 'py/builtinhelp.c')
-rw-r--r--py/builtinhelp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/builtinhelp.c b/py/builtinhelp.c
index 8f162d8858..033242b3df 100644
--- a/py/builtinhelp.c
+++ b/py/builtinhelp.c
@@ -134,7 +134,7 @@ STATIC void mp_help_print_obj(const mp_obj_t obj) {
}
#endif
- mp_obj_type_t *type = mp_obj_get_type(obj);
+ const mp_obj_type_t *type = mp_obj_get_type(obj);
// try to print something sensible about the given object
mp_print_str(MP_PYTHON_PRINTER, "object ");