mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib: add [unsafe] tag to more functions: tos, string_from_wide, strings.Builder: write_bytes, free (#8766)
This commit is contained in:
@@ -29,8 +29,10 @@ pub const (
|
||||
pub fn vhash() string {
|
||||
mut buf := [50]byte{}
|
||||
buf[0] = 0
|
||||
unsafe { C.snprintf(charptr(buf), 50, '%s', C.V_COMMIT_HASH) }
|
||||
return tos_clone(buf)
|
||||
unsafe {
|
||||
C.snprintf(charptr(buf), 50, '%s', C.V_COMMIT_HASH)
|
||||
return tos_clone(buf)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn full_hash() string {
|
||||
@@ -95,8 +97,10 @@ pub fn githash(should_get_from_filesystem bool) string {
|
||||
}
|
||||
mut buf := [50]byte{}
|
||||
buf[0] = 0
|
||||
unsafe { C.snprintf(charptr(buf), 50, '%s', C.V_CURRENT_COMMIT_HASH) }
|
||||
return tos_clone(buf)
|
||||
unsafe {
|
||||
C.snprintf(charptr(buf), 50, '%s', C.V_CURRENT_COMMIT_HASH)
|
||||
return tos_clone(buf)
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user