Skip to content

Commit

Permalink
Make both versions of _cairo_lround consistent again
Browse files Browse the repository at this point in the history
Commit c000824 made cairo use libm's lround instead of its own _cairo_lround
by default. However, since commit ce58f87 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@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
  • Loading branch information
Uli Schlachter authored and Chris Wilson committed Nov 7, 2010
1 parent 5d5a7d6 commit 95f6f7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cairoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 95f6f7a

Please sign in to comment.