mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
unsafe: tag with unsafe{} some more pointer manipulations
This commit is contained in:
@@ -2,17 +2,17 @@ module picohttpparser
|
||||
|
||||
[inline] [unsafe_fn]
|
||||
fn cpy(dst, src byteptr, len int) int {
|
||||
C.memcpy(dst, src, len)
|
||||
unsafe { C.memcpy(dst, src, len) }
|
||||
return len
|
||||
}
|
||||
|
||||
[inline]
|
||||
pub fn cmp(dst, src string) bool {
|
||||
if dst.len != src.len { return false }
|
||||
return C.memcmp(dst.str, src.str, src.len) == 0
|
||||
return unsafe { C.memcmp(dst.str, src.str, src.len) == 0 }
|
||||
}
|
||||
|
||||
[inline]
|
||||
pub fn cmpn(dst, src string, n int) bool {
|
||||
return C.memcmp(dst.str, src.str, n) == 0
|
||||
return unsafe { C.memcmp(dst.str, src.str, n) == 0 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user