[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (a82b657073aff33708a2814ae9063134f6051bc1)
The branch, master has been updated
via a82b657073aff33708a2814ae9063134f6051bc1 (commit)
from c1df6f7725601489a1562811ffc0c717a56445f5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/polyarea.h | 2 +-
src/polygon1.c | 15 +++++++--------
2 files changed, 8 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit a82b657073aff33708a2814ae9063134f6051bc1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
Replace poly_Clear(POLYAREA *) function with poly_FreeContours(PLINE **)
The poly_Clear function only clears the contours of the polygon anyway,
so make a more explicitly named function to do this work, and pass the
contours directly.
This will be useful should we want to deal with a series of contours
separately from a POLYAREA object.
:100644 100644 42acc1a... a883750... M src/polyarea.h
:100644 100644 fc01611... bfa39b3... M src/polygon1.c
=========
Changes
=========
commit a82b657073aff33708a2814ae9063134f6051bc1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
Replace poly_Clear(POLYAREA *) function with poly_FreeContours(PLINE **)
The poly_Clear function only clears the contours of the polygon anyway,
so make a more explicitly named function to do this work, and pass the
contours directly.
This will be useful should we want to deal with a series of contours
separately from a POLYAREA object.
diff --git a/src/polyarea.h b/src/polyarea.h
index 42acc1a..a883750 100644
--- a/src/polyarea.h
+++ b/src/polyarea.h
@@ -158,7 +158,7 @@ POLYAREA *poly_Create(void);
void poly_Free(POLYAREA **p);
void poly_Init(POLYAREA *p);
-void poly_Clear(POLYAREA *p);
+void poly_FreeContours(PLINE **pl);
BOOLp poly_Valid(POLYAREA *p);
enum PolygonBooleanOperation {
diff --git a/src/polygon1.c b/src/polygon1.c
index fc01611..bfa39b3 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -2314,15 +2314,14 @@ poly_Create (void)
}
void
-poly_Clear (POLYAREA * P)
+poly_FreeContours (PLINE **pline)
{
- PLINE *p;
+ PLINE *pl;
- assert (P != NULL);
- while ((p = P->contours) != NULL)
+ while ((pl = *pline) != NULL)
{
- P->contours = p->next;
- poly_DelContour (&p);
+ *pline = pl->next;
+ poly_DelContour (&pl);
}
}
@@ -2335,12 +2334,12 @@ poly_Free (POLYAREA ** p)
return;
for (cur = (*p)->f; cur != *p; cur = (*p)->f)
{
- poly_Clear (cur);
+ poly_FreeContours (&cur->contours);
cur->f->b = cur->b;
cur->b->f = cur->f;
free (cur);
}
- poly_Clear (cur);
+ poly_FreeContours (&cur->contours);
free (*p), *p = NULL;
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs