Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: remove mut declarations for unchanged vars in os_nix.c.v #21564

Merged
merged 1 commit into from
May 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading