Skip to content

Commit

Permalink
fix compilation with latest V after vlang/v#23061
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Dec 4, 2024
1 parent 13a874e commit 27d1acd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions common/pwd/pwd_nix.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/stat/stat.v
Original file line number Diff line number Diff line change
Expand Up @@ -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)}'
}

Expand Down Expand Up @@ -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' {
Expand Down Expand Up @@ -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' {
Expand Down

0 comments on commit 27d1acd

Please sign in to comment.