[PATCH 2/3] Make both versions of _cairo_lround consistent again

Uli Schlachter psychon at znc.in
Fri Oct 22 02:54:57 PDT 2010


Commit c0008242b0f made cairo use libm's lround instead of its own _cairo_lround
by default. However, since commit ce58f874 from 2006, _cairo_lround does
arithmetic rounding instead of away-from-zero rounding (before said commit, it
was using baker's rounding).

So to make the rounding of _cairo_lround be independent from
DISABLE_SOME_FLOATING_POINT, we have to use another function. Turns out that
_cairo_round already does the same thing that _cairo_lround does. Their only
difference is the return type.

Signed-off-by: Uli Schlachter <psychon at znc.in>
---
 src/cairoint.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/cairoint.h b/src/cairoint.h
index 53c87e5..539d92e 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -968,7 +968,11 @@ _cairo_round (double r)
 cairo_private int
 _cairo_lround (double d) cairo_const;
 #else
-#define _cairo_lround lround
+static inline int cairo_const
+_cairo_lround (double r)
+{
+    return _cairo_round (r);
+}
 #endif
 
 cairo_private uint16_t
-- 
1.7.2.3


--------------000402080900070308030407
Content-Type: text/x-diff;
 name="0003-test-README-Change-suggested-screen-size.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0003-test-README-Change-suggested-screen-size.patch"



More information about the cairo mailing list