diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-13 17:52:19 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-13 17:56:14 +0100 |
commit | 8afd4e4c3db53159d1e5b6f13d3355cb5fb1750b (patch) | |
tree | 248d7b4a1203ef812db5695a5018bfd8d80effb5 /src/cairo-hull.c | |
parent | d95037db9915033ef1eee24c2fc05e8a95af5457 (diff) | |
download | cairo-8afd4e4c3db53159d1e5b6f13d3355cb5fb1750b.tar.gz |
hull: _cairo_hull_vertex_compare() return 0 for identical elements
Andreas Falkenhahn reported a bizarre situation with some
implementations of qsort that actually compare the same elements and
require the comparator to return 0. So be it.
Reported-by: Andreas Falkenhahn <andreas@airsoftsoftwair.de>
Diffstat (limited to 'src/cairo-hull.c')
-rw-r--r-- | src/cairo-hull.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cairo-hull.c b/src/cairo-hull.c index abd8dbf13..15b6c00a7 100644 --- a/src/cairo-hull.c +++ b/src/cairo-hull.c @@ -95,6 +95,13 @@ _cairo_hull_vertex_compare (const void *av, const void *bv) cairo_hull_t *b = (cairo_hull_t *) bv; int ret; + /* Some libraries are reported to actually compare identical + * pointers and require the result to be 0. This is the crazy world we + * have to live in. + */ + if (a == b) + return 0; + ret = _cairo_slope_compare (&a->slope, &b->slope); /* |