1
0
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:
ka-weihe
2020-07-14 00:16:31 +02:00
committed by GitHub
parent 042add0e7f
commit df45488e09
14 changed files with 59 additions and 55 deletions

View File

@ -94,7 +94,7 @@ fn print_backtrace_skipping_top_frames_linux(skipframes int) bool {
beforeaddr := sframe.all_before('[')
cmd := 'addr2line -e $executable $addr'
// taken from os, to avoid depending on the os module inside builtin.v
f := C.popen(cmd.str, 'r')
f := C.popen(charptr(cmd.str), 'r')
if isnil(f) {
eprintln(sframe)
continue

View File

@ -3,7 +3,7 @@ module builtin
// <string.h>
fn C.memcpy(byteptr, byteptr, int) voidptr
fn C.memcmp(byteptr, byteptr, int) int
fn C.memmove(byteptr, byteptr, int) voidptr
fn C.calloc(int) byteptr
fn C.malloc(int) byteptr
@ -18,13 +18,13 @@ fn C.qsort(voidptr, int, int, qsort_callback_func)
fn C.sprintf(a ...voidptr) int
fn C.strlen(s byteptr) int
fn C.strlen(s charptr) int
fn C.sscanf(byteptr, byteptr,...byteptr) int
fn C.isdigit(s byteptr) bool
// stdio.h
fn C.popen(c byteptr, t byteptr) voidptr
fn C.popen(c charptr, t charptr) voidptr
// <execinfo.h>
fn C.backtrace(a &voidptr, size int) int
@ -35,7 +35,7 @@ fn C.backtrace_symbols_fd(a &voidptr, size int, fd int)
pub fn proc_pidpath(int, voidptr, int) int
fn C.realpath(byteptr, byteptr) &char
fn C.realpath(charptr, charptr) &char
fn C.chmod(byteptr, int) int
@ -71,10 +71,10 @@ fn C.pclose() int
fn C.system() int
fn C.setenv() int
fn C.setenv(charptr) int
fn C.unsetenv() int
fn C.unsetenv(charptr) int
fn C.access() int
@ -95,7 +95,7 @@ fn C.fread() int
fn C.rewind() int
fn C.stat() int
fn C.stat(charptr) int
fn C.lstat() int

View File

@ -6,8 +6,6 @@ module builtin
import strings
import hash.wyhash
fn C.memcmp(byteptr, byteptr, int) int
/*
This is a highly optimized hashmap implementation. It has several traits that
in combination makes it very fast and memory efficient. Here is a short expl-

View File

@ -149,7 +149,7 @@ pub fn (s string) cstr() byteptr {
// cstring_to_vstring creates a copy of cstr and turns it into a v string
pub fn cstring_to_vstring(cstr byteptr) string {
slen := C.strlen(cstr)
slen := C.strlen(charptr(cstr))
mut s := byteptr(memdup(cstr, slen + 1))
s[slen] = `\0`
return tos(s, slen)