Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
9fc7933f
You need to sign in or sign up before continuing.
Commit
9fc7933f
authored
11 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
Add py_get_qstr.
parent
e9f1e50b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/runtime.c
+11
-2
11 additions, 2 deletions
py/runtime.c
py/runtime.h
+2
-1
2 additions, 1 deletion
py/runtime.h
with
13 additions
and
3 deletions
py/runtime.c
+
11
−
2
View file @
9fc7933f
...
@@ -514,7 +514,7 @@ py_obj_t py_builtin___build_class__(py_obj_t o_class_fun, py_obj_t o_class_name)
...
@@ -514,7 +514,7 @@ py_obj_t py_builtin___build_class__(py_obj_t o_class_fun, py_obj_t o_class_name)
}
}
py_obj_t
py_builtin_range
(
py_obj_t
o_arg
)
{
py_obj_t
py_builtin_range
(
py_obj_t
o_arg
)
{
return
py_obj_new_range
(
0
,
rt
_get_int
(
o_arg
),
1
);
return
py_obj_new_range
(
0
,
py
_get_int
(
o_arg
),
1
);
}
}
#ifdef WRITE_NATIVE
#ifdef WRITE_NATIVE
...
@@ -845,7 +845,7 @@ int rt_is_true(py_obj_t arg) {
...
@@ -845,7 +845,7 @@ int rt_is_true(py_obj_t arg) {
}
}
}
}
int
rt
_get_int
(
py_obj_t
arg
)
{
int
py
_get_int
(
py_obj_t
arg
)
{
if
(
arg
==
py_const_false
)
{
if
(
arg
==
py_const_false
)
{
return
0
;
return
0
;
}
else
if
(
arg
==
py_const_true
)
{
}
else
if
(
arg
==
py_const_true
)
{
...
@@ -858,6 +858,15 @@ int rt_get_int(py_obj_t arg) {
...
@@ -858,6 +858,15 @@ int rt_get_int(py_obj_t arg) {
}
}
}
}
qstr
py_get_qstr
(
py_obj_t
arg
)
{
if
(
IS_O
(
arg
,
O_STR
))
{
return
((
py_obj_base_t
*
)
arg
)
->
u_str
;
}
else
{
assert
(
0
);
return
0
;
}
}
py_obj_t
rt_load_const_str
(
qstr
qstr
)
{
py_obj_t
rt_load_const_str
(
qstr
qstr
)
{
DEBUG_OP_printf
(
"load '%s'
\n
"
,
qstr_str
(
qstr
));
DEBUG_OP_printf
(
"load '%s'
\n
"
,
qstr_str
(
qstr
));
return
py_obj_new_str
(
qstr
);
return
py_obj_new_str
(
qstr
);
...
...
This diff is collapsed.
Click to expand it.
py/runtime.h
+
2
−
1
View file @
9fc7933f
...
@@ -97,7 +97,8 @@ void rt_assign_native_code(int unique_code_id, py_fun_t f, uint len, int n_args)
...
@@ -97,7 +97,8 @@ void rt_assign_native_code(int unique_code_id, py_fun_t f, uint len, int n_args)
void
rt_assign_inline_asm_code
(
int
unique_code_id
,
py_fun_t
f
,
uint
len
,
int
n_args
);
void
rt_assign_inline_asm_code
(
int
unique_code_id
,
py_fun_t
f
,
uint
len
,
int
n_args
);
void
py_obj_print
(
py_obj_t
o
);
void
py_obj_print
(
py_obj_t
o
);
int
rt_is_true
(
py_obj_t
arg
);
int
rt_is_true
(
py_obj_t
arg
);
int
rt_get_int
(
py_obj_t
arg
);
int
py_get_int
(
py_obj_t
arg
);
qstr
py_get_qstr
(
py_obj_t
arg
);
py_obj_t
rt_load_const_str
(
qstr
qstr
);
py_obj_t
rt_load_const_str
(
qstr
qstr
);
py_obj_t
rt_load_name
(
qstr
qstr
);
py_obj_t
rt_load_name
(
qstr
qstr
);
py_obj_t
rt_load_global
(
qstr
qstr
);
py_obj_t
rt_load_global
(
qstr
qstr
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment