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

checker: disallow struct int to ptr outside unsafe (#17923)

This commit is contained in:
Swastik Baranwal
2023-04-13 11:08:21 +05:30
committed by GitHub
parent 92cb7468ce
commit 3d99f1f2c2
36 changed files with 124 additions and 47 deletions

View File

@@ -28,7 +28,7 @@ pub fn (mut s System) init(sc SystemConfig) {
}
pub fn (mut s System) update(dt f64) {
mut p := &Particle(0)
mut p := &Particle(unsafe { nil })
mut moved := 0
for i := 0; i < s.pool.len; i++ {
p = s.pool[i]
@@ -70,7 +70,7 @@ pub fn (mut s System) reset() {
pub fn (mut s System) explode(x f32, y f32) {
mut reserve := 500
center := vec.Vec2[f64]{x, y}
mut p := &Particle(0)
mut p := &Particle(unsafe { nil })
mut moved := 0
for i := 0; i < s.bin.len && reserve > 0; i++ {
p = s.bin[i]