minor cleanup.

2008-01-16  Sven Neumann  <sven@gimp.org>

	* app/base/boundary.c: minor cleanup.


svn path=/trunk/; revision=24629
This commit is contained in:
Sven Neumann 2008-01-16 20:05:29 +00:00 committed by Sven Neumann
parent 7b8fa4c34c
commit e8fcbfcfa3
2 changed files with 76 additions and 65 deletions

View File

@ -1,3 +1,7 @@
2008-01-16 Sven Neumann <sven@gimp.org>
* app/base/boundary.c: minor cleanup.
2008-01-16 Michael Natterer <mitch@gimp.org>
Fix gegl types and includes so we can include operations from

View File

@ -102,11 +102,6 @@ static Boundary * generate_boundary (PixelRegion *PR,
gint y2,
guchar threshold);
static gint cmp_xy (gint ax,
gint ay,
gint bx,
gint by);
static gint cmp_segptr_xy1_addr (const BoundSeg **seg_ptr_a,
const BoundSeg **seg_ptr_b);
static gint cmp_segptr_xy2_addr (const BoundSeg **seg_ptr_a,
@ -345,8 +340,8 @@ boundary_simplify (BoundSeg *sorted_segs,
/* temporarily use the delimiter to close the polygon */
tmp_seg = sorted_segs[seg];
sorted_segs[seg] = sorted_segs[start];
simplify_subdivide (sorted_segs, start, start + n_points,
&tmp_points);
simplify_subdivide (sorted_segs,
start, start + n_points, &tmp_points);
sorted_segs[seg] = tmp_seg;
for (j = 0; j < tmp_points->len; j++)
@ -723,18 +718,30 @@ generate_boundary (PixelRegion *PR,
/* sorting utility functions */
static gint
cmp_xy(gint ax, gint ay, gint bx, gint by)
static inline gint
cmp_xy (const gint ax,
const gint ay,
const gint bx,
const gint by)
{
if (ay < by)
{
if (ay < by) {
return -1;
} else if (ay > by) {
}
else if (ay > by)
{
return 1;
} else if (ax < bx) {
}
else if (ax < bx)
{
return -1;
} else if (ax > bx) {
}
else if (ax > bx)
{
return 1;
} else {
}
else
{
return 0;
}
}