1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2024-12-23 04:50:49 +02:00

Revert "poly2d/p2d_hsort.c (p2d_hier_free): make freeing of polygons optional"

This reverts commit d758359791.
This commit is contained in:
Werner Almesberger 2013-10-14 11:13:22 -03:00
parent ae9ad0348c
commit ebb7d028ea
4 changed files with 12 additions and 15 deletions

View File

@ -39,7 +39,7 @@ struct f2d *f2d_tri(const struct p2d *p)
t = p2d_hsort(p); t = p2d_hsort(p);
recurse_area(t, &last); recurse_area(t, &last);
p2d_hier_free(t, 0); p2d_hier_free(t);
return res; return res;
} }

View File

@ -1,8 +1,8 @@
/* /*
* p2d_area.c - Fill a set of nested polygons * p2d_area.c - Fill a set of nested polygons
* *
* Written 2012, 2013 by Werner Almesberger * Written 2012 by Werner Almesberger
* Copyright 2012, 2013 Werner Almesberger * Copyright 2012 Werner Almesberger
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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); t = p2d_hsort(p);
recurse_area(t, first, next, &last); recurse_area(t, first, next, &last);
p2d_hier_free(t, 1); p2d_hier_free(t);
return res; return res;
} }

View File

@ -1,8 +1,8 @@
/* /*
* p2d_hsort.c - Hierarchical polygon sort * p2d_hsort.c - Hierarchical polygon sort
* *
* Written 2012, 2013 by Werner Almesberger * Written 2012 by Werner Almesberger
* Copyright 2012, 2013 Werner Almesberger * Copyright 2012 Werner Almesberger
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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_hier *next;
struct p2d *p; struct p2d *p;
while (t) { while (t) {
p2d_hier_free(t->holes, free_poly); p2d_hier_free(t->holes);
p = &t->p; p = &t->p;
next = p2d_to_hier(p->next); next = p2d_to_hier(p->next);
if (free_poly) p2d_free(p);
p2d_free(p);
t = next; t = next;
} }
} }

View File

@ -1,8 +1,8 @@
/* /*
* p2d_hsort.h - Hierarchical polygon sort * p2d_hsort.h - Hierarchical polygon sort
* *
* Written 2012, 2013 by Werner Almesberger * Written 2012 by Werner Almesberger
* Copyright 2012, 2013 Werner Almesberger * Copyright 2012 Werner Almesberger
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -14,8 +14,6 @@
#ifndef P2D_HSORT_H #ifndef P2D_HSORT_H
#define P2D_HSORT_H #define P2D_HSORT_H
#include <stdbool.h>
#include "poly2d.h" #include "poly2d.h"
@ -29,6 +27,6 @@ struct p2d_hier {
struct p2d_hier *p2d_hsort(const struct p2d *p); 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 */ #endif /* !P2D_HSORT_H */