Index: trunk/src/libcschem/cnc_line.c =================================================================== --- trunk/src/libcschem/cnc_line.c (revision 3558) +++ trunk/src/libcschem/cnc_line.c (revision 3559) @@ -278,17 +278,18 @@ /*** hash ***/ -unsigned csch_line_hash(const csch_line_t *line) +unsigned csch_line_hash_(const csch_line_t *line, int in_contour) { - unsigned res = csch_chdr_hash(&line->hdr); + unsigned res = 0; + if (!in_contour) res ^= csch_chdr_hash(&line->hdr); res ^= csch_coord_hash(line->spec.p1.x) + csch_coord_hash(line->spec.p2.x); res ^= csch_coord_hash(line->spec.p1.y) + csch_coord_hash(line->spec.p2.y); return res; } -int csch_line_keyeq(const csch_line_t *l1, const csch_line_t *l2) +int csch_line_keyeq_(const csch_line_t *l1, const csch_line_t *l2, int in_contour) { - if (!csch_chdr_eq(&l1->hdr, &l2->hdr)) return 0; + if (!in_contour && !csch_chdr_eq(&l1->hdr, &l2->hdr)) return 0; if (l1->spec.p1.x != l2->spec.p1.x) return 0; if (l1->spec.p1.y != l2->spec.p1.y) return 0; if (l1->spec.p2.x != l2->spec.p2.x) return 0; @@ -296,7 +297,18 @@ return 1; } +unsigned csch_line_hash(const csch_line_t *line) +{ + return csch_line_hash_(line, 0); +} +int csch_line_keyeq(const csch_line_t *l1, const csch_line_t *l2) +{ + return csch_line_keyeq_(l1, l2, 0); +} + + + /*** Modify ***/ typedef struct { csch_line_t *line; /* it is safe to save the object pointer because it is persistent (through the removed object list) */ Index: trunk/src/libcschem/cnc_line.h =================================================================== --- trunk/src/libcschem/cnc_line.h (revision 3558) +++ trunk/src/libcschem/cnc_line.h (revision 3559) @@ -45,7 +45,9 @@ csch_line_t *csch_line_get(csch_sheet_t *sheet, csch_cgrp_t *grp, csch_oid_t oid); void csch_line_update(csch_sheet_t *sheet, csch_line_t *line, int do_xform); +unsigned csch_line_hash_(const csch_line_t *line, int in_contour); unsigned csch_line_hash(const csch_line_t *line); +int csch_line_keyeq_(const csch_line_t *l1, const csch_line_t *l2, int in_contour); int csch_line_keyeq(const csch_line_t *l1, const csch_line_t *l2); /* non-standard calls */