From 97ae63fa3914ac9894a319c0c75eeeffe96b16e9 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 3 May 2014 20:21:13 +1000 Subject: Replacing the int-based constructors for Point and PRectangle with FromInts static methods as there were too many failures with mixed types and not-quite matching types. --- include/Platform.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/Platform.h b/include/Platform.h index c9156fc0c..4bba252f2 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -103,9 +103,9 @@ public: explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) : x(x_), y(y_) { } - explicit Point(int x_, int y_) : x(static_cast(x_)), y(static_cast(y_)) { - } - explicit Point(long x_, long y_) : x(static_cast(x_)), y(static_cast(y_)) { + + static Point FromInts(int x_, int y_) { + return Point(static_cast(x_), static_cast(y_)); } // Other automatically defined methods (assignment, copy constructor, destructor) are fine @@ -128,13 +128,10 @@ public: explicit PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) : left(left_), top(top_), right(right_), bottom(bottom_) { } - explicit PRectangle(int left_, int top_, int right_, int bottom_) : - left(static_cast(left_)), top(static_cast(top_)), - right(static_cast(right_)), bottom(static_cast(bottom_)) { - } - explicit PRectangle(long left_, long top_, long right_, long bottom_) : - left(static_cast(left_)), top(static_cast(top_)), - right(static_cast(right_)), bottom(static_cast(bottom_)) { + + static PRectangle FromInts(int left_, int top_, int right_, int bottom_) { + return PRectangle(static_cast(left_), static_cast(top_), + static_cast(right_), static_cast(bottom_)); } // Other automatically defined methods (assignment, copy constructor, destructor) are fine -- cgit v1.2.3