Index: trunk/src/obj_pinvia_therm.c =================================================================== --- trunk/src/obj_pinvia_therm.c (revision 4800) +++ trunk/src/obj_pinvia_therm.c (revision 4801) @@ -50,7 +50,7 @@ static POLYAREA *diag_line(Coord X, Coord Y, Coord l, Coord w, pcb_bool rt) { PLINE *c; - Vector v; + pcb_vector_t v; Coord x1, x2, y1, y2; if (rt) { @@ -86,7 +86,7 @@ { POLYAREA *p, *p2; PLINE *c; - Vector v; + pcb_vector_t v; Coord d, in, out; switch (style) { Index: trunk/src/polyarea.h =================================================================== --- trunk/src/polyarea.h (revision 4800) +++ trunk/src/polyarea.h (revision 4801) @@ -38,15 +38,15 @@ #endif -typedef Coord vertex[2]; /* longing point representation of +typedef Coord pcb_vertex_t[2]; /* longing point representation of coordinates */ -typedef vertex Vector; +typedef pcb_vertex_t pcb_vector_t; -#define VertexEqu(a,b) (memcmp((a),(b),sizeof(Vector))==0) -#define VertexCpy(a,b) memcpy((a),(b),sizeof(Vector)) +#define VertexEqu(a,b) (memcmp((a),(b),sizeof(pcb_vector_t))==0) +#define VertexCpy(a,b) memcpy((a),(b),sizeof(pcb_vector_t)) -extern Vector vect_zero; +extern pcb_vector_t vect_zero; enum { err_no_memory = 2, @@ -71,7 +71,7 @@ } Flags; CVCList *cvc_prev; CVCList *cvc_next; - Vector point; + pcb_vector_t point; }; typedef struct PLINE PLINE; @@ -91,7 +91,7 @@ } Flags; }; -PLINE *poly_NewContour(Vector v); +PLINE *poly_NewContour(pcb_vector_t v); void poly_IniContour(PLINE * c); void poly_ClrContour(PLINE * c); /* clears list of vertices */ @@ -102,7 +102,7 @@ void poly_PreContour(PLINE * c, pcb_bool optimize); /* prepare contour */ void poly_InvContour(PLINE * c); /* invert contour */ -VNODE *poly_CreateNode(Vector v); +VNODE *poly_CreateNode(pcb_vector_t v); void poly_InclVertex(VNODE * after, VNODE * node); void poly_ExclVertex(VNODE * node); @@ -128,7 +128,7 @@ pcb_bool poly_ChkContour(PLINE * a); -pcb_bool poly_CheckInside(POLYAREA * c, Vector v0); +pcb_bool poly_CheckInside(POLYAREA * c, pcb_vector_t v0); pcb_bool Touching(POLYAREA * p1, POLYAREA * p2); /**********************************************************************/ @@ -138,7 +138,7 @@ /* checks whether point lies within contour independently of its orientation */ -int poly_InsideContour(PLINE * c, Vector v); +int poly_InsideContour(PLINE * c, pcb_vector_t v); int poly_ContourInContour(PLINE * poly, PLINE * inner); POLYAREA *poly_Create(void); @@ -154,11 +154,11 @@ PBO_XOR }; -double vect_dist2(Vector v1, Vector v2); -double vect_det2(Vector v1, Vector v2); -double vect_len2(Vector v1); +double vect_dist2(pcb_vector_t v1, pcb_vector_t v2); +double vect_det2(pcb_vector_t v1, pcb_vector_t v2); +double vect_len2(pcb_vector_t v1); -int vect_inters2(Vector A, Vector B, Vector C, Vector D, Vector S1, Vector S2); +int vect_inters2(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D, pcb_vector_t S1, pcb_vector_t S2); int poly_Boolean(const POLYAREA * a, const POLYAREA * b, POLYAREA ** res, int action); int poly_Boolean_free(POLYAREA * a, POLYAREA * b, POLYAREA ** res, int action); Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 4800) +++ trunk/src/polygon.c (revision 4801) @@ -252,7 +252,7 @@ PLINE *contour = NULL; POLYAREA *np = NULL; pcb_cardinal_t n; - Vector v; + pcb_vector_t v; int hole = 0; if ((np = poly_Create()) == NULL) @@ -300,7 +300,7 @@ POLYAREA *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2) { PLINE *contour = NULL; - Vector v; + pcb_vector_t v; /* Return NULL for zero or negatively sized rectangles */ if (x2 <= x1 || y2 <= y1) @@ -349,7 +349,7 @@ POLYAREA *OctagonPoly(Coord x, Coord y, Coord radius, int style) { PLINE *contour = NULL; - Vector v; + pcb_vector_t v; double xm[8], ym[8]; square_pin_factors(style, xm, ym); @@ -398,7 +398,7 @@ * 2 for a half circle * or 4 for a quarter circle */ -void frac_circle(PLINE * c, Coord X, Coord Y, Vector v, int range) +void frac_circle(PLINE * c, Coord X, Coord Y, pcb_vector_t v, int range) { double e1, e2, t1; int i; @@ -425,7 +425,7 @@ POLYAREA *CirclePoly(Coord x, Coord y, Coord radius) { PLINE *contour; - Vector v; + pcb_vector_t v; if (radius <= 0) return NULL; @@ -445,7 +445,7 @@ POLYAREA *RoundRect(Coord x1, Coord x2, Coord y1, Coord y2, Coord t) { PLINE *contour = NULL; - Vector v; + pcb_vector_t v; assert(x2 > x1); assert(y2 > y1); @@ -474,7 +474,7 @@ { PLINE *contour = NULL; POLYAREA *np = NULL; - Vector v; + pcb_vector_t v; pcb_box_t *ends; int i, segs; double ang, da, rx, ry; @@ -571,7 +571,7 @@ { PLINE *contour = NULL; POLYAREA *np = NULL; - Vector v; + pcb_vector_t v; double d, dx, dy; long half; pcb_line_t _l = *L, *l = &_l; @@ -628,7 +628,7 @@ { PLINE *contour = NULL; POLYAREA *np = NULL; - Vector v; + pcb_vector_t v; double d; double tx, ty; double cx, cy; @@ -1572,7 +1572,7 @@ pcb_bool IsPointInPolygon(Coord X, Coord Y, Coord r, pcb_polygon_t *p) { POLYAREA *c; - Vector v; + pcb_vector_t v; v[0] = X; v[1] = Y; if (poly_CheckInside(p->Clipped, v)) @@ -1597,7 +1597,7 @@ pcb_bool IsPointInPolygonIgnoreHoles(Coord X, Coord Y, pcb_polygon_t *p) { - Vector v; + pcb_vector_t v; v[0] = X; v[1] = Y; return poly_InsideContour(p->Clipped->contours, v); Index: trunk/src/polygon.h =================================================================== --- trunk/src/polygon.h (revision 4800) +++ trunk/src/polygon.h (revision 4801) @@ -74,7 +74,7 @@ POLYAREA *ArcPoly(pcb_arc_t * l, Coord thick); POLYAREA *PinPoly(pcb_pin_t * l, Coord thick, Coord clear); POLYAREA *BoxPolyBloated(pcb_box_t * box, Coord radius); -void frac_circle(PLINE *, Coord, Coord, Vector, int); +void frac_circle(PLINE *, Coord, Coord, pcb_vector_t, int); int InitClip(pcb_data_t * d, pcb_layer_t * l, pcb_polygon_t * p); void RestoreToPolygon(pcb_data_t *, int, void *, void *); void ClearFromPolygon(pcb_data_t *, int, void *, void *); Index: trunk/src/polygon1.c =================================================================== --- trunk/src/polygon1.c (revision 4800) +++ trunk/src/polygon1.c (revision 4801) @@ -66,18 +66,18 @@ /*********************************************************************/ #define Vcopy(a,b) {(a)[0]=(b)[0];(a)[1]=(b)[1];} -int vect_equal(Vector v1, Vector v2); -void vect_init(Vector v, double x, double y); -void vect_sub(Vector res, Vector v2, Vector v3); +int vect_equal(pcb_vector_t v1, pcb_vector_t v2); +void vect_init(pcb_vector_t v, double x, double y); +void vect_sub(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3); -void vect_min(Vector res, Vector v2, Vector v3); -void vect_max(Vector res, Vector v2, Vector v3); +void vect_min(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3); +void vect_max(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3); -double vect_dist2(Vector v1, Vector v2); -double vect_det2(Vector v1, Vector v2); -double vect_len2(Vector v1); +double vect_dist2(pcb_vector_t v1, pcb_vector_t v2); +double vect_det2(pcb_vector_t v1, pcb_vector_t v2); +double vect_len2(pcb_vector_t v1); -int vect_inters2(Vector A, Vector B, Vector C, Vector D, Vector S1, Vector S2); +int vect_inters2(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D, pcb_vector_t S1, pcb_vector_t S2); /* note that a vertex v's Flags.status represents the edge defined by * v to v->next (i.e. the edge is forward of v) @@ -182,7 +182,7 @@ 1 means a new node was created and inserted 4 means the intersection was not on the dest point */ -static VNODE *node_add_single(VNODE * dest, Vector po) +static VNODE *node_add_single(VNODE * dest, pcb_vector_t po) { VNODE *p; @@ -209,7 +209,7 @@ static CVCList *new_descriptor(VNODE * a, char poly, char side) { CVCList *l = (CVCList *) malloc(sizeof(CVCList)); - Vector v; + pcb_vector_t v; register double ang, dx, dy; if (!l) @@ -343,7 +343,7 @@ return 1 if new node in b, 2 if new node in a and 3 if new node in both */ -static VNODE *node_add_single_point(VNODE * a, Vector p) +static VNODE *node_add_single_point(VNODE * a, pcb_vector_t p) { VNODE *next_a, *new_node; @@ -450,7 +450,7 @@ return list; } -static inline void cntrbox_adjust(PLINE * c, Vector p) +static inline void cntrbox_adjust(PLINE * c, pcb_vector_t p) { c->xmin = min(c->xmin, p[0]); c->xmax = max(c->xmax, p[0] + 1); @@ -576,7 +576,7 @@ { struct info *i = (struct info *) cl; struct seg *s = (struct seg *) b; - Vector s1, s2; + pcb_vector_t s1, s2; int cnt; VNODE *new_node; @@ -2218,7 +2218,7 @@ return code; } /* poly_AndSubtract_free */ -static inline int cntrbox_pointin(PLINE * c, Vector p) +static inline int cntrbox_pointin(PLINE * c, pcb_vector_t p) { return (p[0] >= c->xmin && p[1] >= c->ymin && p[0] <= c->xmax && p[1] <= c->ymax); @@ -2229,7 +2229,7 @@ return (a == b) || (a->next == b) || (b->next == a) || (a->next == b->next); } -VNODE *poly_CreateNode(Vector v) +VNODE *poly_CreateNode(pcb_vector_t v) { VNODE *res; Coord *c; @@ -2238,7 +2238,7 @@ res = (VNODE *) calloc(1, sizeof(VNODE)); if (res == NULL) return NULL; - /* bzero (res, sizeof (VNODE) - sizeof(Vector)); */ + /* bzero (res, sizeof (VNODE) - sizeof(pcb_vector_t)); */ c = res->point; *c++ = *v++; *c = *v; @@ -2259,7 +2259,7 @@ c->radius = 0; } -PLINE *poly_NewContour(Vector v) +PLINE *poly_NewContour(pcb_vector_t v) { PLINE *res; @@ -2319,7 +2319,7 @@ { double area = 0; VNODE *p, *c; - Vector p1, p2; + pcb_vector_t p1, p2; assert(C != NULL); @@ -2534,7 +2534,7 @@ typedef struct pip { int f; - Vector p; + pcb_vector_t p; jmp_buf env; } pip; @@ -2546,7 +2546,7 @@ if (s->v->point[1] <= p->p[1]) { if (s->v->next->point[1] > p->p[1]) { - Vector v1, v2; + pcb_vector_t v1, v2; pcb_long64_t cross; Vsub2(v1, s->v->next->point, s->v->point); Vsub2(v2, p->p, s->v->point); @@ -2561,7 +2561,7 @@ } else { if (s->v->next->point[1] <= p->p[1]) { - Vector v1, v2; + pcb_vector_t v1, v2; pcb_long64_t cross; Vsub2(v1, s->v->next->point, s->v->point); Vsub2(v2, p->p, s->v->point); @@ -2577,7 +2577,7 @@ return R_DIR_FOUND_CONTINUE; } -int poly_InsideContour(PLINE * c, Vector p) +int poly_InsideContour(PLINE * c, pcb_vector_t p) { struct pip info; pcb_box_t ray; @@ -2594,7 +2594,7 @@ return info.f; } -pcb_bool poly_CheckInside(POLYAREA * p, Vector v0) +pcb_bool poly_CheckInside(POLYAREA * p, pcb_vector_t v0) { PLINE *cur; @@ -2610,7 +2610,7 @@ return pcb_false; } -pcb_bool poly_M_CheckInside(POLYAREA * p, Vector v0) +pcb_bool poly_M_CheckInside(POLYAREA * p, pcb_vector_t v0) { POLYAREA *cur; @@ -2625,7 +2625,7 @@ return pcb_false; } -static double dot(Vector A, Vector B) +static double dot(pcb_vector_t A, pcb_vector_t B) { return (double) A[0] * (double) B[0] + (double) A[1] * (double) B[1]; } @@ -2632,9 +2632,9 @@ /* Compute whether point is inside a triangle formed by 3 other pints */ /* Algorithm from http://www.blackpawn.com/texts/pointinpoly/default.html */ -static int point_in_triangle(Vector A, Vector B, Vector C, Vector P) +static int point_in_triangle(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t P) { - Vector v0, v1, v2; + pcb_vector_t v0, v1, v2; double dot00, dot01, dot02, dot11, dot12; double invDenom; double u, v; @@ -2664,13 +2664,13 @@ } -/* Returns the dot product of Vector A->B, and a vector - * orthogonal to Vector C->D. The result is not normalised, so will be +/* Returns the dot product of pcb_vector_t A->B, and a vector + * orthogonal to pcb_vector_t C->D. The result is not normalised, so will be * weighted by the magnitude of the C->D vector. */ -static double dot_orthogonal_to_direction(Vector A, Vector B, Vector C, Vector D) +static double dot_orthogonal_to_direction(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D) { - Vector l1, l2, l3; + pcb_vector_t l1, l2, l3; l1[0] = B[0] - A[0]; l1[1] = B[1] - A[1]; l2[0] = D[0] - C[0]; @@ -2699,7 +2699,7 @@ * Joseph O'Rourke, Cambridge University Press 1998, * ISBN 0-521-64010-5 Pbk, ISBN 0-521-64976-5 Hbk */ -static void poly_ComputeInteriorPoint(PLINE * poly, Vector v) +static void poly_ComputeInteriorPoint(PLINE * poly, pcb_vector_t v) { VNODE *pt1, *pt2, *pt3, *q; VNODE *min_q = NULL; @@ -2761,7 +2761,7 @@ */ int poly_ContourInContour(PLINE * poly, PLINE * inner) { - Vector point; + pcb_vector_t point; assert(poly != NULL); assert(inner != NULL); if (cntrbox_inside(inner, poly)) { @@ -2821,9 +2821,9 @@ free(*p), *p = NULL; } -static pcb_bool inside_sector(VNODE * pn, Vector p2) +static pcb_bool inside_sector(VNODE * pn, pcb_vector_t p2) { - Vector cdir, ndir, pdir; + pcb_vector_t cdir, ndir, pdir; int p_c, n_c, p_n; assert(pn != NULL); @@ -2845,7 +2845,7 @@ pcb_bool poly_ChkContour(PLINE * a) { VNODE *a1, *a2, *hit1, *hit2; - Vector i1, i2; + pcb_vector_t i1, i2; int icnt; assert(a != NULL); @@ -2975,13 +2975,13 @@ } -Vector vect_zero = { (long) 0, (long) 0 }; +pcb_vector_t vect_zero = { (long) 0, (long) 0 }; /*********************************************************************/ /* L o n g V e c t o r S t u f f */ /*********************************************************************/ -void vect_init(Vector v, double x, double y) +void vect_init(pcb_vector_t v, double x, double y) { v[0] = (long) x; v[1] = (long) y; @@ -2991,34 +2991,34 @@ #define Vsub(a,b,c) {(a)[0]=(b)[0]-(c)[0];(a)[1]=(b)[1]-(c)[1];} -int vect_equal(Vector v1, Vector v2) +int vect_equal(pcb_vector_t v1, pcb_vector_t v2) { return (v1[0] == v2[0] && v1[1] == v2[1]); } /* vect_equal */ -void vect_sub(Vector res, Vector v1, Vector v2) +void vect_sub(pcb_vector_t res, pcb_vector_t v1, pcb_vector_t v2) { Vsub(res, v1, v2)} /* vect_sub */ -void vect_min(Vector v1, Vector v2, Vector v3) +void vect_min(pcb_vector_t v1, pcb_vector_t v2, pcb_vector_t v3) { v1[0] = (v2[0] < v3[0]) ? v2[0] : v3[0]; v1[1] = (v2[1] < v3[1]) ? v2[1] : v3[1]; } /* vect_min */ -void vect_max(Vector v1, Vector v2, Vector v3) +void vect_max(pcb_vector_t v1, pcb_vector_t v2, pcb_vector_t v3) { v1[0] = (v2[0] > v3[0]) ? v2[0] : v3[0]; v1[1] = (v2[1] > v3[1]) ? v2[1] : v3[1]; } /* vect_max */ -double vect_len2(Vector v) +double vect_len2(pcb_vector_t v) { return ((double) v[0] * v[0] + (double) v[1] * v[1]); /* why sqrt? only used for compares */ } -double vect_dist2(Vector v1, Vector v2) +double vect_dist2(pcb_vector_t v1, pcb_vector_t v2) { double dx = v1[0] - v2[0]; double dy = v1[1] - v2[1]; @@ -3027,12 +3027,12 @@ } /* value has sign of angle between vectors */ -double vect_det2(Vector v1, Vector v2) +double vect_det2(pcb_vector_t v1, pcb_vector_t v2) { return (((double) v1[0] * v2[1]) - ((double) v2[0] * v1[1])); } -static double vect_m_dist(Vector v1, Vector v2) +static double vect_m_dist(pcb_vector_t v1, pcb_vector_t v2) { double dx = v1[0] - v2[0]; double dy = v1[1] - v2[1]; @@ -3053,7 +3053,7 @@ (C) 1997 Michael Leonov, Alexey Nikitin */ -int vect_inters2(Vector p1, Vector p2, Vector q1, Vector q2, Vector S1, Vector S2) +int vect_inters2(pcb_vector_t p1, pcb_vector_t p2, pcb_vector_t q1, pcb_vector_t q2, pcb_vector_t S1, pcb_vector_t S2) { double s, t, deel; double rpx, rpy, rqx, rqy; @@ -3075,7 +3075,7 @@ if (deel == 0) { /* parallel */ double dc1, dc2, d1, d2, h; /* Check to see whether p1-p2 and q1-q2 are on the same line */ - Vector hp1, hq1, hp2, hq2, q1p1, q1q2; + pcb_vector_t hp1, hq1, hp2, hq2, q1p1, q1q2; Vsub2(q1p1, q1, p1); Vsub2(q1q2, q1, q2); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/coordgeo/coordgeo.h =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/coordgeo/coordgeo.h (revision 4800) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/coordgeo/coordgeo.h (revision 4801) @@ -115,7 +115,7 @@ nowrap double cg_dist_(int x1, int y1, int x2, int y2); /* is point on the object? Extend means the object is extended (lines become - infinite long, arcs become circles). Vector always returns 1. */ + infinite long, arcs become circles). pcb_vector_t always returns 1. */ nowrap int cg_ison_(cg_obj_t *o, int x, int y, int extend); nowrap int cg_ison_line_(cg_obj_t *l, int x, int y, int extend); nowrap int cg_ison_arc_(cg_obj_t *a, int x, int y, int extend); Index: trunk/src_plugins/jostle/jostle.c =================================================================== --- trunk/src_plugins/jostle/jostle.c (revision 4800) +++ trunk/src_plugins/jostle/jostle.c (revision 4801) @@ -41,7 +41,7 @@ /*#define DEBUG_POLYAREA*/ -double vect_dist2(Vector v1, Vector v2); +double vect_dist2(pcb_vector_t v1, pcb_vector_t v2); #define Vcpy2(r,a) {(r)[0] = (a)[0]; (r)[1] = (a)[1];} #define Vswp2(a,b) { long t; \ t = (a)[0], (a)[0] = (b)[0], (b)[0] = t; \ @@ -161,7 +161,7 @@ * as a pair of vectors PQ.\n * Make it long so it will intersect everything in the area. */ -static void POLYAREA_findXmostLine(POLYAREA * a, int side, Vector p, Vector q, int clearance) +static void POLYAREA_findXmostLine(POLYAREA * a, int side, pcb_vector_t p, pcb_vector_t q, int clearance) { int extra; p[0] = p[1] = 0; @@ -192,7 +192,7 @@ { int kx, ky, minmax, dq, ckx, cky; Coord mm[2] = { MAX_COORD, -MAX_COORD }; - Vector mmp[2]; + pcb_vector_t mmp[2]; VNODE *v; switch (side) { @@ -269,7 +269,7 @@ /*! * Wrapper for CreateNewLineOnLayer that takes vectors and deals with Undo */ -static pcb_line_t *CreateVectorLineOnLayer(pcb_layer_t * layer, Vector a, Vector b, int thickness, int clearance, pcb_flag_t flags) +static pcb_line_t *Createpcb_vector_tLineOnLayer(pcb_layer_t * layer, pcb_vector_t a, pcb_vector_t b, int thickness, int clearance, pcb_flag_t flags) { pcb_line_t *line; @@ -280,11 +280,11 @@ return line; } -static pcb_line_t *MakeBypassLine(pcb_layer_t * layer, Vector a, Vector b, pcb_line_t * orig, POLYAREA ** expandp) +static pcb_line_t *MakeBypassLine(pcb_layer_t * layer, pcb_vector_t a, pcb_vector_t b, pcb_line_t * orig, POLYAREA ** expandp) { pcb_line_t *line; - line = CreateVectorLineOnLayer(layer, a, b, orig->Thickness, orig->Clearance, orig->Flags); + line = Createpcb_vector_tLineOnLayer(layer, a, b, orig->Thickness, orig->Clearance, orig->Flags); if (line && expandp) { POLYAREA *p = LinePoly(line, line->Thickness + line->Clearance); poly_Boolean_free(*expandp, p, expandp, PBO_UNITE); @@ -313,9 +313,9 @@ */ static int MakeBypassingLines(POLYAREA * brush, pcb_layer_t * layer, pcb_line_t * line, int side, POLYAREA ** expandp) { - Vector pA, pB, flatA, flatB, qA, qB; - Vector lA, lB; - Vector a, b, c, d, junk; + pcb_vector_t pA, pB, flatA, flatB, qA, qB; + pcb_vector_t lA, lB; + pcb_vector_t a, b, c, d, junk; int hits; SET_FLAG(PCB_FLAG_DRC, line); /* will cause sublines to inherit */ @@ -371,7 +371,7 @@ pcb_line_t *line = (pcb_line_t *) targ; struct info *info = private; POLYAREA *lp, *copy, *tmp, *n, *smallest = NULL; - Vector p; + pcb_vector_t p; int inside = 0, side, r; double small, big; int nocentroid = 0; Index: trunk/src_plugins/polycombine/polycombine.c =================================================================== --- trunk/src_plugins/polycombine/polycombine.c (revision 4800) +++ trunk/src_plugins/polycombine/polycombine.c (revision 4801) @@ -43,7 +43,7 @@ PLINE *contour = NULL; POLYAREA *np = NULL; pcb_cardinal_t n; - Vector v; + pcb_vector_t v; int hole = 0; *forward = pcb_true;