[Mesa-dev] [PATCH] Removed two Clang Warnings in GLU

Brian Paul brianp at vmware.com
Mon May 21 07:25:39 PDT 2012


On 05/21/2012 05:14 AM, Lukas Rössler wrote:
> Hi, i hope this is the right place to send a small patch to.
>
> 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.
>
> greetings,
> Lukas
>
> ---
> src/glu/sgi/libnurbs/internals/mapdesc.cc | 2 +-
> src/glu/sgi/libnurbs/internals/nurbstess.cc | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/glu/sgi/libnurbs/internals/mapdesc.cc
> b/src/glu/sgi/libnurbs/internals/mapdesc.cc
> index d59f8fd..0a96c5f 100644
> --- a/src/glu/sgi/libnurbs/internals/mapdesc.cc
> +++ b/src/glu/sgi/libnurbs/internals/mapdesc.cc
> @@ -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;
> }
> diff --git a/src/glu/sgi/libnurbs/internals/nurbstess.cc
> b/src/glu/sgi/libnurbs/internals/nurbstess.cc
> index 68dfd95..e477a8c 100644
> --- a/src/glu/sgi/libnurbs/internals/nurbstess.cc
> +++ b/src/glu/sgi/libnurbs/internals/nurbstess.cc
> @@ -505,7 +505,7 @@ NurbsTessellator::do_pwlcurve( O_pwlcurve
> *o_pwlcurve )
> o_pwlcurve->owner = currentCurve;
> }
>
> - if( (inCurve == 2) )
> + if( inCurve == 2 )
> endcurve();
> }
>

Looks good.  AFAIK you don't have git-write ability so I'll commit 
this for you.

-Brian



More information about the mesa-dev mailing list