Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
0e4c24ec
Commit
0e4c24ec
authored
Mar 09, 2019
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py/nativeglue: Rename native convert funs to match other native helpers.
parent
3b973a56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
py/nativeglue.c
py/nativeglue.c
+6
-6
py/objfun.c
py/objfun.c
+1
-1
py/runtime.h
py/runtime.h
+2
-2
No files found.
py/nativeglue.c
View file @
0e4c24ec
...
...
@@ -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
,
...
...
py/objfun.c
View file @
0e4c24ec
...
...
@@ -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
=
{
...
...
py/runtime.h
View file @
0e4c24ec
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment