dlls/d3dx8/math.c -- simple fixup

Gerald Pfeifer gerald at pfeifer.com
Wed Nov 28 16:15:07 CST 2007


I found the following patch in my tree.  I do not recollect the original 
background, but while not a bug fix it simplifies things a bit and fixes 
indentation so I figured I'd pass it along.

Gerald

ChangeLog:
Reduce the scope of a variable and fix identation in D3DXMatrixInverse().

Index: dlls/d3dx8/math.c
===================================================================
RCS file: /home/wine/wine/dlls/d3dx8/math.c,v
retrieving revision 1.59
diff -u -3 -p -r1.59 math.c
--- dlls/d3dx8/math.c	28 Nov 2007 14:03:02 -0000	1.59
+++ dlls/d3dx8/math.c	28 Nov 2007 22:11:55 -0000
@@ -112,7 +112,7 @@ D3DXMATRIX* WINAPI D3DXMatrixInverse(D3D
 {
     int a, i, j;
     D3DXVECTOR4 v, vec[3];
-    FLOAT cofactor, det;
+    FLOAT det;
 
     det = D3DXMatrixfDeterminant(pm);
     if ( !det ) return NULL;
@@ -134,6 +134,7 @@ D3DXMATRIX* WINAPI D3DXMatrixInverse(D3D
     D3DXVec4Cross(&v, &vec[0], &vec[1], &vec[2]);
     for (j=0; j<4; j++)
     {
+     FLOAT cofactor;
      switch(j)
      {
       case 0: cofactor = v.x; break;
@@ -141,7 +142,7 @@ D3DXMATRIX* WINAPI D3DXMatrixInverse(D3D
       case 2: cofactor = v.z; break;
       case 3: cofactor = v.w; break;
      }
-    pout->u.m[j][i] = pow(-1.0f, i) * cofactor / det;
+     pout->u.m[j][i] = pow(-1.0f, i) * cofactor / det;
     }
    }
     return pout;



More information about the wine-patches mailing list