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

checker: improve checking of a << b, when a and b are numbers (#12589)

This commit is contained in:
Delyan Angelov
2021-11-29 02:48:49 +02:00
committed by GitHub
parent fe37da31a8
commit 6d97b0a407
33 changed files with 436 additions and 148 deletions

View File

@ -88,7 +88,7 @@ pub fn (x Mat4) get_e(elem_index int) f32 {
// Get an element of the matrix using [0..3][0..3] indexes, two dimension
pub fn (x Mat4) get_f(index_col int, index_row int) f32 {
unsafe {
return x.e[(index_row << 2) + index_col]
return x.e[int(u32(index_row) << 2) + index_col]
}
}
@ -102,7 +102,7 @@ pub fn (mut x Mat4) set_e(index int, value f32) {
// Set an element of the matrix using [0..3][0..3] indexes, two dimension
pub fn (mut x Mat4) set_f(index_col int, index_row int, value f32) {
unsafe {
x.e[(index_row << 2) + index_col] = value
x.e[int(u32(index_row) << 2) + index_col] = value
}
}