Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
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
Container Registry
Model registry
Operate
Environments
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
29424304
Commit
29424304
authored
8 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
unix: Use mp_obj_str_get_str instead of mp_obj_str_get_data.
parent
ab5689bc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
unix/modffi.c
+1
-2
1 addition, 2 deletions
unix/modffi.c
unix/modos.c
+3
-6
3 additions, 6 deletions
unix/modos.c
unix/modtermios.c
+1
-2
1 addition, 2 deletions
unix/modtermios.c
with
5 additions
and
10 deletions
unix/modffi.c
+
1
−
2
View file @
29424304
...
...
@@ -126,8 +126,7 @@ STATIC ffi_type *char2ffi_type(char c)
STATIC
ffi_type
*
get_ffi_type
(
mp_obj_t
o_in
)
{
if
(
MP_OBJ_IS_STR
(
o_in
))
{
mp_uint_t
len
;
const
char
*
s
=
mp_obj_str_get_data
(
o_in
,
&
len
);
const
char
*
s
=
mp_obj_str_get_str
(
o_in
);
ffi_type
*
t
=
char2ffi_type
(
*
s
);
if
(
t
!=
NULL
)
{
return
t
;
...
...
This diff is collapsed.
Click to expand it.
unix/modos.c
+
3
−
6
View file @
29424304
...
...
@@ -46,8 +46,7 @@
STATIC
mp_obj_t
mod_os_stat
(
mp_obj_t
path_in
)
{
struct
stat
sb
;
mp_uint_t
len
;
const
char
*
path
=
mp_obj_str_get_data
(
path_in
,
&
len
);
const
char
*
path
=
mp_obj_str_get_str
(
path_in
);
int
res
=
stat
(
path
,
&
sb
);
RAISE_ERRNO
(
res
,
errno
);
...
...
@@ -87,8 +86,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_os_stat_obj, mod_os_stat);
STATIC
mp_obj_t
mod_os_statvfs
(
mp_obj_t
path_in
)
{
STRUCT_STATVFS
sb
;
mp_uint_t
len
;
const
char
*
path
=
mp_obj_str_get_data
(
path_in
,
&
len
);
const
char
*
path
=
mp_obj_str_get_str
(
path_in
);
int
res
=
STATVFS
(
path
,
&
sb
);
RAISE_ERRNO
(
res
,
errno
);
...
...
@@ -110,8 +108,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_os_statvfs_obj, mod_os_statvfs);
#endif
STATIC
mp_obj_t
mod_os_unlink
(
mp_obj_t
path_in
)
{
mp_uint_t
len
;
const
char
*
path
=
mp_obj_str_get_data
(
path_in
,
&
len
);
const
char
*
path
=
mp_obj_str_get_str
(
path_in
);
int
r
=
unlink
(
path
);
...
...
This diff is collapsed.
Click to expand it.
unix/modtermios.c
+
1
−
2
View file @
29424304
...
...
@@ -90,8 +90,7 @@ STATIC mp_obj_t mod_termios_tcsetattr(mp_obj_t fd_in, mp_obj_t when_in, mp_obj_t
if
(
i
==
VMIN
||
i
==
VTIME
)
{
term
.
c_cc
[
i
]
=
mp_obj_get_int
(
cc
->
items
[
i
]);
}
else
{
mp_uint_t
len
;
term
.
c_cc
[
i
]
=
*
mp_obj_str_get_data
(
cc
->
items
[
i
],
&
len
);
term
.
c_cc
[
i
]
=
*
mp_obj_str_get_str
(
cc
->
items
[
i
]);
}
}
...
...
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