glu: fix two Clang warnings
authorLukas Rössler <pontomedon@gmail.com>
Mon, 21 May 2012 14:29:21 +0000 (08:29 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 21 May 2012 14:29:23 +0000 (08:29 -0600)
This patch removes two Clang warnings in GLU:

The first one seems to be an actual bug in mapdesc.cc: Clang complains
that sizeof(dest) will return the size of REAL*[MAXCOORDS], instead of
the intended REAL[MAXCOORDS][MAXCOORDS]. The second one is just
cosmetic because Clang doesn't like extra parentheses.

NOTE: This is a candidate for the 8.0 branch

Reviewed-by: Brian Paul <brianp@vmware.com>
src/glu/sgi/libnurbs/internals/mapdesc.cc
src/glu/sgi/libnurbs/internals/nurbstess.cc

index d59f8fd..0a96c5f 100644 (file)
@@ -90,7 +90,7 @@ Mapdesc::setBboxsize( INREAL *mat )
 void
 Mapdesc::identify( REAL dest[MAXCOORDS][MAXCOORDS] )
 {
-    memset( dest, 0, sizeof( dest ) );
+    memset( dest, 0, sizeof( REAL ) * MAXCOORDS * MAXCOORDS );
     for( int i=0; i != hcoords; i++ )
        dest[i][i] = 1.0;
 }
index 68dfd95..e477a8c 100644 (file)
@@ -505,7 +505,7 @@ NurbsTessellator::do_pwlcurve( O_pwlcurve *o_pwlcurve )
        o_pwlcurve->owner = currentCurve;
     }
 
-    if( (inCurve == 2) ) 
+    if( inCurve == 2 ) 
        endcurve();
 }