From ebb7d028eab843a7d6eb9d0d0661c8f1d6802e4a Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 14 Oct 2013 11:13:22 -0300 Subject: [PATCH] Revert "poly2d/p2d_hsort.c (p2d_hier_free): make freeing of polygons optional" This reverts commit d758359791fb5a8a6c083b96161170f512a7fdb9. --- poly2d/f2d_tri.c | 2 +- poly2d/p2d_area.c | 6 +++--- poly2d/p2d_hsort.c | 11 +++++------ poly2d/p2d_hsort.h | 8 +++----- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/poly2d/f2d_tri.c b/poly2d/f2d_tri.c index 7d15a95..b5c4c90 100644 --- a/poly2d/f2d_tri.c +++ b/poly2d/f2d_tri.c @@ -39,7 +39,7 @@ struct f2d *f2d_tri(const struct p2d *p) t = p2d_hsort(p); recurse_area(t, &last); - p2d_hier_free(t, 0); + p2d_hier_free(t); return res; } diff --git a/poly2d/p2d_area.c b/poly2d/p2d_area.c index b0ef6b1..bc45a66 100644 --- a/poly2d/p2d_area.c +++ b/poly2d/p2d_area.c @@ -1,8 +1,8 @@ /* * p2d_area.c - Fill a set of nested polygons * - * Written 2012, 2013 by Werner Almesberger - * Copyright 2012, 2013 Werner Almesberger + * Written 2012 by Werner Almesberger + * Copyright 2012 Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,6 +39,6 @@ struct p2d *p2d_area(const struct p2d *p, double first, double next) t = p2d_hsort(p); recurse_area(t, first, next, &last); - p2d_hier_free(t, 1); + p2d_hier_free(t); return res; } diff --git a/poly2d/p2d_hsort.c b/poly2d/p2d_hsort.c index 2570211..07aa958 100644 --- a/poly2d/p2d_hsort.c +++ b/poly2d/p2d_hsort.c @@ -1,8 +1,8 @@ /* * p2d_hsort.c - Hierarchical polygon sort * - * Written 2012, 2013 by Werner Almesberger - * Copyright 2012, 2013 Werner Almesberger + * Written 2012 by Werner Almesberger + * Copyright 2012 Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -92,17 +92,16 @@ struct p2d_hier *p2d_hsort(const struct p2d *p) } -void p2d_hier_free(struct p2d_hier *t, bool free_poly) +void p2d_hier_free(struct p2d_hier *t) { struct p2d_hier *next; struct p2d *p; while (t) { - p2d_hier_free(t->holes, free_poly); + p2d_hier_free(t->holes); p = &t->p; next = p2d_to_hier(p->next); - if (free_poly) - p2d_free(p); + p2d_free(p); t = next; } } diff --git a/poly2d/p2d_hsort.h b/poly2d/p2d_hsort.h index 8f9b37c..e789656 100644 --- a/poly2d/p2d_hsort.h +++ b/poly2d/p2d_hsort.h @@ -1,8 +1,8 @@ /* * p2d_hsort.h - Hierarchical polygon sort * - * Written 2012, 2013 by Werner Almesberger - * Copyright 2012, 2013 Werner Almesberger + * Written 2012 by Werner Almesberger + * Copyright 2012 Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,6 @@ #ifndef P2D_HSORT_H #define P2D_HSORT_H -#include - #include "poly2d.h" @@ -29,6 +27,6 @@ struct p2d_hier { struct p2d_hier *p2d_hsort(const struct p2d *p); -void p2d_hier_free(struct p2d_hier *t, bool free_poly); +void p2d_hier_free(struct p2d_hier *t); #endif /* !P2D_HSORT_H */