diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-03 04:26:00 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-03 04:26:00 -0300 |
commit | 40fda5093b8f50cb8071ce2ee23a60bb681c181f (patch) | |
tree | edcf1be30fe64f71f794f5a76e2c360fb4230ab9 /tests/libsample/point.cpp | |
parent | 0dc6d7208900278cf612567faf71dd4327266041 (diff) |
minor changes to Point class from the test library: using more
references as arguments, and added setX and setY methods
Diffstat (limited to 'tests/libsample/point.cpp')
-rw-r--r-- | tests/libsample/point.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/libsample/point.cpp b/tests/libsample/point.cpp index ffde59fcd..410e1c8cb 100644 --- a/tests/libsample/point.cpp +++ b/tests/libsample/point.cpp @@ -88,25 +88,25 @@ Point::operator-=(Point &other) } Point -operator*(Point& pt, double mult) +operator*(const Point& pt, double mult) { return Point(pt.m_x * mult, pt.m_y * mult); } Point -operator*(Point& pt, int mult) +operator*(const Point& pt, int mult) { return Point(((int) pt.m_x) * mult, ((int) pt.m_y) * mult); } Point -operator*(double mult, Point& pt) +operator*(double mult, const Point& pt) { return Point(pt.m_x * mult, pt.m_y * mult); } Point -operator*(int mult, Point& pt) +operator*(int mult, const Point& pt) { return Point(((int) pt.m_x) * mult, ((int) pt.m_y) * mult); } @@ -124,22 +124,16 @@ operator!(const Point& pt) } Complex -transmutePointIntoComplex(Point point) +transmutePointIntoComplex(const Point& point) { Complex cpx(point.x(), point.y()); - // cout << __PRETTY_FUNCTION__ << " "; - // point.show(); - // cout << endl; return cpx; } Point -transmuteComplexIntoPoint(Complex cpx) +transmuteComplexIntoPoint(const Complex& cpx) { Point pt(cpx.real(), cpx.imag()); - // cout << __PRETTY_FUNCTION__ << " "; - // cpx.show(); - // cout << endl; return pt; } |