summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-03-09 10:22:09 +1100
committerDamien George <damien.p.george@gmail.com>2019-03-14 12:22:25 +1100
commit0e4c24ec08c19773b26a662abb133c05b474b1fa (patch)
tree0501b0019a08e664f070a10efe5ddc70c7c4f403 /py
parent3b973a5658025bb99f503fb15ba11884729ac77a (diff)
downloadmicropython-0e4c24ec08c19773b26a662abb133c05b474b1fa.tar.gz
micropython-0e4c24ec08c19773b26a662abb133c05b474b1fa.zip
py/nativeglue: Rename native convert funs to match other native helpers.
Diffstat (limited to 'py')
-rw-r--r--py/nativeglue.c12
-rw-r--r--py/objfun.c2
-rw-r--r--py/runtime.h4
3 files changed, 9 insertions, 9 deletions
diff --git a/py/nativeglue.c b/py/nativeglue.c
index 6e5bd6ce2e..db54d12332 100644
--- a/py/nativeglue.c
+++ b/py/nativeglue.c
@@ -56,8 +56,8 @@ int mp_native_type_from_qstr(qstr qst) {
}
// convert a MicroPython object to a valid native value based on type
-mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type) {
- DEBUG_printf("mp_convert_obj_to_native(%p, " UINT_FMT ")\n", obj, type);
+mp_uint_t mp_native_from_obj(mp_obj_t obj, mp_uint_t type) {
+ DEBUG_printf("mp_native_from_obj(%p, " UINT_FMT ")\n", obj, type);
switch (type & 0xf) {
case MP_NATIVE_TYPE_OBJ: return (mp_uint_t)obj;
case MP_NATIVE_TYPE_BOOL:
@@ -80,8 +80,8 @@ mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type) {
#if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM
// convert a native value to a MicroPython object based on type
-mp_obj_t mp_convert_native_to_obj(mp_uint_t val, mp_uint_t type) {
- DEBUG_printf("mp_convert_native_to_obj(" UINT_FMT ", " UINT_FMT ")\n", val, type);
+mp_obj_t mp_native_to_obj(mp_uint_t val, mp_uint_t type) {
+ DEBUG_printf("mp_native_to_obj(" UINT_FMT ", " UINT_FMT ")\n", val, type);
switch (type & 0xf) {
case MP_NATIVE_TYPE_OBJ: return (mp_obj_t)val;
case MP_NATIVE_TYPE_BOOL: return mp_obj_new_bool(val);
@@ -192,8 +192,8 @@ const void *const mp_fun_table[MP_F_NUMBER_OF] = {
&mp_const_none_obj,
&mp_const_false_obj,
&mp_const_true_obj,
- mp_convert_obj_to_native,
- mp_convert_native_to_obj,
+ mp_native_from_obj,
+ mp_native_to_obj,
mp_native_swap_globals,
mp_load_name,
mp_load_global,
diff --git a/py/objfun.c b/py/objfun.c
index 159d67e5ea..d50b7fa25d 100644
--- a/py/objfun.c
+++ b/py/objfun.c
@@ -510,7 +510,7 @@ STATIC mp_obj_t fun_asm_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const
);
}
- return mp_convert_native_to_obj(ret, self->type_sig);
+ return mp_native_to_obj(ret, self->type_sig);
}
STATIC const mp_obj_type_t mp_type_fun_asm = {
diff --git a/py/runtime.h b/py/runtime.h
index 3e447ee4fe..0dd97a584f 100644
--- a/py/runtime.h
+++ b/py/runtime.h
@@ -170,8 +170,8 @@ NORETURN void mp_raise_recursion_depth(void);
// helper functions for native/viper code
int mp_native_type_from_qstr(qstr qst);
-mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type);
-mp_obj_t mp_convert_native_to_obj(mp_uint_t val, mp_uint_t type);
+mp_uint_t mp_native_from_obj(mp_obj_t obj, mp_uint_t type);
+mp_obj_t mp_native_to_obj(mp_uint_t val, mp_uint_t type);
mp_obj_dict_t *mp_native_swap_globals(mp_obj_dict_t *new_globals);
mp_obj_t mp_native_call_function_n_kw(mp_obj_t fun_in, size_t n_args_kw, const mp_obj_t *args);
void mp_native_raise(mp_obj_t o);