[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (2c772a4e139a7e3ba4836bb82d9d17f7687bd4c8)



The branch, master has been updated
       via  2c772a4e139a7e3ba4836bb82d9d17f7687bd4c8 (commit)
      from  d1110fdfd2be920366a23dc008b8bfac9b32a437 (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/polygon1.c |   46 +++-------------------------------------------
 1 files changed, 3 insertions(+), 43 deletions(-)


=================
 Commit Messages
=================

commit 2c772a4e139a7e3ba4836bb82d9d17f7687bd4c8
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Feb 10 19:03:23 2009 +0000

    polygon1.c: Implement poly_Boolean() by calling poly_Boolean_free()
    
    Reduces duplicated code. The poly_Boolean() implemetation already
    copied the original contours, then duplicated the processing steps
    taken in poly_Boolean_free().

:100644 100644 32ffb31... c0dd8e7... M	src/polygon1.c

=========
 Changes
=========

commit 2c772a4e139a7e3ba4836bb82d9d17f7687bd4c8
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Feb 10 19:03:23 2009 +0000

    polygon1.c: Implement poly_Boolean() by calling poly_Boolean_free()
    
    Reduces duplicated code. The poly_Boolean() implemetation already
    copied the original contours, then duplicated the processing steps
    taken in poly_Boolean_free().

diff --git a/src/polygon1.c b/src/polygon1.c
index 32ffb31..c0dd8e7 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -1654,51 +1654,11 @@ poly_Boolean (const POLYAREA * a_org, const POLYAREA * b_org,
 	      POLYAREA ** res, int action)
 {
   POLYAREA *a = NULL, *b = NULL;
-  PLINE *p, *holes = NULL;
-  jmp_buf e;
-  int code;
-
-  *res = NULL;
-
-  if ((code = setjmp (e)) == 0)
-    {
-      if (!poly_M_Copy0 (&a, a_org) || !poly_M_Copy0 (&b, b_org))
-	longjmp (e, err_no_memory);
-
-#ifdef DEBUG
-      if (!poly_Valid (a))
-	return -1;
-      if (!poly_Valid (b))
-	return -1;
-#endif
-      M_POLYAREA_intersect (&e, a, b, TRUE);
-
-      M_POLYAREA_label (a, b, FALSE);
-      M_POLYAREA_label (b, a, FALSE);
-
-      M_POLYAREA_Collect (&e, a, res, &holes, action, b->f == b
-			  && !b->contours->next
-			  && b->contours->Flags.status != ISECTED);
-      poly_Free (&a);
-      M_B_AREA_Collect (&e, b, res, &holes, action);
-      poly_Free (&b);
 
-      InsertHoles (&e, *res, &holes);
-    }
-  /* delete holes */
-  while ((p = holes) != NULL)
-    {
-      holes = p->next;
-      poly_DelContour (&p);
-    }
+  if (!poly_M_Copy0 (&a, a_org) || !poly_M_Copy0 (&b, b_org))
+    return err_no_memory;
 
-  if (code)
-    {
-      poly_Free (res);
-      return code;
-    }
-  assert (!*res || poly_Valid (*res));
-  return code;
+  return poly_Boolean_free (a, b, res, action);
 }				/* poly_Boolean */
 
 /* just like poly_Boolean but frees the input polys */




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs