diff options
Diffstat (limited to 'mesalib/src/glu/sgi/libnurbs')
35 files changed, 101 insertions, 43 deletions
diff --git a/mesalib/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h b/mesalib/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h index 449329665..ba6868a30 100644 --- a/mesalib/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h +++ b/mesalib/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h @@ -33,6 +33,7 @@ #ifndef _BEZIERPATCHMESH_H #define _BEZIERPATCHMESH_H +#include <GL/gl.h> #include "bezierPatch.h" typedef struct bezierPatchMesh{ diff --git a/mesalib/src/glu/sgi/libnurbs/interface/glsurfeval.h b/mesalib/src/glu/sgi/libnurbs/interface/glsurfeval.h index 1567c6b09..621e59391 100644 --- a/mesalib/src/glu/sgi/libnurbs/interface/glsurfeval.h +++ b/mesalib/src/glu/sgi/libnurbs/interface/glsurfeval.h @@ -83,7 +83,7 @@ typedef struct surfEvalMachine{ class StoredVertex { public: - StoredVertex() { type = 0; } + StoredVertex() { type = 0; coord[0] = 0; coord[1] = 0; point[0] = 0; point[1] = 0; } ~StoredVertex(void) {} void saveEvalCoord(REAL x, REAL y) {coord[0] = x; coord[1] = y; type = TYPECOORD; } diff --git a/mesalib/src/glu/sgi/libnurbs/internals/arc.cc b/mesalib/src/glu/sgi/libnurbs/internals/arc.cc index b85139de9..cd4c4048a 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/arc.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/arc.cc @@ -43,7 +43,6 @@ #include "myassert.h" #include "arc.h" #include "bin.h" -#include "bezierarc.h" #include "pwlarc.h" #include "simplemath.h" diff --git a/mesalib/src/glu/sgi/libnurbs/internals/arc.h b/mesalib/src/glu/sgi/libnurbs/internals/arc.h index e986019c3..ca397f3b1 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/arc.h +++ b/mesalib/src/glu/sgi/libnurbs/internals/arc.h @@ -108,6 +108,9 @@ public: inline Arc::Arc( Arc *j, PwlArc *p ) { + prev = NULL; + next = NULL; + link = NULL; bezierArc = NULL; pwlArc = p; type = j->type; @@ -123,6 +126,9 @@ Arc::Arc( Arc *j, PwlArc *p ) inline Arc::Arc( arc_side side, long _nuid ) { + prev = NULL; + next = NULL; + link = NULL; bezierArc = NULL; pwlArc = NULL; type = 0; diff --git a/mesalib/src/glu/sgi/libnurbs/internals/arcsorter.h b/mesalib/src/glu/sgi/libnurbs/internals/arcsorter.h index d72dd1e86..a55df9267 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/arcsorter.h +++ b/mesalib/src/glu/sgi/libnurbs/internals/arcsorter.h @@ -37,7 +37,6 @@ #define __gluarcsorter_h_ #include "sorter.h" -#include "arcsorter.h" class Arc; class Subdivider; diff --git a/mesalib/src/glu/sgi/libnurbs/internals/backend.cc b/mesalib/src/glu/sgi/libnurbs/internals/backend.cc index 88dc3f516..27b41ebb2 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/backend.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/backend.cc @@ -46,7 +46,6 @@ #include "backend.h" #include "basiccrveval.h" #include "basicsurfeval.h" -#include "nurbsconsts.h" #define NOWIREFRAME diff --git a/mesalib/src/glu/sgi/libnurbs/internals/bin.cc b/mesalib/src/glu/sgi/libnurbs/internals/bin.cc index 54b406147..ff75b86be 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/bin.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/bin.cc @@ -49,6 +49,7 @@ Bin::Bin() { head = NULL; + current = NULL; } Bin::~Bin() diff --git a/mesalib/src/glu/sgi/libnurbs/internals/bufpool.cc b/mesalib/src/glu/sgi/libnurbs/internals/bufpool.cc index 8cc847ab2..53ac1a569 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/bufpool.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/bufpool.cc @@ -60,6 +60,9 @@ Pool::Pool( int _buffersize, int initpoolsize, const char *n ) curblock = 0; freelist = 0; nextfree = 0; + for (int i = 0; i < NBLOCKS; i++) { + blocklist[i] = 0; + } } /*----------------------------------------------------------------------------- diff --git a/mesalib/src/glu/sgi/libnurbs/internals/curve.cc b/mesalib/src/glu/sgi/libnurbs/internals/curve.cc index 33e275264..b7c4d4a9c 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/curve.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/curve.cc @@ -60,6 +60,12 @@ Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c ) cullval = mapdesc->isCulling() ? CULL_ACCEPT : CULL_TRIVIAL_ACCEPT; order = geo->qspec[0].order; stride = MAXCOORDS; + for( int i = 0; i < MAXORDER * MAXCOORDS; i++ ) { + cpts[i] = 0; + spts[i] = 0; + } + stepsize = 0; + minstepsize = 0; REAL *ps = geo->cpts; Quiltspec_ptr qs = geo->qspec; diff --git a/mesalib/src/glu/sgi/libnurbs/internals/curvelist.cc b/mesalib/src/glu/sgi/libnurbs/internals/curvelist.cc index 872eb5816..8f2ee4678 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/curvelist.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/curvelist.cc @@ -43,7 +43,6 @@ #include "quilt.h" #include "curvelist.h" #include "curve.h" -#include "nurbsconsts.h" #include "types.h" Curvelist::Curvelist( Quilt *quilts, REAL pta, REAL ptb ) @@ -54,20 +53,23 @@ Curvelist::Curvelist( Quilt *quilts, REAL pta, REAL ptb ) range[0] = pta; range[1] = ptb; range[2] = ptb - pta; + needsSubdivision = 0; + stepsize = 0; } Curvelist::Curvelist( Curvelist &upper, REAL value ) { - Curvelist &lower = *this; curve = 0; for( Curve *c = upper.curve; c; c = c->next ) curve = new Curve( *c, value, curve ); - lower.range[0] = upper.range[0]; - lower.range[1] = value; - lower.range[2] = value - upper.range[0]; + range[0] = upper.range[0]; + range[1] = value; + range[2] = value - upper.range[0]; upper.range[0] = value; upper.range[2] = upper.range[1] - value; + needsSubdivision = 0; + stepsize = 0; } Curvelist::~Curvelist() diff --git a/mesalib/src/glu/sgi/libnurbs/internals/curvesub.cc b/mesalib/src/glu/sgi/libnurbs/internals/curvesub.cc index f85acc269..91f2ca8ce 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/curvesub.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/curvesub.cc @@ -45,7 +45,6 @@ #include "backend.h" #include "quilt.h" #include "curvelist.h" -#include "curve.h" #include "nurbsconsts.h" /*-------------------------------------------------------------------------- diff --git a/mesalib/src/glu/sgi/libnurbs/internals/displaylist.h b/mesalib/src/glu/sgi/libnurbs/internals/displaylist.h index 22cbec378..d009a4251 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/displaylist.h +++ b/mesalib/src/glu/sgi/libnurbs/internals/displaylist.h @@ -59,6 +59,7 @@ Dlnode::Dlnode( PFVS _work, void *_arg, PFVS _cleanup ) work = _work; arg = _arg; cleanup = _cleanup; + next = 0; } class DisplayList { diff --git a/mesalib/src/glu/sgi/libnurbs/internals/gridvertex.h b/mesalib/src/glu/sgi/libnurbs/internals/gridvertex.h index 36a65c7bd..2e27436ef 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/gridvertex.h +++ b/mesalib/src/glu/sgi/libnurbs/internals/gridvertex.h @@ -38,7 +38,7 @@ struct GridVertex { long gparam[2]; - GridVertex( void ) {} + GridVertex( void ) { gparam[0] = 0, gparam[1] = 0; } GridVertex( long u, long v ) { gparam[0] = u, gparam[1] = v; } void set( long u, long v ) { gparam[0] = u, gparam[1] = v; } long nextu() { return gparam[0]++; } diff --git a/mesalib/src/glu/sgi/libnurbs/internals/knotvector.cc b/mesalib/src/glu/sgi/libnurbs/internals/knotvector.cc index 9eb5cbace..dcbf0067d 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/knotvector.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/knotvector.cc @@ -61,6 +61,9 @@ void Knotvector::init( long _knotcount, long _stride, long _order, INREAL *_knot Knotvector::Knotvector( void ) { + knotcount = 0; + stride = 0; + order = 0; knotlist = 0; } diff --git a/mesalib/src/glu/sgi/libnurbs/internals/maplist.cc b/mesalib/src/glu/sgi/libnurbs/internals/maplist.cc index f944d1529..e51a3e85d 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/maplist.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/maplist.cc @@ -44,7 +44,6 @@ #include "nurbsconsts.h" #include "maplist.h" #include "mapdesc.h" -#include "backend.h" Maplist::Maplist( Backend& b ) : mapdescPool( sizeof( Mapdesc ), 10, "mapdesc pool" ), diff --git a/mesalib/src/glu/sgi/libnurbs/internals/mesher.cc b/mesalib/src/glu/sgi/libnurbs/internals/mesher.cc index 9cc436adb..b2d83f412 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/mesher.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/mesher.cc @@ -58,6 +58,9 @@ Mesher::Mesher( Backend& b ) { stacksize = 0; vdata = 0; + last[0] = 0; + last[1] = 0; + itop = 0; lastedge = 0; //needed to prevent purify UMR } diff --git a/mesalib/src/glu/sgi/libnurbs/internals/patchlist.cc b/mesalib/src/glu/sgi/libnurbs/internals/patchlist.cc index 989d2dd00..6a400ab6f 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/patchlist.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/patchlist.cc @@ -44,7 +44,6 @@ #include "quilt.h" #include "patchlist.h" #include "patch.h" -#include "nurbsconsts.h" Patchlist::Patchlist( Quilt *quilts, REAL *pta, REAL *ptb ) { diff --git a/mesalib/src/glu/sgi/libnurbs/internals/quilt.cc b/mesalib/src/glu/sgi/libnurbs/internals/quilt.cc index 4fc58b747..d16f4bfec 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/quilt.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/quilt.cc @@ -44,9 +44,7 @@ #include "backend.h" #include "mapdesc.h" #include "flist.h" -#include "knotvector.h" #include "patchlist.h" -#include "math.h" //fglu_abs() #include "simplemath.h" //min() /* local preprocessor definitions */ diff --git a/mesalib/src/glu/sgi/libnurbs/internals/reader.cc b/mesalib/src/glu/sgi/libnurbs/internals/reader.cc index 6135eef60..c59240d26 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/reader.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/reader.cc @@ -64,6 +64,7 @@ O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, owner = 0; pts = trimpts; npts = (int) count; + save = 0; int i; /* copy user data into internal trimming data structures */ @@ -115,6 +116,7 @@ O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, owner = 0; pts = trimpts; npts = (int) count; + save = 0; /* copy user data into internal trimming data structures */ switch( _type ) { diff --git a/mesalib/src/glu/sgi/libnurbs/internals/reader.h b/mesalib/src/glu/sgi/libnurbs/internals/reader.h index 8a8dcebb5..cae6cada4 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/reader.h +++ b/mesalib/src/glu/sgi/libnurbs/internals/reader.h @@ -64,7 +64,7 @@ struct O_curve : public PooledObj { int save; /* 1 if in display list */ long nuid; O_curve() { next = 0; used = 0; owner = 0; - curve.o_pwlcurve = 0; } + curve.o_pwlcurve = 0; curvetype = ct_none; save = 0; nuid = 0; } }; struct O_nurbscurve : public PooledObj { @@ -77,7 +77,7 @@ struct O_nurbscurve : public PooledObj { int save; /* 1 if in display list */ O_curve * owner; /* owning curve */ O_nurbscurve( long _type ) - { type = _type; owner = 0; next = 0; used = 0; } + { bezier_curves = 0; type = _type; tesselation = 0; method = 0; next = 0; used = 0; save = 0; owner = 0; } }; class O_pwlcurve : public PooledObj { @@ -95,7 +95,7 @@ struct O_trim : public PooledObj { O_curve *o_curve; /* closed trim loop */ O_trim * next; /* next loop along trim */ int save; /* 1 if in display list */ - O_trim() { next = 0; o_curve = 0; } + O_trim() { next = 0; o_curve = 0; save = 0; } }; struct O_nurbssurface : public PooledObj { @@ -106,7 +106,7 @@ struct O_nurbssurface : public PooledObj { int save; /* 1 if in display list */ int used; /* 1 if prev called in block */ O_nurbssurface( long _type ) - { type = _type; owner = 0; next = 0; used = 0; } + { bezier_patches = 0; type = _type; owner = 0; next = 0; save = 0; used = 0; } }; struct O_surface : public PooledObj { @@ -114,7 +114,7 @@ struct O_surface : public PooledObj { O_trim * o_trim; /* list of trim loops */ int save; /* 1 if in display list */ long nuid; - O_surface() { o_trim = 0; o_nurbssurface = 0; } + O_surface() { o_trim = 0; o_nurbssurface = 0; save = 0; nuid = 0; } }; struct Property : public PooledObj { @@ -123,9 +123,9 @@ struct Property : public PooledObj { REAL value; int save; /* 1 if in display list */ Property( long _type, long _tag, INREAL _value ) - { type = _type; tag = _tag; value = (REAL) _value; } + { type = _type; tag = _tag; value = (REAL) _value; save = 0; } Property( long _tag, INREAL _value ) - { type = 0; tag = _tag; value = (REAL) _value; } + { type = 0; tag = _tag; value = (REAL) _value; save = 0; } }; class NurbsTessellator; diff --git a/mesalib/src/glu/sgi/libnurbs/internals/renderhints.cc b/mesalib/src/glu/sgi/libnurbs/internals/renderhints.cc index a3aa62d42..4b347ebc7 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/renderhints.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/renderhints.cc @@ -40,7 +40,6 @@ #include "glimports.h" #include "mystdio.h" #include "renderhints.h" -#include "defines.h" #include "nurbsconsts.h" @@ -54,6 +53,10 @@ Renderhints::Renderhints() errorchecking = N_MSG; subdivisions = 6.0; tmp1 = 0.0; + displaydomain = 0; + maxsubdivisions = (int) subdivisions; + wiretris = 0; + wirequads = 0; } void diff --git a/mesalib/src/glu/sgi/libnurbs/internals/simplemath.h b/mesalib/src/glu/sgi/libnurbs/internals/simplemath.h index 0a060c57e..d00062dc7 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/simplemath.h +++ b/mesalib/src/glu/sgi/libnurbs/internals/simplemath.h @@ -38,6 +38,8 @@ /* simple inline routines */ +#include "types.h" + inline int max( int x, int y ) { return ( x < y ) ? y : x; } diff --git a/mesalib/src/glu/sgi/libnurbs/internals/slicer.cc b/mesalib/src/glu/sgi/libnurbs/internals/slicer.cc index 27d2a650d..1b18d73c1 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/slicer.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/slicer.cc @@ -1181,6 +1181,10 @@ void Slicer::slice(Arc_ptr loop) Slicer::Slicer( Backend &b ) : CoveAndTiler( b ), Mesher( b ), backend( b ) { + oneOverDu = 0; + du = 0; + dv = 0; + isolines = 0; ulinear = 0; vlinear = 0; } diff --git a/mesalib/src/glu/sgi/libnurbs/internals/subdivider.cc b/mesalib/src/glu/sgi/libnurbs/internals/subdivider.cc index cc0b51470..ccddc270f 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/subdivider.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/subdivider.cc @@ -531,16 +531,18 @@ Subdivider::nonSamplingSplit( patchlist.pspec[param].range[1] ) * 0.5; split( source, left, right, param, mid ); Patchlist subpatchlist( patchlist, param, mid ); - if( left.isnonempty() ) + if( left.isnonempty() ) { if( subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT ) freejarcs( left ); else nonSamplingSplit( left, subpatchlist, subdivisions-1, param ); - if( right.isnonempty() ) + } + if( right.isnonempty() ) { if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) freejarcs( right ); else nonSamplingSplit( right, patchlist, subdivisions-1, param ); + } } else { // make bbox calls diff --git a/mesalib/src/glu/sgi/libnurbs/internals/trimregion.cc b/mesalib/src/glu/sgi/libnurbs/internals/trimregion.cc index efe789356..4aeb5eeac 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/trimregion.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/trimregion.cc @@ -41,7 +41,6 @@ #include "myassert.h" #include "mystdio.h" #include "trimregion.h" -#include "backend.h" TrimRegion::TrimRegion( void ) { diff --git a/mesalib/src/glu/sgi/libnurbs/internals/uarray.cc b/mesalib/src/glu/sgi/libnurbs/internals/uarray.cc index f0e236437..4b3329c0f 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/uarray.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/uarray.cc @@ -47,6 +47,7 @@ Uarray::Uarray( void ) { uarray = 0; size = 0; + ulines = 0; } Uarray::~Uarray( void ) diff --git a/mesalib/src/glu/sgi/libnurbs/internals/varray.cc b/mesalib/src/glu/sgi/libnurbs/internals/varray.cc index 31cc73a9d..1cb235443 100644 --- a/mesalib/src/glu/sgi/libnurbs/internals/varray.cc +++ b/mesalib/src/glu/sgi/libnurbs/internals/varray.cc @@ -53,8 +53,16 @@ inline long sgn( REAL x ) Varray::Varray( void ) { + int i; + varray = 0; size = 0; + numquads = 0; + + for (i = 0; i < 1000; i++) { + vval[i] = 0; + voffset[i] = 0; + } } Varray::~Varray( void ) diff --git a/mesalib/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/mesalib/src/glu/sgi/libnurbs/nurbtess/directedLine.cc index 74450352d..d942db728 100644 --- a/mesalib/src/glu/sgi/libnurbs/nurbtess/directedLine.cc +++ b/mesalib/src/glu/sgi/libnurbs/nurbtess/directedLine.cc @@ -309,6 +309,8 @@ directedLine::directedLine() nextPolygon = NULL; rootBit = 0;/*important to initilzae to 0 meaning not root yet*/ rootLink = NULL; + direction = INCREASING; + sline = NULL; } directedLine::~directedLine() @@ -791,22 +793,30 @@ directedLine* readAllPolygons(char* filename) { Int i,j; FILE* fp = fopen(filename, "r"); - assert(fp); Int nPolygons; - fscanf(fp, "%i", &nPolygons); + int result; + + assert(fp); + result = fscanf(fp, "%i", &nPolygons); + assert(result != EOF); directedLine *ret = NULL; for(i=0; i<nPolygons; i++) { Int nEdges; - fscanf(fp, "%i", &nEdges); - Real vert[2][2]; + result = fscanf(fp, "%i", &nEdges); + assert(result != EOF); + Real vert[2][2] = { { 0 } }; Real VV[2][2]; /*the first two vertices*/ - fscanf(fp, "%f", &(vert[0][0])); - fscanf(fp, "%f", &(vert[0][1])); - fscanf(fp, "%f", &(vert[1][0])); - fscanf(fp, "%f", &(vert[1][1])); + result = fscanf(fp, "%f", &(vert[0][0])); + assert(result != EOF); + result = fscanf(fp, "%f", &(vert[0][1])); + assert(result != EOF); + result = fscanf(fp, "%f", &(vert[1][0])); + assert(result != EOF); + result = fscanf(fp, "%f", &(vert[1][1])); + assert(result != EOF); VV[1][0] = vert[0][0]; VV[1][1] = vert[0][1]; sampledLine *sLine = new sampledLine(2, vert); @@ -818,8 +828,10 @@ thisPoly->rootLinkSet(NULL); { vert[0][0]=vert[1][0]; vert[0][1]=vert[1][1]; - fscanf(fp, "%f", &(vert[1][0])); - fscanf(fp, "%f", &(vert[1][1])); + result = fscanf(fp, "%f", &(vert[1][0])); + assert(result != EOF); + result = fscanf(fp, "%f", &(vert[1][1])); + assert(result != EOF); sLine = new sampledLine(2,vert); dLine = new directedLine(INCREASING, sLine); dLine->rootLinkSet(thisPoly); diff --git a/mesalib/src/glu/sgi/libnurbs/nurbtess/monoChain.cc b/mesalib/src/glu/sgi/libnurbs/nurbtess/monoChain.cc index 814bf32fa..cb28129ad 100644 --- a/mesalib/src/glu/sgi/libnurbs/nurbtess/monoChain.cc +++ b/mesalib/src/glu/sgi/libnurbs/nurbtess/monoChain.cc @@ -127,6 +127,7 @@ monoChain::monoChain(directedLine* cHead, directedLine* cTail) current = chainTail; isKey = 0; + keyY = 0; } //insert a new line between prev and this @@ -263,6 +264,7 @@ monoChain* directedLineLoopToMonoChainLoop(directedLine* loop) prevCusp = temp; } } + assert(ret); ret->insert(new monoChain(prevCusp, firstCusp)); return ret; diff --git a/mesalib/src/glu/sgi/libnurbs/nurbtess/partitionY.cc b/mesalib/src/glu/sgi/libnurbs/nurbtess/partitionY.cc index 297c62997..e097461ac 100644 --- a/mesalib/src/glu/sgi/libnurbs/nurbtess/partitionY.cc +++ b/mesalib/src/glu/sgi/libnurbs/nurbtess/partitionY.cc @@ -111,8 +111,8 @@ Int isCusp(directedLine *v) else if(A[1] > B[1] && C[1] > B[1]) return 1; - if(isAbove(v, v) && isAbove(v, v->getPrev()) || - isBelow(v, v) && isBelow(v, v->getPrev())) + if((isAbove(v, v) && isAbove(v, v->getPrev())) || + (isBelow(v, v) && isBelow(v, v->getPrev()))) return 1; else return 0; diff --git a/mesalib/src/glu/sgi/libnurbs/nurbtess/partitionY.h b/mesalib/src/glu/sgi/libnurbs/nurbtess/partitionY.h index 8dda409de..5570c183d 100644 --- a/mesalib/src/glu/sgi/libnurbs/nurbtess/partitionY.h +++ b/mesalib/src/glu/sgi/libnurbs/nurbtess/partitionY.h @@ -39,7 +39,7 @@ *or both at or below v. In addition, at least one of the ajacent verteces is *strictly below or above v. * A vertex is a relex vertex if the internals angle is strictly greater than - *180. In other words, if the the signed area is negative: + *180. In other words, if the signed area is negative: *(x1, y1), (x2, y2), (x3, y3) are the three vertices along a polygon, the *order is such that left hand side is inside the polygon. Then (x2,y2) is *reflex if: diff --git a/mesalib/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc b/mesalib/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc index 26d05342f..dfdbd4e84 100644 --- a/mesalib/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc +++ b/mesalib/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc @@ -156,6 +156,8 @@ primStream::primStream(Int sizeLengths, Int sizeVertices) index_vertices = 0; size_lengths = sizeLengths; size_vertices = sizeVertices; + + counter = 0; } primStream::~primStream() diff --git a/mesalib/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc b/mesalib/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc index e12f88bab..2e70f8393 100644 --- a/mesalib/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc +++ b/mesalib/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc @@ -207,7 +207,7 @@ void sampleBotRightWithGridLine(Real* botVertex, return; } - Int segIndexMono, segIndexPass; + Int segIndexMono = 0, segIndexPass; findBotRightSegment(rightChain, rightEnd, rightCorner, @@ -293,7 +293,7 @@ void sampleBotLeftWithGridLine(Real* botVertex, return; } - Int segIndexPass, segIndexMono; + Int segIndexPass, segIndexMono = 0; findBotLeftSegment(leftChain, leftEnd, leftCorner, grid->get_u_value(leftU), segIndexMono, segIndexPass); sampleBotLeftWithGridLinePost(botVertex, diff --git a/mesalib/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc b/mesalib/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc index b7b929623..951e937c4 100644 --- a/mesalib/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc +++ b/mesalib/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc @@ -172,7 +172,7 @@ void sampleTopRightWithGridLine(Real* topVertex, return; } - Int segIndexSmall, segIndexLarge; + Int segIndexSmall = 0, segIndexLarge; findTopRightSegment(rightChain, rightStart, rightEnd, @@ -294,7 +294,7 @@ void sampleTopLeftWithGridLine(Real* topVertex, primStream* pStream ) { - Int segIndexSmall, segIndexLarge; + Int segIndexSmall = 0, segIndexLarge; //if left chain is empty, then there is only one top vertex with one grid // line if(leftEnd < leftStart) { diff --git a/mesalib/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc b/mesalib/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc index 6253a7c09..89f6c6e23 100644 --- a/mesalib/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc +++ b/mesalib/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc @@ -107,6 +107,9 @@ sampledLine::sampledLine(Real pt1[2], Real pt2[2]) //needs tp call init to setup sampledLine::sampledLine() { + npoints = 0; + points = NULL; + next = NULL; } //warning: ONLY pointer is copies!!! |