1
0
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:
spaceface777
2020-11-06 15:26:59 +01:00
committed by GitHub
parent 98e8894d90
commit a9e9554b11
16 changed files with 89 additions and 90 deletions

View File

@@ -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)

View File

@@ -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')
}