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

ui: cleanup warnings from glm module

This commit is contained in:
Delyan Angelov 2020-02-21 13:20:59 +02:00 committed by GitHub
parent 6b706a0c99
commit d90a291c5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,7 +131,7 @@ fn rotate(m Mat4, angle f32, vec Vec3) Mat4 {
*/ */
fn f32_calloc(n int) &f32 { fn f32_calloc(n int) &f32 {
return *f32(calloc(n * sizeof(f32))) return &f32(calloc(n * sizeof(f32)))
} }
// fn translate(vec Vec3) *f32 { // fn translate(vec Vec3) *f32 {
pub fn translate(m Mat4, v Vec3) Mat4 { pub fn translate(m Mat4, v Vec3) Mat4 {
@ -277,7 +277,8 @@ fn ortho_js(left, right, bottom, top f32) &f32 {
lr := 1.0 / (left - right) lr := 1.0 / (left - right)
bt := 1.0 / (bottom - top) bt := 1.0 / (bottom - top)
nf := 1.0 / 1.0// (mynear -myfar) nf := 1.0 / 1.0// (mynear -myfar)
mut out := (*f32)( malloc (sizeof(f32) * 16)) mut out := &f32(0)
unsafe { out = &f32( malloc (sizeof(f32) * 16)) }
out[0] = -2.0 * lr out[0] = -2.0 * lr
out[1] = 0 out[1] = 0
out[2] = 0 out[2] = 0