From 679761983d129653874302e9f0eddeeaa5012841 Mon Sep 17 00:00:00 2001 From: Shell Date: Wed, 28 Aug 2024 21:32:10 +0800 Subject: [PATCH] fixup: ptyfs: CI reported snprintf type issues --- components/dfs/dfs_v2/filesystems/ptyfs/ptyfs.c | 4 ++-- components/lwp/syscall_generic.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/dfs/dfs_v2/filesystems/ptyfs/ptyfs.c b/components/dfs/dfs_v2/filesystems/ptyfs/ptyfs.c index c6f4f3d52d..75bffdf510 100644 --- a/components/dfs/dfs_v2/filesystems/ptyfs/ptyfs.c +++ b/components/dfs/dfs_v2/filesystems/ptyfs/ptyfs.c @@ -262,7 +262,7 @@ ptsno_t ptyfs_register_pts(rt_device_t ptmx, rt_device_t pts) pts_file = rt_calloc(1, sizeof(struct ptyfs_file)); if (pts_file) { - snprintf(pts_file->basename, DIRENT_NAME_MAX, "%lu", rc); + snprintf(pts_file->basename, DIRENT_NAME_MAX, "%lu", (unsigned long)rc); ptyfile_init(pts_file, sb, 0, PTYFS_TYPE_FILE_SLAVE, PTS_DEFAULT_FILE_MODE, pts); ptyfile_add_to_root(sb, pts_file); @@ -296,7 +296,7 @@ rt_err_t ptyfs_unregister_pts(rt_device_t ptmx, ptsno_t ptsno) else { /* get path and findout device */ - snprintf(path_buf, sizeof(path_buf), "%lu", ptsno); + snprintf(path_buf, sizeof(path_buf), "%lu", (unsigned long)ptsno); pts_file = ptyfile_lookup(sb, path_buf); if (pts_file) { diff --git a/components/lwp/syscall_generic.h b/components/lwp/syscall_generic.h index a589b6fcdd..5d8287372c 100644 --- a/components/lwp/syscall_generic.h +++ b/components/lwp/syscall_generic.h @@ -16,7 +16,8 @@ #include #include -typedef long sysret_t; +/* signed ARCH related types */ +typedef rt_base_t sysret_t; struct rt_syscall_def {