Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
3f5e1b3e
Commit
3f5e1b3e
authored
Jan 13, 2014
by
Damien George
Browse files
Merge pull request #172 from dhylands/init-kw
Initialize is_kw for dynamically allocated mp_obj_fun_native_t ojects.
parents
a23a24f8
44332ec9
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objfun.c
View file @
3f5e1b3e
...
...
@@ -101,6 +101,7 @@ const mp_obj_type_t fun_native_type = {
mp_obj_t
rt_make_function_0
(
mp_fun_0_t
fun
)
{
mp_obj_fun_native_t
*
o
=
m_new_obj
(
mp_obj_fun_native_t
);
o
->
base
.
type
=
&
fun_native_type
;
o
->
is_kw
=
false
;
o
->
n_args_min
=
0
;
o
->
n_args_max
=
0
;
o
->
fun
=
fun
;
...
...
@@ -110,6 +111,7 @@ mp_obj_t rt_make_function_0(mp_fun_0_t fun) {
mp_obj_t
rt_make_function_1
(
mp_fun_1_t
fun
)
{
mp_obj_fun_native_t
*
o
=
m_new_obj
(
mp_obj_fun_native_t
);
o
->
base
.
type
=
&
fun_native_type
;
o
->
is_kw
=
false
;
o
->
n_args_min
=
1
;
o
->
n_args_max
=
1
;
o
->
fun
=
fun
;
...
...
@@ -119,6 +121,7 @@ mp_obj_t rt_make_function_1(mp_fun_1_t fun) {
mp_obj_t
rt_make_function_2
(
mp_fun_2_t
fun
)
{
mp_obj_fun_native_t
*
o
=
m_new_obj
(
mp_obj_fun_native_t
);
o
->
base
.
type
=
&
fun_native_type
;
o
->
is_kw
=
false
;
o
->
n_args_min
=
2
;
o
->
n_args_max
=
2
;
o
->
fun
=
fun
;
...
...
@@ -128,6 +131,7 @@ mp_obj_t rt_make_function_2(mp_fun_2_t fun) {
mp_obj_t
rt_make_function_3
(
mp_fun_3_t
fun
)
{
mp_obj_fun_native_t
*
o
=
m_new_obj
(
mp_obj_fun_native_t
);
o
->
base
.
type
=
&
fun_native_type
;
o
->
is_kw
=
false
;
o
->
n_args_min
=
3
;
o
->
n_args_max
=
3
;
o
->
fun
=
fun
;
...
...
@@ -137,6 +141,7 @@ mp_obj_t rt_make_function_3(mp_fun_3_t fun) {
mp_obj_t
rt_make_function_var
(
int
n_args_min
,
mp_fun_var_t
fun
)
{
mp_obj_fun_native_t
*
o
=
m_new_obj
(
mp_obj_fun_native_t
);
o
->
base
.
type
=
&
fun_native_type
;
o
->
is_kw
=
false
;
o
->
n_args_min
=
n_args_min
;
o
->
n_args_max
=
~
((
machine_uint_t
)
0
);
o
->
fun
=
fun
;
...
...
@@ -147,6 +152,7 @@ mp_obj_t rt_make_function_var(int n_args_min, mp_fun_var_t fun) {
mp_obj_t
rt_make_function_var_between
(
int
n_args_min
,
int
n_args_max
,
mp_fun_var_t
fun
)
{
mp_obj_fun_native_t
*
o
=
m_new_obj
(
mp_obj_fun_native_t
);
o
->
base
.
type
=
&
fun_native_type
;
o
->
is_kw
=
false
;
o
->
n_args_min
=
n_args_min
;
o
->
n_args_max
=
n_args_max
;
o
->
fun
=
fun
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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