mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix warnings (#5820)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// that can be found in the LICENSE file.
|
||||
module os
|
||||
|
||||
fn C.getenv(byteptr) &char
|
||||
fn C.getenv(charptr) &char
|
||||
// C.GetEnvironmentStringsW & C.FreeEnvironmentStringsW are defined only on windows
|
||||
fn C.GetEnvironmentStringsW() &u16
|
||||
|
||||
@@ -18,7 +18,7 @@ pub fn getenv(key string) string {
|
||||
}
|
||||
return string_from_wide(s)
|
||||
} $else {
|
||||
s := C.getenv(key.str)
|
||||
s := C.getenv(charptr(key.str))
|
||||
if s == voidptr(0) {
|
||||
return ''
|
||||
}
|
||||
@@ -36,7 +36,7 @@ pub fn setenv(name string, value string, overwrite bool) int {
|
||||
}
|
||||
return -1
|
||||
} $else {
|
||||
return C.setenv(name.str, value.str, overwrite)
|
||||
return C.setenv(charptr(name.str), charptr(value.str), overwrite)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ pub fn unsetenv(name string) int {
|
||||
format := '${name}='
|
||||
return C._putenv(format.str)
|
||||
} $else {
|
||||
return C.unsetenv(name.str)
|
||||
return C.unsetenv(charptr(name.str))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ pub fn environ() map[string]string {
|
||||
} $else {
|
||||
e := &charptr(C.environ)
|
||||
for i := 0; !isnil(e[i]); i++ {
|
||||
eline := cstring_to_vstring(e[i])
|
||||
eline := cstring_to_vstring(byteptr(e[i]))
|
||||
eq_index := eline.index_byte(`=`)
|
||||
if eq_index > 0 {
|
||||
res[eline[0..eq_index]] = eline[eq_index + 1..]
|
||||
|
||||
Reference in New Issue
Block a user