mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: fix most C warnings (#6758)
This commit is contained in:
@@ -142,7 +142,7 @@ pub fn (mut f File) get_line() ?string {
|
||||
mut zblen := size_t(0)
|
||||
mut zx := 0
|
||||
unsafe {
|
||||
zx = C.getline(&zbuf, &zblen, f.cfile)
|
||||
zx = C.getline(&charptr(&zbuf), &zblen, f.cfile)
|
||||
if zx == -1 {
|
||||
C.free(zbuf)
|
||||
if C.errno == 0 {
|
||||
@@ -160,7 +160,7 @@ pub fn (mut f File) get_line() ?string {
|
||||
//
|
||||
buf := [4096]byte{}
|
||||
mut res := strings.new_builder(1024)
|
||||
mut x := 0
|
||||
mut x := charptr(0)
|
||||
for {
|
||||
unsafe {
|
||||
x = C.fgets(charptr(buf), 4096, f.cfile)
|
||||
|
@@ -252,7 +252,7 @@ pub fn is_writable_folder(folder string) ?bool {
|
||||
}
|
||||
tmp_perm_check := os.join_path(folder, 'XXXXXX')
|
||||
unsafe {
|
||||
x := C.mkstemp(tmp_perm_check.str)
|
||||
x := C.mkstemp(charptr(tmp_perm_check.str))
|
||||
if -1 == x {
|
||||
return error('folder `$folder` is not writable')
|
||||
}
|
||||
|
Reference in New Issue
Block a user