diff options
author | Neil <nyamatongwe@gmail.com> | 2014-05-03 20:21:13 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-05-03 20:21:13 +1000 |
commit | 97ae63fa3914ac9894a319c0c75eeeffe96b16e9 (patch) | |
tree | 7cc80911f2b6338a9ea84744577c535c16346c2d /include/Platform.h | |
parent | 850baf30484384711aa410d3596531f49c15e1ac (diff) | |
download | scintilla-mirror-97ae63fa3914ac9894a319c0c75eeeffe96b16e9.tar.gz |
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.
Diffstat (limited to 'include/Platform.h')
-rw-r--r-- | include/Platform.h | 17 |
1 files changed, 7 insertions, 10 deletions
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<XYPOSITION>(x_)), y(static_cast<XYPOSITION>(y_)) { - } - explicit Point(long x_, long y_) : x(static_cast<XYPOSITION>(x_)), y(static_cast<XYPOSITION>(y_)) { + + static Point FromInts(int x_, int y_) { + return Point(static_cast<XYPOSITION>(x_), static_cast<XYPOSITION>(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<XYPOSITION>(left_)), top(static_cast<XYPOSITION>(top_)), - right(static_cast<XYPOSITION>(right_)), bottom(static_cast<XYPOSITION>(bottom_)) { - } - explicit PRectangle(long left_, long top_, long right_, long bottom_) : - left(static_cast<XYPOSITION>(left_)), top(static_cast<XYPOSITION>(top_)), - right(static_cast<XYPOSITION>(right_)), bottom(static_cast<XYPOSITION>(bottom_)) { + + static PRectangle FromInts(int left_, int top_, int right_, int bottom_) { + return PRectangle(static_cast<XYPOSITION>(left_), static_cast<XYPOSITION>(top_), + static_cast<XYPOSITION>(right_), static_cast<XYPOSITION>(bottom_)); } // Other automatically defined methods (assignment, copy constructor, destructor) are fine |