From 28cf404a251add04b15a1f8be1737795bcc587ec Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 31 Jul 2006 14:49:36 +0000 Subject: [PATCH] Tweaked the invert() method to avoid silly OSX warnings. --- include/osg/Matrixd | 6 ++---- include/osg/Matrixf | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/osg/Matrixd b/include/osg/Matrixd index 80b0540fc..6b4dfc426 100644 --- a/include/osg/Matrixd +++ b/include/osg/Matrixd @@ -200,10 +200,8 @@ class OSG_EXPORT Matrixd /** invert the matrix rhs, automatically select invert_4x3 or invert_4x4. */ inline bool invert( const Matrixd& rhs) { - if (rhs._mat[0][3]==0.0 && rhs._mat[1][3]==0.0 && rhs._mat[2][3]==0.0 && rhs._mat[3][3]==1.0) - return invert_4x3(rhs); - else - return invert_4x4(rhs); + bool is_4x3 = (rhs._mat[0][3]==0.0 && rhs._mat[1][3]==0.0 && rhs._mat[2][3]==0.0 && rhs._mat[3][3]==1.0); + return is_4x3 ? invert_4x3(rhs) : invert_4x4(rhs); } /** 4x3 matrix invert, not right hand column is assumed to be 0,0,0,1. */ diff --git a/include/osg/Matrixf b/include/osg/Matrixf index 19342948d..b68f5301a 100644 --- a/include/osg/Matrixf +++ b/include/osg/Matrixf @@ -200,10 +200,8 @@ class OSG_EXPORT Matrixf /** invert the matrix rhs, automatically select invert_4x3 or invert_4x4. */ inline bool invert( const Matrixf& rhs) { - if (rhs._mat[0][3]==0.0 && rhs._mat[1][3]==0.0 && rhs._mat[2][3]==0.0 && rhs._mat[3][3]==1.0) - return invert_4x3(rhs); - else - return invert_4x4(rhs); + bool is_4x3 = (rhs._mat[0][3]==0.0f && rhs._mat[1][3]==0.0f && rhs._mat[2][3]==0.0f && rhs._mat[3][3]==1.0f); + return is_4x3 ? invert_4x3(rhs) : invert_4x4(rhs); } /** 4x3 matrix invert, not right hand column is assumed to be 0,0,0,1. */