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

checker: require unsafe for Struct(voidptr) casts

This commit is contained in:
Alexander Medvednikov
2023-01-06 09:28:01 +03:00
parent 0146509516
commit 868908b80d
25 changed files with 64 additions and 83 deletions

View File

@@ -656,9 +656,8 @@ pub:
// interpolation function
[direct_array_access; manualfree]
pub fn str_intp(data_len int, in_data voidptr) string {
pub fn str_intp(data_len int, input_base &StrIntpData) string {
mut res := strings.new_builder(256)
input_base := &StrIntpData(in_data)
for i := 0; i < data_len; i++ {
data := unsafe { &input_base[i] }
// avoid empty strings