mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: change f mut Foo
to mut f Foo
This commit is contained in:
@@ -32,7 +32,7 @@ pub mut:
|
||||
s []Position
|
||||
}
|
||||
|
||||
fn advance(sys mut System, dt f64) {
|
||||
fn advance(mut sys System, dt f64) {
|
||||
for i in 0..c_n - 1 {
|
||||
mut vx := sys.v[i].x
|
||||
mut vy := sys.v[i].y
|
||||
@@ -68,7 +68,7 @@ fn advance(sys mut System, dt f64) {
|
||||
}
|
||||
}
|
||||
|
||||
fn offsetmomentum(sys mut System) {
|
||||
fn offsetmomentum(mut sys System) {
|
||||
mut px := f64(0)
|
||||
mut py := f64(0)
|
||||
mut pz := f64(0)
|
||||
|
@@ -20,7 +20,7 @@ fn hello_response() string {
|
||||
}
|
||||
|
||||
|
||||
fn callback(req picohttpparser.Request, res mut picohttpparser.Response) {
|
||||
fn callback(req picohttpparser.Request, mut res picohttpparser.Response) {
|
||||
if picohttpparser.cmpn(req.method, 'GET ', 4) {
|
||||
if picohttpparser.cmp(req.path, '/t') {
|
||||
res.http_ok().header_server().header_date().plain().body(hello_response())
|
||||
|
@@ -19,7 +19,7 @@ fn main() {
|
||||
println('after quick sort whether array is sorted: ${is_sorted(arr)}')
|
||||
}
|
||||
|
||||
fn quick_sort(arr mut []int, l int, r int) {
|
||||
fn quick_sort(mut arr []int, l int, r int) {
|
||||
if l>=r { return }
|
||||
mut sep := l // what is sep: [...all_value<arr[sep]...sep...all_value>=arr[sep]...]
|
||||
for i in l+1..r+1 {
|
||||
@@ -34,7 +34,7 @@ fn quick_sort(arr mut []int, l int, r int) {
|
||||
}
|
||||
|
||||
[inline]
|
||||
fn swap(arr mut []int, i int, j int) {
|
||||
fn swap(mut arr []int, i int, j int) {
|
||||
temp := arr[i]
|
||||
arr[i] = arr[j]
|
||||
arr[j] = temp
|
||||
|
@@ -38,7 +38,7 @@ fn main() {
|
||||
sapp.run(&desc)
|
||||
}
|
||||
|
||||
fn init(state mut AppState) {
|
||||
fn init(mut state AppState) {
|
||||
// dont actually alocate this on the heap in real life
|
||||
gfx.setup(&C.sg_desc{
|
||||
mtl_device: sapp.metal_get_device()
|
||||
|
@@ -18,7 +18,7 @@ fn evala(i, j int) int {
|
||||
return ((i + j) * (i + j + 1) / 2 + i + 1)
|
||||
}
|
||||
|
||||
fn times(v mut []f64, u []f64) {
|
||||
fn times(mut v []f64, u []f64) {
|
||||
for i in 0..v.len {
|
||||
mut a := f64(0)
|
||||
for j in 0..u.len {
|
||||
@@ -28,7 +28,7 @@ fn times(v mut []f64, u []f64) {
|
||||
}
|
||||
}
|
||||
|
||||
fn times_trans(v mut []f64, u []f64) {
|
||||
fn times_trans(mut v []f64, u []f64) {
|
||||
for i in 0..v.len {
|
||||
mut a := f64(0)
|
||||
for j in 0..u.len {
|
||||
@@ -38,7 +38,7 @@ fn times_trans(v mut []f64, u []f64) {
|
||||
}
|
||||
}
|
||||
|
||||
fn a_times_transp(v mut []f64, u []f64) {
|
||||
fn a_times_transp(mut v []f64, u []f64) {
|
||||
mut x := []f64{len:u.len, init:0}
|
||||
times(mut x, u)
|
||||
times_trans(mut v, x)
|
||||
@@ -69,4 +69,3 @@ fn main() {
|
||||
ans := math.sqrt(vbv / vv)
|
||||
println('${ans:0.9f}')
|
||||
}
|
||||
|
||||
|
@@ -402,7 +402,7 @@ fn parse_binary_tetro(t_ int) []Block {
|
||||
return res
|
||||
}
|
||||
|
||||
fn on_event(e &sapp.Event, game mut Game) {
|
||||
fn on_event(e &sapp.Event, mut game Game) {
|
||||
if e.typ == .key_down {
|
||||
game.key_down(e.key_code)
|
||||
}
|
||||
|
Reference in New Issue
Block a user