From bdd78c31b68db5323796d93e0a17159806ce10fc Mon Sep 17 00:00:00 2001 From: blmorris Date: Tue, 4 Aug 2015 19:45:30 -0400 Subject: py: Add stream_tell method, and use for unix and stmhal file tell. --- stmhal/file.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'stmhal/file.c') diff --git a/stmhal/file.c b/stmhal/file.c index d09d0a0a8..d7d8009b3 100644 --- a/stmhal/file.c +++ b/stmhal/file.c @@ -148,12 +148,6 @@ STATIC mp_uint_t file_obj_ioctl(mp_obj_t o_in, mp_uint_t request, mp_uint_t arg, } } -mp_obj_t file_obj_tell(mp_obj_t self_in) { - pyb_file_obj_t *self = self_in; - return mp_obj_new_int_from_uint(f_tell(&self->fp)); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(file_obj_tell_obj, file_obj_tell); - // Note: encoding is ignored for now; it's also not a valid kwarg for CPython's FileIO, // but by adding it here we can use one single mp_arg_t array for open() and FileIO's constructor STATIC const mp_arg_t file_open_args[] = { @@ -231,7 +225,7 @@ STATIC const mp_map_elem_t rawfile_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_flush), (mp_obj_t)&file_obj_flush_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_close), (mp_obj_t)&file_obj_close_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_seek), (mp_obj_t)&mp_stream_seek_obj }, - { MP_OBJ_NEW_QSTR(MP_QSTR_tell), (mp_obj_t)&file_obj_tell_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_tell), (mp_obj_t)&mp_stream_tell_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR___del__), (mp_obj_t)&file_obj_close_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR___enter__), (mp_obj_t)&mp_identity_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR___exit__), (mp_obj_t)&file_obj___exit___obj }, -- cgit v1.2.3