summaryrefslogtreecommitdiff
path: root/src/glu/sgi/libnurbs/nurbtess/directedLine.cc
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-12-31 09:02:27 -0700
committerBrian Paul <brianp@vmware.com>2009-12-31 09:02:27 -0700
commit25024d948298a9f3f3210a0b91486f79a3917b0f (patch)
tree5647623b9781193b7ed55c8d9233404938aeb853 /src/glu/sgi/libnurbs/nurbtess/directedLine.cc
parentd14beea534dcb2b3ae2ae1f7ee0ba5dcdef3dba3 (diff)
parent195e7657e2f15f7ad8b22042b86bcf33c5bba76b (diff)
Merge branch 'mesa_7_7_branch'
Conflicts: configs/darwin src/gallium/auxiliary/util/u_clear.h src/gallium/state_trackers/xorg/xorg_exa_tgsi.c src/mesa/drivers/dri/i965/brw_draw_upload.c
Diffstat (limited to 'src/glu/sgi/libnurbs/nurbtess/directedLine.cc')
-rw-r--r--src/glu/sgi/libnurbs/nurbtess/directedLine.cc32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc
index 74450352d8..d942db7287 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()
@@ -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);