1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

more C warnings fixed

This commit is contained in:
Alexander Medvednikov
2019-09-15 15:36:05 +03:00
parent e3bd72e8e2
commit 849bef987c
9 changed files with 30 additions and 25 deletions

View File

@@ -22,6 +22,10 @@ pub:
// For C strings only
fn C.strlen(s byteptr) int
pub fn vstrlen(s byteptr) int {
return C.strlen(*char(s))
}
fn todo() { }
// Converts a C string to a V string.
@@ -50,7 +54,7 @@ fn tos2(s byteptr) string {
if isnil(s) {
panic('tos2: nil string')
}
len := C.strlen(s)
len := vstrlen(s)
res := tos(s, len)
return res
}