Skip to content

Commit

Permalink
os: remove mut declarions for unchanged vars in os_nix.c.v (#21564)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed May 25, 2024
1 parent c9e6a12 commit 14018f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vlib/os/os_nix.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ fn glob_match(dir string, pattern string, next_pattern string, mut matches []str

fn native_glob_pattern(pattern string, mut matches []string) ! {
steps := pattern.split(os.path_separator)
mut cwd := if pattern.starts_with(os.path_separator) { os.path_separator } else { '.' }
cwd := if pattern.starts_with(os.path_separator) { os.path_separator } else { '.' }
mut subdirs := [cwd]
for i := 0; i < steps.len; i++ {
step := steps[i]
Expand Down Expand Up @@ -214,7 +214,7 @@ fn native_glob_pattern(pattern string, mut matches []string) ! {
}

pub fn utime(path string, actime int, modtime int) ! {
mut u := C.utimbuf{actime, modtime}
u := C.utimbuf{actime, modtime}
if C.utime(&char(path.str), voidptr(&u)) != 0 {
return error_with_code(posix_get_error_msg(C.errno), C.errno)
}
Expand Down Expand Up @@ -257,7 +257,7 @@ pub fn uname() Uname {
pub fn hostname() !string {
mut hstnme := ''
size := 256
mut buf := unsafe { &char(malloc_noscan(size)) }
buf := unsafe { &char(malloc_noscan(size)) }
if C.gethostname(buf, size) == 0 {
hstnme = unsafe { cstring_to_vstring(buf) }
unsafe { free(buf) }
Expand Down

0 comments on commit 14018f1

Please sign in to comment.