From 85ef9930f56bf15181f9a0b238f03d55303cf411 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 22 Nov 2010 19:42:40 +0000 Subject: Updated to mesalib 7.9 --- mesalib/src/glu/sgi/libtess/geom.c | 2 +- mesalib/src/glu/sgi/libtess/mesh.c | 4 ++++ mesalib/src/glu/sgi/libtess/normal.c | 4 ++++ mesalib/src/glu/sgi/libtess/priorityq-heap.c | 22 +++++++++++++--------- mesalib/src/glu/sgi/libtess/priorityq.c | 2 +- mesalib/src/glu/sgi/libtess/render.c | 8 ++++++-- mesalib/src/glu/sgi/libtess/sweep.c | 4 ++++ mesalib/src/glu/sgi/libtess/tess.c | 4 ++++ mesalib/src/glu/sgi/libutil/mipmap.c | 4 ++-- 9 files changed, 39 insertions(+), 15 deletions(-) (limited to 'mesalib/src/glu') diff --git a/mesalib/src/glu/sgi/libtess/geom.c b/mesalib/src/glu/sgi/libtess/geom.c index 7d3b8d8a6..35b36a394 100644 --- a/mesalib/src/glu/sgi/libtess/geom.c +++ b/mesalib/src/glu/sgi/libtess/geom.c @@ -198,7 +198,7 @@ printf("*********************%d\n",RandomInterpolate); #endif -#define Swap(a,b) if (1) { GLUvertex *t = a; a = b; b = t; } else +#define Swap(a,b) do { GLUvertex *t = a; a = b; b = t; } while (0) void __gl_edgeIntersect( GLUvertex *o1, GLUvertex *d1, GLUvertex *o2, GLUvertex *d2, diff --git a/mesalib/src/glu/sgi/libtess/mesh.c b/mesalib/src/glu/sgi/libtess/mesh.c index 95f87cdc9..36cb3a7be 100644 --- a/mesalib/src/glu/sgi/libtess/mesh.c +++ b/mesalib/src/glu/sgi/libtess/mesh.c @@ -38,8 +38,12 @@ #include "mesh.h" #include "memalloc.h" +#ifndef TRUE #define TRUE 1 +#endif +#ifndef FALSE #define FALSE 0 +#endif static GLUvertex *allocVertex() { diff --git a/mesalib/src/glu/sgi/libtess/normal.c b/mesalib/src/glu/sgi/libtess/normal.c index 7ab83167b..9a3bd43d3 100644 --- a/mesalib/src/glu/sgi/libtess/normal.c +++ b/mesalib/src/glu/sgi/libtess/normal.c @@ -39,8 +39,12 @@ #include #include +#ifndef TRUE #define TRUE 1 +#endif +#ifndef FALSE #define FALSE 0 +#endif #define Dot(u,v) (u[0]*v[0] + u[1]*v[1] + u[2]*v[2]) diff --git a/mesalib/src/glu/sgi/libtess/priorityq-heap.c b/mesalib/src/glu/sgi/libtess/priorityq-heap.c index e3a6c6068..52698b59c 100644 --- a/mesalib/src/glu/sgi/libtess/priorityq-heap.c +++ b/mesalib/src/glu/sgi/libtess/priorityq-heap.c @@ -39,8 +39,12 @@ #define INIT_SIZE 32 +#ifndef TRUE #define TRUE 1 +#endif +#ifndef FALSE #define FALSE 0 +#endif #ifdef FOR_TRITE_TEST_PROGRAM #define LEQ(x,y) (*pq->leq)(x,y) @@ -159,7 +163,7 @@ void pqInit( PriorityQ *pq ) PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) { long curr; - PQhandle free; + PQhandle free_handle; curr = ++ pq->size; if( (curr*2) > pq->max ) { @@ -186,21 +190,21 @@ PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) } if( pq->freeList == 0 ) { - free = curr; + free_handle = curr; } else { - free = pq->freeList; - pq->freeList = pq->handles[free].node; + free_handle = pq->freeList; + pq->freeList = pq->handles[free_handle].node; } - pq->nodes[curr].handle = free; - pq->handles[free].node = curr; - pq->handles[free].key = keyNew; + pq->nodes[curr].handle = free_handle; + pq->handles[free_handle].node = curr; + pq->handles[free_handle].key = keyNew; if( pq->initialized ) { FloatUp( pq, curr ); } - assert(free != LONG_MAX); - return free; + assert(free_handle != LONG_MAX); + return free_handle; } /* really __gl_pqHeapExtractMin */ diff --git a/mesalib/src/glu/sgi/libtess/priorityq.c b/mesalib/src/glu/sgi/libtess/priorityq.c index 11f0263ac..c6b99cce5 100644 --- a/mesalib/src/glu/sgi/libtess/priorityq.c +++ b/mesalib/src/glu/sgi/libtess/priorityq.c @@ -85,7 +85,7 @@ void pqDeletePriorityQ( PriorityQ *pq ) #define LT(x,y) (! LEQ(y,x)) #define GT(x,y) (! LEQ(x,y)) -#define Swap(a,b) if(1){PQkey *tmp = *a; *a = *b; *b = tmp;}else +#define Swap(a,b) do{PQkey *tmp = *a; *a = *b; *b = tmp;}while(0) /* really __gl_pqSortInit */ int pqInit( PriorityQ *pq ) diff --git a/mesalib/src/glu/sgi/libtess/render.c b/mesalib/src/glu/sgi/libtess/render.c index 4f376f7f4..bca836f04 100644 --- a/mesalib/src/glu/sgi/libtess/render.c +++ b/mesalib/src/glu/sgi/libtess/render.c @@ -39,8 +39,12 @@ #include "tess.h" #include "render.h" +#ifndef TRUE #define TRUE 1 +#endif +#ifndef FALSE #define FALSE 0 +#endif /* This structure remembers the information we need about a primitive * to be able to render it later, once we have determined which @@ -143,11 +147,11 @@ static void RenderMaximumFaceGroup( GLUtesselator *tess, GLUface *fOrig ) #define AddToTrail(f,t) ((f)->trail = (t), (t) = (f), (f)->marked = TRUE) -#define FreeTrail(t) if( 1 ) { \ +#define FreeTrail(t) do { \ while( (t) != NULL ) { \ (t)->marked = FALSE; t = (t)->trail; \ } \ - } else /* absorb trailing semicolon */ + } while(0) /* absorb trailing semicolon */ diff --git a/mesalib/src/glu/sgi/libtess/sweep.c b/mesalib/src/glu/sgi/libtess/sweep.c index 744be6b47..eca828ff6 100644 --- a/mesalib/src/glu/sgi/libtess/sweep.c +++ b/mesalib/src/glu/sgi/libtess/sweep.c @@ -46,8 +46,12 @@ #include "memalloc.h" #include "sweep.h" +#ifndef TRUE #define TRUE 1 +#endif +#ifndef FALSE #define FALSE 0 +#endif #ifdef FOR_TRITE_TEST_PROGRAM extern void DebugEvent( GLUtesselator *tess ); diff --git a/mesalib/src/glu/sgi/libtess/tess.c b/mesalib/src/glu/sgi/libtess/tess.c index 029a02c3a..4a0e8dea7 100644 --- a/mesalib/src/glu/sgi/libtess/tess.c +++ b/mesalib/src/glu/sgi/libtess/tess.c @@ -47,8 +47,12 @@ #define GLU_TESS_DEFAULT_TOLERANCE 0.0 #define GLU_TESS_MESH 100112 /* void (*)(GLUmesh *mesh) */ +#ifndef TRUE #define TRUE 1 +#endif +#ifndef FALSE #define FALSE 0 +#endif /*ARGSUSED*/ static void GLAPIENTRY noBegin( GLenum type ) {} /*ARGSUSED*/ static void GLAPIENTRY noEdgeFlag( GLboolean boundaryEdge ) {} diff --git a/mesalib/src/glu/sgi/libutil/mipmap.c b/mesalib/src/glu/sgi/libutil/mipmap.c index 8e63eaaad..026ab849c 100644 --- a/mesalib/src/glu/sgi/libutil/mipmap.c +++ b/mesalib/src/glu/sgi/libutil/mipmap.c @@ -5552,7 +5552,7 @@ static void shove233rev(const GLfloat shoveComponents[], static void extract565(int isSwap, const void *packedPixel, GLfloat extractComponents[]) { - GLushort ushort= *(const GLushort *)packedPixel; + GLushort ushort; if (isSwap) { ushort= __GLU_SWAP_2_BYTES(packedPixel); @@ -5593,7 +5593,7 @@ static void shove565(const GLfloat shoveComponents[], static void extract565rev(int isSwap, const void *packedPixel, GLfloat extractComponents[]) { - GLushort ushort= *(const GLushort *)packedPixel; + GLushort ushort; if (isSwap) { ushort= __GLU_SWAP_2_BYTES(packedPixel); -- cgit v1.2.3