diff options
author | Damien George <damien.p.george@gmail.com> | 2014-07-31 13:47:06 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-07-31 13:47:06 +0000 |
commit | 8cc2018d47bc15a1b10295965fc0ccd27c0dcbba (patch) | |
tree | 5e8ba4bed5de1f1973203b9cff2c8aab78b419fc /unix/file.c | |
parent | c9aa58e6381018cca2513e3468363af0b5442d1f (diff) | |
parent | bb4c6f35c627ab3487cdd6bafb4588cc633cd6a4 (diff) |
Merge branch 'master' of https://github.com/micropython/micropython
Diffstat (limited to 'unix/file.c')
-rw-r--r-- | unix/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/file.c b/unix/file.c index cdec1ad1a..76a44e187 100644 --- a/unix/file.c +++ b/unix/file.c @@ -114,7 +114,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(fdfile___exit___obj, 4, 4, fdfile___e STATIC mp_obj_t fdfile_fileno(mp_obj_t self_in) { mp_obj_fdfile_t *self = self_in; check_fd_is_open(self); - return MP_OBJ_NEW_SMALL_INT((mp_int_t)self->fd); + return MP_OBJ_NEW_SMALL_INT(self->fd); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(fdfile_fileno_obj, fdfile_fileno); @@ -167,7 +167,7 @@ STATIC mp_obj_t fdfile_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const const char *fname = mp_obj_str_get_str(args[0]); int fd = open(fname, mode, 0644); if (fd == -1) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT((mp_int_t)errno))); + nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno))); } o->fd = fd; return o; |