[Gcblue-commits] gcb_wx/src/common nsNav.cpp,1.4,1.5
Status: Alpha
Brought to you by:
ddcforge
|
From: Xavi <xr...@us...> - 2004-03-28 19:00:46
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10309 Modified Files: nsNav.cpp Log Message: + removed unnecessary code refered to min/max in linux + added "using std::min/max" in order to avoid problems with declarations of these functions Index: nsNav.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/nsNav.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nsNav.cpp 4 Dec 2003 22:31:52 -0000 1.4 --- nsNav.cpp 28 Mar 2004 18:49:24 -0000 1.5 *************** *** 26,41 **** #include "simmath.h" #include <stdio.h> ! #include <math.h> ! #ifdef __unix__ ! #define min(X,Y)\ ! ({ typeof (X) x_ =(X); \ ! typeof (Y) y_ =(Y); \ ! (x_ < y_) ?x_: y_; }) ! #define max(X,Y)\ ! ({ typeof (X) x_ =(X); \ ! typeof (Y) y_ =(Y); \ ! (x_ > y_) ?x_: y_; }) ! #endif // great circle distance in radians between points a and b --- 26,33 ---- #include "simmath.h" #include <stdio.h> ! #include <cmath> ! using std::max; ! using std::min; // great circle distance in radians between points a and b *************** *** 91,98 **** (sinf(fDistanceRad)*cosf(a.mfLat_rad)); if (sinf(a.mfLon_rad-b.mfLon_rad) < 0) { ! return acosf(max(min(fTerm,1.0f),-1.0f)); } else { ! return C_TWOPI - acosf(max(min(fTerm,1.0f),-1.0f)); } } --- 83,90 ---- (sinf(fDistanceRad)*cosf(a.mfLat_rad)); if (sinf(a.mfLon_rad-b.mfLon_rad) < 0) { ! return acosf( max( min( fTerm,1.0f ),-1.0f ) ); } else { ! return C_TWOPI - acosf( max( min(fTerm,1.0f), -1.0f) ); } } |