Index: trunk/src/libcschem/util_wirenet.c =================================================================== --- trunk/src/libcschem/util_wirenet.c (revision 2204) +++ trunk/src/libcschem/util_wirenet.c (revision 2205) @@ -226,33 +226,6 @@ return &line->hdr; } -RND_INLINE int is_junction(csch_chdr_t *obj) -{ - /* simplest case: zero-length line is implied to be a junction */ - if (obj->type == CSCH_CTYPE_LINE) { - csch_line_t *line = (csch_line_t *)obj; - if ((line->spec.p1.x == line->spec.p2.x) && (line->spec.p1.y == line->spec.p2.y)) - return 1; - } - - /* non-line drawing object, or line with non-zero length: check if parent is a junction grp */ - if (!csch_obj_is_grp(obj)) - obj = &obj->parent->hdr; - - if (csch_obj_is_grp(obj)) { /* more complex junction graphics must go in a role=junction grp */ - csch_cgrp_t *grp = (csch_cgrp_t *)obj; - return (grp->role == CSCH_ROLE_JUNCTION); - } - - return 0; /* anything else is wire */ -} - -int csch_obj_is_junction(csch_chdr_t *obj) -{ - return is_junction(obj); -} - - typedef struct { htPo_t jl; /* junction list */ htpi_t obj2seg; /* assigns an unique segment ID to each object */ @@ -315,7 +288,7 @@ for(e = htip_first(&wirenet->id2obj); e != NULL; e = htip_next(&wirenet->id2obj, e)) { csch_chdr_t *obj = e->value; - int junc = is_junction(obj); + int junc = csch_obj_is_junction(obj); if (junc) { /* verify if an existing junction is still valid */ jk.x = (obj->bbox.x1 + obj->bbox.x2)/2; @@ -336,7 +309,7 @@ if ((pair == obj) || (pair->type != CSCH_CTYPE_LINE) || (pair->parent != wirenet)) continue; len = g2d_iscp_cline_cline(&lo->spec, &lp->spec, ip, offs); - lp_is_junc = is_junction(&lp->hdr); + lp_is_junc = csch_obj_is_junction(&lp->hdr); for(n = 0; n < len; n++) { jk.x = ip[n].x; jk.y = ip[n].y; Index: trunk/src/libcschem/util_wirenet.h =================================================================== --- trunk/src/libcschem/util_wirenet.h (revision 2204) +++ trunk/src/libcschem/util_wirenet.h (revision 2205) @@ -28,7 +28,31 @@ void csch_wirenet_recalc_line_chg(csch_sheet_t *sheet, csch_line_t *line); /* Return true if object is a wirenet junction */ -int csch_obj_is_junction(csch_chdr_t *obj); +RND_INLINE int csch_obj_is_junction(csch_chdr_t *obj); +/*** implementation ***/ +RND_INLINE int csch_obj_is_junction(csch_chdr_t *obj) +{ + /* simplest case: zero-length line is implied to be a junction */ + if (obj->type == CSCH_CTYPE_LINE) { + csch_line_t *line = (csch_line_t *)obj; + if ((line->spec.p1.x == line->spec.p2.x) && (line->spec.p1.y == line->spec.p2.y)) + return 1; + } + + /* non-line drawing object, or line with non-zero length: check if parent is a junction grp */ + if (!csch_obj_is_grp(obj)) + obj = &obj->parent->hdr; + + if (csch_obj_is_grp(obj)) { /* more complex junction graphics must go in a role=junction grp */ + csch_cgrp_t *grp = (csch_cgrp_t *)obj; + return (grp->role == CSCH_ROLE_JUNCTION); + } + + return 0; /* anything else is wire */ +} + + + #endif \ No newline at end of file