diff options
author | Damien George <damien.p.george@gmail.com> | 2017-03-25 19:54:07 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-03-25 19:54:07 +1100 |
commit | 29424304d9837339d31e1c276ebd39df46c44eb9 (patch) | |
tree | 2f616f7b644352630dd362a1404d5a5c9a94693e | |
parent | ab5689bc9df27d481c08f8087bf6c4f12b881255 (diff) | |
download | micropython-29424304d9837339d31e1c276ebd39df46c44eb9.tar.gz micropython-29424304d9837339d31e1c276ebd39df46c44eb9.zip |
unix: Use mp_obj_str_get_str instead of mp_obj_str_get_data.
-rw-r--r-- | unix/modffi.c | 3 | ||||
-rw-r--r-- | unix/modos.c | 9 | ||||
-rw-r--r-- | unix/modtermios.c | 3 |
3 files changed, 5 insertions, 10 deletions
diff --git a/unix/modffi.c b/unix/modffi.c index 74194e2cc0..7a35d61ef4 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -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; diff --git a/unix/modos.c b/unix/modos.c index d6e6a8fb31..8e746c1637 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -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); diff --git a/unix/modtermios.c b/unix/modtermios.c index 2cb5f26df5..5e82e772ac 100644 --- a/unix/modtermios.c +++ b/unix/modtermios.c @@ -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]); } } |