From 17f299c5d14f0435595afe51c4153ae4037bb81b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 6 Aug 2019 04:34:54 +1000 Subject: Cleanup: quiet cast warnings in recent commit --- source/blender/blenlib/intern/math_geom.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 6f71551d4a0..b4a96ff316a 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -4481,7 +4481,8 @@ void projmat_dimensions(const float projmat[4][4], } } -/* Creates a projection matrix for a small region of the viewport. +/** + * Creates a projection matrix for a small region of the viewport. * * \param projmat: Projection Matrix. * \param win_size: Viewport Size. @@ -4499,12 +4500,12 @@ void projmat_from_subregion(const float projmat[4][4], float rect_width = (float)(x_max - x_min); float rect_height = (float)(y_max - y_min); - float x_fac = ((x_min + x_max) - win_size[0]) / rect_width; - float y_fac = ((y_min + y_max) - win_size[1]) / rect_height; + float x_fac = (float)((x_min + x_max) - win_size[0]) / rect_width; + float y_fac = (float)((y_min + y_max) - win_size[1]) / rect_height; copy_m4_m4(r_projmat, projmat); - r_projmat[0][0] *= (win_size[0] / rect_width); - r_projmat[1][1] *= (win_size[1] / rect_height); + r_projmat[0][0] *= (float)win_size[0] / rect_width; + r_projmat[1][1] *= (float)win_size[1] / rect_height; #if 0 /* TODO: check if this is more efficient. */ r_projmat[2][0] -= x_fac * r_projmat[2][3]; -- cgit v1.2.3