diff options
author | Kendall Bennett <KendallB@scitechsoft.com> | 2003-10-14 23:48:57 +0000 |
---|---|---|
committer | Kendall Bennett <KendallB@scitechsoft.com> | 2003-10-14 23:48:57 +0000 |
commit | 596d57c42a24430e72e225c051270918d0b2e864 (patch) | |
tree | 98b771dd11e637f88107682adb3797c4731b548d /src/glu/sgi/libnurbs/internals/knotvector.cc | |
parent | 9b77fb7dab3fd4e4a9228e5c0609cc494aa01211 (diff) |
Updates to SGI GLU code to get it to compile clean with the Open Watcom compiler.
Most of the changes were to get rid of warnings, but many of the warnings could
not be removed in the code so I also added #pragma's to disable the warnings.
Someone really should clean up this code, but I didn't want to mess with it
that much (and potentially break it).
Diffstat (limited to 'src/glu/sgi/libnurbs/internals/knotvector.cc')
-rw-r--r-- | src/glu/sgi/libnurbs/internals/knotvector.cc | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/glu/sgi/libnurbs/internals/knotvector.cc b/src/glu/sgi/libnurbs/internals/knotvector.cc index b48efbd4bf..3e047456f5 100644 --- a/src/glu/sgi/libnurbs/internals/knotvector.cc +++ b/src/glu/sgi/libnurbs/internals/knotvector.cc @@ -35,8 +35,8 @@ /* * knotvector.c++ * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/knotvector.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ + * $Date: 2003/10/14 23:48:57 $ $Revision: 1.2 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/knotvector.cc,v 1.2 2003/10/14 23:48:57 kendallb Exp $ */ #include "glimports.h" @@ -45,17 +45,20 @@ #include "knotvector.h" #include "defines.h" +#ifdef __WATCOMC__ +#pragma warning 726 10 +#endif void Knotvector::init( long _knotcount, long _stride, long _order, INREAL *_knotlist ) { - knotcount = _knotcount; - stride = _stride; - order = _order; + knotcount = _knotcount; + stride = _stride; + order = _order; knotlist = new Knot[_knotcount]; assert( knotlist != 0 ); for( int i = 0; i != _knotcount; i++ ) - knotlist[i] = (Knot) _knotlist[i]; + knotlist[i] = (Knot) _knotlist[i]; } Knotvector::Knotvector( void ) @@ -70,7 +73,7 @@ Knotvector::~Knotvector( void ) int Knotvector::validate( void ) { - /* kindex is used as an array index so subtract one first, + /* kindex is used as an array index so subtract one first, * this propagates throughout the code so study carefully */ long kindex = knotcount-1; @@ -85,7 +88,7 @@ int Knotvector::validate( void ) } if( identical( knotlist[kindex-(order-1)], knotlist[order-1]) ) { - // valid knot range is empty + // valid knot range is empty return( 3 ); } @@ -94,33 +97,33 @@ int Knotvector::validate( void ) // decreasing knot sequence return( 4 ); } - + /* check for valid multiplicity */ /* kindex is currently the index of the last knot. * In the next loop it is decremented to ignore the last knot - * and the loop stops when kindex is 2 so as to ignore the first - * knot as well. These knots are not used in computing - * knot multiplicities. + * and the loop stops when kindex is 2 so as to ignore the first + * knot as well. These knots are not used in computing + * knot multiplicities. */ long multi = 1; for( ; kindex >= 1; kindex-- ) { if( knotlist[kindex] - knotlist[kindex-1] < TOLERANCE ) { - multi++; + multi++; continue; - } + } if ( multi > order ) { - // knot multiplicity greater than order of spline + // knot multiplicity greater than order of spline return( 5 ); - } + } multi = 1; } if ( multi > order ) { - // knot multiplicity greater than order of spline + // knot multiplicity greater than order of spline return( 5 ); - } + } return 0; } @@ -128,7 +131,7 @@ int Knotvector::validate( void ) void Knotvector::show( char *msg ) { #ifndef NDEBUG - dprintf( "%s\n", msg ); + dprintf( "%s\n", msg ); dprintf( "order = %ld, count = %ld\n", order, knotcount ); for( int i=0; i<knotcount; i++ ) |