From f92cf69e6054171eaffd010b49138fcdf47ccfcc Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Sat, 25 Apr 2020 18:09:52 +1000 Subject: [PATCH] parser: allow deref assign without parens pt2 update vlib --- examples/game_of_life/modules/automaton/automaton.v | 2 +- vlib/hash/wyhash/rand.v | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/game_of_life/modules/automaton/automaton.v b/examples/game_of_life/modules/automaton/automaton.v index 458b996b1b..af3fc88e37 100644 --- a/examples/game_of_life/modules/automaton/automaton.v +++ b/examples/game_of_life/modules/automaton/automaton.v @@ -12,7 +12,7 @@ pub mut: unsafe { mut e := &int(0) e = a.data + y*a.maxx + x - (*e) = newval + *e = newval } } [inline] pub fn (a &A2D) get(x,y int) int { diff --git a/vlib/hash/wyhash/rand.v b/vlib/hash/wyhash/rand.v index 38a675d939..0583a905dc 100644 --- a/vlib/hash/wyhash/rand.v +++ b/vlib/hash/wyhash/rand.v @@ -7,8 +7,8 @@ pub fn rand_u64(seed &u64) u64 { mut seed0 := seed unsafe{ mut seed1 := *seed0 - seed1 += (wyp0) - (*seed0) = seed1 + seed1 += wyp0 + *seed0 = seed1 return wymum(seed1^wyp1, seed1) } return 0