diff options
author | Brian Paul <[email protected]> | 2001-08-13 16:52:18 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-08-13 16:52:18 +0000 |
commit | 978a2a0a43ccdb9090cf19b38347b1aa2d4c8f5e (patch) | |
tree | 01a12bc103fa3f8350cb3dc54fd5272ffd766ba7 /src/glu/sgi/libnurbs | |
parent | 2e5a20ae21ab8c25cc3eb211e713a5712c3ee5cb (diff) |
fixed Solaris compilation problems (Bug 441817)
Diffstat (limited to 'src/glu/sgi/libnurbs')
-rw-r--r-- | src/glu/sgi/libnurbs/internals/curve.cc | 6 | ||||
-rw-r--r-- | src/glu/sgi/libnurbs/internals/mapdescv.cc | 16 | ||||
-rw-r--r-- | src/glu/sgi/libnurbs/internals/mymath.h | 14 | ||||
-rw-r--r-- | src/glu/sgi/libnurbs/internals/patch.cc | 40 |
4 files changed, 43 insertions, 33 deletions
diff --git a/src/glu/sgi/libnurbs/internals/curve.cc b/src/glu/sgi/libnurbs/internals/curve.cc index 70e7251573f..5a5bc1770c1 100644 --- a/src/glu/sgi/libnurbs/internals/curve.cc +++ b/src/glu/sgi/libnurbs/internals/curve.cc @@ -35,8 +35,8 @@ /* * curve.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/curve.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ + * $Date: 2001/08/13 16:52:18 $ $Revision: 1.2 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/curve.cc,v 1.2 2001/08/13 16:52:18 brianp Exp $ */ #include "glimports.h" @@ -170,7 +170,7 @@ Curve::getstepsize( void ) REAL t = mapdesc->getProperty( N_PIXEL_TOLERANCE ); if( mapdesc->isParametricDistanceSampling() ) { REAL d = mapdesc->calcPartialVelocity( &tmp[0][0], tstride, order, 2, range[2] ); - stepsize = (d > 0.0) ? ::sqrtf( 8.0 * t / d ) : range[2]; + stepsize = (d > 0.0) ? sqrtf( 8.0 * t / d ) : range[2]; minstepsize = ( mapdesc->maxrate > 0.0 ) ? (range[2] / mapdesc->maxrate) : 0.0; } else if( mapdesc->isPathLengthSampling() ) { // t is upper bound on path (arc) length diff --git a/src/glu/sgi/libnurbs/internals/mapdescv.cc b/src/glu/sgi/libnurbs/internals/mapdescv.cc index 5c26664451c..3d18b47b112 100644 --- a/src/glu/sgi/libnurbs/internals/mapdescv.cc +++ b/src/glu/sgi/libnurbs/internals/mapdescv.cc @@ -35,8 +35,8 @@ /* * mapdescv.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/mapdescv.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ + * $Date: 2001/08/13 16:52:18 $ $Revision: 1.2 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mapdescv.cc,v 1.2 2001/08/13 16:52:18 brianp Exp $ */ #include "glimports.h" @@ -93,7 +93,7 @@ Mapdesc::calcPartialVelocity ( REAL max = 0.0; for( j=0; j != ncols-partial; j++ ) if( mag[j] > max ) max = mag[j]; - max = fac * ::sqrtf( (float) max ); + max = fac * sqrtf( (float) max ); return max; } @@ -217,8 +217,8 @@ Mapdesc::calcPartialVelocity ( j = ncols-tpartial-1; if( mag[i][j] > dist[1] ) dist[1] = mag[i][j]; } - dist[0] = fac * ::sqrtf( dist[0] ); - dist[1] = fac * ::sqrtf( dist[1] ); + dist[0] = fac * sqrtf( dist[0] ); + dist[1] = fac * sqrtf( dist[1] ); } else if( side == 1 ) { // compute max magnitude of first and last row dist[0] = 0.0; @@ -230,11 +230,11 @@ Mapdesc::calcPartialVelocity ( i = nrows-spartial-1; if( mag[i][j] > dist[1] ) dist[1] = mag[i][j]; } - dist[0] = fac * ::sqrtf( dist[0] ); - dist[1] = fac * ::sqrtf( dist[1] ); + dist[0] = fac * sqrtf( dist[0] ); + dist[1] = fac * sqrtf( dist[1] ); } - max = fac * ::sqrtf( (float) max ); + max = fac * sqrtf( (float) max ); return max; } diff --git a/src/glu/sgi/libnurbs/internals/mymath.h b/src/glu/sgi/libnurbs/internals/mymath.h index 8aca9fc9f65..70138321152 100644 --- a/src/glu/sgi/libnurbs/internals/mymath.h +++ b/src/glu/sgi/libnurbs/internals/mymath.h @@ -35,8 +35,8 @@ /* * mymath.h * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mymath.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ + * $Date: 2001/08/13 16:52:18 $ $Revision: 1.2 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mymath.h,v 1.2 2001/08/13 16:52:18 brianp Exp $ */ #ifndef __glumymath_h_ @@ -61,4 +61,14 @@ extern "C" float floorf(float); #include <math.h> #endif +#if !defined sqrtf +# define sqrtf(x) ((float)sqrt(x)) +#endif +#if !defined ceilf +# define ceilf(x) ((float)ceil(x)) +#endif +#if !defined floorf +# define floorf(x) ((float)floor(x)) +#endif + #endif /* __glumymath_h_ */ diff --git a/src/glu/sgi/libnurbs/internals/patch.cc b/src/glu/sgi/libnurbs/internals/patch.cc index 64bcfa4c9c0..b04262b439e 100644 --- a/src/glu/sgi/libnurbs/internals/patch.cc +++ b/src/glu/sgi/libnurbs/internals/patch.cc @@ -35,8 +35,8 @@ /* * patch.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/patch.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ + * $Date: 2001/08/13 16:52:18 $ $Revision: 1.2 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.2 2001/08/13 16:52:18 brianp Exp $ */ #include <stdio.h> @@ -321,43 +321,43 @@ Patch::getstepsize( void ) if( ss != 0.0 && tt != 0.0 ) { /* printf( "ssv[0] %g ssv[1] %g ttv[0] %g ttv[1] %g\n", ssv[0], ssv[1], ttv[0], ttv[1] ); */ - REAL ttq = ::sqrtf( (float) ss ); - REAL ssq = ::sqrtf( (float) tt ); - REAL ds = ::sqrtf( 4 * t2 * ttq / ( ss * ttq + st * ssq ) ); - REAL dt = ::sqrtf( 4 * t2 * ssq / ( tt * ssq + st * ttq ) ); + REAL ttq = sqrtf( (float) ss ); + REAL ssq = sqrtf( (float) tt ); + REAL ds = sqrtf( 4 * t2 * ttq / ( ss * ttq + st * ssq ) ); + REAL dt = sqrtf( 4 * t2 * ssq / ( tt * ssq + st * ttq ) ); pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; REAL scutoff = 2.0 * t2 / ( pspec[0].range[2] * pspec[0].range[2]); - pspec[0].sidestep[0] = (ssv[0] > scutoff) ? ::sqrtf( 2.0 * t2 / ssv[0] ) : pspec[0].range[2]; - pspec[0].sidestep[1] = (ssv[1] > scutoff) ? ::sqrtf( 2.0 * t2 / ssv[1] ) : pspec[0].range[2]; + pspec[0].sidestep[0] = (ssv[0] > scutoff) ? sqrtf( 2.0 * t2 / ssv[0] ) : pspec[0].range[2]; + pspec[0].sidestep[1] = (ssv[1] > scutoff) ? sqrtf( 2.0 * t2 / ssv[1] ) : pspec[0].range[2]; pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; REAL tcutoff = 2.0 * t2 / ( pspec[1].range[2] * pspec[1].range[2]); - pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? ::sqrtf( 2.0 * t2 / ttv[0] ) : pspec[1].range[2]; - pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? ::sqrtf( 2.0 * t2 / ttv[1] ) : pspec[1].range[2]; + pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[0] ) : pspec[1].range[2]; + pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[1] ) : pspec[1].range[2]; } else if( ss != 0.0 ) { REAL x = pspec[1].range[2] * st; - REAL ds = ( ::sqrtf( x * x + 8.0 * t2 * ss ) - x ) / ss; + REAL ds = ( sqrtf( x * x + 8.0 * t2 * ss ) - x ) / ss; pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; REAL scutoff = 2.0 * t2 / ( pspec[0].range[2] * pspec[0].range[2]); - pspec[0].sidestep[0] = (ssv[0] > scutoff) ? ::sqrtf( 2.0 * t2 / ssv[0] ) : pspec[0].range[2]; - pspec[0].sidestep[1] = (ssv[1] > scutoff) ? ::sqrtf( 2.0 * t2 / ssv[1] ) : pspec[0].range[2]; + pspec[0].sidestep[0] = (ssv[0] > scutoff) ? sqrtf( 2.0 * t2 / ssv[0] ) : pspec[0].range[2]; + pspec[0].sidestep[1] = (ssv[1] > scutoff) ? sqrtf( 2.0 * t2 / ssv[1] ) : pspec[0].range[2]; pspec[1].singleStep(); } else if( tt != 0.0 ) { REAL x = pspec[0].range[2] * st; - REAL dt = ( ::sqrtf( x * x + 8.0 * t2 * tt ) - x ) / tt; + REAL dt = ( sqrtf( x * x + 8.0 * t2 * tt ) - x ) / tt; pspec[0].singleStep(); REAL tcutoff = 2.0 * t2 / ( pspec[1].range[2] * pspec[1].range[2]); pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; - pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? ::sqrtf( 2.0 * t2 / ttv[0] ) : pspec[1].range[2]; - pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? ::sqrtf( 2.0 * t2 / ttv[1] ) : pspec[1].range[2]; + pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[0] ) : pspec[1].range[2]; + pspec[1].sidestep[1] = (ttv[1] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[1] ) : pspec[1].range[2]; } else { if( 4.0 * t2 > st * pspec[0].range[2] * pspec[1].range[2] ) { pspec[0].singleStep(); pspec[1].singleStep(); } else { REAL area = 4.0 * t2 / st; - REAL ds = ::sqrtf( area * pspec[0].range[2] / pspec[1].range[2] ); - REAL dt = ::sqrtf( area * pspec[1].range[2] / pspec[0].range[2] ); + REAL ds = sqrtf( area * pspec[0].range[2] / pspec[1].range[2] ); + REAL dt = sqrtf( area * pspec[1].range[2] / pspec[0].range[2] ); pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; pspec[0].sidestep[0] = pspec[0].range[2]; pspec[0].sidestep[1] = pspec[0].range[2]; @@ -417,8 +417,8 @@ Patch::getstepsize( void ) if( ms != 0.0 && mt != 0.0 ) { REAL d = 1.0 / (ms * mt); t *= M_SQRT2; - REAL ds = t * ::sqrtf( d * pspec[0].range[2] / pspec[1].range[2] ); - REAL dt = t * ::sqrtf( d * pspec[1].range[2] / pspec[0].range[2] ); + REAL ds = t * sqrtf( d * pspec[0].range[2] / pspec[1].range[2] ); + REAL dt = t * sqrtf( d * pspec[1].range[2] / pspec[0].range[2] ); pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t ) ? (t / msv[0]) : pspec[0].range[2]; pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t ) ? (t / msv[1]) : pspec[0].range[2]; |