mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
checker: check unsafe
V function calls (#8752)
This commit is contained in:
parent
d3bcd5d305
commit
ea803113c3
36 changed files with 200 additions and 161 deletions
|
@ -106,8 +106,8 @@ fn (mut m SortedMap) set(key string, value voidptr) {
|
|||
j--
|
||||
}
|
||||
node.keys[j + 1] = key
|
||||
node.values[j + 1] = malloc(m.value_bytes)
|
||||
unsafe {
|
||||
node.values[j + 1] = malloc(m.value_bytes)
|
||||
C.memcpy(node.values[j + 1], value, m.value_bytes)
|
||||
}
|
||||
node.len++
|
||||
|
@ -129,17 +129,17 @@ fn (mut n mapnode) split_child(child_index int, mut y mapnode) {
|
|||
z.values[j] = y.values[j + degree]
|
||||
}
|
||||
if !isnil(y.children) {
|
||||
z.children = &voidptr(malloc(int(children_bytes)))
|
||||
z.children = unsafe {&voidptr(malloc(int(children_bytes)))}
|
||||
for jj := degree - 1; jj >= 0; jj-- {
|
||||
unsafe {
|
||||
z.children[jj] = y.children[jj + degree]
|
||||
}
|
||||
}
|
||||
}
|
||||
if isnil(n.children) {
|
||||
n.children = &voidptr(malloc(int(children_bytes)))
|
||||
}
|
||||
unsafe {
|
||||
if isnil(n.children) {
|
||||
n.children = &voidptr(malloc(int(children_bytes)))
|
||||
}
|
||||
n.children[n.len + 1] = n.children[n.len]
|
||||
}
|
||||
for j := n.len; j > child_index; j-- {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue