From 27d1acd9cd27b9edbef2a0730962c65c5552d327 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 4 Dec 2024 08:24:53 +0200 Subject: [PATCH] fix compilation with latest V after https://github.com/vlang/v/pull/23061 --- common/pwd/pwd_nix.c.v | 6 +++--- src/stat/stat.v | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/pwd/pwd_nix.c.v b/common/pwd/pwd_nix.c.v index c5a1c86..bac10b7 100644 --- a/common/pwd/pwd_nix.c.v +++ b/common/pwd/pwd_nix.c.v @@ -33,7 +33,7 @@ pub fn get_uid_for_name(username string) !int { if isnil(r) { return os.error_posix() } - return r.pw_uid + return int(r.pw_uid) } pub fn get_userinfo_for_name(username string) !UserInfo { @@ -44,8 +44,8 @@ pub fn get_userinfo_for_name(username string) !UserInfo { unsafe { return UserInfo{ username: cstring_to_vstring(r.pw_name) - uid: r.pw_uid - gid: r.pw_gid + uid: int(r.pw_uid) + gid: int(r.pw_gid) } } } diff --git a/src/stat/stat.v b/src/stat/stat.v index 1e9b16e..9d9a5cb 100644 --- a/src/stat/stat.v +++ b/src/stat/stat.v @@ -97,7 +97,7 @@ fn make_dev(major u32, minor u32) u32 { } fn datetime_for_humans(ts StatxTimestamp) string { - t := time.unix_nanosecond(ts.tv_sec, ts.tv_nsec).utc_to_local() + t := time.unix_nanosecond(ts.tv_sec, int(ts.tv_nsec)).utc_to_local() return '${t.format_ss_nano()} ${dtoffset_for_humans(t)}' } @@ -176,7 +176,7 @@ fn process_token(token string, st Statx, path string, mtab []MountInfo) string { '${st.stx_gid}' } 'G' { - name := pwd.get_name_for_gid(st.stx_gid) or { 'Unknown group ${st.stx_gid}' } + name := pwd.get_name_for_gid(int(st.stx_gid)) or { 'Unknown group ${st.stx_gid}' } '${name}' } 'h' { @@ -228,7 +228,7 @@ fn process_token(token string, st Statx, path string, mtab []MountInfo) string { '${st.stx_uid}' } 'U' { - name := pwd.get_name_for_uid(st.stx_uid) or { 'Unknown user ${st.stx_uid}' } + name := pwd.get_name_for_uid(int(st.stx_uid)) or { 'Unknown user ${st.stx_uid}' } '${name}' } 'w' {