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

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



The branch, master has been updated
       via  b8cd62ae33d2473ff73416dd9c387bb542c1c070 (commit)
      from  d3449dfd68f6e751ffd760c0b7dcd96689b314d5 (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/global.h   |    7 ++++---
 src/polyarea.h |    2 +-
 src/polygon1.c |   13 +++++++------
 3 files changed, 12 insertions(+), 10 deletions(-)


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

commit b8cd62ae33d2473ff73416dd9c387bb542c1c070
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Make rtree_t type available to polygon1.c
    
    This saves a load of casting, and helps the compiler doing its job
    catching programming errors.

:100644 100644 f494dbc... 4cf489a... M	src/global.h
:100644 100644 a883750... 6652fce... M	src/polyarea.h
:100644 100644 bfa39b3... 8170197... M	src/polygon1.c

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

commit b8cd62ae33d2473ff73416dd9c387bb542c1c070
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Make rtree_t type available to polygon1.c
    
    This saves a load of casting, and helps the compiler doing its job
    catching programming errors.

diff --git a/src/global.h b/src/global.h
index f494dbc..4cf489a 100644
--- a/src/global.h
+++ b/src/global.h
@@ -40,7 +40,6 @@
 
 #include "const.h"
 #include "macro.h"
-#include "polyarea.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -54,8 +53,10 @@
 typedef struct BoxType BoxType, *BoxTypePtr;
 typedef struct polygon_st PolygonType, *PolygonTypePtr;
 typedef struct drc_violation_st DrcViolationType, *DrcViolationTypePtr;
+typedef struct rtree rtree_t;
 
 #include "hid.h"
+#include "polyarea.h"
 
 #define _(S) (S)
 
@@ -257,11 +258,11 @@ typedef struct			/* holds information about arcs */
     Delta;
 } ArcType, *ArcTypePtr;
 
-typedef struct
+struct rtree
 {
   struct rtree_node *root;
   int size;			/* number of entries in tree */
-} rtree_t;
+};
 
 typedef struct			/* holds information about one layer */
 {
diff --git a/src/polyarea.h b/src/polyarea.h
index a883750..6652fce 100644
--- a/src/polyarea.h
+++ b/src/polyarea.h
@@ -98,7 +98,7 @@ struct PLINE
     VNODE head;
     unsigned int Count;
     double area;
-    void *tree;
+    rtree_t *tree;
     struct {
       unsigned int status:3;
       unsigned int orient:1;
diff --git a/src/polygon1.c b/src/polygon1.c
index bfa39b3..8170197 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -45,7 +45,8 @@
 #include	<setjmp.h>
 #include	<math.h>
 #include	<string.h>
-#include "polyarea.h"
+
+#include "global.h"
 #include "rtree.h"
 #include "heap.h"
 
@@ -638,7 +639,7 @@ seg_in_seg (const BoxType * b, void *cl)
       if (res & 2)
 	{
 	  cntrbox_adjust (i->s->p, cnt > 1 ? s2 : s1);
-	  if (adjust_tree ((rtree_t *) (i->s->p->tree), i->s))
+	  if (adjust_tree (i->s->p->tree, i->s))
 	    return 1;
 	}
       /* if we added a node in the tree we need to change the tree */
@@ -809,12 +810,12 @@ intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
             /* fill in the segment in info corresponding to this node */
             if (setjmp (info.sego) == 0)
               {
-                r_search ((rtree_t *) (looping_over->tree), &box, NULL, get_seg, &info);
+                r_search (looping_over->tree, &box, NULL, get_seg, &info);
                 assert (0);
               }
 
               /* NB: If this actually hits anything, we are teleported back to the beginning */
-              info.tree = (rtree_t *) rtree_over->tree;
+              info.tree = rtree_over->tree;
               if (info.tree)
                 if (UNLIKELY (r_search (info.tree, &info.s->box,
                                         seg_in_region, seg_in_seg, &info)))
@@ -2019,7 +2020,7 @@ poly_InvContour (PLINE * c)
   c->Flags.orient ^= 1;
   if (c->tree)
     {
-      r = r_search ((rtree_t *) (c->tree), NULL, NULL, flip_cb, NULL);
+      r = r_search (c->tree, NULL, NULL, flip_cb, NULL);
       assert (r == c->Count);
     }
 }
@@ -2247,7 +2248,7 @@ poly_InsideContour (PLINE * c, Vector p)
   ray.X2 = 0x7fffffff;
   ray.Y2 = p[1] + 1;
   if (setjmp (info.env) == 0)
-    r_search ((rtree_t *) c->tree, &ray, NULL, crossing, &info);
+    r_search (c->tree, &ray, NULL, crossing, &info);
   return info.f;
 }
 




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