From 948dd2ab95790267277446311596d8af9841afde Mon Sep 17 00:00:00 2001
From: Thomas Geymayer <tomgey@gmail.com>
Date: Tue, 3 Jul 2012 15:48:11 +0200
Subject: [PATCH] Add missing glx.h include and fix some warnings.

---
 src/Canvas/ShivaVG/src/shDefs.h     | 1 +
 src/Canvas/ShivaVG/src/shGeometry.c | 2 +-
 src/Canvas/ShivaVG/src/shPaint.c    | 6 +++---
 src/Canvas/ShivaVG/src/shParams.c   | 8 ++++----
 src/Canvas/ShivaVG/src/shPipeline.c | 6 +++---
 5 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/Canvas/ShivaVG/src/shDefs.h b/src/Canvas/ShivaVG/src/shDefs.h
index d6e57a782..d0f3bb84d 100644
--- a/src/Canvas/ShivaVG/src/shDefs.h
+++ b/src/Canvas/ShivaVG/src/shDefs.h
@@ -159,6 +159,7 @@ SHfloat getMaxFloat();
 #if defined(VG_API_LINUX)
     #include <GL/gl.h>
     #include <GL/glu.h>
+    #include <GL/glx.h>
 #elif defined(VG_API_MACOSX)
     #include <OpenGL/gl.h>
     #include <OpenGL/glu.h>
diff --git a/src/Canvas/ShivaVG/src/shGeometry.c b/src/Canvas/ShivaVG/src/shGeometry.c
index 71ab463b0..3a711b37b 100644
--- a/src/Canvas/ShivaVG/src/shGeometry.c
+++ b/src/Canvas/ShivaVG/src/shGeometry.c
@@ -347,7 +347,7 @@ static void shSubdivideSegment(SHPath *p, VGPathSegment segment,
 void shFlattenPath(SHPath *p, SHint surfaceSpace)
 {
   SHint contourStart = -1;
-  SHint surfSpace = surfaceSpace;
+//  SHint surfSpace = surfaceSpace;
   SHint *userData[2];
   SHint processFlags =
     SH_PROCESS_SIMPLIFY_LINES |
diff --git a/src/Canvas/ShivaVG/src/shPaint.c b/src/Canvas/ShivaVG/src/shPaint.c
index 2e1ba4ad2..406a889b8 100644
--- a/src/Canvas/ShivaVG/src/shPaint.c
+++ b/src/Canvas/ShivaVG/src/shPaint.c
@@ -405,7 +405,7 @@ int shDrawLinearGradientMesh(SHPaint *p, SHVector2 *min, SHVector2 *max,
   SHVector2 c, ux, uy;
   SHVector2 cc, uux, uuy;
   
-  SHMatrix3x3 *m;
+  SHMatrix3x3 *m = 0;
   SHMatrix3x3 mi;
   SHint invertible;
   SHVector2 corners[4];
@@ -521,7 +521,7 @@ int shDrawRadialGradientMesh(SHPaint *p, SHVector2 *min, SHVector2 *max,
   SHVector2 c, f;
   SHVector2 cf;
 
-  SHMatrix3x3 *m;
+  SHMatrix3x3 *m = 0;
   SHMatrix3x3 mi;
   SHint invertible;
   SHVector2 corners[4];
@@ -722,7 +722,7 @@ int shDrawRadialGradientMesh(SHPaint *p, SHVector2 *min, SHVector2 *max,
 int shDrawPatternMesh(SHPaint *p, SHVector2 *min, SHVector2 *max,
                       VGPaintMode mode, GLenum texUnit)
 {
-  SHMatrix3x3 *m;
+  SHMatrix3x3 *m = 0;
   SHMatrix3x3 mi;
   SHfloat migl[16];
   SHint invertible;
diff --git a/src/Canvas/ShivaVG/src/shParams.c b/src/Canvas/ShivaVG/src/shParams.c
index 3ed90fe84..2535c1497 100644
--- a/src/Canvas/ShivaVG/src/shParams.c
+++ b/src/Canvas/ShivaVG/src/shParams.c
@@ -839,9 +839,9 @@ static void shSetParameter(VGContext *context, VGHandle object,
                            SHResourceType rtype, VGint ptype,
                            SHint count, const void *values, SHint floats)
 {
-  SHfloat fvalue = 0.0f;
+//  SHfloat fvalue = 0.0f;
   SHint ivalue = 0;
-  VGboolean bvalue = VG_FALSE;
+//  VGboolean bvalue = VG_FALSE;
   int i;
   
   /* Check for negative count */
@@ -852,9 +852,9 @@ static void shSetParameter(VGContext *context, VGHandle object,
   
   /* Pre-convert first value for non-vector params */
   if (count == 1) {
-    fvalue = shParamToFloat(values, floats, 0);
+//    fvalue = shParamToFloat(values, floats, 0);
     ivalue = shParamToInt(values, floats, 0);
-    bvalue = (ivalue ? VG_TRUE : VG_FALSE);
+//    bvalue = (ivalue ? VG_TRUE : VG_FALSE);
   }
   
   switch (rtype)
diff --git a/src/Canvas/ShivaVG/src/shPipeline.c b/src/Canvas/ShivaVG/src/shPipeline.c
index a03ced057..1e07bc56a 100644
--- a/src/Canvas/ShivaVG/src/shPipeline.c
+++ b/src/Canvas/ShivaVG/src/shPipeline.c
@@ -148,7 +148,7 @@ static void shDrawBoundBox(VGContext *c, SHPath *p, VGPaintMode mode)
 static void shDrawPaintMesh(VGContext *c, SHVector2 *min, SHVector2 *max,
                             VGPaintMode mode, GLenum texUnit)
 {
-  SHPaint *p;
+  SHPaint *p = 0;
   SHVector2 pmin, pmax;
   SHfloat K = 1.0f;
   
@@ -199,7 +199,7 @@ VGboolean shIsTessCacheValid (VGContext *c, SHPath *p)
 {
   SHfloat nX, nY;
   SHVector2 X, Y;
-  SHMatrix3x3 mi, mchange;
+  SHMatrix3x3 mi;//, mchange;
   VGboolean valid = VG_TRUE;
 
   if (p->cacheDataValid == VG_FALSE) {
@@ -214,7 +214,7 @@ VGboolean shIsTessCacheValid (VGContext *c, SHPath *p)
   else
   {
     /* TODO: Compare change matrix for any scale or shear  */
-    MULMATMAT( c->pathTransform, mi, mchange );
+//    MULMATMAT( c->pathTransform, mi, mchange );
     SET2( X, mi.m[0][0], mi.m[1][0] );
     SET2( Y, mi.m[0][1], mi.m[1][1] );
     nX = NORM2( X ); nY = NORM2( Y );