diff options
author | Damien George <damien.p.george@gmail.com> | 2014-07-31 10:49:14 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-07-31 10:49:14 +0100 |
commit | bb4c6f35c627ab3487cdd6bafb4588cc633cd6a4 (patch) | |
tree | 6177f71ef43916008070e625f6eea0c7834f8c48 /unix/file.c | |
parent | fa1ecda3fdaecd89b86bb63930a6521c8f63fe90 (diff) | |
download | micropython-bb4c6f35c627ab3487cdd6bafb4588cc633cd6a4.tar.gz micropython-bb4c6f35c627ab3487cdd6bafb4588cc633cd6a4.zip |
py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.
Addresses issue #724.
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 cdec1ad1af..76a44e187c 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; |