summaryrefslogtreecommitdiffstatshomepage
path: root/unix/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/file.c')
-rw-r--r--unix/file.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/unix/file.c b/unix/file.c
index 386f018bdd..62e3253b7d 100644
--- a/unix/file.c
+++ b/unix/file.c
@@ -62,20 +62,20 @@ STATIC void fdfile_print(void (*print)(void *env, const char *fmt, ...), void *e
print(env, "<io.%s %d>", mp_obj_get_type_str(self), self->fd);
}
-STATIC machine_int_t fdfile_read(mp_obj_t o_in, void *buf, machine_uint_t size, int *errcode) {
+STATIC mp_int_t fdfile_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errcode) {
mp_obj_fdfile_t *o = o_in;
check_fd_is_open(o);
- machine_int_t r = read(o->fd, buf, size);
+ mp_int_t r = read(o->fd, buf, size);
if (r == -1) {
*errcode = errno;
}
return r;
}
-STATIC machine_int_t fdfile_write(mp_obj_t o_in, const void *buf, machine_uint_t size, int *errcode) {
+STATIC mp_int_t fdfile_write(mp_obj_t o_in, const void *buf, mp_uint_t size, int *errcode) {
mp_obj_fdfile_t *o = o_in;
check_fd_is_open(o);
- machine_int_t r = write(o->fd, buf, size);
+ mp_int_t r = write(o->fd, buf, size);
if (r == -1) {
*errcode = errno;
}
@@ -100,7 +100,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((machine_int_t)self->fd);
+ return MP_OBJ_NEW_SMALL_INT((mp_int_t)self->fd);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(fdfile_fileno_obj, fdfile_fileno);
@@ -153,7 +153,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((machine_int_t)errno)));
+ nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT((mp_int_t)errno)));
}
o->fd = fd;
return o;