Add more wxRound() compatibility overloads and improve docs
Make the overloads added for compatibility available only when WXWIN_COMPATIBILITY_3_0 is on and add two more of them, to cover all the interer types (except char but, honestly, who rounds those?). Also improve the documentation and make it clear that this function is not needed at all in the new code. Closes https://github.com/wxWidgets/wxWidgets/pull/2111
This commit is contained in:
@@ -164,9 +164,21 @@ inline int wxRound(float x)
|
||||
|
||||
inline int wxRound(long double x) { return wxRound(double(x)); }
|
||||
|
||||
// For compatibility purposes, define wxRound() overloads for integer types
|
||||
// too, as this used to compile with wx 3.0.
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
|
||||
wxDEPRECATED_MSG("rounding an integer is useless")
|
||||
inline int wxRound(int x) { return x; }
|
||||
|
||||
wxDEPRECATED_MSG("rounding an integer is useless")
|
||||
inline int wxRound(short x) { return x; }
|
||||
|
||||
wxDEPRECATED_MSG("rounding an integer is useless")
|
||||
inline int wxRound(long x) { return static_cast<int>(x); }
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY_3_0
|
||||
|
||||
// Convert between degrees and radians.
|
||||
inline double wxDegToRad(double deg) { return (deg * M_PI) / 180.0; }
|
||||
inline double wxRadToDeg(double rad) { return (rad * 180.0) / M_PI; }
|
||||
|
Reference in New Issue
Block a user