From 8c627eaa7f0b0fc762880e5fd112c7e7af3cfe1e Mon Sep 17 00:00:00 2001 From: buliabyak Date: Fri, 9 Mar 2007 05:35:40 +0000 Subject: [PATCH] fix crash --- src/libnr/nr-rect.cpp | 2 +- src/libnr/nr-rect.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libnr/nr-rect.cpp b/src/libnr/nr-rect.cpp index fd291218b..2d4629d42 100644 --- a/src/libnr/nr-rect.cpp +++ b/src/libnr/nr-rect.cpp @@ -285,7 +285,7 @@ void Rect::expandTo(Point p) { } /** Returns the set of points shared by both rectangles. */ -Maybe intersection(Maybe a, Maybe b) { +Maybe intersection(Maybe const & a, Maybe const & b) { if ( !a || !b ) { return Nothing(); } else { diff --git a/src/libnr/nr-rect.h b/src/libnr/nr-rect.h index 4ae5642ae..b632261aa 100644 --- a/src/libnr/nr-rect.h +++ b/src/libnr/nr-rect.h @@ -176,7 +176,7 @@ private: Point _min, _max; friend class MaybeStorage; - friend Maybe intersection(Maybe, Maybe); + friend Maybe intersection(Maybe const &, Maybe const &); friend Rect union_bounds(Rect const &, Rect const &); }; @@ -197,25 +197,25 @@ private: }; /** Returns the set of points shared by both rectangles. */ -Maybe intersection(Maybe a, Maybe b); +Maybe intersection(Maybe const & a, Maybe const & b); /** Returns the smallest rectangle that encloses both rectangles. */ Rect union_bounds(Rect const &a, Rect const &b); -inline Rect union_bounds(Maybe a, Rect const &b) { +inline Rect union_bounds(Maybe const & a, Rect const &b) { if (a) { return union_bounds(*a, b); } else { return b; } } -inline Rect union_bounds(Rect const &a, Maybe b) { +inline Rect union_bounds(Rect const &a, Maybe const & b) { if (b) { return union_bounds(a, *b); } else { return a; } } -inline Maybe union_bounds(Maybe a, Maybe b) +inline Maybe union_bounds(Maybe const & a, Maybe const & b) { if (!a) { return b; -- 2.30.2