Update of /cvsroot/plib/plib/src/sg
In directory usw-pr-cvs1:/tmp/cvs-serv2976
Modified Files:
sg.cxx sg.h sgdIsect.cxx sgPerlinNoise.cxx
Log Message:
Removing compiler warnings due to double to float conversion.
Index: sg.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/sg/sg.cxx,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- sg.cxx 11 Aug 2002 14:07:09 -0000 1.35
+++ sg.cxx 30 Aug 2002 10:04:47 -0000 1.36
@@ -1786,7 +1786,7 @@
SGfloat s = lenC * lenC +
lenA * lenA - SG_TWO * lenC * lenA * sgCos( angB ) ;
- SGfloat lb = ( s <= SG_ZERO ) ? SG_ZERO : sqrt ( s ) ;
+ SGfloat lb = ( s <= SG_ZERO ) ? SG_ZERO : (SGfloat) sqrt ( s ) ;
if ( lenB ) *lenB = lb ;
Index: sg.h
===================================================================
RCS file: /cvsroot/plib/plib/src/sg/sg.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- sg.h 24 Aug 2002 23:22:13 -0000 1.45
+++ sg.h 30 Aug 2002 10:04:47 -0000 1.46
@@ -2788,7 +2788,7 @@
sgVec3 dP ; sgSubVec3 ( dP, p0->getPos(), p1->getPos() ) ;
sgVec3 dV ; sgSubVec3 ( dV, p0->getVel(), p1->getVel() ) ;
- float L = sgLengthVec3 ( dP ) ; if ( L == 0.0f ) L = 0.0000001 ;
+ float L = sgLengthVec3 ( dP ) ; if ( L == 0.0f ) L = 0.0000001f ;
float H = ( L - restLength ) * stiffness ;
float D = sgScalarProductVec3 ( dV, dP ) * damping / L ;
Index: sgdIsect.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/sg/sgdIsect.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sgdIsect.cxx 18 Dec 2001 04:06:04 -0000 1.1
+++ sgdIsect.cxx 30 Aug 2002 10:04:47 -0000 1.2
@@ -216,7 +216,7 @@
return FLT_MAX ;
}
- float s = - ( sgdScalarProductVec3 ( plane, v1 ) + plane[3] ) / p ;
+ float s = (float) (- ( sgdScalarProductVec3 ( plane, v1 ) + plane[3] ) / p) ;
sgdScaleVec3 ( dst, delta, s ) ;
sgdAddVec3 ( dst, dst, v1 ) ;
Index: sgPerlinNoise.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/sg/sgPerlinNoise.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- sgPerlinNoise.cxx 25 Aug 2002 11:59:34 -0000 1.2
+++ sgPerlinNoise.cxx 30 Aug 2002 10:04:47 -0000 1.3
@@ -60,7 +60,7 @@
though -cos(x * PI) * 0.5 + 0.5 would work too
*/
-inline SGfloat easeCurve ( SGfloat t ) { return t * t * (3.0 - 2.0 * t) ; }
+inline SGfloat easeCurve ( SGfloat t ) { return (SGfloat) (t * t * (3.0 - 2.0 * t)) ; }
inline SGfloat dot2 ( SGfloat rx, SGfloat ry, sgVec2 q )
{
@@ -91,7 +91,7 @@
*g0 = it & SG_PERLIN_NOISE_MOD_MASK ;
*g1 = (*g0 + 1) & SG_PERLIN_NOISE_MOD_MASK ;
*d0 = t - it ;
- *d1 = *d0 - 1.0 ;
+ *d1 = *d0 - 1.0f ;
}
|