summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extmod/vfs_fat.c6
-rw-r--r--extmod/vfs_lfsx.c6
-rw-r--r--extmod/vfs_posix.c18
3 files changed, 15 insertions, 15 deletions
diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c
index e7af4057b..79b0fc119 100644
--- a/extmod/vfs_fat.c
+++ b/extmod/vfs_fat.c
@@ -326,9 +326,9 @@ STATIC mp_obj_t fat_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_in) {
t->items[4] = MP_OBJ_NEW_SMALL_INT(0); // st_uid
t->items[5] = MP_OBJ_NEW_SMALL_INT(0); // st_gid
t->items[6] = mp_obj_new_int_from_uint(fno.fsize); // st_size
- t->items[7] = MP_OBJ_NEW_SMALL_INT(seconds); // st_atime
- t->items[8] = MP_OBJ_NEW_SMALL_INT(seconds); // st_mtime
- t->items[9] = MP_OBJ_NEW_SMALL_INT(seconds); // st_ctime
+ t->items[7] = mp_obj_new_int_from_uint(seconds); // st_atime
+ t->items[8] = mp_obj_new_int_from_uint(seconds); // st_mtime
+ t->items[9] = mp_obj_new_int_from_uint(seconds); // st_ctime
return MP_OBJ_FROM_PTR(t);
}
diff --git a/extmod/vfs_lfsx.c b/extmod/vfs_lfsx.c
index 511b741b0..9f5d9ce6d 100644
--- a/extmod/vfs_lfsx.c
+++ b/extmod/vfs_lfsx.c
@@ -377,9 +377,9 @@ STATIC mp_obj_t MP_VFS_LFSx(stat)(mp_obj_t self_in, mp_obj_t path_in) {
t->items[4] = MP_OBJ_NEW_SMALL_INT(0); // st_uid
t->items[5] = MP_OBJ_NEW_SMALL_INT(0); // st_gid
t->items[6] = mp_obj_new_int_from_uint(info.size); // st_size
- t->items[7] = MP_OBJ_NEW_SMALL_INT(mtime); // st_atime
- t->items[8] = MP_OBJ_NEW_SMALL_INT(mtime); // st_mtime
- t->items[9] = MP_OBJ_NEW_SMALL_INT(mtime); // st_ctime
+ t->items[7] = mp_obj_new_int_from_uint(mtime); // st_atime
+ t->items[8] = mp_obj_new_int_from_uint(mtime); // st_mtime
+ t->items[9] = mp_obj_new_int_from_uint(mtime); // st_ctime
return MP_OBJ_FROM_PTR(t);
}
diff --git a/extmod/vfs_posix.c b/extmod/vfs_posix.c
index f14f56e81..719afe28f 100644
--- a/extmod/vfs_posix.c
+++ b/extmod/vfs_posix.c
@@ -295,15 +295,15 @@ STATIC mp_obj_t vfs_posix_stat(mp_obj_t self_in, mp_obj_t path_in) {
MP_HAL_RETRY_SYSCALL(ret, stat(path, &sb), mp_raise_OSError(err));
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(10, NULL));
t->items[0] = MP_OBJ_NEW_SMALL_INT(sb.st_mode);
- t->items[1] = MP_OBJ_NEW_SMALL_INT(sb.st_ino);
- t->items[2] = MP_OBJ_NEW_SMALL_INT(sb.st_dev);
- t->items[3] = MP_OBJ_NEW_SMALL_INT(sb.st_nlink);
- t->items[4] = MP_OBJ_NEW_SMALL_INT(sb.st_uid);
- t->items[5] = MP_OBJ_NEW_SMALL_INT(sb.st_gid);
- t->items[6] = MP_OBJ_NEW_SMALL_INT(sb.st_size);
- t->items[7] = MP_OBJ_NEW_SMALL_INT(sb.st_atime);
- t->items[8] = MP_OBJ_NEW_SMALL_INT(sb.st_mtime);
- t->items[9] = MP_OBJ_NEW_SMALL_INT(sb.st_ctime);
+ t->items[1] = mp_obj_new_int_from_uint(sb.st_ino);
+ t->items[2] = mp_obj_new_int_from_uint(sb.st_dev);
+ t->items[3] = mp_obj_new_int_from_uint(sb.st_nlink);
+ t->items[4] = mp_obj_new_int_from_uint(sb.st_uid);
+ t->items[5] = mp_obj_new_int_from_uint(sb.st_gid);
+ t->items[6] = mp_obj_new_int_from_uint(sb.st_size);
+ t->items[7] = mp_obj_new_int_from_uint(sb.st_atime);
+ t->items[8] = mp_obj_new_int_from_uint(sb.st_mtime);
+ t->items[9] = mp_obj_new_int_from_uint(sb.st_ctime);
return MP_OBJ_FROM_PTR(t);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(vfs_posix_stat_obj, vfs_posix_stat);