better fix for MIPSpro warnings: removed unneeded calls to floor()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -392,49 +392,49 @@ public:
|
|||||||
class WXDLLEXPORT wxPoint2DInt
|
class WXDLLEXPORT wxPoint2DInt
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
inline wxPoint2DInt();
|
inline wxPoint2DInt();
|
||||||
inline wxPoint2DInt( wxInt32 x , wxInt32 y );
|
inline wxPoint2DInt( wxInt32 x , wxInt32 y );
|
||||||
inline wxPoint2DInt( const wxPoint2DInt &pt );
|
inline wxPoint2DInt( const wxPoint2DInt &pt );
|
||||||
inline wxPoint2DInt( const wxPoint &pt );
|
inline wxPoint2DInt( const wxPoint &pt );
|
||||||
|
|
||||||
// two different conversions to integers, floor and rounding
|
// noops for this class, just return the coords
|
||||||
inline void GetFloor( wxInt32 *x , wxInt32 *y );
|
inline void GetFloor( wxInt32 *x , wxInt32 *y );
|
||||||
inline void GetRounded( wxInt32 *x , wxInt32 *y );
|
inline void GetRounded( wxInt32 *x , wxInt32 *y );
|
||||||
|
|
||||||
inline wxDouble GetVectorLength();
|
inline wxDouble GetVectorLength();
|
||||||
wxDouble GetVectorAngle();
|
wxDouble GetVectorAngle();
|
||||||
inline void SetVectorLength( wxDouble length );
|
inline void SetVectorLength( wxDouble length );
|
||||||
void SetVectorAngle( wxDouble degrees );
|
void SetVectorAngle( wxDouble degrees );
|
||||||
void SetPolarCoordinates( wxInt32 angle , wxInt32 length );
|
void SetPolarCoordinates( wxInt32 angle , wxInt32 length );
|
||||||
// set the vector length to 1.0, preserving the angle
|
// set the vector length to 1.0, preserving the angle
|
||||||
inline void Normalize();
|
inline void Normalize();
|
||||||
|
|
||||||
inline wxDouble GetDistance( const wxPoint2DInt &pt ) const;
|
inline wxDouble GetDistance( const wxPoint2DInt &pt ) const;
|
||||||
inline wxDouble GetDistanceSquare( const wxPoint2DInt &pt ) const;
|
inline wxDouble GetDistanceSquare( const wxPoint2DInt &pt ) const;
|
||||||
inline wxInt32 GetDotProduct( const wxPoint2DInt &vec ) const;
|
inline wxInt32 GetDotProduct( const wxPoint2DInt &vec ) const;
|
||||||
inline wxInt32 GetCrossProduct( const wxPoint2DInt &vec ) const;
|
inline wxInt32 GetCrossProduct( const wxPoint2DInt &vec ) const;
|
||||||
|
|
||||||
// the reflection of this point
|
// the reflection of this point
|
||||||
inline wxPoint2DInt operator-();
|
inline wxPoint2DInt operator-();
|
||||||
|
|
||||||
inline wxPoint2DInt& operator=(const wxPoint2DInt& pt);
|
inline wxPoint2DInt& operator=(const wxPoint2DInt& pt);
|
||||||
inline wxPoint2DInt& operator+=(const wxPoint2DInt& pt);
|
inline wxPoint2DInt& operator+=(const wxPoint2DInt& pt);
|
||||||
inline wxPoint2DInt& operator-=(const wxPoint2DInt& pt);
|
inline wxPoint2DInt& operator-=(const wxPoint2DInt& pt);
|
||||||
inline wxPoint2DInt& operator*=(const wxPoint2DInt& pt);
|
inline wxPoint2DInt& operator*=(const wxPoint2DInt& pt);
|
||||||
inline wxPoint2DInt& operator*=(wxDouble n);
|
inline wxPoint2DInt& operator*=(wxDouble n);
|
||||||
inline wxPoint2DInt& operator*=(wxInt32 n);
|
inline wxPoint2DInt& operator*=(wxInt32 n);
|
||||||
inline wxPoint2DInt& operator/=(const wxPoint2DInt& pt);
|
inline wxPoint2DInt& operator/=(const wxPoint2DInt& pt);
|
||||||
inline wxPoint2DInt& operator/=(wxDouble n);
|
inline wxPoint2DInt& operator/=(wxDouble n);
|
||||||
inline wxPoint2DInt& operator/=(wxInt32 n);
|
inline wxPoint2DInt& operator/=(wxInt32 n);
|
||||||
inline operator wxPoint() const;
|
inline operator wxPoint() const;
|
||||||
inline bool operator==(const wxPoint2DInt& pt) const;
|
inline bool operator==(const wxPoint2DInt& pt) const;
|
||||||
inline bool operator!=(const wxPoint2DInt& pt) const;
|
inline bool operator!=(const wxPoint2DInt& pt) const;
|
||||||
|
|
||||||
void WriteTo( wxDataOutputStream &stream ) const;
|
void WriteTo( wxDataOutputStream &stream ) const;
|
||||||
void ReadFrom( wxDataInputStream &stream );
|
void ReadFrom( wxDataInputStream &stream );
|
||||||
|
|
||||||
wxInt32 m_x;
|
wxInt32 m_x;
|
||||||
wxInt32 m_y;
|
wxInt32 m_y;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
|
wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
|
||||||
@@ -474,20 +474,20 @@ inline wxPoint2DInt::wxPoint2DInt( const wxPoint &pt )
|
|||||||
|
|
||||||
inline void wxPoint2DInt::GetFloor( wxInt32 *x , wxInt32 *y )
|
inline void wxPoint2DInt::GetFloor( wxInt32 *x , wxInt32 *y )
|
||||||
{
|
{
|
||||||
// casts needed MIPSpro compiler under SGI
|
if ( x )
|
||||||
*x = (wxInt32) floor( (double)m_x );
|
*x = m_x;
|
||||||
*y = (wxInt32) floor( (double)m_y );
|
if ( y )
|
||||||
|
*y = m_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void wxPoint2DInt::GetRounded( wxInt32 *x , wxInt32 *y )
|
inline void wxPoint2DInt::GetRounded( wxInt32 *x , wxInt32 *y )
|
||||||
{
|
{
|
||||||
*x = (wxInt32) floor( m_x + 0.5 );
|
GetFloor(x, y);
|
||||||
*y = (wxInt32) floor( m_y + 0.5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline wxDouble wxPoint2DInt::GetVectorLength()
|
inline wxDouble wxPoint2DInt::GetVectorLength()
|
||||||
{
|
{
|
||||||
// casts needed MIPSpro compiler under SGI
|
// cast needed MIPSpro compiler under SGI
|
||||||
return sqrt( (double)(m_x)*(m_x) + (m_y)*(m_y) );
|
return sqrt( (double)(m_x)*(m_x) + (m_y)*(m_y) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user