From 57b5ca5d11044d06f8969d54ff01c27ff44585ac Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 22 Dec 2009 23:07:00 -0800 Subject: glu/sgi: Silence uninitialized variable warnings. --- src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc | 4 ++-- src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc index e12f88bab1..2e70f83936 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc +++ b/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/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc index b7b929623a..951e937c45 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc +++ b/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) { -- cgit v1.2.3 From 6138145b350d9e58725b43162680b43904497ec8 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 23 Dec 2009 16:11:10 -0800 Subject: glu/sgi: Silence compiler warnings. --- src/glu/sgi/libnurbs/internals/subdivider.cc | 6 ++++-- src/glu/sgi/libnurbs/nurbtess/partitionY.cc | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/subdivider.cc b/src/glu/sgi/libnurbs/internals/subdivider.cc index cc0b514706..ccddc270ff 100644 --- a/src/glu/sgi/libnurbs/internals/subdivider.cc +++ b/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/src/glu/sgi/libnurbs/nurbtess/partitionY.cc b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc index 297c629976..e097461ac5 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc +++ b/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; -- cgit v1.2.3 From 261c3cd530437362f906ef78459ffda7ab2b2077 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 23 Dec 2009 17:50:02 -0800 Subject: glu/sgi: Initialize variable in directedLine. --- src/glu/sgi/libnurbs/nurbtess/directedLine.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc index 74450352d8..5be1ae3976 100644 --- a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc @@ -800,7 +800,7 @@ directedLine* readAllPolygons(char* filename) { Int nEdges; fscanf(fp, "%i", &nEdges); - Real vert[2][2]; + Real vert[2][2] = { { 0 } }; Real VV[2][2]; /*the first two vertices*/ fscanf(fp, "%f", &(vert[0][0])); -- cgit v1.2.3 From 67a4abcc3b9daabdf873d750e689893fcc94e4d5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 25 Dec 2009 14:23:10 -0800 Subject: glu/sgi: Fix include recursion. arcsorter.h should not include itself. --- src/glu/sgi/libnurbs/internals/arcsorter.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/arcsorter.h b/src/glu/sgi/libnurbs/internals/arcsorter.h index d72dd1e86c..a55df92677 100644 --- a/src/glu/sgi/libnurbs/internals/arcsorter.h +++ b/src/glu/sgi/libnurbs/internals/arcsorter.h @@ -37,7 +37,6 @@ #define __gluarcsorter_h_ #include "sorter.h" -#include "arcsorter.h" class Arc; class Subdivider; -- cgit v1.2.3 From 495b8f8f7a58616d7b75a84d828e3ea356b9a1d4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 14:28:33 -0800 Subject: glu/sgi: Initialize members of class directedLine. --- src/glu/sgi/libnurbs/nurbtess/directedLine.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc index 5be1ae3976..1ceda025d9 100644 --- a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc +++ b/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() -- cgit v1.2.3 From 5060fb428d841154013a49af7d4efc3144792260 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 17:22:11 -0800 Subject: glu/sgi: Initialize members of class sampledLine. --- src/glu/sgi/libnurbs/nurbtess/sampledLine.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc index 6253a7c09d..89f6c6e23f 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc +++ b/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!!! -- cgit v1.2.3 From a7db305c2f9fd4ee43b12ed0ef19efc1532cc30d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 17:35:22 -0800 Subject: glu/sgi: Initialize member of class monoChain. --- src/glu/sgi/libnurbs/nurbtess/monoChain.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc b/src/glu/sgi/libnurbs/nurbtess/monoChain.cc index 814bf32fae..b17b9405c1 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc +++ b/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 -- cgit v1.2.3 From 3bcf7d7d7be074246d815fdf4a486e08f5db46a3 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 17:46:42 -0800 Subject: glu/sgi: Initialize member variables in class Varray. --- src/glu/sgi/libnurbs/internals/varray.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/varray.cc b/src/glu/sgi/libnurbs/internals/varray.cc index 31cc73a9d0..1cb235443a 100644 --- a/src/glu/sgi/libnurbs/internals/varray.cc +++ b/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 ) -- cgit v1.2.3 From 97b899374cf6f2f3926863ca70c5561ef6c189a9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 20:45:24 -0800 Subject: glu/sgi: Initialize member of struct GridVertex. --- src/glu/sgi/libnurbs/internals/gridvertex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/gridvertex.h b/src/glu/sgi/libnurbs/internals/gridvertex.h index 36a65c7bdd..2e27436ef8 100644 --- a/src/glu/sgi/libnurbs/internals/gridvertex.h +++ b/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]++; } -- cgit v1.2.3 From 70bbe2236668bdee9131dc2e6f71e53f9bc78863 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 21:03:23 -0800 Subject: glu/sgi: Silence warn_unused_result warnings. --- src/glu/sgi/libnurbs/nurbtess/directedLine.cc | 28 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc index 1ceda025d9..d942db7287 100644 --- a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc @@ -793,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; irootLinkSet(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); -- cgit v1.2.3 From de95e5768bf5186a29c75981350042581b760684 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 22:29:53 -0800 Subject: glu/sgi: Initialize members of struct O_nurbssurface. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 8a8dcebb50..3f259c777b 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -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 { -- cgit v1.2.3 From 5d3d202ac991bd1a67ba40f4be145621b35620fe Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 14:39:16 -0800 Subject: glu/sgi: Initialize member of struct Property. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 3f259c777b..e5ec1827db 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -125,7 +125,7 @@ struct Property : public PooledObj { Property( long _type, long _tag, INREAL _value ) { type = _type; tag = _tag; value = (REAL) _value; } Property( long _tag, INREAL _value ) - { type = 0; tag = _tag; value = (REAL) _value; } + { type = 0; tag = _tag; value = (REAL) _value; save = 0; } }; class NurbsTessellator; -- cgit v1.2.3 From a349687d499a76496dc9433d5437398f774f0bd4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 14:46:11 -0800 Subject: glu/sgi: Initialize members of class Knotvector. --- src/glu/sgi/libnurbs/internals/knotvector.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/knotvector.cc b/src/glu/sgi/libnurbs/internals/knotvector.cc index 9eb5cbace9..dcbf0067d8 100644 --- a/src/glu/sgi/libnurbs/internals/knotvector.cc +++ b/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; } -- cgit v1.2.3 From 64a19610112efdbde9daa81b742a081832d186e9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 17:19:27 -0800 Subject: glu/sgi: Initialize members of struct O_nurbscurve. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index e5ec1827db..faa26101cf 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -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 { -- cgit v1.2.3 From 2c64e4c50eaf7c3dd0cc95edbca1d31316baac3a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 17:25:16 -0800 Subject: glu/sgi: Initialize member of struct Dlnode. --- src/glu/sgi/libnurbs/internals/displaylist.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/displaylist.h b/src/glu/sgi/libnurbs/internals/displaylist.h index 22cbec3787..d009a42513 100644 --- a/src/glu/sgi/libnurbs/internals/displaylist.h +++ b/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 { -- cgit v1.2.3 From 37e5626111ea99409d41af9581a3bc32a5d1519f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 23:01:03 -0800 Subject: glu/sgi: Initialize member of struct Property. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index faa26101cf..48249466f3 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -123,7 +123,7 @@ 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; save = 0; } }; -- cgit v1.2.3 From ba9dc26eec0ee65ea3aa1d8f8f31731157f86fa0 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 2 Jan 2010 15:29:25 -0800 Subject: glu/sgi: Initialize member of struct O_trim. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 48249466f3..14f07d3c15 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -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 { -- cgit v1.2.3 From 386f91eec3f96cb8e28dfc6545a11e1d7dedc22b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 2 Jan 2010 15:46:11 -0800 Subject: glu/sgi: Initialize members of struct O_surface. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 14f07d3c15..3390ce80e9 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -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 { -- cgit v1.2.3 From fe27b07b0fe7b63755add9bf522d7efcbf1ffb9b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 2 Jan 2010 20:04:00 -0800 Subject: glu/sgi: Initialize members of struct O_curve. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi/libnurbs') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 3390ce80e9..cae6cada46 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/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 { -- cgit v1.2.3