[Xcircuit-dev] xcircuit disappearing labels
R. Timothy Edwards
tim at stravinsky.jhuapl.edu
Mon Mar 25 09:15:35 PST 2002
Dear Jeremy,
Thanks for the detailed---and repeatable---bug report. I discovered
the problem at netlist.c, line 3106, where the comment
/* (All elements after the 1st temp label are temp labels) */
was rendered false by the method of retaining netlists. If you make
a netlist, temporary labels which are not visible on the schematic
get created. If you subsequently add more parts, they get wiped out
the next time the netlist is invalidated. To correct the problem,
the section following the comment needs to be a little more
sophisticated. Change (netlist.c, line 3105 in source version 2.5.4):
/* Free any temporary labels which have been created */
/* (All elements after the 1st temp label are temp labels) */
else if ((*cgen)->type == LABEL) {
labelptr clab = TOLABEL(cgen);
int tmpval = (int)(cgen - cschem->plist);
if (clab->string->type != FONT_NAME) {
while (cgen < cschem->plist + cschem->parts) {
clab = TOLABEL(cgen);
freelabel(clab->string);
free(clab);
cgen++;
}
cschem->parts = tmpval;
break;
}
}
to:
/* Free any temporary labels which have been created */
else if ((*cgen)->type == LABEL) {
labelptr clab = TOLABEL(cgen);
int tmpval = (int)(cgen - cschem->plist);
if (clab->string->type != FONT_NAME) {
genericptr *tgen;
clab = TOLABEL(cgen);
freelabel(clab->string);
free(clab);
for (tgen = cgen + 1; tgen < cschem->plist + cschem->parts; tgen++)
*(tgen - 1) = *tgen;
cschem->parts--;
cgen--;
}
}
I have tested this and it gets rid of the problem. I have changed it in the
distribution, which is now version 2.5.4 rev. 1.
Regards,
Tim
_______________________________________________
Xcircuit-dev mailing list
Xcircuit-dev at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xcircuit-dev
More information about the Xcircuit-dev
mailing list