fix memory leak in table_read()

This commit is contained in:
stefan schippers 2023-02-09 21:04:22 +01:00
parent c882a34825
commit 3be9a66aed
31 changed files with 1681 additions and 1676 deletions

View File

@ -51,7 +51,7 @@ unsigned int hash_file(const char *f, int skip_path_lines)
/* skip lines of type: '** sch_path: ...' or '-- sch_path: ...' or '// sym_path: ...' */
if(skip_path_lines && strlen(line) > 14) {
if(!strncmp(line+2, " sch_path: ", 11) || !strncmp(line+2, " sym_path: ", 11) ) {
my_free(_ALLOC_ID_, &line);
my_free(0, &line);
continue;
}
}
@ -60,7 +60,7 @@ unsigned int hash_file(const char *f, int skip_path_lines)
/* skip CRs so hashes will match on unix / windows */
if(line[i] == '\r') {
cr = 1;
my_free(_ALLOC_ID_, &line);
my_free(1, &line);
continue;
} else if(line[i] == '\n' && cr) {
cr = 0;
@ -70,7 +70,7 @@ unsigned int hash_file(const char *f, int skip_path_lines)
}
h += (h << 5) + (unsigned char)line[i];
}
my_free(_ALLOC_ID_, &line);
my_free(2, &line);
}
if(cr) h += (h << 5) + '\r'; /* file ends with \r not followed by \n: keep it */
fclose(fd);
@ -461,7 +461,7 @@ void ask_new_file(void)
remove_symbols();
load_schematic(1, f,1); /* 20180925.1 */
tclvareval("update_recent_file {", f, "}", NULL);
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch],".");
my_strdup(3, &xctx->sch_path[xctx->currsch],".");
xctx->sch_path_hash[xctx->currsch] = 0;
xctx->sch_inst_number[xctx->currsch] = 1;
zoom_full(1, 0, 1, 0.97);
@ -479,60 +479,60 @@ void remove_symbol(int j)
xSymbol save;
dbg(1,"clearing symbol %s\n", xctx->sym[j].name);
my_free(_ALLOC_ID_, &xctx->sym[j].prop_ptr);
my_free(_ALLOC_ID_, &xctx->sym[j].templ);
my_free(_ALLOC_ID_, &xctx->sym[j].type);
my_free(_ALLOC_ID_, &xctx->sym[j].name);
my_free(4, &xctx->sym[j].prop_ptr);
my_free(5, &xctx->sym[j].templ);
my_free(6, &xctx->sym[j].type);
my_free(7, &xctx->sym[j].name);
/* /20150409 */
for(c=0;c<cadlayers;c++) {
for(i=0;i<xctx->sym[j].polygons[c];i++) {
if(xctx->sym[j].poly[c][i].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c][i].prop_ptr);
my_free(8, &xctx->sym[j].poly[c][i].prop_ptr);
}
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c][i].x);
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c][i].y);
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c][i].selected_point);
my_free(9, &xctx->sym[j].poly[c][i].x);
my_free(10, &xctx->sym[j].poly[c][i].y);
my_free(11, &xctx->sym[j].poly[c][i].selected_point);
}
my_free(_ALLOC_ID_, &xctx->sym[j].poly[c]);
my_free(12, &xctx->sym[j].poly[c]);
xctx->sym[j].polygons[c] = 0;
for(i=0;i<xctx->sym[j].lines[c];i++) {
if(xctx->sym[j].line[c][i].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &xctx->sym[j].line[c][i].prop_ptr);
my_free(13, &xctx->sym[j].line[c][i].prop_ptr);
}
}
my_free(_ALLOC_ID_, &xctx->sym[j].line[c]);
my_free(14, &xctx->sym[j].line[c]);
xctx->sym[j].lines[c] = 0;
for(i=0;i<xctx->sym[j].arcs[c];i++) {
if(xctx->sym[j].arc[c][i].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &xctx->sym[j].arc[c][i].prop_ptr);
my_free(15, &xctx->sym[j].arc[c][i].prop_ptr);
}
}
my_free(_ALLOC_ID_, &xctx->sym[j].arc[c]);
my_free(16, &xctx->sym[j].arc[c]);
xctx->sym[j].arcs[c] = 0;
for(i=0;i<xctx->sym[j].rects[c];i++) {
if(xctx->sym[j].rect[c][i].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &xctx->sym[j].rect[c][i].prop_ptr);
my_free(17, &xctx->sym[j].rect[c][i].prop_ptr);
}
set_rect_extraptr(0, &xctx->sym[j].rect[c][i]);
}
my_free(_ALLOC_ID_, &xctx->sym[j].rect[c]);
my_free(18, &xctx->sym[j].rect[c]);
xctx->sym[j].rects[c] = 0;
}
for(i=0;i<xctx->sym[j].texts;i++) {
if(xctx->sym[j].text[i].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &xctx->sym[j].text[i].prop_ptr);
my_free(19, &xctx->sym[j].text[i].prop_ptr);
}
if(xctx->sym[j].text[i].txt_ptr != NULL) {
my_free(_ALLOC_ID_, &xctx->sym[j].text[i].txt_ptr);
my_free(20, &xctx->sym[j].text[i].txt_ptr);
}
if(xctx->sym[j].text[i].font != NULL) {
my_free(_ALLOC_ID_, &xctx->sym[j].text[i].font);
my_free(21, &xctx->sym[j].text[i].font);
}
}
my_free(_ALLOC_ID_, &xctx->sym[j].text);
my_free(22, &xctx->sym[j].text);
xctx->sym[j].texts = 0;
save = xctx->sym[j]; /* save cleared symbol slot */
@ -589,7 +589,7 @@ int set_text_flags(xText *t)
t->vcenter = 0;
t->layer = -1;
if(t->prop_ptr) {
my_strdup(_ALLOC_ID_, &t->font, get_tok_value(t->prop_ptr, "font", 0));
my_strdup(23, &t->font, get_tok_value(t->prop_ptr, "font", 0));
str = get_tok_value(t->prop_ptr, "hcenter", 0);
t->hcenter = strcmp(str, "true") ? 0 : 1;
str = get_tok_value(t->prop_ptr, "vcenter", 0);
@ -618,7 +618,7 @@ int set_rect_extraptr(int what, xRect *drptr)
if(drptr->flags & 1024) { /* embedded image */
if(!drptr->extraptr) {
xEmb_image *d;
d = my_malloc(_ALLOC_ID_, sizeof(xEmb_image));
d = my_malloc(24, sizeof(xEmb_image));
d->image = NULL;
drptr->extraptr = d;
}
@ -628,7 +628,7 @@ int set_rect_extraptr(int what, xRect *drptr)
if(drptr->extraptr) {
xEmb_image *d = drptr->extraptr;
if(d->image) cairo_surface_destroy(d->image);
my_free(_ALLOC_ID_, &drptr->extraptr);
my_free(25, &drptr->extraptr);
}
}
}
@ -642,55 +642,55 @@ void clear_drawing(void)
xctx->graph_lastsel = -1;
del_inst_table();
del_wire_table();
my_free(_ALLOC_ID_, &xctx->schtedaxprop);
my_free(_ALLOC_ID_, &xctx->schsymbolprop);
my_free(_ALLOC_ID_, &xctx->schprop);
my_free(_ALLOC_ID_, &xctx->schvhdlprop);
my_free(_ALLOC_ID_, &xctx->version_string);
if(xctx->header_text) my_free(_ALLOC_ID_, &xctx->header_text);
my_free(_ALLOC_ID_, &xctx->schverilogprop);
my_free(26, &xctx->schtedaxprop);
my_free(27, &xctx->schsymbolprop);
my_free(28, &xctx->schprop);
my_free(29, &xctx->schvhdlprop);
my_free(30, &xctx->version_string);
if(xctx->header_text) my_free(31, &xctx->header_text);
my_free(32, &xctx->schverilogprop);
for(i=0;i<xctx->wires;i++)
{
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->wire[i].node);
my_free(33, &xctx->wire[i].prop_ptr);
my_free(34, &xctx->wire[i].node);
}
xctx->wires = 0;
for(i=0;i<xctx->instances;i++)
{
my_free(_ALLOC_ID_, &xctx->inst[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->inst[i].name);
my_free(_ALLOC_ID_, &xctx->inst[i].instname);
my_free(_ALLOC_ID_, &xctx->inst[i].lab);
my_free(35, &xctx->inst[i].prop_ptr);
my_free(36, &xctx->inst[i].name);
my_free(37, &xctx->inst[i].instname);
my_free(38, &xctx->inst[i].lab);
delete_inst_node(i);
}
xctx->instances = 0;
for(i=0;i<xctx->texts;i++)
{
my_free(_ALLOC_ID_, &xctx->text[i].font);
my_free(_ALLOC_ID_, &xctx->text[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->text[i].txt_ptr);
my_free(39, &xctx->text[i].font);
my_free(40, &xctx->text[i].prop_ptr);
my_free(41, &xctx->text[i].txt_ptr);
}
xctx->texts = 0;
for(i=0;i<cadlayers;i++)
{
for(j=0;j<xctx->lines[i];j++)
{
my_free(_ALLOC_ID_, &xctx->line[i][j].prop_ptr);
my_free(42, &xctx->line[i][j].prop_ptr);
}
for(j=0;j<xctx->rects[i];j++)
{
my_free(_ALLOC_ID_, &xctx->rect[i][j].prop_ptr);
my_free(43, &xctx->rect[i][j].prop_ptr);
set_rect_extraptr(0, &xctx->rect[i][j]);
}
for(j=0;j<xctx->arcs[i];j++)
{
my_free(_ALLOC_ID_, &xctx->arc[i][j].prop_ptr);
my_free(44, &xctx->arc[i][j].prop_ptr);
}
for(j=0;j<xctx->polygons[i]; j++) {
my_free(_ALLOC_ID_, &xctx->poly[i][j].x);
my_free(_ALLOC_ID_, &xctx->poly[i][j].y);
my_free(_ALLOC_ID_, &xctx->poly[i][j].prop_ptr);
my_free(_ALLOC_ID_, &xctx->poly[i][j].selected_point);
my_free(45, &xctx->poly[i][j].x);
my_free(46, &xctx->poly[i][j].y);
my_free(47, &xctx->poly[i][j].prop_ptr);
my_free(48, &xctx->poly[i][j].selected_point);
}
xctx->lines[i] = 0;
xctx->arcs[i] = 0;
@ -825,8 +825,8 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
int use_label_prefix;
int found=0;
my_strdup(_ALLOC_ID_, &symname_pin, tcleval("rel_sym_path [find_file lab_pin.sym]"));
my_strdup(_ALLOC_ID_, &symname_wire, tcleval("rel_sym_path [find_file lab_wire.sym]"));
my_strdup(49, &symname_pin, tcleval("rel_sym_path [find_file lab_pin.sym]"));
my_strdup(50, &symname_wire, tcleval("rel_sym_path [find_file lab_wire.sym]"));
if(symname_pin && symname_wire) {
rebuild_selected_array();
k = xctx->lastsel;
@ -834,8 +834,8 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
prepare_netlist_structs(0);
for(j=0;j<k;j++) if(xctx->sel_array[j].type==ELEMENT) {
found=1;
my_strdup(_ALLOC_ID_, &prop, xctx->inst[xctx->sel_array[j].n].instname);
my_strcat(_ALLOC_ID_, &prop, "_");
my_strdup(51, &prop, xctx->inst[xctx->sel_array[j].n].instname);
my_strcat(52, &prop, "_");
tclsetvar("custom_label_prefix",prop);
if(interactive && !do_all_inst) {
@ -843,7 +843,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
tcleval("attach_labels_to_inst");
if(!strcmp(tclgetvar("rcode"),"") ) {
bbox(END, 0., 0., 0., 0.);
my_free(_ALLOC_ID_, &prop);
my_free(53, &prop);
return;
}
}
@ -857,7 +857,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
use_label_prefix = atoi(tclgetvar("use_label_prefix"));
rot_txt = tclgetvar("rotated_text");
if(strcmp(rot_txt,"")) rotated_text=atoi(rot_txt);
my_strdup(_ALLOC_ID_, &type,(xctx->inst[xctx->sel_array[j].n].ptr+ xctx->sym)->type);
my_strdup(54, &type,(xctx->inst[xctx->sel_array[j].n].ptr+ xctx->sym)->type);
if( type && IS_LABEL_OR_PIN(type) ) {
continue;
}
@ -877,7 +877,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
rct=symbol->rect[PINLAYER];
for(i=0;i<npin;i++) {
my_strdup(_ALLOC_ID_, &labname,get_tok_value(rct[i].prop_ptr,"name",1));
my_strdup(55, &labname,get_tok_value(rct[i].prop_ptr,"name",1));
dbg(1,"attach_labels_to_inst(): 2 --> labname=%s\n", labname);
pinx0 = (rct[i].x1+rct[i].x2)/2;
@ -921,13 +921,13 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
wptr = wptr->next;
}
if(!skip) {
my_strdup(_ALLOC_ID_, &prop, "name=p1 lab=");
my_strdup(56, &prop, "name=p1 lab=");
if(use_label_prefix) {
my_strcat(_ALLOC_ID_, &prop, (char *)tclgetvar("custom_label_prefix"));
my_strcat(57, &prop, (char *)tclgetvar("custom_label_prefix"));
}
/* /20171005 */
my_strcat(_ALLOC_ID_, &prop, labname);
my_strcat(58, &prop, labname);
dir ^= flip; /* 20101129 20111030 */
if(rotated_text ==-1) {
rot1=rot;
@ -946,9 +946,9 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
dbg(1, "attach_labels_to_inst(): %d %.16g %.16g %s\n", i, pinx0, piny0,labname);
}
}
my_free(_ALLOC_ID_, &prop);
my_free(_ALLOC_ID_, &labname);
my_free(_ALLOC_ID_, &type);
my_free(59, &prop);
my_free(60, &labname);
my_free(61, &type);
if(!found) return;
/* draw things */
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
@ -958,8 +958,8 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
fprintf(errfp, "attach_labels_to_inst(): location of schematic labels not found\n");
tcleval("alert_ {attach_labels_to_inst(): location of schematic labels not found} {}");
}
my_free(_ALLOC_ID_, &symname_pin);
my_free(_ALLOC_ID_, &symname_wire);
my_free(62, &symname_pin);
my_free(63, &symname_wire);
}
void delete_files(void)
@ -1038,7 +1038,7 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, short rot
xctx->inst[n].instname=NULL;
xctx->inst[n].lab=NULL;
dbg(1, "place_symbol(): entering my_strdup: name=%s\n",name); /* 03-02-2000 */
my_strdup2(_ALLOC_ID_, &xctx->inst[n].name ,name);
my_strdup2(64, &xctx->inst[n].name ,name);
dbg(1, "place_symbol(): done my_strdup: name=%s\n",name); /* 03-02-2000 */
/* xctx->inst[n].x0=symbol_name ? x : xctx->mousex_snap; */
/* xctx->inst[n].y0=symbol_name ? y : xctx->mousey_snap; */
@ -1067,7 +1067,7 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, short rot
type = xctx->sym[xctx->inst[n].ptr].type;
cond= !type || !IS_LABEL_SH_OR_PIN(type);
if(cond) xctx->inst[n].flags|=2;
else my_strdup(_ALLOC_ID_, &xctx->inst[n].lab, get_tok_value(xctx->inst[n].prop_ptr,"lab",0));
else my_strdup(65, &xctx->inst[n].lab, get_tok_value(xctx->inst[n].prop_ptr,"lab",0));
xctx->inst[n].embed = !strcmp(get_tok_value(xctx->inst[n].prop_ptr, "embed", 2), "true");
if(first_call && (draw_sym & 3) ) bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
xctx->instances++; /* must be updated before calling symbol_bbox() */
@ -1216,25 +1216,25 @@ void get_sch_from_sym(char *filename, xSymbol *sym)
strstr(xctx->current_dirname, "https://") == xctx->current_dirname) {
web_url = 1;
}
my_strdup2(_ALLOC_ID_, &str_tmp, get_tok_value(sym->prop_ptr, "schematic", 2));
my_strdup2(66, &str_tmp, get_tok_value(sym->prop_ptr, "schematic", 2));
if(str_tmp[0]) {
/* @symname in schematic attribute will be replaced with symbol name */
if( (ptr = strstr(str_tmp, "@symname"))) {
*ptr = '\0';
my_strdup2(_ALLOC_ID_, &sch, str_tmp);
my_strcat(_ALLOC_ID_, &sch, sym->name);
my_strdup2(67, &sch, str_tmp);
my_strcat(68, &sch, sym->name);
ptr += 8;
my_strcat(_ALLOC_ID_, &sch, ptr);
my_strcat(69, &sch, ptr);
} else {
my_strdup2(_ALLOC_ID_, &sch, str_tmp);
my_strdup2(70, &sch, str_tmp);
}
dbg(1, "get_sch_from_sym(): sch=%s\n", sch);
my_strdup2(_ALLOC_ID_, &sch, tcl_hook2(&sch));
my_strdup2(71, &sch, tcl_hook2(&sch));
dbg(1, "get_sch_from_sym(): after tcl_hook2 sch=%s\n", sch);
/* for schematics referenced from web symbols do not build absolute path */
if(web_url) my_strncpy(filename, sch, PATH_MAX);
else my_strncpy(filename, abs_sym_path(sch, ""), PATH_MAX);
my_free(_ALLOC_ID_, &sch);
my_free(72, &sch);
} else {
if(tclgetboolvar("search_schematic")) {
/* for schematics referenced from web symbols do not build absolute path */
@ -1246,7 +1246,7 @@ void get_sch_from_sym(char *filename, xSymbol *sym)
else my_strncpy(filename, add_ext(abs_sym_path(sym->name, ""), ".sch"), PATH_MAX);
}
}
my_free(_ALLOC_ID_, &str_tmp);
my_free(73, &str_tmp);
dbg(1, "get_sch_from_sym(): sym->name=%s, filename=%s\n", sym->name, filename);
}
@ -1319,11 +1319,11 @@ int descend_schematic(int instnumber)
str = "";
inst_mult = 1;
}
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strdup(74, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
xctx->sch_path_hash[xctx->currsch+1] =0;
my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].prop_ptr,
my_strdup(75, &xctx->hier_attr[xctx->currsch].prop_ptr,
xctx->inst[n].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].templ,
my_strdup(76, &xctx->hier_attr[xctx->currsch].templ,
get_tok_value((xctx->inst[n].ptr+ xctx->sym)->prop_ptr, "template", 0));
inst_number = 1;
if(inst_mult > 1) { /* on multiple instances ask where to descend, to correctly evaluate
@ -1337,7 +1337,7 @@ int descend_schematic(int instnumber)
inum = tclresult();
dbg(1, "descend_schematic(): inum=%s\n", inum);
if(!inum[0]) {
my_free(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1]);
my_free(77, &xctx->sch_path[xctx->currsch+1]);
xctx->sch_path_hash[xctx->currsch+1] =0;
return 0;
}
@ -1350,9 +1350,9 @@ int descend_schematic(int instnumber)
if(inst_number <1 || inst_number > inst_mult) inst_number = 1;
}
dbg(1,"descend_schematic(): inst_number=%d\n", inst_number);
my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], find_nth(str, ",", inst_number));
my_strcat(78, &xctx->sch_path[xctx->currsch+1], find_nth(str, ",", inst_number));
dbg(1,"descend_schematic(): inst_number=%d\n", inst_number);
my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], ".");
my_strcat(79, &xctx->sch_path[xctx->currsch+1], ".");
xctx->sch_inst_number[xctx->currsch+1] = inst_number;
dbg(1, "descend_schematic(): current path: %s\n", xctx->sch_path[xctx->currsch+1]);
dbg(1, "descend_schematic(): inst_number=%d\n", inst_number);
@ -2114,7 +2114,7 @@ void change_layer()
if(xctx->rectcolor != xctx->text[n].layer) {
char *p;
set_modify(1);
my_strdup(_ALLOC_ID_, &xctx->text[n].prop_ptr,
my_strdup(80, &xctx->text[n].prop_ptr,
subst_token(xctx->text[n].prop_ptr, "layer", dtoa(xctx->rectcolor) ));
xctx->text[n].layer = xctx->rectcolor;
p = xctx->text[n].prop_ptr;
@ -2338,8 +2338,8 @@ void new_polygon(int what)
if(xctx->nl_points >= xctx->nl_maxpoints-1) { /* check storage for 2 xctx->nl_points */
xctx->nl_maxpoints = (1+xctx->nl_points / CADCHUNKALLOC) * CADCHUNKALLOC;
my_realloc(_ALLOC_ID_, &xctx->nl_polyx, sizeof(double)*xctx->nl_maxpoints);
my_realloc(_ALLOC_ID_, &xctx->nl_polyy, sizeof(double)*xctx->nl_maxpoints);
my_realloc(81, &xctx->nl_polyx, sizeof(double)*xctx->nl_maxpoints);
my_realloc(82, &xctx->nl_polyy, sizeof(double)*xctx->nl_maxpoints);
}
if( what & PLACE )
{
@ -2386,8 +2386,8 @@ void new_polygon(int what)
drawtemppolygon(xctx->gc[xctx->rectcolor], NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points);
xctx->ui_state &= ~STARTPOLYGON;
drawpolygon(xctx->rectcolor, NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points, 0, 0);
my_free(_ALLOC_ID_, &xctx->nl_polyx);
my_free(_ALLOC_ID_, &xctx->nl_polyy);
my_free(83, &xctx->nl_polyx);
my_free(84, &xctx->nl_polyy);
xctx->nl_maxpoints = xctx->nl_points = 0;
}
if(what & RUBBER)
@ -2426,7 +2426,7 @@ int text_bbox(const char *str, double xscale, double yscale,
ww=0.; hh=1.;
c=0;
*cairo_lines=1;
my_strdup2(_ALLOC_ID_, &s, str);
my_strdup2(85, &s, str);
str_ptr = s;
while( s && s[c] ) {
if(s[c] == '\n') {
@ -2449,7 +2449,7 @@ int text_bbox(const char *str, double xscale, double yscale,
maxw = ext.x_advance > ext.width ? ext.x_advance : ext.width;
if(maxw > ww) ww= maxw;
}
my_free(_ALLOC_ID_, &s);
my_free(86, &s);
hh = hh*fext.height * cairo_font_line_spacing;
*cairo_longest_line = ww;
@ -2606,7 +2606,7 @@ int place_text(int draw_text, double mx, double my)
t->txt_ptr=NULL;
t->prop_ptr=NULL; /* 20111006 added missing initialization of pointer */
t->font=NULL;
my_strdup(_ALLOC_ID_, &t->txt_ptr, txt);
my_strdup(87, &t->txt_ptr, txt);
t->x0=mx;
t->y0=my;
t->rot=0;
@ -2614,7 +2614,7 @@ int place_text(int draw_text, double mx, double my)
t->sel=0;
t->xscale= atof(tclgetvar("hsize"));
t->yscale= atof(tclgetvar("vsize"));
my_strdup(_ALLOC_ID_, &t->prop_ptr, (char *)tclgetvar("props"));
my_strdup(88, &t->prop_ptr, (char *)tclgetvar("props"));
/* debug ... */
/* t->prop_ptr=NULL; */
dbg(1, "place_text(): done text input\n");

View File

@ -583,8 +583,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(fabs(xctx->my_double_save - xctx->mousey_snap) > fabs(gr->dcy * delta) * delta_threshold) {
yy1 = gr->ypos1 + (xctx->my_double_save - xctx->mousey_snap) / gr->dcy;
yy2 = gr->ypos2 + (xctx->my_double_save - xctx->mousey_snap) / gr->dcy;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
my_strdup(89, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(90, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
xctx->my_double_save = xctx->mousey_snap;
need_redraw = 1;
}
@ -594,8 +594,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(fabs(xctx->my_double_save - xctx->mousey_snap) > fabs(gr->cy * delta) * delta_threshold) {
yy1 = gr->gy1 + (xctx->my_double_save - xctx->mousey_snap) / gr->cy;
yy2 = gr->gy2 + (xctx->my_double_save - xctx->mousey_snap) / gr->cy;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
my_strdup(91, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(92, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
xctx->my_double_save = xctx->mousey_snap;
need_redraw = 1;
}
@ -611,8 +611,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(fabs(xctx->mx_double_save - xctx->mousex_snap) > fabs(gr->cx * delta) * delta_threshold) {
xx1 = gr->gx1 + (xctx->mx_double_save - xctx->mousex_snap) / gr->cx;
xx2 = gr->gx2 + (xctx->mx_double_save - xctx->mousex_snap) / gr->cx;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(93, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(94, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -626,16 +626,16 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
delta = gr->posh * 0.05;
yy1 = gr->ypos1 + delta;
yy2 = gr->ypos2 + delta;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
my_strdup(95, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(96, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
need_redraw = 1;
} else {
delta = gr->gh/ gr->divy;
delta_threshold = 1.0;
yy1 = gr->gy1 + delta * delta_threshold;
yy2 = gr->gy2 + delta * delta_threshold;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
my_strdup(97, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(98, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
need_redraw = 1;
}
}
@ -646,8 +646,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
delta_threshold = 0.05;
xx1 = gr->gx1 - delta * delta_threshold;
xx2 =gr->gx2 - delta * delta_threshold;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(99, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(100, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -657,7 +657,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
const char *unlocked = strstr(get_tok_value(r->prop_ptr, "flags", 0), "unlocked");
if(i == xctx->graph_master || !unlocked) {
gr->dataset = track_dset;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "dataset", my_itoa(track_dset)));
my_strdup(101, &r->prop_ptr, subst_token(r->prop_ptr, "dataset", my_itoa(track_dset)));
}
if((xctx->graph_flags & 4) && tclgetboolvar("live_cursor2_backannotate")) {
if(i == xctx->graph_master) backannotate_at_cursor_b_pos(r, gr);
@ -679,8 +679,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = delta * 0.2;
yy2 = gr->gy2 + var * b / delta;
yy1 = gr->gy1 - var * a / delta;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
my_strdup(102, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(103, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
need_redraw = 1;
}
} else {
@ -688,8 +688,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
delta_threshold = 0.05;
xx1 = gr->gx1 - delta * delta_threshold;
xx2 = gr->gx2 - delta * delta_threshold;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(104, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(105, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -701,16 +701,16 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
delta = gr->posh * 0.05;
yy1 = gr->ypos1 - delta;
yy2 = gr->ypos2 - delta;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
my_strdup(106, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(107, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
need_redraw = 1;
} else {
delta = gr->gh / gr->divy;
delta_threshold = 1.0;
yy1 = gr->gy1 - delta * delta_threshold;
yy2 = gr->gy2 - delta * delta_threshold;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
my_strdup(108, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(109, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
need_redraw = 1;
}
}
@ -721,8 +721,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
delta_threshold = 0.05;
xx1 = gr->gx1 + delta * delta_threshold;
xx2 = gr->gx2 + delta * delta_threshold;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(110, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(111, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -738,8 +738,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = delta * 0.2;
yy2 = gr->gy2 - var * b / delta;
yy1 = gr->gy1 + var * a / delta;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
my_strdup(112, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(113, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
need_redraw = 1;
}
} else {
@ -747,8 +747,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
delta_threshold = 0.05;
xx1 = gr->gx1 + delta * delta_threshold;
xx2 = gr->gx2 + delta * delta_threshold;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(114, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(115, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -763,8 +763,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = delta * 0.05;
yy2 = gr->ypos2 + var * b / delta;
yy1 = gr->ypos1 - var * a / delta;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
my_strdup(116, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(117, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
need_redraw = 1;
} else {
@ -775,8 +775,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = delta * 0.2;
yy2 = gr->gy2 + var * b / delta;
yy1 = gr->gy1 - var * a / delta;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
my_strdup(118, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(119, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
need_redraw = 1;
}
}
@ -786,8 +786,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = 0.2 * gr->gw;
xx2 = gr->gx2 + var * (1 - zoom_m);
xx1 = gr->gx1 - var * zoom_m;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(120, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(121, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -799,8 +799,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = 0.2 * gr->gw;
xx2 = gr->gx2 + var * (1 - zoom_m);
xx1 = gr->gx1 - var * zoom_m;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(122, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(123, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -816,8 +816,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = delta * 0.05;
yy2 = gr->ypos2 - var * b / delta;
yy1 = gr->ypos1 + var * a / delta;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
my_strdup(124, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(125, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
need_redraw = 1;
} else {
double m = G_Y(xctx->mousey);
@ -827,8 +827,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = delta * 0.2;
yy2 = gr->gy2 - var * b / delta;
yy1 = gr->gy1 + var * a / delta;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
my_strdup(126, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(127, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
need_redraw = 1;
}
}
@ -838,8 +838,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = 0.2 * gr->gw;
xx2 = gr->gx2 - var * (1 - zoom_m);
xx1 = gr->gx1 + var * zoom_m;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(128, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(129, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -851,8 +851,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double var = 0.2 * gr->gw;
xx2 = gr->gx2 - var * (1 - zoom_m);
xx1 = gr->gx1 + var * zoom_m;
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(130, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(131, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -870,8 +870,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
double min=0.0, max=0.0;
int first = 1;
char *saves, *sptr, *stok, *sweep = NULL, *saven, *nptr, *ntok, *node = NULL;
my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",0));
my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
my_strdup2(132, &node, get_tok_value(r->prop_ptr,"node",0));
my_strdup2(133, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
nptr = node;
sptr = sweep;
start = (gr->gx1 <= gr->gx2) ? gr->gx1 : gr->gx2;
@ -889,9 +889,9 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(!bus_msb) {
char *express = NULL;
if(strstr(ntok, ";")) {
my_strdup2(_ALLOC_ID_, &express, find_nth(ntok, ";", 2));
my_strdup2(134, &express, find_nth(ntok, ";", 2));
} else {
my_strdup2(_ALLOC_ID_, &express, ntok);
my_strdup2(135, &express, ntok);
}
if(strpbrk(express, " \n\t")) {
/* just probe a single point to get the index. custom data column already calculated */
@ -899,7 +899,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
} else {
j = get_raw_index(express);
}
my_free(_ALLOC_ID_, &express);
my_free(136, &express);
}
if(j >= 0) {
int ofs = 0;
@ -926,15 +926,15 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(max == min) max += 0.01;
min = floor_to_n_digits(min, 2);
max = ceil_to_n_digits(max, 2);
my_free(_ALLOC_ID_, &node);
my_free(_ALLOC_ID_, &sweep);
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(min)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(max)));
my_free(137, &node);
my_free(138, &sweep);
my_strdup(139, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(min)));
my_strdup(140, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(max)));
need_redraw = 1;
} else { /* digital plot */
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1",
my_strdup(141, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1",
get_tok_value(r->prop_ptr, "y1", 0) ));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2",
my_strdup(142, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2",
get_tok_value(r->prop_ptr, "y2", 0) ));
need_redraw = 1;
}
@ -951,8 +951,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
xx1 = mylog10(xx1);
xx2 = mylog10(xx2);
}
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(143, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(144, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -987,8 +987,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
xx2 = pp + delta / 2.0;
*/
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(145, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(146, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -1016,8 +1016,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(xx1 == xx2) xx2 += 1e-6;
*/
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
my_strdup(147, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(148, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
}
}
@ -2063,11 +2063,11 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
if(!tool) {
tool = atoi(tclgetvar("sim(spicewave,default)"));
my_snprintf(str, S(str), "sim(spicewave,%d,name)", tool);
my_strdup(_ALLOC_ID_, &tool_name, tclgetvar(str));
my_strdup(149, &tool_name, tclgetvar(str));
dbg(1,"callback(): tool_name=%s\n", tool_name);
if(strstr(tool_name, "Gaw")) tool=GAW;
else if(strstr(tool_name, "Bespice")) tool=BESPICE;
my_free(_ALLOC_ID_, &tool_name);
my_free(150, &tool_name);
}
}
if(tool) {

View File

@ -189,14 +189,14 @@ void trim_wires(void)
xctx->wire[xctx->wires].y2=y0;
xctx->wire[xctx->wires].sel=0;
xctx->wire[xctx->wires].prop_ptr=NULL;
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[j].prop_ptr);
my_strdup(151, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[j].prop_ptr);
if(!strcmp(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0), "true"))
xctx->wire[xctx->wires].bus=1;
else
xctx->wire[xctx->wires].bus=0;
xctx->wire[xctx->wires].node=NULL;
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].node, xctx->wire[j].node);
my_strdup(152, &xctx->wire[xctx->wires].node, xctx->wire[j].node);
xctx->wire[j].x1 = x0;
xctx->wire[j].y1 = y0;
hash_wire(XINSERT, xctx->wires, 0);
@ -212,7 +212,7 @@ void trim_wires(void)
}
/* dbg(1, "trim_wires(): break: %g\n", timer(1)); */
/* reduce included wires */
my_realloc(_ALLOC_ID_, &wireflag, xctx->wires*sizeof(unsigned short));
my_realloc(153, &wireflag, xctx->wires*sizeof(unsigned short));
memset(wireflag, 0, xctx->wires*sizeof(unsigned short));
for(i=0;i<xctx->wires;i++) {
if(wireflag[i]) continue;
@ -255,8 +255,8 @@ void trim_wires(void)
if(wireflag[i]) {
j++;
/* hash_wire(XDELETE, i, 0);*/ /* can not be done since wire deletions change wire idexes in array */
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->wire[i].node);
my_free(154, &xctx->wire[i].prop_ptr);
my_free(155, &xctx->wire[i].node);
continue;
}
if(j) {
@ -273,7 +273,7 @@ void trim_wires(void)
/* after wire deletions full rehash is needed */
hash_wires();
my_realloc(_ALLOC_ID_, &wireflag, xctx->wires*sizeof(unsigned short));
my_realloc(156, &wireflag, xctx->wires*sizeof(unsigned short));
memset(wireflag, 0, xctx->wires*sizeof(unsigned short));
/* dbg(1, "trim_wires(): hash_wires_2: %g\n", timer(1)); */
@ -351,8 +351,8 @@ void trim_wires(void)
if(wireflag[i]) {
j++;
/* hash_wire(XDELETE, i, 0);*/ /* can not be done since wire deletions change wire idexes in array */
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->wire[i].node);
my_free(157, &xctx->wire[i].prop_ptr);
my_free(158, &xctx->wire[i].node);
continue;
}
if(j) {
@ -374,7 +374,7 @@ void trim_wires(void)
}
} while(changed);
dbg(1, "trim_wires(): doloops=%d changed=%d\n", doloops, changed);
my_free(_ALLOC_ID_, &wireflag);
my_free(159, &wireflag);
update_conn_cues(WIRELAYER, 0, 0);
}
@ -413,14 +413,14 @@ void break_wires_at_pins(void)
xctx->wire[xctx->wires].y2=y0;
xctx->wire[xctx->wires].sel=0;
xctx->wire[xctx->wires].prop_ptr=NULL;
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
my_strdup(160, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
if(!strcmp(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0), "true"))
xctx->wire[xctx->wires].bus=1;
else
xctx->wire[xctx->wires].bus=0;
xctx->wire[xctx->wires].node=NULL;
hash_wire(XINSERT, xctx->wires, 0); /* insertion happens at beginning of list */
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].node, xctx->wire[i].node);
my_strdup(161, &xctx->wire[xctx->wires].node, xctx->wire[i].node);
xctx->need_reb_sel_arr=1;
xctx->wires++;
xctx->wire[i].x1 = x0;
@ -469,7 +469,7 @@ void break_wires_at_pins(void)
xctx->wire[xctx->wires].y2=y0;
xctx->wire[xctx->wires].sel=0;
xctx->wire[xctx->wires].prop_ptr=NULL;
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
my_strdup(162, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
if(!strcmp(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0), "true"))
xctx->wire[xctx->wires].bus=1;
else

View File

@ -304,7 +304,7 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in
dbg(1, "draw_string(): size * mooz=%g height=%g ascent=%g descent=%g\n",
size * xctx->mooz, fext.height, fext.ascent, fext.descent);
llength=0;
my_strdup2(_ALLOC_ID_, &sss, str);
my_strdup2(163, &sss, str);
tt=ss=sss;
for(;;) {
c=*ss;
@ -325,7 +325,7 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in
}
ss++;
}
my_free(_ALLOC_ID_, &sss);
my_free(164, &sss);
}
#else /* !HAS_CAIRO */
@ -504,16 +504,16 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot,
for(j=0;j< symptr->polygons[layer];j++)
{
polygon = &(symptr->poly[layer])[j];
x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
x = my_malloc(165, sizeof(double) * polygon->points);
y = my_malloc(166, sizeof(double) * polygon->points);
for(k=0;k<polygon->points;k++) {
ROTATION(rot, flip, 0.0,0.0,polygon->x[k],polygon->y[k],x[k],y[k]);
x[k]+= x0;
y[k] += y0;
}
drawpolygon(c, NOW, x, y, polygon->points, polygon->fill, polygon->dash); /* added fill */
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
my_free(167, &x);
my_free(168, &y);
}
for(j=0;j< symptr->arcs[layer];j++)
{
@ -683,16 +683,16 @@ void draw_temp_symbol(int what, GC gc, int n,int layer,short tmp_flip, short rot
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
int k;
double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
double *x = my_malloc(169, sizeof(double) * polygon->points);
double *y = my_malloc(170, sizeof(double) * polygon->points);
for(k=0;k<polygon->points;k++) {
ROTATION(rot, flip, 0.0,0.0,polygon->x[k],polygon->y[k],x[k],y[k]);
x[k] += x0;
y[k] += y0;
}
drawtemppolygon(gc, NOW, x, y, polygon->points);
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
my_free(171, &x);
my_free(172, &y);
}
}
@ -1504,7 +1504,7 @@ void drawpolygon(int c, int what, double *x, double *y, int points, int poly_fil
return;
}
if(!xctx->only_probes && (x2-x1)<1.0 && (y2-y1)<1.0) return;
p = my_malloc(_ALLOC_ID_, sizeof(XPoint) * points);
p = my_malloc(173, sizeof(XPoint) * points);
if(what) {
for(i=0;i<points; i++) {
clip_xy_to_short(X_TO_SCREEN(x[i]), Y_TO_SCREEN(y[i]), &sx, &sy);
@ -1536,7 +1536,7 @@ void drawpolygon(int c, int what, double *x, double *y, int points, int poly_fil
if(dash) {
XSetLineAttributes (display, xctx->gc[c], INT_WIDTH(xctx->lw) ,LineSolid, LINECAP , LINEJOIN);
}
my_free(_ALLOC_ID_, &p);
my_free(174, &p);
}
void drawtemppolygon(GC g, int what, double *x, double *y, int points)
@ -1551,7 +1551,7 @@ void drawtemppolygon(GC g, int what, double *x, double *y, int points)
y1=Y_TO_SCREEN(y1);
x2=X_TO_SCREEN(x2);
y2=Y_TO_SCREEN(y2);
p = my_malloc(_ALLOC_ID_, sizeof(XPoint) * points);
p = my_malloc(175, sizeof(XPoint) * points);
if( rectclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,&x1,&y1,&x2,&y2) ) {
for(i=0;i<points; i++) {
clip_xy_to_short(X_TO_SCREEN(x[i]), Y_TO_SCREEN(y[i]), &sx, &sy);
@ -1560,7 +1560,7 @@ void drawtemppolygon(GC g, int what, double *x, double *y, int points)
}
XDrawLines(display, xctx->window, g, p, points, CoordModeOrigin);
}
my_free(_ALLOC_ID_, &p);
my_free(176, &p);
}
void drawrect(int c, int what, double rectx1,double recty1,double rectx2,double recty2, int dash)
@ -1834,9 +1834,9 @@ static SPICE_DATA **get_bus_idx_array(const char *ntok, int *n_bits)
*n_bits = count_items(ntok, ";,", "") - 1;
/* dbg(0, "get_bus_idx_array(): ntok=%s\n", ntok); */
/* dbg(0, "get_bus_idx_array(): *n_bits=%d\n", *n_bits); */
idx_arr = my_malloc(_ALLOC_ID_, (*n_bits) * sizeof(SPICE_DATA *));
idx_arr = my_malloc(177, (*n_bits) * sizeof(SPICE_DATA *));
p = 0;
my_strdup2(_ALLOC_ID_, &ntok_copy, ntok);
my_strdup2(178, &ntok_copy, ntok);
nptr = ntok_copy;
my_strtok_r(nptr, ";,", "", &saven); /*strip off bus name (1st field) */
while( (bit_name = my_strtok_r(NULL, ";,", "", &saven)) ) {
@ -1850,7 +1850,7 @@ static SPICE_DATA **get_bus_idx_array(const char *ntok, int *n_bits)
/* dbg(0, "get_bus_idx_array(): bit_name=%s, p=%d\n", bit_name, p); */
p++;
}
my_free(_ALLOC_ID_, &ntok_copy);
my_free(179, &ntok_copy);
return idx_arr;
}
@ -2333,18 +2333,18 @@ static void draw_graph_variables(int wcnt, int wave_color, int n_nodes, int swee
char *ntok_ptr = NULL;
char *alias_ptr = NULL;
if(strstr(ntok, ";")) {
my_strdup2(_ALLOC_ID_, &alias_ptr, find_nth(ntok, ";", 1));
my_strdup2(_ALLOC_ID_, &ntok_ptr, find_nth(ntok, ";", 2));
my_strdup2(180, &alias_ptr, find_nth(ntok, ";", 1));
my_strdup2(181, &ntok_ptr, find_nth(ntok, ";", 2));
}
else {
my_strdup2(_ALLOC_ID_, &alias_ptr, ntok);
my_strdup2(_ALLOC_ID_, &ntok_ptr, ntok);
my_strdup2(182, &alias_ptr, ntok);
my_strdup2(183, &ntok_ptr, ntok);
}
if(gr->unity != 1.0) my_snprintf(tmpstr, S(tmpstr), "%s[%c]", alias_ptr, gr->unity_suffix);
else my_snprintf(tmpstr, S(tmpstr), "%s", alias_ptr);
my_free(_ALLOC_ID_, &alias_ptr);
my_free(_ALLOC_ID_, &ntok_ptr);
my_free(184, &alias_ptr);
my_free(185, &ntok_ptr);
}
if(gr->digital) {
double xt = gr->x1 - 15 * gr->txtsizelab;
@ -2474,8 +2474,8 @@ int embed_rawfile(const char *rawfile)
xctx->push_undo();
set_modify(1);
ptr = base64_from_file(rawfile, &len);
my_strdup2(_ALLOC_ID_, &i->prop_ptr, subst_token(i->prop_ptr, "spice_data", ptr));
my_free(_ALLOC_ID_, &ptr);
my_strdup2(186, &i->prop_ptr, subst_token(i->prop_ptr, "spice_data", ptr));
my_free(187, &ptr);
}
return res;
}
@ -2499,9 +2499,9 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
xRect *r = &xctx->rect[GRIDLAYER][i];
/* get plot data */
my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",0));
my_strdup2(_ALLOC_ID_, &color, get_tok_value(r->prop_ptr,"color",0));
my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
my_strdup2(188, &node, get_tok_value(r->prop_ptr,"node",0));
my_strdup2(189, &color, get_tok_value(r->prop_ptr,"color",0));
my_strdup2(190, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
nptr = node;
cptr = color;
sptr = sweep;
@ -2539,10 +2539,10 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
} else {
if(gr->hilight_wave == wcnt) {
gr->hilight_wave = -1;
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
my_strdup2(191, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
} else {
gr->hilight_wave = wcnt;
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
my_strdup2(192, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
}
}
}
@ -2564,19 +2564,19 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
} else {
if(gr->hilight_wave == wcnt) {
gr->hilight_wave = -1;
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
my_strdup2(193, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
} else {
gr->hilight_wave = wcnt;
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
my_strdup2(194, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
}
}
}
}
wcnt++;
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", &saven)) ) */
my_free(_ALLOC_ID_, &node);
my_free(_ALLOC_ID_, &color);
my_free(_ALLOC_ID_, &sweep);
my_free(195, &node);
my_free(196, &color);
my_free(197, &sweep);
return ret;
}
@ -2661,8 +2661,8 @@ int find_closest_wave(int i, Graph_ctx *gr)
yval = G_Y(xctx->mousey);
xval = G_X(xctx->mousex);
/* get data to plot */
my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",0));
my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
my_strdup2(198, &node, get_tok_value(r->prop_ptr,"node",0));
my_strdup2(199, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
nptr = node;
sptr = sweep;
/* process each node given in "node" attribute, get also associated sweep var if any*/
@ -2684,9 +2684,9 @@ int find_closest_wave(int i, Graph_ctx *gr)
expression = 0;
if(xctx->graph_values) {
if(strstr(ntok, ";")) {
my_strdup2(_ALLOC_ID_, &express, find_nth(ntok, ";", 2));
my_strdup2(200, &express, find_nth(ntok, ";", 2));
} else {
my_strdup2(_ALLOC_ID_, &express, ntok);
my_strdup2(201, &express, ntok);
}
if(strpbrk(express, " \n\t")) {
expression = 1;
@ -2768,9 +2768,9 @@ int find_closest_wave(int i, Graph_ctx *gr)
wcnt++;
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", &saven)) ) */
dbg(0, "closest dataset=%d\n", closest_dataset);
if(express) my_free(_ALLOC_ID_, &express);
my_free(_ALLOC_ID_, &node);
my_free(_ALLOC_ID_, &sweep);
if(express) my_free(202, &express);
my_free(203, &node);
my_free(204, &sweep);
return closest_dataset;
}
@ -2821,9 +2821,9 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
/* graph box, gridlines and axes */
draw_graph_grid(gr, ct);
/* get data to plot */
my_strdup2(_ALLOC_ID_, &node, get_tok_value(r->prop_ptr,"node",0));
my_strdup2(_ALLOC_ID_, &color, get_tok_value(r->prop_ptr,"color",0));
my_strdup2(_ALLOC_ID_, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
my_strdup2(205, &node, get_tok_value(r->prop_ptr,"node",0));
my_strdup2(206, &color, get_tok_value(r->prop_ptr,"color",0));
my_strdup2(207, &sweep, get_tok_value(r->prop_ptr,"sweep",0));
nptr = node;
cptr = color;
sptr = sweep;
@ -2831,7 +2831,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
/* process each node given in "node" attribute, get also associated color/sweep var if any*/
while( (ntok = my_strtok_r(nptr, "\n\t ", "\"", &saven)) ) {
if(strstr(ntok, ",")) {
my_strdup2(_ALLOC_ID_, &bus_msb, find_nth(ntok, ";,", 2));
my_strdup2(208, &bus_msb, find_nth(ntok, ";,", 2));
}
ctok = my_strtok_r(cptr, " ", "", &savec);
stok = my_strtok_r(sptr, "\t\n ", "\"", &saves);
@ -2852,9 +2852,9 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
expression = 0;
if(xctx->graph_values && !bus_msb) {
if(strstr(ntok, ";")) {
my_strdup2(_ALLOC_ID_, &express, find_nth(ntok, ";", 2));
my_strdup2(209, &express, find_nth(ntok, ";", 2));
} else {
my_strdup2(_ALLOC_ID_, &express, ntok);
my_strdup2(210, &express, ntok);
}
if(strpbrk(express, " \n\t")) {
expression = 1;
@ -2893,7 +2893,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
else wave_color = wc;
first = -1;
poly_npoints = 0;
my_realloc(_ALLOC_ID_, &point, xctx->graph_npoints[dset] * sizeof(XPoint));
my_realloc(211, &point, xctx->graph_npoints[dset] * sizeof(XPoint));
/* Process "npoints" simulation items
* p loop split repeated 2 timed (for x and y points) to preserve cache locality */
prev_prev_x = prev_x = 0;
@ -2967,16 +2967,16 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
if(measure_p != -1) show_node_measures(measure_p, measure_x, measure_prev_x, bus_msb, wave_color,
idx, idx_arr, n_bits, n_nodes, ntok, wcnt, gr);
my_free(_ALLOC_ID_, &point);
if(idx_arr) my_free(_ALLOC_ID_, &idx_arr);
my_free(212, &point);
if(idx_arr) my_free(213, &idx_arr);
} /* if( expression || (idx = get_raw_index(bus_msb ? bus_msb : express)) != -1 ) */
wcnt++;
if(bus_msb) my_free(_ALLOC_ID_, &bus_msb);
if(bus_msb) my_free(214, &bus_msb);
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", &saven)) ) */
if(express) my_free(_ALLOC_ID_, &express);
my_free(_ALLOC_ID_, &node);
my_free(_ALLOC_ID_, &color);
my_free(_ALLOC_ID_, &sweep);
if(express) my_free(215, &express);
my_free(216, &node);
my_free(217, &color);
my_free(218, &sweep);
} /* if(flags & 8) */
bbox(START, 0.0, 0.0, 0.0, 0.0);
bbox(ADD, gr->rx1, gr->ry1, gr->rx2, gr->ry2);
@ -3069,7 +3069,7 @@ static cairo_status_t png_writer(void *in_closure, const unsigned char *in_data,
png_to_byte_closure_t *closure = (png_to_byte_closure_t *) in_closure;
if(!in_data) return CAIRO_STATUS_WRITE_ERROR;
if(closure->pos + length > closure->size) {
my_realloc(_ALLOC_ID_, &closure->buffer, closure->pos + length + 65536);
my_realloc(219, &closure->buffer, closure->pos + length + 65536);
closure->size = closure->pos + length + 65536;
}
memcpy(closure->buffer + closure->pos, in_data, length);
@ -3116,7 +3116,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
cairo_save(xctx->cairo_save_ctx);
}
my_strncpy(filename, get_tok_value(r->prop_ptr, "image", 0), S(filename));
my_strdup(_ALLOC_ID_, &filter, get_tok_value(r->prop_ptr, "filter", 0));
my_strdup(220, &filter, get_tok_value(r->prop_ptr, "filter", 0));
/* read PNG from in-memory buffer ... */
if(emb_ptr && emb_ptr->image) {
@ -3131,7 +3131,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
closure.buffer = NULL;
filterdata = (char *)base64_decode(attr, strlen(attr), &filtersize);
filter_data(filterdata, filtersize, (char **)&closure.buffer, &data_size, filter);
my_free(_ALLOC_ID_, &filterdata);
my_free(221, &filterdata);
} else {
closure.buffer = base64_decode(attr, strlen(attr), &data_size);
}
@ -3139,7 +3139,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
closure.size = data_size; /* should not be necessary */
emb_ptr->image = cairo_image_surface_create_from_png_stream(png_reader, &closure);
if(closure.buffer == NULL) dbg(0, "draw_image(): image creation failed\n");
my_free(_ALLOC_ID_, &closure.buffer);
my_free(222, &closure.buffer);
dbg(1, "draw_image(): length2 = %d\n", closure.pos);
/* ... or read PNG from file (image attribute) */
} else if(filename[0] && !stat(filename, &buf)) {
@ -3155,7 +3155,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
if(filtersize) {
fd = fopen(filename, "r");
if(fd) {
filterdata = my_malloc(_ALLOC_ID_, filtersize);
filterdata = my_malloc(223, filtersize);
fread(filterdata, filtersize, 1, fd);
fclose(fd);
}
@ -3166,7 +3166,7 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
closure.pos = 0;
emb_ptr->image = cairo_image_surface_create_from_png_stream(png_reader, &closure);
image_data = base64_encode((unsigned char *)filterdata, filtersize, &olength, 0);
my_free(_ALLOC_ID_, &filterdata);
my_free(224, &filterdata);
} else {
closure.buffer = NULL;
closure.size = 0;
@ -3175,25 +3175,25 @@ void draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2
/* write PNG to in-memory buffer */
cairo_surface_write_to_png_stream(emb_ptr->image, png_writer, &closure);
image_data = base64_encode(closure.buffer, closure.pos, &olength, 0);
my_free(_ALLOC_ID_, &closure.buffer);
my_free(225, &closure.buffer);
}
/* put base64 encoded data to rect image_data attrinute */
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", image_data));
my_free(_ALLOC_ID_, &image_data);
my_strdup2(226, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", image_data));
my_free(227, &image_data);
if(cairo_surface_status(emb_ptr->image) != CAIRO_STATUS_SUCCESS) {
my_free(_ALLOC_ID_, &filter);
my_free(228, &filter);
return;
}
dbg(1, "draw_image(): length3 = %d\n", closure.pos);
} else {
my_free(_ALLOC_ID_, &filter);
my_free(229, &filter);
return;
}
if(cairo_surface_status(emb_ptr->image) != CAIRO_STATUS_SUCCESS) {
my_free(_ALLOC_ID_, &filter);
my_free(230, &filter);
return;
}
my_free(_ALLOC_ID_, &filter);
my_free(231, &filter);
ptr = get_tok_value(r->prop_ptr, "alpha", 0);
alpha = 1.0;
if(ptr[0]) alpha = atof(ptr);
@ -3328,7 +3328,7 @@ void svg_embedded_graph(FILE *fd, xRect *r, double rx1, double ry1, double rx2,
closure.pos = 0;
cairo_surface_write_to_png_stream(png_sfc, png_writer, &closure);
ptr = base64_encode(closure.buffer, closure.pos, &olength, 1);
my_free(_ALLOC_ID_, &closure.buffer);
my_free(232, &closure.buffer);
cairo_surface_destroy(png_sfc);
xctx->draw_pixmap=1;
xctx->draw_window=save_draw_window;
@ -3351,7 +3351,7 @@ void svg_embedded_graph(FILE *fd, xRect *r, double rx1, double ry1, double rx2,
"xlink:href=\"data:image/png;base64,%s\"/>\n",
0.0, 0.0, w, h, transform, ptr);
}
my_free(_ALLOC_ID_, &ptr);
my_free(233, &ptr);
#endif
}

View File

@ -66,7 +66,7 @@ char *my_fgets(FILE *fd)
size_t len;
while(fgets(buf, SIZE, fd)) {
my_strcat(_ALLOC_ID_, &s, buf);
my_strcat(234, &s, buf);
len = strlen(buf);
if(buf[len - 1] == '\n') break;
}
@ -126,7 +126,7 @@ size_t my_strdup(int id, char **dest, const char *src) /* empty source string --
dbg(3,"my_strdup(%d,): duplicated string %s\n", id, src);
return len-1;
} else if(*dest) {
my_free(_ALLOC_ID_, dest);
my_free(235, dest);
dbg(3,"my_strdup(%d,): freed destination ptr\n", id);
}
@ -139,7 +139,7 @@ void my_strndup(int id, char **dest, const char *src, size_t n) /* empty source
{
if(*dest!=NULL) {
dbg(3," my_strndup: calling my_free\n");
my_free(_ALLOC_ID_, dest);
my_free(236, dest);
}
if(src!=NULL && src[0]!='\0')
{
@ -303,7 +303,7 @@ size_t my_strdup2(int id, char **dest, const char *src) /* 20150409 duplicates a
dbg(3,"my_strdup2(%d,): duplicated string %s\n", id, src);
return len-1;
} else if(*dest) {
my_free(_ALLOC_ID_, dest);
my_free(237, dest);
dbg(3,"my_strdup2(%d,): freed destination ptr\n", id);
}
return 0;
@ -584,12 +584,12 @@ void set_inst_prop(int i)
ptr = (xctx->inst[i].ptr+ xctx->sym)->templ;
dbg(1, "set_inst_prop(): i=%d, name=%s, prop_ptr = %s, template=%s\n",
i, xctx->inst[i].name, xctx->inst[i].prop_ptr, ptr);
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, ptr);
my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, get_tok_value(ptr, "name",0));
my_strdup(238, &xctx->inst[i].prop_ptr, ptr);
my_strdup2(239, &xctx->inst[i].instname, get_tok_value(ptr, "name",0));
if(xctx->inst[i].instname[0]) {
my_strdup(_ALLOC_ID_, &tmp, xctx->inst[i].prop_ptr);
my_strdup(240, &tmp, xctx->inst[i].prop_ptr);
new_prop_string(i, tmp, 0, tclgetboolvar("disable_unique_names"));
my_free(_ALLOC_ID_, &tmp);
my_free(241, &tmp);
}
}
@ -600,7 +600,7 @@ static void edit_rect_property(int x)
const char *dash, *fill;
int preserve;
char *oldprop=NULL;
my_strdup(_ALLOC_ID_, &oldprop, xctx->rect[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
my_strdup(242, &oldprop, xctx->rect[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval",oldprop);
} else {
@ -629,7 +629,7 @@ static void edit_rect_property(int x)
set_different_token(&xctx->rect[c][n].prop_ptr,
(char *) tclgetvar("retval"), oldprop, 0, 0);
} else {
my_strdup(_ALLOC_ID_, &xctx->rect[c][n].prop_ptr,
my_strdup(243, &xctx->rect[c][n].prop_ptr,
(char *) tclgetvar("retval"));
}
set_rect_flags(&xctx->rect[c][n]); /* set cached .flags bitmask from on attributes */
@ -665,7 +665,7 @@ static void edit_rect_property(int x)
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
}
}
my_free(_ALLOC_ID_, &oldprop);
my_free(244, &oldprop);
}
static void edit_line_property(void)
@ -674,7 +674,7 @@ static void edit_line_property(void)
const char *dash;
int preserve;
char *oldprop=NULL;
my_strdup(_ALLOC_ID_, &oldprop, xctx->line[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
my_strdup(245, &oldprop, xctx->line[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval", oldprop);
} else {
@ -698,7 +698,7 @@ static void edit_line_property(void)
set_different_token(&xctx->line[c][n].prop_ptr,
(char *) tclgetvar("retval"), oldprop, 0, 0);
} else {
my_strdup(_ALLOC_ID_, &xctx->line[c][n].prop_ptr,
my_strdup(246, &xctx->line[c][n].prop_ptr,
(char *) tclgetvar("retval"));
}
xctx->line[c][n].bus = !strcmp(get_tok_value(xctx->line[c][n].prop_ptr,"bus",0), "true");
@ -719,7 +719,7 @@ static void edit_line_property(void)
draw();
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
}
my_free(_ALLOC_ID_, &oldprop);
my_free(247, &oldprop);
}
@ -730,7 +730,7 @@ static void edit_wire_property(void)
char *oldprop=NULL;
const char *bus_ptr;
my_strdup(_ALLOC_ID_, &oldprop, xctx->wire[xctx->sel_array[0].n].prop_ptr);
my_strdup(248, &oldprop, xctx->wire[xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval", oldprop);
} else {
@ -758,7 +758,7 @@ static void edit_wire_property(void)
set_different_token(&xctx->wire[k].prop_ptr,
(char *) tclgetvar("retval"), oldprop, 0, 0);
} else {
my_strdup(_ALLOC_ID_, &xctx->wire[k].prop_ptr,(char *) tclgetvar("retval"));
my_strdup(249, &xctx->wire[k].prop_ptr,(char *) tclgetvar("retval"));
}
bus_ptr = get_tok_value(xctx->wire[k].prop_ptr,"bus",0);
if(!strcmp(bus_ptr, "true")) {
@ -783,7 +783,7 @@ static void edit_wire_property(void)
draw();
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
}
my_free(_ALLOC_ID_, &oldprop);
my_free(250, &oldprop);
}
static void edit_arc_property(void)
@ -795,7 +795,7 @@ static void edit_arc_property(void)
const char *dash;
int preserve;
my_strdup(_ALLOC_ID_, &oldprop, xctx->arc[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
my_strdup(251, &oldprop, xctx->arc[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval", oldprop);
} else {
@ -819,7 +819,7 @@ static void edit_arc_property(void)
set_different_token(&xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"), oldprop, 0, 0);
} else {
my_strdup(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"));
my_strdup(252, &xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"));
}
old_fill = xctx->arc[c][i].fill;
if( !strcmp(get_tok_value(xctx->arc[c][i].prop_ptr,"fill",0),"true") )
@ -864,7 +864,7 @@ static void edit_polygon_property(void)
int preserve;
dbg(1, "edit_property(): input property:\n");
my_strdup(_ALLOC_ID_, &oldprop, xctx->poly[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
my_strdup(253, &oldprop, xctx->poly[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval", oldprop);
} else {
@ -887,7 +887,7 @@ static void edit_polygon_property(void)
if(oldprop && preserve == 1) {
set_different_token(&xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval"), oldprop, 0, 0);
} else {
my_strdup(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval"));
my_strdup(254, &xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval"));
}
old_fill = xctx->poly[c][i].fill;
old_dash = xctx->poly[c][i].dash;
@ -942,7 +942,7 @@ static void edit_text_property(int x)
dbg(1, "edit_text_property(): entering\n");
sel = xctx->sel_array[0].n;
my_strdup(_ALLOC_ID_, &oldprop, xctx->text[sel].prop_ptr);
my_strdup(255, &oldprop, xctx->text[sel].prop_ptr);
if(oldprop && oldprop[0])
tclsetvar("props", oldprop);
else
@ -1035,23 +1035,23 @@ static void edit_text_property(int x)
(fabs(yy1 - pcy) < cg*3 || fabs(yy2 - pcy) < cg*3) )
) {
if(x==0)
my_strdup(_ALLOC_ID_, &xctx->rect[PINLAYER][l].prop_ptr,
my_strdup(256, &xctx->rect[PINLAYER][l].prop_ptr,
subst_token(xctx->rect[PINLAYER][l].prop_ptr, "name",
(char *) tclgetvar("retval")) );
else
my_strdup(_ALLOC_ID_, &xctx->rect[PINLAYER][l].prop_ptr,
my_strdup(257, &xctx->rect[PINLAYER][l].prop_ptr,
subst_token(xctx->rect[PINLAYER][l].prop_ptr, "name",
(char *) tclgetvar("retval")) );
}
}
}
my_strdup(_ALLOC_ID_, &xctx->text[sel].txt_ptr, (char *) tclgetvar("retval"));
my_strdup(258, &xctx->text[sel].txt_ptr, (char *) tclgetvar("retval"));
}
if(x==0 && props_changed) {
if(oldprop && preserve)
set_different_token(&xctx->text[sel].prop_ptr, (char *) tclgetvar("props"), oldprop, 0, 0);
else
my_strdup(_ALLOC_ID_, &xctx->text[sel].prop_ptr,(char *) tclgetvar("props"));
my_strdup(259, &xctx->text[sel].prop_ptr,(char *) tclgetvar("props"));
set_text_flags(&xctx->text[sel]);
}
if(size_changed) {
@ -1078,7 +1078,7 @@ static void edit_text_property(int x)
draw();
bbox(END,0.0,0.0,0.0,0.0);
}
my_free(_ALLOC_ID_, &oldprop);
my_free(260, &oldprop);
}
/* x=0 use text widget x=1 use vim editor */
@ -1101,19 +1101,19 @@ static void update_symbol(const char *result, int x)
*ii=xctx->sel_array[0].n;
if(!result) {
dbg(1, "update_symbol(): edit symbol prop aborted\n");
my_free(_ALLOC_ID_, &xctx->old_prop);
my_free(261, &xctx->old_prop);
return;
}
/* create new_prop updated attribute string */
if(*netl_com && x==1) {
my_strdup(_ALLOC_ID_, &new_prop,
my_strdup(262, &new_prop,
subst_token(xctx->old_prop, "value", (char *) tclgetvar("retval") )
);
dbg(1, "update_symbol(): new_prop=%s\n", new_prop);
dbg(1, "update_symbol(): tcl retval==%s\n", tclgetvar("retval"));
}
else {
my_strdup(_ALLOC_ID_, &new_prop, (char *) tclgetvar("retval"));
my_strdup(263, &new_prop, (char *) tclgetvar("retval"));
dbg(1, "update_symbol(): new_prop=%s\n", new_prop);
}
my_strncpy(symbol, (char *) tclgetvar("symbol") , S(symbol));
@ -1154,7 +1154,7 @@ static void update_symbol(const char *result, int x)
delete_inst_node(*ii); /* 20180208 fix crashing bug: delete node info if changing symbol */
/* if number of pins is different we must delete these data *before* */
/* changing ysmbol, otherwise *ii might end up deleting non allocated data. */
my_strdup2(_ALLOC_ID_, &xctx->inst[*ii].name, rel_sym_path(symbol));
my_strdup2(264, &xctx->inst[*ii].name, rel_sym_path(symbol));
xctx->inst[*ii].ptr=sym_number; /* update instance to point to new symbol */
}
bbox(ADD, xctx->inst[*ii].x1, xctx->inst[*ii].y1,
@ -1166,13 +1166,13 @@ static void update_symbol(const char *result, int x)
dbg(1, "update_symbol(): no_change_props=%d\n", no_change_props);
if(only_different) {
char * ss=NULL;
my_strdup(_ALLOC_ID_, &ss, xctx->inst[*ii].prop_ptr);
my_strdup(265, &ss, xctx->inst[*ii].prop_ptr);
if( set_different_token(&ss, new_prop, xctx->old_prop, 0, 0) ) {
if(!pushed) { xctx->push_undo(); pushed=1;}
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, ss);
my_strdup(266, &xctx->inst[*ii].prop_ptr, ss);
set_modify(1);
}
my_free(_ALLOC_ID_, &ss);
my_free(267, &ss);
}
else {
if(new_prop) {
@ -1180,39 +1180,39 @@ static void update_symbol(const char *result, int x)
dbg(1, "update_symbol(): changing prop: |%s| -> |%s|\n",
xctx->inst[*ii].prop_ptr, new_prop);
if(!pushed) { xctx->push_undo(); pushed=1;}
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, new_prop);
my_strdup(268, &xctx->inst[*ii].prop_ptr, new_prop);
set_modify(1);
}
} else {
if(!pushed) { xctx->push_undo(); pushed=1;}
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, "");
my_strdup(269, &xctx->inst[*ii].prop_ptr, "");
set_modify(1);
}
}
}
/* if symbol changed ensure instance name (with new prefix char) is unique */
/* preserve backslashes in name ----------------------------------->. */
my_strdup(_ALLOC_ID_, &name, get_tok_value(xctx->inst[*ii].prop_ptr, "name", 1));
my_strdup(270, &name, get_tok_value(xctx->inst[*ii].prop_ptr, "name", 1));
if(name && name[0] ) {
dbg(1, "update_symbol(): prefix!='\\0', name=%s\n", name);
/* 20110325 only modify prefix if prefix not NUL */
if(prefix) name[0]=(char)prefix; /* change prefix if changing symbol type; */
dbg(1, "update_symbol(): name=%s, inst[*ii].prop_ptr=%s\n",
name, xctx->inst[*ii].prop_ptr);
my_strdup(_ALLOC_ID_, &ptr,subst_token(xctx->inst[*ii].prop_ptr, "name", name) );
my_strdup(271, &ptr,subst_token(xctx->inst[*ii].prop_ptr, "name", name) );
/* set name of current inst */
if(!pushed) { xctx->push_undo(); pushed=1;}
if(!k) hash_all_names();
new_prop_string(*ii, ptr, k, tclgetboolvar("disable_unique_names")); /* set new prop_ptr */
} else {
my_strdup2(_ALLOC_ID_, &xctx->inst[*ii].instname, "");
my_strdup2(272, &xctx->inst[*ii].instname, "");
}
type=xctx->sym[xctx->inst[*ii].ptr].type;
cond= !type || !IS_LABEL_SH_OR_PIN(type);
if(cond) xctx->inst[*ii].flags |= 2; /* bit 1: flag for different textlayer for pin/labels */
else {
xctx->inst[*ii].flags &= ~2;
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].lab,
my_strdup(273, &xctx->inst[*ii].lab,
get_tok_value(xctx->inst[*ii].prop_ptr, "lab",0));
}
if(!strcmp(get_tok_value(xctx->inst[*ii].prop_ptr,"highlight",0), "true"))
@ -1236,10 +1236,10 @@ static void update_symbol(const char *result, int x)
dbg(1, "update_symbol(): redrawing inst_ptr.txtprop string\n");
draw();
bbox(END,0.0,0.0,0.0,0.0);
my_free(_ALLOC_ID_, &name);
my_free(_ALLOC_ID_, &ptr);
my_free(_ALLOC_ID_, &new_prop);
my_free(_ALLOC_ID_, &xctx->old_prop);
my_free(274, &name);
my_free(275, &ptr);
my_free(276, &new_prop);
my_free(277, &xctx->old_prop);
}
/* x=0 use text widget x=1 use vim editor */
@ -1264,12 +1264,12 @@ static void edit_symbol_property(int x)
else {
tclsetvar("retval","");
}
my_strdup(_ALLOC_ID_, &xctx->old_prop, xctx->inst[*ii].prop_ptr);
my_strdup(278, &xctx->old_prop, xctx->inst[*ii].prop_ptr);
tclsetvar("symbol",xctx->inst[*ii].name);
if(x==0) {
tcleval("edit_prop {Input property:}");
my_strdup(_ALLOC_ID_, &result, tclresult());
my_strdup(279, &result, tclresult());
}
else {
/* edit_vi_netlist_prop will replace \" with " before editing,
@ -1278,11 +1278,11 @@ static void edit_symbol_property(int x)
if(*netl_com && x==1) tcleval("edit_vi_netlist_prop {Input property:}");
else if(x==1) tcleval("edit_vi_prop {Input property:}");
else if(x==2) tcleval("viewdata $::retval");
my_strdup(_ALLOC_ID_, &result, tclresult());
my_strdup(280, &result, tclresult());
}
dbg(1, "edit_symbol_property(): before update_symbol, modified=%d\n", xctx->modified);
update_symbol(result, x);
my_free(_ALLOC_ID_, &result);
my_free(281, &result);
dbg(1, "edit_symbol_property(): done update_symbol, modified=%d\n", xctx->modified);
*ii=-1;
}
@ -1355,7 +1355,7 @@ char *str_replace(const char *s, const char *rep, const char *with)
size_t with_len;
if(s==NULL || rep == NULL || with == NULL || rep[0] == '\0') {
my_free(_ALLOC_ID_, &result);
my_free(282, &result);
size = 0;
return NULL;
}
@ -1364,7 +1364,7 @@ char *str_replace(const char *s, const char *rep, const char *with)
dbg(1, "str_replace(): %s, %s, %s\n", s, rep, with);
if( size == 0 ) {
size = CADCHUNKALLOC;
my_realloc(_ALLOC_ID_, &result, size);
my_realloc(283, &result, size);
}
while(*s) {
STR_ALLOC(&result, result_pos + with_len + 1, &size);
@ -1436,9 +1436,9 @@ void edit_property(int x)
dbg(1, "edit_property(): done executing edit_vi_prop, result=%s\n",tclresult());
dbg(1, "edit_property(): rcode=%s\n",tclgetvar("rcode") );
my_strdup(_ALLOC_ID_, &new_prop, (char *) tclgetvar("retval"));
my_strdup(284, &new_prop, (char *) tclgetvar("retval"));
tclsetvar("retval", new_prop);
my_free(_ALLOC_ID_, &new_prop);
my_free(285, &new_prop);
if(strcmp(tclgetvar("rcode"),"") )
@ -1446,27 +1446,27 @@ void edit_property(int x)
if(xctx->netlist_type==CAD_SYMBOL_ATTRS &&
(!xctx->schsymbolprop || strcmp(xctx->schsymbolprop, tclgetvar("retval") ) ) ) {
set_modify(1); xctx->push_undo();
my_strdup(_ALLOC_ID_, &xctx->schsymbolprop, (char *) tclgetvar("retval"));
my_strdup(286, &xctx->schsymbolprop, (char *) tclgetvar("retval"));
} else if(xctx->netlist_type==CAD_VERILOG_NETLIST &&
(!xctx->schverilogprop || strcmp(xctx->schverilogprop, tclgetvar("retval") ) ) ) {
set_modify(1); xctx->push_undo();
my_strdup(_ALLOC_ID_, &xctx->schverilogprop, (char *) tclgetvar("retval"));
my_strdup(287, &xctx->schverilogprop, (char *) tclgetvar("retval"));
} else if(xctx->netlist_type==CAD_SPICE_NETLIST &&
(!xctx->schprop || strcmp(xctx->schprop, tclgetvar("retval") ) ) ) {
set_modify(1); xctx->push_undo();
my_strdup(_ALLOC_ID_, &xctx->schprop, (char *) tclgetvar("retval"));
my_strdup(288, &xctx->schprop, (char *) tclgetvar("retval"));
} else if(xctx->netlist_type==CAD_TEDAX_NETLIST &&
(!xctx->schtedaxprop || strcmp(xctx->schtedaxprop, tclgetvar("retval") ) ) ) {
set_modify(1); xctx->push_undo();
my_strdup(_ALLOC_ID_, &xctx->schtedaxprop, (char *) tclgetvar("retval"));
my_strdup(289, &xctx->schtedaxprop, (char *) tclgetvar("retval"));
} else if(xctx->netlist_type==CAD_VHDL_NETLIST &&
(!xctx->schvhdlprop || strcmp(xctx->schvhdlprop, tclgetvar("retval") ) ) ) {
set_modify(1); xctx->push_undo();
my_strdup(_ALLOC_ID_, &xctx->schvhdlprop, (char *) tclgetvar("retval"));
my_strdup(290, &xctx->schvhdlprop, (char *) tclgetvar("retval"));
}
}

View File

@ -69,13 +69,13 @@ static char *expandlabel_strdup(char *src)
char *ptr;
if(src==NULL || src[0]=='\0') {
ptr=NULL;
my_strdup(_ALLOC_ID_, &ptr,"");
my_strdup(291, &ptr,"");
return ptr;
}
else
{
ptr=NULL;
my_strdup(_ALLOC_ID_, &ptr,src);
my_strdup(292, &ptr,src);
dbg(3, "expandlabel_strdup(): duplicated %lu string %s\n",(unsigned long)ptr,src);
return ptr;
}
@ -89,7 +89,7 @@ static char *expandlabel_strcat(char *s1, char *s2)
if(s1) l1=strlen(s1);
if(s2) l2=strlen(s2);
res=my_malloc(_ALLOC_ID_, l1+l2+1); /* 2 strings plus '\0' */
res=my_malloc(293, l1+l2+1); /* 2 strings plus '\0' */
if(s1) memcpy(res, s1, l1);
if(s2) memcpy(res + l1 , s2, l2+1);
else memcpy(res + l1 , "", 1);
@ -104,7 +104,7 @@ static char *expandlabel_strcat_char(char *s1, char c, char *s2)
if(s1) l1=strlen(s1);
if(s2) l2=strlen(s2);
res=my_malloc(_ALLOC_ID_, l1+l2+2); /* 2 strings plus 'c' and '\0' */
res=my_malloc(294, l1+l2+2); /* 2 strings plus 'c' and '\0' */
if(s1) memcpy(res, s1, l1);
res[l1] = c;
if(s2) memcpy(res + l1 + 1, s2, l2+1);
@ -127,7 +127,7 @@ static char *expandlabel_strmult2(int n, char *s)
if(n==0) return expandlabel_strdup("");
len=strlen(s);
prev=s;
ss = str=my_malloc(_ALLOC_ID_, (len+1)*n);
ss = str=my_malloc(295, (len+1)*n);
str[0]='\0';
for(pos=s;pos<=s+len;pos++) {
if(*pos==',' || *pos=='\0') {
@ -161,7 +161,7 @@ static char *expandlabel_strmult(int n, char *s)
if(n==0) return expandlabel_strdup("");
len=strlen(s);
str=pos=my_malloc(_ALLOC_ID_, (len+1)*n);
str=pos=my_malloc(296, (len+1)*n);
for(i=1;i<=n;i++)
{
/* strcpy(pos,s); */
@ -179,8 +179,8 @@ static char *expandlabel_strbus(char *s, int *n)
int tmplen;
char *res=NULL;
char *tmp=NULL;
my_realloc(_ALLOC_ID_, &res, n[0]*(strlen(s)+20));
my_realloc(_ALLOC_ID_, &tmp, strlen(s)+30);
my_realloc(297, &res, n[0]*(strlen(s)+20));
my_realloc(298, &tmp, strlen(s)+30);
l=0;
for(i=1;i<n[0];i++)
{
@ -189,7 +189,7 @@ static char *expandlabel_strbus(char *s, int *n)
memcpy(res+l,tmp, tmplen+1); /* 20180923 */
l+=tmplen;
}
my_free(_ALLOC_ID_, &tmp);
my_free(299, &tmp);
sprintf(res+l, "%s[%d]", s, n[i]);
return res;
}
@ -200,7 +200,7 @@ static void check_idx(int **ptr,int n)
{
idxsize*=2;
dbg(3, "check_idx(): reallocating idx array: size=%d\n",idxsize);
my_realloc(_ALLOC_ID_, ptr, idxsize*sizeof(int));
my_realloc(300, ptr, idxsize*sizeof(int));
}
}
@ -210,8 +210,8 @@ static char *expandlabel_strbus_nobracket(char *s, int *n)
int tmplen;
char *res=NULL;
char *tmp=NULL;
my_realloc(_ALLOC_ID_, &res, n[0]*(strlen(s)+20));
my_realloc(_ALLOC_ID_, &tmp, strlen(s)+30);
my_realloc(301, &res, n[0]*(strlen(s)+20));
my_realloc(302, &tmp, strlen(s)+30);
l=0;
for(i=1;i<n[0];i++)
{
@ -220,7 +220,7 @@ static char *expandlabel_strbus_nobracket(char *s, int *n)
memcpy(res+l,tmp, tmplen+1);
l+=tmplen;
}
my_free(_ALLOC_ID_, &tmp);
my_free(303, &tmp);
sprintf(res+l, "%s%d", s, n[i]);
return res;
}
@ -261,29 +261,29 @@ int *idx; /* for bus index & bus index ranges */
line: /* empty */
| list {
my_strdup(_ALLOC_ID_, &(dest_string.str),$1.str);
my_free(_ALLOC_ID_, &$1.str);
my_strdup(304, &(dest_string.str),$1.str);
my_free(305, &$1.str);
dest_string.m=$1.m;
}
;
list: B_NAME {
dbg(3, "yyparse(): B_NAME, $1=%s\n", $1);
$$.str = expandlabel_strdup($1);
my_free(_ALLOC_ID_, &$1);
my_free(306, &$1);
$$.m = 1;
}
| B_LINE {
dbg(3, "yyparse(): B_LINE\n");
$$.str = expandlabel_strdup($1); /* prima era =$1 */
my_free(_ALLOC_ID_, &$1);
my_free(307, &$1);
$$.m = 1;
}
| list B_NAME {
dbg(3, "yyparse(): list B_NAME, $2=%s\n", $2);
$$.str = expandlabel_strcat($1.str, $2);
my_free(_ALLOC_ID_, &$1.str);
my_free(_ALLOC_ID_, &$2);
my_free(308, &$1.str);
my_free(309, &$2);
$$.m = $1.m;
}
@ -294,37 +294,37 @@ list: B_NAME {
$$.str=expandlabel_strmult2($3,$1.str);
dbg(3, "yyparse(): |%s|\n",$$.str);
$$.m = $3 * $1.m;
my_free(_ALLOC_ID_, &$1.str);
my_free(310, &$1.str);
}
| B_NUM '*' list
{
dbg(3, "yyparse(): B_NUM * list\n");
$$.str=expandlabel_strmult($1,$3.str);
$$.m = $1 * $3.m;
my_free(_ALLOC_ID_, &$3.str);
my_free(311, &$3.str);
}
| B_NAME '*' list
{
dbg(3, "yyparse(): B_NAME * list\n");
$$.str=expandlabel_strcat_char($1, '*', $3.str);
$$.m = 1;
my_free(_ALLOC_ID_, &$1);
my_free(_ALLOC_ID_, &$3.str);
my_free(312, &$1);
my_free(313, &$3.str);
}
| list ',' list {
dbg(3, "yyparse(): list , list\n");
$$.str=expandlabel_strcat_char($1.str, ',', $3.str);
$$.m = $1.m + $3.m;
my_free(_ALLOC_ID_, &$1.str);
my_free(_ALLOC_ID_, &$3.str);
my_free(314, &$1.str);
my_free(315, &$3.str);
}
| list B_CAR list
{
dbg(3, "yyparse(): list B_CAR list\n");
$$.str=expandlabel_strcat_char($1.str, (char)$2, $3.str);
$$.m = $1.m + $3.m;
my_free(_ALLOC_ID_, &$1.str);
my_free(_ALLOC_ID_, &$3.str);
my_free(316, &$1.str);
my_free(317, &$3.str);
}
| '(' list ')' {
dbg(3, "yyparse(): ( list )\n");
@ -333,31 +333,31 @@ list: B_NAME {
| B_NAME '[' B_NAME ']'
{
size_t size = strlen($1) + strlen($3) + 3;
$$.str = my_malloc(_ALLOC_ID_, size);
$$.str = my_malloc(318, size);
$$.m=-1;
my_snprintf($$.str, size, "%s[%s]", $1, $3);
my_free(_ALLOC_ID_, &$1);
my_free(_ALLOC_ID_, &$3);
my_free(319, &$1);
my_free(320, &$3);
}
| B_NAME '[' index ']'
{
dbg(3, "yyparse(): making bus: n=%d\n",$3[0]);
dbg(3, "yyparse(): B_NAME[ index ] , $1=%s $3=%d\n", $1, *$3);
$$.str=expandlabel_strbus($1,$3);
my_free(_ALLOC_ID_, &$1);
my_free(321, &$1);
dbg(3, "yyparse(): done making bus: n=%d\n",$3[0]);
$$.m=$3[0];
my_free(_ALLOC_ID_, &$3);
my_free(322, &$3);
idxsize=INITIALIDXSIZE;
}
| B_NAME '[' index_nobracket ']'
{
dbg(3, "yyparse(): making nobracket bus: n=%d\n",$3[0]);
$$.str=expandlabel_strbus_nobracket($1,$3);
my_free(_ALLOC_ID_, &$1);
my_free(323, &$1);
dbg(3, "yyparse(): done making nobracket bus: n=%d\n",$3[0]);
$$.m=$3[0];
my_free(_ALLOC_ID_, &$3);
my_free(324, &$3);
idxsize=INITIALIDXSIZE;
}
;
@ -366,7 +366,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
/* start : end : extend : repetitions */
int r, i, sign, offset;
sign = XSIGN($3-$1);
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(325, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
offset = 0;
for(r=0; r < $7; r++) {
@ -384,7 +384,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
int sign;
sign = XSIGN($3-$1);
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(326, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
dbg(3, "yyparse(): parsing first idx range\n");
for(i=$1;;i+=sign*$5)
@ -399,7 +399,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
| B_IDXNUM ':' B_IDXNUM
{
int i;
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(327, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
dbg(3, "yyparse(): parsing first idx range\n");
for(i=$1;;i+=XSIGN($3-$1))
@ -411,7 +411,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
}
| B_IDXNUM {
dbg(3, "yyparse(): parsing first idx item\n");
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(328, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
check_idx(&$$, ++$$[0]);
$$[$$[0]]=$1;
@ -467,7 +467,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
index_nobracket: B_IDXNUM B_DOUBLEDOT B_IDXNUM
{
int i;
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(329, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
dbg(3, "yyparse(): doubledot\n");
for(i=$1;;i+=XSIGN($3-$1))
@ -483,7 +483,7 @@ index_nobracket: B_IDXNUM B_DOUBLEDOT B_IDXNUM
int sign;
sign = XSIGN($3-$1);
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(330, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
dbg(3, "yyparse(): parsing first idx range\n");
for(i=$1;;i+=sign*$5)

View File

@ -126,7 +126,7 @@ void find_closest_net_or_symbol_pin(double mx,double my, double *x, double *y)
y0=xctx->inst[i].y0;
rot = xctx->inst[i].rot;
flip = xctx->inst[i].flip;
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(331, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if(!type) continue;
no_of_pin_rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER];
@ -169,7 +169,7 @@ void find_closest_net_or_symbol_pin(double mx,double my, double *x, double *y)
}
*x = min_dist_x;
*y = min_dist_y;
my_free(_ALLOC_ID_, &type);
my_free(332, &type);
}
static void find_closest_arc(double mx,double my)

View File

@ -38,7 +38,7 @@ void compile_font(void)
select_inside(code*FONTOFFSET-1,-FONTHEIGHT-1,
code*FONTOFFSET+FONTWIDTH+1,FONTWHITESPACE + FONTDESCENT+1, 1);
rebuild_selected_array();
character[code] = my_calloc(_ALLOC_ID_, xctx->lastsel*4+1, sizeof(double));
character[code] = my_calloc(333, xctx->lastsel*4+1, sizeof(double));
character[code][0] = (double)xctx->lastsel;
dbg(2, "compile_font(): character[%d][]={%.16g",code,character[code][0]);
for(i=0;i<xctx->lastsel;i++)

View File

@ -28,7 +28,7 @@ void init_inst_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, doub
dbg(3, "init_inst_iterator(): instances=%d\n", xctx->instances);
if(xctx->instances) {
my_realloc(_ALLOC_ID_, &ctx->instflag, xctx->instances*sizeof(unsigned short));
my_realloc(334, &ctx->instflag, xctx->instances*sizeof(unsigned short));
memset(ctx->instflag, 0, xctx->instances*sizeof(unsigned short));
}
/* calculate square 4 1st corner of drawing area */
@ -72,7 +72,7 @@ Instentry *inst_iterator_next(Iterator_ctx *ctx)
ctx->tmpj = ctx->j % NBOXES; if(ctx->tmpj < 0) ctx->tmpj += NBOXES;
ctx->instanceptr = xctx->inst_spatial_table[ctx->tmpi][ctx->tmpj];
} else {
my_free(_ALLOC_ID_, &ctx->instflag);
my_free(335, &ctx->instflag);
return NULL;
}
}
@ -83,7 +83,7 @@ void init_wire_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, doub
ctx->wireflag = NULL;
dbg(3, "init_wire_iterator(): wires=%d\n", xctx->wires);
if(xctx->wires) {
my_realloc(_ALLOC_ID_, &ctx->wireflag, xctx->wires*sizeof(unsigned short));
my_realloc(336, &ctx->wireflag, xctx->wires*sizeof(unsigned short));
memset(ctx->wireflag, 0, xctx->wires*sizeof(unsigned short));
}
/* calculate square 4 1st corner of drawing area */
@ -127,7 +127,7 @@ Wireentry *wire_iterator_next(Iterator_ctx *ctx)
ctx->tmpj = ctx->j % NBOXES; if(ctx->tmpj < 0) ctx->tmpj += NBOXES;
ctx->wireptr = xctx->wire_spatial_table[ctx->tmpi][ctx->tmpj];
} else {
my_free(_ALLOC_ID_, &ctx->wireflag);
my_free(337, &ctx->wireflag);
return NULL;
}
}

View File

@ -48,9 +48,9 @@ static void hilight_hash_free_entry(Hilight_hashentry *entry)
Hilight_hashentry *tmp;
while(entry) {
tmp = entry->next;
my_free(_ALLOC_ID_, &entry->token);
my_free(_ALLOC_ID_, &entry->path);
my_free(_ALLOC_ID_, &entry);
my_free(338, &entry->token);
my_free(339, &entry->path);
my_free(340, &entry);
entry = tmp;
}
}
@ -92,11 +92,11 @@ static Hilight_hashentry *hilight_hash_lookup(const char *token, int value, int
size_t lenp = strlen(xctx->sch_path[xctx->currsch]) + 1;
if( what==XINSERT || what == XINSERT_NOREPLACE) { /* insert data */
s=sizeof( Hilight_hashentry );
entry= (Hilight_hashentry *)my_malloc(_ALLOC_ID_, s );
entry= (Hilight_hashentry *)my_malloc(341, s );
entry->next = NULL;
entry->token = my_malloc(_ALLOC_ID_, lent);
entry->token = my_malloc(342, lent);
memcpy(entry->token, token, lent);
entry->path = my_malloc(_ALLOC_ID_, lenp);
entry->path = my_malloc(343, lenp);
memcpy(entry->path, xctx->sch_path[xctx->currsch], lenp);
entry->oldvalue = value-1000; /* no old value, set different value anyway*/
entry->value = value;
@ -111,9 +111,9 @@ static Hilight_hashentry *hilight_hash_lookup(const char *token, int value, int
!strcmp(xctx->sch_path[xctx->currsch], entry->path) ) { /* found matching tok */
if(what==XDELETE) { /* remove token from the hash table ... */
saveptr=entry->next;
my_free(_ALLOC_ID_, &entry->token);
my_free(_ALLOC_ID_, &entry->path);
my_free(_ALLOC_ID_, &entry);
my_free(344, &entry->token);
my_free(345, &entry->path);
my_free(346, &entry);
*preventry=saveptr;
} else if(what == XINSERT ) {
entry->oldvalue = entry->value;
@ -134,11 +134,11 @@ Hilight_hashentry *inst_hilight_hash_lookup(const char *token, int value, int wh
size_t len = strlen(token) + 2; /* token plus one more character and \0 */
Hilight_hashentry *entry;
dbg(1, "inst_hilight_hash_lookup: token=%s value=%d what=%d\n", token, value, what);
inst_tok = my_malloc(_ALLOC_ID_, len);
inst_tok = my_malloc(347, len);
/* instance name uglyfication: add a space at beginning so it will never match a valid net name */
my_snprintf(inst_tok, len, " %s", token);
entry = hilight_hash_lookup(inst_tok, value, what);
my_free(_ALLOC_ID_, &inst_tok);
my_free(348, &inst_tok);
return entry;
}
@ -156,7 +156,7 @@ Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int wha
ptr1=hilight_hash_lookup(token, value, what);
return ptr1;
}
my_strdup(_ALLOC_ID_, &string, expandlabel(token,&mult));
my_strdup(349, &string, expandlabel(token,&mult));
if(string==NULL) {
return NULL;
}
@ -179,7 +179,7 @@ Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int wha
string_ptr++;
}
/* if something found return first pointer */
my_free(_ALLOC_ID_, &string);
my_free(350, &string);
return ptr2;
}
@ -191,11 +191,11 @@ void display_hilights(char **str)
for(i=0;i<HASHSIZE;i++) {
entry = xctx->hilight_table[i];
while(entry) {
if(!first) my_strcat(_ALLOC_ID_, str, " ");
my_strcat(_ALLOC_ID_, str,"{");
my_strcat(_ALLOC_ID_, str, entry->path+1);
my_strcat(_ALLOC_ID_, str, entry->token);
my_strcat(_ALLOC_ID_, str,"}");
if(!first) my_strcat(351, str, " ");
my_strcat(352, str,"{");
my_strcat(353, str, entry->path+1);
my_strcat(354, str, entry->token);
my_strcat(355, str,"}");
first = 0;
entry = entry->next;
}
@ -271,12 +271,12 @@ void create_plot_cmd(void)
if(exists) {
viewer = atoi(tclgetvar("sim(spicewave,default)"));
my_snprintf(tcl_str, S(tcl_str), "sim(spicewave,%d,name)", viewer);
my_strdup(_ALLOC_ID_, &viewer_name, tclgetvar(tcl_str));
my_strdup(356, &viewer_name, tclgetvar(tcl_str));
dbg(1,"create_plot_cmd(): viewer_name=%s\n", viewer_name);
if(strstr(viewer_name, "Gaw")) viewer=GAW;
else if(strstr(viewer_name, "Bespice")) viewer=BESPICE;
else if(strstr(viewer_name, "Ngspice")) viewer=NGSPICE;
my_free(_ALLOC_ID_, &viewer_name);
my_free(357, &viewer_name);
}
if(!exists || !viewer) return;
my_snprintf(plotfile, S(plotfile), "%s/xplot", tclgetvar("netlist_dir"));
@ -310,24 +310,24 @@ void create_plot_cmd(void)
fprintf(fd, "%s", str);
fprintf(fd, "\n");
first = 1;
my_free(_ALLOC_ID_, &str);
my_free(358, &str);
}
fprintf(fd, "set color%d=rgb:%s\n", idx, color_str);
if(first) {
my_strcat(_ALLOC_ID_, &str, "plot ");
my_strcat(359, &str, "plot ");
first = 0;
}
my_strcat(_ALLOC_ID_, &str, "\"");
my_strcat(_ALLOC_ID_, &str, (entry->path)+1);
my_strcat(_ALLOC_ID_, &str, tok);
my_strcat(_ALLOC_ID_, &str, "\" ");
my_strcat(360, &str, "\"");
my_strcat(361, &str, (entry->path)+1);
my_strcat(362, &str, tok);
my_strcat(363, &str, "\" ");
}
if(viewer == GAW) {
char *t=NULL, *p=NULL;
sprintf(color_str, "%02x%02x%02x",
xctx->xcolor_array[c].red>>8, xctx->xcolor_array[c].green>>8, xctx->xcolor_array[c].blue>>8);
my_strdup(_ALLOC_ID_, &t, tok);
my_strdup2(_ALLOC_ID_, &p, (entry->path)+1);
my_strdup(364, &t, tok);
my_strdup2(365, &p, (entry->path)+1);
if(simtype == 0 ) { /* spice */
tclvareval("puts $gaw_fd {copyvar v(", strtolower(p), strtolower(t),
") sel #", color_str, "}\nvwait gaw_fd\n", NULL);
@ -340,15 +340,15 @@ void create_plot_cmd(void)
tclvareval("puts $gaw_fd {copyvar ", strtoupper(p), strtoupper(t),
" sel #", color_str, "}\nvwait gaw_fd\n", NULL);
}
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
my_free(366, &p);
my_free(367, &t);
}
if(viewer == BESPICE) {
char *t=NULL, *p=NULL;
sprintf(color_str, "%d %d %d",
xctx->xcolor_array[c].red>>8, xctx->xcolor_array[c].green>>8, xctx->xcolor_array[c].blue>>8);
my_strdup(_ALLOC_ID_, &t, tok);
my_strdup2(_ALLOC_ID_, &p, (entry->path)+1);
my_strdup(368, &t, tok);
my_strdup2(369, &p, (entry->path)+1);
if(simtype == 0 ) { /* spice */
tclvareval(
@ -384,8 +384,8 @@ void create_plot_cmd(void)
"\" \"\"}",
NULL);
}
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
my_free(370, &p);
my_free(371, &t);
}
}
entry = entry->next;
@ -394,7 +394,7 @@ void create_plot_cmd(void)
if(viewer == NGSPICE) {
fprintf(fd, "%s", str);
fprintf(fd, "\nremcirc\n.endc\n");
my_free(_ALLOC_ID_, &str);
my_free(372, &str);
fclose(fd);
}
if(viewer == GAW) {
@ -434,16 +434,16 @@ void hilight_net_pin_mismatches(void)
for(k=0; k<xctx->lastsel; k++) {
if(xctx->sel_array[k].type!=ELEMENT) continue;
j = xctx->sel_array[k].n ;
my_strdup(_ALLOC_ID_, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
my_strdup(373, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
if( type && IS_LABEL_SH_OR_PIN(type)) break;
symbol = xctx->sym + xctx->inst[j].ptr;
npin = symbol->rects[PINLAYER];
rct=symbol->rect[PINLAYER];
dbg(1, "hilight_net_pin_mismatches(): \n");
for(i=0;i<npin;i++) {
my_strdup(_ALLOC_ID_, &labname,get_tok_value(rct[i].prop_ptr,"name",0));
my_strdup(_ALLOC_ID_, &lab, expandlabel(labname, &mult));
my_strdup(_ALLOC_ID_, &netname, net_name(j,i, &mult, 0, 0));
my_strdup(374, &labname,get_tok_value(rct[i].prop_ptr,"name",0));
my_strdup(375, &lab, expandlabel(labname, &mult));
my_strdup(376, &netname, net_name(j,i, &mult, 0, 0));
dbg(1, "hilight_net_pin_mismatches(): i=%d labname=%s explabname = %s net = %s\n", i, labname, lab, netname);
if(netname && strcmp(lab, netname)) {
dbg(1, "hilight_net_pin_mismatches(): hilight: %s\n", netname);
@ -452,10 +452,10 @@ void hilight_net_pin_mismatches(void)
}
}
}
my_free(_ALLOC_ID_, &type);
my_free(_ALLOC_ID_, &labname);
my_free(_ALLOC_ID_, &lab);
my_free(_ALLOC_ID_, &netname);
my_free(377, &type);
my_free(378, &labname);
my_free(379, &lab);
my_free(380, &netname);
if(xctx->hilight_nets) propagate_hilights(1, 0, XINSERT_NOREPLACE);
redraw_hilights(0);
}
@ -481,11 +481,11 @@ void hilight_parent_pins(void)
for(j=0;j<rects;j++)
{
if(!xctx->inst[i].node[j]) continue;
my_strdup(_ALLOC_ID_, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
my_strdup(381, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
dbg(1, "hilight_parent_pins(): net_node=%s\n", net_node);
pin_name = get_tok_value((xctx->inst[i].ptr+ xctx->sym)->rect[PINLAYER][j].prop_ptr,"name",0);
if(!pin_name[0]) continue;
my_strdup(_ALLOC_ID_, &pin_node, expandlabel(pin_name, &mult));
my_strdup(382, &pin_node, expandlabel(pin_name, &mult));
dbg(1, "hilight_parent_pins(): pin_node=%s\n", pin_node);
for(k = 1; k<=mult; k++) {
@ -504,8 +504,8 @@ void hilight_parent_pins(void)
}
}
}
my_free(_ALLOC_ID_, &pin_node);
my_free(_ALLOC_ID_, &net_node);
my_free(383, &pin_node);
my_free(384, &net_node);
}
void hilight_child_pins(void)
@ -527,11 +527,11 @@ void hilight_child_pins(void)
dbg(1, "hilight_child_pins(): inst_number=%d\n", inst_number);
if(!xctx->inst[i].node[j]) continue;
my_strdup(_ALLOC_ID_, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
my_strdup(385, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
dbg(1, "hilight_child_pins(): net_node=%s\n", net_node);
pin_name = get_tok_value((xctx->inst[i].ptr+ xctx->sym)->rect[PINLAYER][j].prop_ptr,"name",0);
if(!pin_name[0]) continue;
my_strdup(_ALLOC_ID_, &pin_node, expandlabel(pin_name, &mult));
my_strdup(386, &pin_node, expandlabel(pin_name, &mult));
dbg(1, "hilight_child_pins(): pin_node=%s\n", pin_node);
for(k = 1; k<=mult; k++) {
dbg(1, "hilight_child_pins(): looking nth net:%d, k=%d, inst_number=%d, mult=%d\n",
@ -552,8 +552,8 @@ void hilight_child_pins(void)
}
} /* for(k..) */
}
my_free(_ALLOC_ID_, &pin_node);
my_free(_ALLOC_ID_, &net_node);
my_free(387, &pin_node);
my_free(388, &net_node);
}
@ -615,7 +615,7 @@ int search(const char *tok, const char *val, int sub, int sel)
} else if(!strcmp(tok,"cell::propstring")) {
has_token = (str = (xctx->inst[i].ptr+ xctx->sym)->prop_ptr) ? 1 : 0;
} else if(!strncmp(tok,"cell::", 6)) { /* cell::xxx looks for xxx in global symbol attributes */
my_strdup(_ALLOC_ID_, &tmpname,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,tok+6,0));
my_strdup(389, &tmpname,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,tok+6,0));
has_token = xctx->tok_size;
if(tmpname) {
str = tmpname;
@ -768,7 +768,7 @@ int search(const char *tok, const char *val, int sub, int sel)
regfree(&re);
#endif
xctx->draw_window = save_draw;
my_free(_ALLOC_ID_, &tmpname);
my_free(390, &tmpname);
return found;
}
@ -796,7 +796,7 @@ static void drill_hilight(int mode)
hilight_connected_inst = en_hi &&
((xctx->inst[i].flags & HILIGHT_CONN) || (symbol->flags & HILIGHT_CONN));
for(j=0; j<npin;j++) {
my_strdup2(_ALLOC_ID_, &netname, net_name(i, j, &mult, 1, 0));
my_strdup2(391, &netname, net_name(i, j, &mult, 1, 0));
expandlabel(netname, &mult);
dbg(1, "inst=%s, pin=%d, netname=%s, mult=%d\n", xctx->inst[i].instname, j, netname, mult);
for(k = 1; k <= mult; k++) {
@ -807,7 +807,7 @@ static void drill_hilight(int mode)
xctx->inst[i].color = entry->value;
inst_hilight_hash_lookup(xctx->inst[i].instname, entry->value, XINSERT_NOREPLACE);
}
my_strdup(_ALLOC_ID_, &propagate_str, get_tok_value(rct[j].prop_ptr, "propag", 0));
my_strdup(392, &propagate_str, get_tok_value(rct[j].prop_ptr, "propag", 0));
if(propagate_str) {
int n = 1;
const char *propag;
@ -822,7 +822,7 @@ static void drill_hilight(int mode)
}
/* expandlabel(rct[propagate].name, &pinmult); */
/* get net to propagate hilight to...*/
my_strdup2(_ALLOC_ID_, &propagated_net, net_name(i, propagate, &mult2, 1, 0));
my_strdup2(393, &propagated_net, net_name(i, propagate, &mult2, 1, 0));
netbitname = find_nth(propagated_net, ",", k);
dbg(1, "netbitname=%s\n", netbitname);
/* add net to highlight list */
@ -837,9 +837,9 @@ static void drill_hilight(int mode)
} /* for(i...) */
if(!found) break;
} /* while(1) */
my_free(_ALLOC_ID_, &netname);
if(propagated_net) my_free(_ALLOC_ID_, &propagated_net);
if(propagate_str) my_free(_ALLOC_ID_, &propagate_str);
my_free(394, &netname);
if(propagated_net) my_free(395, &propagated_net);
if(propagate_str) my_free(396, &propagate_str);
}
int hilight_netname(const char *name)
@ -879,9 +879,9 @@ static void send_net_to_bespice(int simtype, const char *node)
sprintf(color_str, "%d %d %d", xctx->xcolor_array[c].red>>8, xctx->xcolor_array[c].green>>8,
xctx->xcolor_array[c].blue>>8);
expanded_tok = expandlabel(tok, &tok_mult);
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(397, &p, xctx->sch_path[xctx->currsch]+1);
for(k=1; k<=tok_mult; k++) {
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
my_strdup(398, &t, find_nth(expanded_tok, ",", k));
if(simtype == 0 ) { /* spice */
tclvareval(
"puts $bespice_server_getdata(sock) ",
@ -917,8 +917,8 @@ static void send_net_to_bespice(int simtype, const char *node)
NULL);
}
}
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
my_free(399, &p);
my_free(400, &t);
}
}
@ -939,7 +939,7 @@ static void send_net_to_graph(char **s, int simtype, const char *node)
int start_level;
c = get_color(xctx->hilight_color);
expanded_tok = expandlabel(tok, &tok_mult);
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(401, &p, xctx->sch_path[xctx->currsch]+1);
path = p;
start_level = sch_waves_loaded();
if(path) {
@ -952,20 +952,20 @@ static void send_net_to_graph(char **s, int simtype, const char *node)
}
strtolower(path);
for(k=1; k<=tok_mult; k++) {
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
my_strdup(402, &t, find_nth(expanded_tok, ",", k));
strtolower(t);
if(simtype == 0 ) { /* ngspice */
dbg(1, "%s%s color=%d\n", path, t, c);
my_snprintf(ss, S(ss), "%s%s %d ", path, t, c);
my_strcat(_ALLOC_ID_, s, ss);
my_strcat(403, s, ss);
} else { /* Xyce */
my_snprintf(ss, S(ss), "%s%s %d", path, t, c);
my_strcat(_ALLOC_ID_, s, ss);
my_strcat(404, s, ss);
}
}
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
my_free(405, &p);
my_free(406, &t);
}
}
@ -990,11 +990,11 @@ static void send_net_to_gaw(int simtype, const char *node)
expanded_tok = expandlabel(tok, &tok_mult);
tcleval("setup_tcp_gaw");
if(tclresult()[0] == '0') return;
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(407, &p, xctx->sch_path[xctx->currsch]+1);
path = p;
strtolower(path);
for(k=1; k<=tok_mult; k++) {
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
my_strdup(408, &t, find_nth(expanded_tok, ",", k));
strtolower(t);
if(simtype == 0 ) { /* ngspice */
tclvareval("puts $gaw_fd {copyvar v(", path, t,
@ -1004,8 +1004,8 @@ static void send_net_to_gaw(int simtype, const char *node)
") sel #", color_str, "}\nvwait gaw_fd\n", NULL);
}
}
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
my_free(409, &p);
my_free(410, &t);
}
}
@ -1028,9 +1028,9 @@ static void send_current_to_bespice(int simtype, const char *node)
sprintf(color_str, "%d %d %d", xctx->xcolor_array[c].red>>8, xctx->xcolor_array[c].green>>8,
xctx->xcolor_array[c].blue>>8);
expanded_tok = expandlabel(tok, &tok_mult);
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(411, &p, xctx->sch_path[xctx->currsch]+1);
for(k=1; k<=tok_mult; k++) {
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
my_strdup(412, &t, find_nth(expanded_tok, ",", k));
if(!simtype) { /* spice */
tclvareval(
"puts $bespice_server_getdata(sock) ",
@ -1071,8 +1071,8 @@ static void send_current_to_bespice(int simtype, const char *node)
NULL);
}
}
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
my_free(413, &p);
my_free(414, &t);
}
static void send_current_to_graph(char **s, int simtype, const char *node)
@ -1087,7 +1087,7 @@ static void send_current_to_graph(char **s, int simtype, const char *node)
tok = node;
c = get_color(xctx->hilight_color);
expanded_tok = expandlabel(tok, &tok_mult);
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(415, &p, xctx->sch_path[xctx->currsch]+1);
path = p;
start_level = sch_waves_loaded();
if(path) {
@ -1101,22 +1101,22 @@ static void send_current_to_graph(char **s, int simtype, const char *node)
strtolower(path);
there_is_hierarchy = (strstr(path, ".") != NULL);
for(k=1; k<=tok_mult; k++) {
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
my_strdup(416, &t, find_nth(expanded_tok, ",", k));
strtolower(t);
if(!simtype) { /* ngspice */
my_snprintf(ss, S(ss), "i(%s%s%s) %d", there_is_hierarchy ? "v." : "", path, t, c);
my_strcat(_ALLOC_ID_, s, ss);
my_strcat(417, s, ss);
} else { /* Xyce */
/*
my_snprintf(ss, S(ss), "%s%s%s#branch %d", there_is_hierarchy ? "v." : "",
path, (there_is_hierarchy ? t+1 : t) , c);
*/
my_snprintf(ss, S(ss), "i(%s%s) %d", path, t, c);
my_strcat(_ALLOC_ID_, s, ss);
my_strcat(418, s, ss);
}
}
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
my_free(419, &p);
my_free(420, &t);
}
static void send_current_to_gaw(int simtype, const char *node)
@ -1136,12 +1136,12 @@ static void send_current_to_gaw(int simtype, const char *node)
expanded_tok = expandlabel(tok, &tok_mult);
tcleval("setup_tcp_gaw");
if(tclresult()[0] == '0') return;
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(421, &p, xctx->sch_path[xctx->currsch]+1);
path = p;
strtolower(path);
there_is_hierarchy = (xctx->currsch > 0);
for(k=1; k<=tok_mult; k++) {
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", k));
my_strdup(422, &t, find_nth(expanded_tok, ",", k));
strtolower(t);
if(!simtype) { /* spice */
tclvareval("puts $gaw_fd {copyvar i(", there_is_hierarchy ? "v." : "", path, t,
@ -1161,8 +1161,8 @@ static void send_current_to_gaw(int simtype, const char *node)
" sel #", color_str, "}\nvwait gaw_fd\n", NULL);
}
}
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
my_free(423, &p);
my_free(424, &t);
}
/* hilight/clear pin/label instances attached to hilight nets, or instances with "hilight=true"
@ -1438,21 +1438,21 @@ static void create_simdata(void)
int i, j;
const char *str;
free_simdata();
my_realloc(_ALLOC_ID_, &xctx->simdata, xctx->instances * sizeof(Simdata));
my_realloc(425, &xctx->simdata, xctx->instances * sizeof(Simdata));
xctx->simdata_ninst = xctx->instances;
for(i = 0; i < xctx->instances; i++) {
xSymbol *symbol = xctx->inst[i].ptr + xctx->sym;
int npin = symbol->rects[PINLAYER];
xctx->simdata[i].pin = NULL;
if(npin) my_realloc(_ALLOC_ID_, &xctx->simdata[i].pin, npin * sizeof(Simdata_pin));
if(npin) my_realloc(426, &xctx->simdata[i].pin, npin * sizeof(Simdata_pin));
xctx->simdata[i].npin = npin;
for(j = 0; j < npin; j++) {
char function[20];
xctx->simdata[i].pin[j].function=NULL;
xctx->simdata[i].pin[j].go_to=NULL;
my_snprintf(function, S(function), "function%d", j);
my_strdup(_ALLOC_ID_, &xctx->simdata[i].pin[j].function, get_tok_value(symbol->prop_ptr, function, 0));
my_strdup(_ALLOC_ID_, &xctx->simdata[i].pin[j].go_to,
my_strdup(427, &xctx->simdata[i].pin[j].function, get_tok_value(symbol->prop_ptr, function, 0));
my_strdup(428, &xctx->simdata[i].pin[j].go_to,
get_tok_value(symbol->rect[PINLAYER][j].prop_ptr, "goto", 0));
str = get_tok_value(symbol->rect[PINLAYER][j].prop_ptr, "clock", 0);
xctx->simdata[i].pin[j].clock = str[0] ? str[0] - '0' : -1;
@ -1468,12 +1468,12 @@ void free_simdata(void)
for(i = 0; i < xctx->simdata_ninst; i++) { /* can not use xctx->instances if a new sch is loaded */
int npin = xctx->simdata[i].npin;
for(j = 0; j < npin; j++) {
my_free(_ALLOC_ID_, &xctx->simdata[i].pin[j].function);
my_free(_ALLOC_ID_, &xctx->simdata[i].pin[j].go_to);
my_free(429, &xctx->simdata[i].pin[j].function);
my_free(430, &xctx->simdata[i].pin[j].go_to);
}
if(npin) my_free(_ALLOC_ID_, &xctx->simdata[i].pin);
if(npin) my_free(431, &xctx->simdata[i].pin);
}
my_free(_ALLOC_ID_, &xctx->simdata);
my_free(432, &xctx->simdata);
}
xctx->simdata_ninst = 0;
}
@ -1594,7 +1594,7 @@ static void propagate_logic()
if( tclresult()[0] == '1') break;
iter++;
} /* while(1) */
/* my_free(_ALLOC_ID_, &propagated_net); */
/* my_free(433, &propagated_net); */
}
void logic_set(int value, int num)
@ -1713,7 +1713,7 @@ void hilight_net(int viewer)
}
if( viewer == XSCHEM_GRAPH && s) {
tclvareval("graph_add_nodes_from_list {", s, "}", NULL);
my_free(_ALLOC_ID_, &s);
my_free(434, &s);
}
if(!incr_hi) incr_hilight_color();
if(xctx->hilight_nets) propagate_hilights(1, 0, XINSERT_NOREPLACE);
@ -1945,14 +1945,14 @@ void print_hilight_net(int show)
fprintf(errfp, "print_hilight_net(): can not create tmpfile %s\n", filename_ptr);
return;
}
my_strdup(_ALLOC_ID_, &filetmp2, filename_ptr);
my_strdup(435, &filetmp2, filename_ptr);
fclose(fd);
if(!(fd = open_tmpfile("hilight1_", &filename_ptr))) {
fprintf(errfp, "print_hilight_net(): can not create tmpfile %s\n", filename_ptr);
my_free(_ALLOC_ID_, &filetmp2);
my_free(436, &filetmp2);
return;
}
my_strdup(_ALLOC_ID_, &filetmp1, filename_ptr);
my_strdup(437, &filetmp1, filename_ptr);
my_snprintf(cmd, S(cmd), "awk -f \"%s/order_labels.awk\"", tclgetvar("XSCHEM_SHAREDIR"));
my_snprintf(cmd2, S(cmd2), "%s %s > %s", cmd, filetmp1, filetmp2);
my_snprintf(cmd3, S(cmd3), "awk -f \"%s/sort_labels.awk\" %s", tclgetvar("XSCHEM_SHAREDIR"), filetmp1);
@ -2025,8 +2025,8 @@ void print_hilight_net(int show)
xctx->prep_hi_structs=0;
xctx->prep_net_structs=0;
my_free(_ALLOC_ID_, &filetmp1);
my_free(_ALLOC_ID_, &filetmp2);
my_free(438, &filetmp1);
my_free(439, &filetmp2);
}
void list_hilights(void)

View File

@ -28,9 +28,9 @@ static void free_undo_lines(int slot)
for(c = 0;c<cadlayers; c++) {
for(i = 0;i<xctx->uslot[slot].lines[c]; i++) {
my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr[c][i].prop_ptr);
my_free(440, &xctx->uslot[slot].lptr[c][i].prop_ptr);
}
my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr[c]);
my_free(441, &xctx->uslot[slot].lptr[c]);
xctx->uslot[slot].lines[c] = 0;
}
}
@ -41,9 +41,9 @@ static void free_undo_rects(int slot)
for(c = 0;c<cadlayers; c++) {
for(i = 0;i<xctx->uslot[slot].rects[c]; i++) {
my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr[c][i].prop_ptr);
my_free(442, &xctx->uslot[slot].bptr[c][i].prop_ptr);
}
my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr[c]);
my_free(443, &xctx->uslot[slot].bptr[c]);
xctx->uslot[slot].rects[c] = 0;
}
}
@ -54,12 +54,12 @@ static void free_undo_polygons(int slot)
for(c = 0;c<cadlayers; c++) {
for(i = 0;i<xctx->uslot[slot].polygons[c]; i++) {
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].x);
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].y);
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].selected_point);
my_free(444, &xctx->uslot[slot].pptr[c][i].prop_ptr);
my_free(445, &xctx->uslot[slot].pptr[c][i].x);
my_free(446, &xctx->uslot[slot].pptr[c][i].y);
my_free(447, &xctx->uslot[slot].pptr[c][i].selected_point);
}
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c]);
my_free(448, &xctx->uslot[slot].pptr[c]);
xctx->uslot[slot].polygons[c] = 0;
}
}
@ -70,9 +70,9 @@ static void free_undo_arcs(int slot)
for(c = 0;c<cadlayers; c++) {
for(i = 0;i<xctx->uslot[slot].arcs[c]; i++) {
my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr[c][i].prop_ptr);
my_free(449, &xctx->uslot[slot].aptr[c][i].prop_ptr);
}
my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr[c]);
my_free(450, &xctx->uslot[slot].aptr[c]);
xctx->uslot[slot].arcs[c] = 0;
}
}
@ -82,9 +82,9 @@ static void free_undo_wires(int slot)
int i;
for(i = 0;i<xctx->uslot[slot].wires; i++) {
my_free(_ALLOC_ID_, &xctx->uslot[slot].wptr[i].prop_ptr);
my_free(451, &xctx->uslot[slot].wptr[i].prop_ptr);
}
my_free(_ALLOC_ID_, &xctx->uslot[slot].wptr);
my_free(452, &xctx->uslot[slot].wptr);
xctx->uslot[slot].wires = 0;
}
@ -93,11 +93,11 @@ static void free_undo_texts(int slot)
int i;
for(i = 0;i<xctx->uslot[slot].texts; i++) {
my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].txt_ptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].font);
my_free(453, &xctx->uslot[slot].tptr[i].prop_ptr);
my_free(454, &xctx->uslot[slot].tptr[i].txt_ptr);
my_free(455, &xctx->uslot[slot].tptr[i].font);
}
my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr);
my_free(456, &xctx->uslot[slot].tptr);
xctx->uslot[slot].texts = 0;
}
@ -106,12 +106,12 @@ static void free_undo_instances(int slot)
int i;
for(i = 0;i<xctx->uslot[slot].instances; i++) {
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].name);
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].instname);
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].lab);
my_free(457, &xctx->uslot[slot].iptr[i].name);
my_free(458, &xctx->uslot[slot].iptr[i].prop_ptr);
my_free(459, &xctx->uslot[slot].iptr[i].instname);
my_free(460, &xctx->uslot[slot].iptr[i].lab);
}
my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr);
my_free(461, &xctx->uslot[slot].iptr);
xctx->uslot[slot].instances = 0;
}
@ -123,70 +123,70 @@ static void free_undo_symbols(int slot)
symbols = xctx->uslot[slot].symbols;
for(i = 0;i < symbols; i++) {
sym = &xctx->uslot[slot].symptr[i];
my_free(_ALLOC_ID_, &sym->name);
my_free(_ALLOC_ID_, &sym->prop_ptr);
my_free(_ALLOC_ID_, &sym->type);
my_free(_ALLOC_ID_, &sym->templ);
my_free(462, &sym->name);
my_free(463, &sym->prop_ptr);
my_free(464, &sym->type);
my_free(465, &sym->templ);
for(c = 0;c<cadlayers;c++) {
for(j = 0;j<sym->polygons[c];j++) {
if(sym->poly[c][j].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &sym->poly[c][j].prop_ptr);
my_free(466, &sym->poly[c][j].prop_ptr);
}
my_free(_ALLOC_ID_, &sym->poly[c][j].x);
my_free(_ALLOC_ID_, &sym->poly[c][j].y);
my_free(_ALLOC_ID_, &sym->poly[c][j].selected_point);
my_free(467, &sym->poly[c][j].x);
my_free(468, &sym->poly[c][j].y);
my_free(469, &sym->poly[c][j].selected_point);
}
my_free(_ALLOC_ID_, &sym->poly[c]);
my_free(470, &sym->poly[c]);
sym->polygons[c] = 0;
for(j = 0;j<sym->lines[c];j++) {
if(sym->line[c][j].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &sym->line[c][j].prop_ptr);
my_free(471, &sym->line[c][j].prop_ptr);
}
}
my_free(_ALLOC_ID_, &sym->line[c]);
my_free(472, &sym->line[c]);
sym->lines[c] = 0;
for(j = 0;j<sym->arcs[c];j++) {
if(sym->arc[c][j].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &sym->arc[c][j].prop_ptr);
my_free(473, &sym->arc[c][j].prop_ptr);
}
}
my_free(_ALLOC_ID_, &sym->arc[c]);
my_free(474, &sym->arc[c]);
sym->arcs[c] = 0;
for(j = 0;j<sym->rects[c];j++) {
if(sym->rect[c][j].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &sym->rect[c][j].prop_ptr);
my_free(475, &sym->rect[c][j].prop_ptr);
}
}
my_free(_ALLOC_ID_, &sym->rect[c]);
my_free(476, &sym->rect[c]);
sym->rects[c] = 0;
}
for(j = 0;j<sym->texts;j++) {
if(sym->text[j].prop_ptr != NULL) {
my_free(_ALLOC_ID_, &sym->text[j].prop_ptr);
my_free(477, &sym->text[j].prop_ptr);
}
if(sym->text[j].txt_ptr != NULL) {
my_free(_ALLOC_ID_, &sym->text[j].txt_ptr);
my_free(478, &sym->text[j].txt_ptr);
}
if(sym->text[j].font != NULL) {
my_free(_ALLOC_ID_, &sym->text[j].font);
my_free(479, &sym->text[j].font);
}
}
my_free(_ALLOC_ID_, &sym->text);
my_free(480, &sym->text);
sym->texts = 0;
my_free(_ALLOC_ID_, &sym->line);
my_free(_ALLOC_ID_, &sym->rect);
my_free(_ALLOC_ID_, &sym->poly);
my_free(_ALLOC_ID_, &sym->arc);
my_free(_ALLOC_ID_, &sym->lines);
my_free(_ALLOC_ID_, &sym->rects);
my_free(_ALLOC_ID_, &sym->polygons);
my_free(_ALLOC_ID_, &sym->arcs);
my_free(481, &sym->line);
my_free(482, &sym->rect);
my_free(483, &sym->poly);
my_free(484, &sym->arc);
my_free(485, &sym->lines);
my_free(486, &sym->rects);
my_free(487, &sym->polygons);
my_free(488, &sym->arcs);
}
my_free(_ALLOC_ID_, &xctx->uslot[slot].symptr);
my_free(489, &xctx->uslot[slot].symptr);
xctx->uslot[slot].symbols = 0;
}
@ -197,14 +197,14 @@ static void mem_init_undo(void)
dbg(1, "mem_init_undo(): undo_initialized = %d\n", xctx->undo_initialized);
if(!xctx->undo_initialized) {
for(slot = 0;slot<MAX_UNDO; slot++) {
xctx->uslot[slot].lines = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->uslot[slot].rects = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->uslot[slot].arcs = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->uslot[slot].polygons = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->uslot[slot].lptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
xctx->uslot[slot].bptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
xctx->uslot[slot].aptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
xctx->uslot[slot].pptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
xctx->uslot[slot].lines = my_calloc(490, cadlayers, sizeof(int));
xctx->uslot[slot].rects = my_calloc(491, cadlayers, sizeof(int));
xctx->uslot[slot].arcs = my_calloc(492, cadlayers, sizeof(int));
xctx->uslot[slot].polygons = my_calloc(493, cadlayers, sizeof(int));
xctx->uslot[slot].lptr = my_calloc(494, cadlayers, sizeof(xLine *));
xctx->uslot[slot].bptr = my_calloc(495, cadlayers, sizeof(xRect *));
xctx->uslot[slot].aptr = my_calloc(496, cadlayers, sizeof(xArc *));
xctx->uslot[slot].pptr = my_calloc(497, cadlayers, sizeof(xPoly *));
}
xctx->undo_initialized = 1;
}
@ -239,14 +239,14 @@ void mem_delete_undo(void)
if(!xctx->undo_initialized) return;
mem_clear_undo();
for(slot = 0;slot<MAX_UNDO; slot++) {
my_free(_ALLOC_ID_, &xctx->uslot[slot].lines);
my_free(_ALLOC_ID_, &xctx->uslot[slot].rects);
my_free(_ALLOC_ID_, &xctx->uslot[slot].arcs);
my_free(_ALLOC_ID_, &xctx->uslot[slot].polygons);
my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr);
my_free(498, &xctx->uslot[slot].lines);
my_free(499, &xctx->uslot[slot].rects);
my_free(500, &xctx->uslot[slot].arcs);
my_free(501, &xctx->uslot[slot].polygons);
my_free(502, &xctx->uslot[slot].lptr);
my_free(503, &xctx->uslot[slot].bptr);
my_free(504, &xctx->uslot[slot].aptr);
my_free(505, &xctx->uslot[slot].pptr);
}
xctx->undo_initialized = 0;
}
@ -261,11 +261,11 @@ void mem_push_undo(void)
mem_init_undo();
slot = xctx->cur_undo_ptr%MAX_UNDO;
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].gptr, xctx->schvhdlprop);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].vptr, xctx->schverilogprop);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].sptr, xctx->schprop);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].kptr, xctx->schsymbolprop);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].eptr, xctx->schtedaxprop);
my_strdup(506, &xctx->uslot[slot].gptr, xctx->schvhdlprop);
my_strdup(507, &xctx->uslot[slot].vptr, xctx->schverilogprop);
my_strdup(508, &xctx->uslot[slot].sptr, xctx->schprop);
my_strdup(509, &xctx->uslot[slot].kptr, xctx->schsymbolprop);
my_strdup(510, &xctx->uslot[slot].eptr, xctx->schtedaxprop);
free_undo_lines(slot);
free_undo_rects(slot);
@ -281,15 +281,15 @@ void mem_push_undo(void)
memcpy(xctx->uslot[slot].arcs, xctx->arcs, sizeof(xctx->arcs[0]) * cadlayers);
memcpy(xctx->uslot[slot].polygons, xctx->polygons, sizeof(xctx->polygons[0]) * cadlayers);
for(c = 0;c<cadlayers;c++) {
xctx->uslot[slot].lptr[c] = my_calloc(_ALLOC_ID_, xctx->lines[c], sizeof(xLine));
xctx->uslot[slot].bptr[c] = my_calloc(_ALLOC_ID_, xctx->rects[c], sizeof(xRect));
xctx->uslot[slot].pptr[c] = my_calloc(_ALLOC_ID_, xctx->polygons[c], sizeof(xPoly));
xctx->uslot[slot].aptr[c] = my_calloc(_ALLOC_ID_, xctx->arcs[c], sizeof(xArc));
xctx->uslot[slot].lptr[c] = my_calloc(511, xctx->lines[c], sizeof(xLine));
xctx->uslot[slot].bptr[c] = my_calloc(512, xctx->rects[c], sizeof(xRect));
xctx->uslot[slot].pptr[c] = my_calloc(513, xctx->polygons[c], sizeof(xPoly));
xctx->uslot[slot].aptr[c] = my_calloc(514, xctx->arcs[c], sizeof(xArc));
}
xctx->uslot[slot].wptr = my_calloc(_ALLOC_ID_, xctx->wires, sizeof(xWire));
xctx->uslot[slot].tptr = my_calloc(_ALLOC_ID_, xctx->texts, sizeof(xText));
xctx->uslot[slot].iptr = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(xInstance));
xctx->uslot[slot].symptr = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(xSymbol));
xctx->uslot[slot].wptr = my_calloc(515, xctx->wires, sizeof(xWire));
xctx->uslot[slot].tptr = my_calloc(516, xctx->texts, sizeof(xText));
xctx->uslot[slot].iptr = my_calloc(517, xctx->instances, sizeof(xInstance));
xctx->uslot[slot].symptr = my_calloc(518, xctx->symbols, sizeof(xSymbol));
xctx->uslot[slot].texts = xctx->texts;
xctx->uslot[slot].instances = xctx->instances;
xctx->uslot[slot].symbols = xctx->symbols;
@ -300,34 +300,34 @@ void mem_push_undo(void)
for(i = 0;i<xctx->lines[c];i++) {
xctx->uslot[slot].lptr[c][i] = xctx->line[c][i];
xctx->uslot[slot].lptr[c][i].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].lptr[c][i].prop_ptr, xctx->line[c][i].prop_ptr);
my_strdup(519, &xctx->uslot[slot].lptr[c][i].prop_ptr, xctx->line[c][i].prop_ptr);
}
/* rects */
for(i = 0;i<xctx->rects[c];i++) {
xctx->uslot[slot].bptr[c][i] = xctx->rect[c][i];
xctx->uslot[slot].bptr[c][i].prop_ptr = NULL;
xctx->uslot[slot].bptr[c][i].extraptr = NULL;
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].bptr[c][i].prop_ptr, xctx->rect[c][i].prop_ptr);
my_strdup(520, &xctx->uslot[slot].bptr[c][i].prop_ptr, xctx->rect[c][i].prop_ptr);
}
/* arcs */
for(i = 0;i<xctx->arcs[c];i++) {
xctx->uslot[slot].aptr[c][i] = xctx->arc[c][i];
xctx->uslot[slot].aptr[c][i].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].aptr[c][i].prop_ptr, xctx->arc[c][i].prop_ptr);
my_strdup(521, &xctx->uslot[slot].aptr[c][i].prop_ptr, xctx->arc[c][i].prop_ptr);
}
/*polygons */
for(i = 0;i<xctx->polygons[c];i++) {
int points = xctx->poly[c][i].points;
xctx->uslot[slot].pptr[c][i] = xctx->poly[c][i];
xctx->uslot[slot].pptr[c][i].prop_ptr = NULL;
xctx->uslot[slot].pptr[c][i].x = my_malloc(_ALLOC_ID_, points * sizeof(double));
xctx->uslot[slot].pptr[c][i].y = my_malloc(_ALLOC_ID_, points * sizeof(double));
xctx->uslot[slot].pptr[c][i].selected_point = my_malloc(_ALLOC_ID_, points * sizeof(unsigned short));
xctx->uslot[slot].pptr[c][i].x = my_malloc(522, points * sizeof(double));
xctx->uslot[slot].pptr[c][i].y = my_malloc(523, points * sizeof(double));
xctx->uslot[slot].pptr[c][i].selected_point = my_malloc(524, points * sizeof(unsigned short));
memcpy(xctx->uslot[slot].pptr[c][i].x, xctx->poly[c][i].x, points * sizeof(double));
memcpy(xctx->uslot[slot].pptr[c][i].y, xctx->poly[c][i].y, points * sizeof(double));
memcpy(xctx->uslot[slot].pptr[c][i].selected_point, xctx->poly[c][i].selected_point,
points * sizeof(unsigned short));
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].pptr[c][i].prop_ptr, xctx->poly[c][i].prop_ptr);
my_strdup(525, &xctx->uslot[slot].pptr[c][i].prop_ptr, xctx->poly[c][i].prop_ptr);
}
}
/* instances */
@ -338,10 +338,10 @@ void mem_push_undo(void)
xctx->uslot[slot].iptr[i].instname = NULL;
xctx->uslot[slot].iptr[i].lab = NULL;
xctx->uslot[slot].iptr[i].node = NULL;
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].lab, xctx->inst[i].lab);
my_strdup2(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].instname, xctx->inst[i].instname);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].prop_ptr, xctx->inst[i].prop_ptr);
my_strdup2(_ALLOC_ID_, &xctx->uslot[slot].iptr[i].name, xctx->inst[i].name);
my_strdup(526, &xctx->uslot[slot].iptr[i].lab, xctx->inst[i].lab);
my_strdup2(527, &xctx->uslot[slot].iptr[i].instname, xctx->inst[i].instname);
my_strdup(528, &xctx->uslot[slot].iptr[i].prop_ptr, xctx->inst[i].prop_ptr);
my_strdup2(529, &xctx->uslot[slot].iptr[i].name, xctx->inst[i].name);
}
/* symbols */
@ -352,19 +352,19 @@ void mem_push_undo(void)
sym->prop_ptr = NULL;
sym->type = NULL;
sym->templ = NULL;
my_strdup2(_ALLOC_ID_, &sym->name, xctx->sym[i].name);
my_strdup2(_ALLOC_ID_, &sym->type, xctx->sym[i].type);
my_strdup2(_ALLOC_ID_, &sym->templ, xctx->sym[i].templ);
my_strdup2(_ALLOC_ID_, &sym->prop_ptr, xctx->sym[i].prop_ptr);
sym->line = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
sym->poly = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
sym->arc = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
sym->rect = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
sym->lines = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
sym->rects = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
sym->arcs = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
sym->polygons = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
sym->text = my_calloc(_ALLOC_ID_, xctx->sym[i].texts, sizeof(xText));
my_strdup2(530, &sym->name, xctx->sym[i].name);
my_strdup2(531, &sym->type, xctx->sym[i].type);
my_strdup2(532, &sym->templ, xctx->sym[i].templ);
my_strdup2(533, &sym->prop_ptr, xctx->sym[i].prop_ptr);
sym->line = my_calloc(534, cadlayers, sizeof(xLine *));
sym->poly = my_calloc(535, cadlayers, sizeof(xPoly *));
sym->arc = my_calloc(536, cadlayers, sizeof(xArc *));
sym->rect = my_calloc(537, cadlayers, sizeof(xRect *));
sym->lines = my_calloc(538, cadlayers, sizeof(int));
sym->rects = my_calloc(539, cadlayers, sizeof(int));
sym->arcs = my_calloc(540, cadlayers, sizeof(int));
sym->polygons = my_calloc(541, cadlayers, sizeof(int));
sym->text = my_calloc(542, xctx->sym[i].texts, sizeof(xText));
memcpy(sym->lines, xctx->sym[i].lines, sizeof(sym->lines[0]) * cadlayers);
memcpy(sym->rects, xctx->sym[i].rects, sizeof(sym->rects[0]) * cadlayers);
@ -372,37 +372,37 @@ void mem_push_undo(void)
memcpy(sym->polygons, xctx->sym[i].polygons, sizeof(sym->polygons[0]) * cadlayers);
for(c = 0;c<cadlayers;c++) {
/* symbol lines */
sym->line[c] = my_calloc(_ALLOC_ID_, xctx->sym[i].lines[c], sizeof(xLine));
sym->line[c] = my_calloc(543, xctx->sym[i].lines[c], sizeof(xLine));
for(j = 0; j < xctx->sym[i].lines[c]; j++) {
sym->line[c][j] = xctx->sym[i].line[c][j];
sym->line[c][j].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, &sym->line[c][j].prop_ptr, xctx->sym[i].line[c][j].prop_ptr);
my_strdup(544, &sym->line[c][j].prop_ptr, xctx->sym[i].line[c][j].prop_ptr);
}
/* symbol rects */
sym->rect[c] = my_calloc(_ALLOC_ID_, xctx->sym[i].rects[c], sizeof(xRect));
sym->rect[c] = my_calloc(545, xctx->sym[i].rects[c], sizeof(xRect));
for(j = 0; j < xctx->sym[i].rects[c]; j++) {
sym->rect[c][j] = xctx->sym[i].rect[c][j];
sym->rect[c][j].prop_ptr = NULL;
sym->rect[c][j].extraptr = NULL;
my_strdup(_ALLOC_ID_, &sym->rect[c][j].prop_ptr, xctx->sym[i].rect[c][j].prop_ptr);
my_strdup(546, &sym->rect[c][j].prop_ptr, xctx->sym[i].rect[c][j].prop_ptr);
}
/* symbol arcs */
sym->arc[c] = my_calloc(_ALLOC_ID_, xctx->sym[i].arcs[c], sizeof(xArc));
sym->arc[c] = my_calloc(547, xctx->sym[i].arcs[c], sizeof(xArc));
for(j = 0; j < xctx->sym[i].arcs[c]; j++) {
sym->arc[c][j] = xctx->sym[i].arc[c][j];
sym->arc[c][j].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, &sym->arc[c][j].prop_ptr, xctx->sym[i].arc[c][j].prop_ptr);
my_strdup(548, &sym->arc[c][j].prop_ptr, xctx->sym[i].arc[c][j].prop_ptr);
}
/* symbol polygons */
sym->poly[c] = my_calloc(_ALLOC_ID_, xctx->sym[i].polygons[c], sizeof(xPoly));
sym->poly[c] = my_calloc(549, xctx->sym[i].polygons[c], sizeof(xPoly));
for(j = 0; j < xctx->sym[i].polygons[c]; j++) {
int points = xctx->sym[i].poly[c][j].points;
sym->poly[c][j] = xctx->sym[i].poly[c][j];
sym->poly[c][j].prop_ptr = NULL;
sym->poly[c][j].x = my_malloc(_ALLOC_ID_, points * sizeof(double));
sym->poly[c][j].y = my_malloc(_ALLOC_ID_, points * sizeof(double));
sym->poly[c][j].selected_point = my_malloc(_ALLOC_ID_, points * sizeof(unsigned short));
my_strdup(_ALLOC_ID_, &sym->poly[c][j].prop_ptr, xctx->sym[i].poly[c][j].prop_ptr);
sym->poly[c][j].x = my_malloc(550, points * sizeof(double));
sym->poly[c][j].y = my_malloc(551, points * sizeof(double));
sym->poly[c][j].selected_point = my_malloc(552, points * sizeof(unsigned short));
my_strdup(553, &sym->poly[c][j].prop_ptr, xctx->sym[i].poly[c][j].prop_ptr);
memcpy(sym->poly[c][j].x, xctx->sym[i].poly[c][j].x, points * sizeof(double));
memcpy(sym->poly[c][j].y, xctx->sym[i].poly[c][j].y, points * sizeof(double));
memcpy(sym->poly[c][j].selected_point, xctx->sym[i].poly[c][j].selected_point,
@ -415,9 +415,9 @@ void mem_push_undo(void)
sym->text[j].prop_ptr = NULL;
sym->text[j].txt_ptr = NULL;
sym->text[j].font = NULL;
my_strdup(_ALLOC_ID_, &sym->text[j].prop_ptr, xctx->sym[i].text[j].prop_ptr);
my_strdup(_ALLOC_ID_, &sym->text[j].txt_ptr, xctx->sym[i].text[j].txt_ptr);
my_strdup(_ALLOC_ID_, &sym->text[j].font, xctx->sym[i].text[j].font);
my_strdup(554, &sym->text[j].prop_ptr, xctx->sym[i].text[j].prop_ptr);
my_strdup(555, &sym->text[j].txt_ptr, xctx->sym[i].text[j].txt_ptr);
my_strdup(556, &sym->text[j].font, xctx->sym[i].text[j].font);
}
}
@ -427,9 +427,9 @@ void mem_push_undo(void)
xctx->uslot[slot].tptr[i].prop_ptr = NULL;
xctx->uslot[slot].tptr[i].txt_ptr = NULL;
xctx->uslot[slot].tptr[i].font = NULL;
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].prop_ptr, xctx->text[i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].txt_ptr, xctx->text[i].txt_ptr);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].font, xctx->text[i].font);
my_strdup(557, &xctx->uslot[slot].tptr[i].prop_ptr, xctx->text[i].prop_ptr);
my_strdup(558, &xctx->uslot[slot].tptr[i].txt_ptr, xctx->text[i].txt_ptr);
my_strdup(559, &xctx->uslot[slot].tptr[i].font, xctx->text[i].font);
}
/* wires */
@ -437,7 +437,7 @@ void mem_push_undo(void)
xctx->uslot[slot].wptr[i] = xctx->wire[i];
xctx->uslot[slot].wptr[i].prop_ptr = NULL;
xctx->uslot[slot].wptr[i].node = NULL;
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].wptr[i].prop_ptr, xctx->wire[i].prop_ptr);
my_strdup(560, &xctx->uslot[slot].wptr[i].prop_ptr, xctx->wire[i].prop_ptr);
}
@ -480,78 +480,78 @@ void mem_pop_undo(int redo, int set_modify_status)
slot = xctx->cur_undo_ptr%MAX_UNDO;
clear_drawing();
unselect_all(1);
my_free(_ALLOC_ID_, &xctx->wire);
my_free(_ALLOC_ID_, &xctx->text);
my_free(_ALLOC_ID_, &xctx->inst);
my_free(561, &xctx->wire);
my_free(562, &xctx->text);
my_free(563, &xctx->inst);
for(i = 0;i<cadlayers;i++) {
my_free(_ALLOC_ID_, &xctx->rect[i]);
my_free(_ALLOC_ID_, &xctx->line[i]);
my_free(_ALLOC_ID_, &xctx->poly[i]);
my_free(_ALLOC_ID_, &xctx->arc[i]);
my_free(564, &xctx->rect[i]);
my_free(565, &xctx->line[i]);
my_free(566, &xctx->poly[i]);
my_free(567, &xctx->arc[i]);
}
remove_symbols();
for(i = 0;i<xctx->maxs;i++) {
my_free(_ALLOC_ID_, &xctx->sym[i].line);
my_free(_ALLOC_ID_, &xctx->sym[i].rect);
my_free(_ALLOC_ID_, &xctx->sym[i].arc);
my_free(_ALLOC_ID_, &xctx->sym[i].poly);
my_free(_ALLOC_ID_, &xctx->sym[i].lines);
my_free(_ALLOC_ID_, &xctx->sym[i].polygons);
my_free(_ALLOC_ID_, &xctx->sym[i].arcs);
my_free(_ALLOC_ID_, &xctx->sym[i].rects);
my_free(568, &xctx->sym[i].line);
my_free(569, &xctx->sym[i].rect);
my_free(570, &xctx->sym[i].arc);
my_free(571, &xctx->sym[i].poly);
my_free(572, &xctx->sym[i].lines);
my_free(573, &xctx->sym[i].polygons);
my_free(574, &xctx->sym[i].arcs);
my_free(575, &xctx->sym[i].rects);
}
my_free(_ALLOC_ID_, &xctx->sym);
my_free(576, &xctx->sym);
my_strdup(_ALLOC_ID_, &xctx->schvhdlprop, xctx->uslot[slot].gptr);
my_strdup(_ALLOC_ID_, &xctx->schverilogprop, xctx->uslot[slot].vptr);
my_strdup(_ALLOC_ID_, &xctx->schprop, xctx->uslot[slot].sptr);
my_strdup(_ALLOC_ID_, &xctx->schsymbolprop, xctx->uslot[slot].kptr);
my_strdup(_ALLOC_ID_, &xctx->schtedaxprop, xctx->uslot[slot].eptr);
my_strdup(577, &xctx->schvhdlprop, xctx->uslot[slot].gptr);
my_strdup(578, &xctx->schverilogprop, xctx->uslot[slot].vptr);
my_strdup(579, &xctx->schprop, xctx->uslot[slot].sptr);
my_strdup(580, &xctx->schsymbolprop, xctx->uslot[slot].kptr);
my_strdup(581, &xctx->schtedaxprop, xctx->uslot[slot].eptr);
for(c = 0;c<cadlayers;c++) {
/* lines */
xctx->maxl[c] = xctx->lines[c] = xctx->uslot[slot].lines[c];
xctx->line[c] = my_calloc(_ALLOC_ID_, xctx->lines[c], sizeof(xLine));
xctx->line[c] = my_calloc(582, xctx->lines[c], sizeof(xLine));
for(i = 0;i<xctx->lines[c];i++) {
xctx->line[c][i] = xctx->uslot[slot].lptr[c][i];
xctx->line[c][i].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, &xctx->line[c][i].prop_ptr, xctx->uslot[slot].lptr[c][i].prop_ptr);
my_strdup(583, &xctx->line[c][i].prop_ptr, xctx->uslot[slot].lptr[c][i].prop_ptr);
}
/* rects */
xctx->maxr[c] = xctx->rects[c] = xctx->uslot[slot].rects[c];
xctx->rect[c] = my_calloc(_ALLOC_ID_, xctx->rects[c], sizeof(xRect));
xctx->rect[c] = my_calloc(584, xctx->rects[c], sizeof(xRect));
for(i = 0;i<xctx->rects[c];i++) {
xctx->rect[c][i] = xctx->uslot[slot].bptr[c][i];
xctx->rect[c][i].prop_ptr = NULL;
xctx->rect[c][i].extraptr = NULL;
my_strdup(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr, xctx->uslot[slot].bptr[c][i].prop_ptr);
my_strdup(585, &xctx->rect[c][i].prop_ptr, xctx->uslot[slot].bptr[c][i].prop_ptr);
}
/* arcs */
xctx->maxa[c] = xctx->arcs[c] = xctx->uslot[slot].arcs[c];
xctx->arc[c] = my_calloc(_ALLOC_ID_, xctx->arcs[c], sizeof(xArc));
xctx->arc[c] = my_calloc(586, xctx->arcs[c], sizeof(xArc));
for(i = 0;i<xctx->arcs[c];i++) {
xctx->arc[c][i] = xctx->uslot[slot].aptr[c][i];
xctx->arc[c][i].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr, xctx->uslot[slot].aptr[c][i].prop_ptr);
my_strdup(587, &xctx->arc[c][i].prop_ptr, xctx->uslot[slot].aptr[c][i].prop_ptr);
}
/* polygons */
xctx->maxp[c] = xctx->polygons[c] = xctx->uslot[slot].polygons[c];
xctx->poly[c] = my_calloc(_ALLOC_ID_, xctx->polygons[c], sizeof(xPoly));
xctx->poly[c] = my_calloc(588, xctx->polygons[c], sizeof(xPoly));
for(i = 0;i<xctx->polygons[c];i++) {
int points = xctx->uslot[slot].pptr[c][i].points;
xctx->poly[c][i] = xctx->uslot[slot].pptr[c][i];
xctx->poly[c][i].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr, xctx->uslot[slot].pptr[c][i].prop_ptr);
xctx->poly[c][i].x = my_malloc(_ALLOC_ID_, points * sizeof(double));
xctx->poly[c][i].y = my_malloc(_ALLOC_ID_, points * sizeof(double));
xctx->poly[c][i].selected_point = my_malloc(_ALLOC_ID_, points * sizeof(unsigned short));
my_strdup(589, &xctx->poly[c][i].prop_ptr, xctx->uslot[slot].pptr[c][i].prop_ptr);
xctx->poly[c][i].x = my_malloc(590, points * sizeof(double));
xctx->poly[c][i].y = my_malloc(591, points * sizeof(double));
xctx->poly[c][i].selected_point = my_malloc(592, points * sizeof(unsigned short));
memcpy(xctx->poly[c][i].x, xctx->uslot[slot].pptr[c][i].x, points * sizeof(double));
memcpy(xctx->poly[c][i].y, xctx->uslot[slot].pptr[c][i].y, points * sizeof(double));
memcpy(xctx->poly[c][i].selected_point, xctx->uslot[slot].pptr[c][i].selected_point,
@ -561,22 +561,22 @@ void mem_pop_undo(int redo, int set_modify_status)
/* instances */
xctx->maxi = xctx->instances = xctx->uslot[slot].instances;
xctx->inst = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(xInstance));
xctx->inst = my_calloc(593, xctx->instances, sizeof(xInstance));
for(i = 0;i<xctx->instances;i++) {
xctx->inst[i] = xctx->uslot[slot].iptr[i];
xctx->inst[i].prop_ptr = NULL;
xctx->inst[i].name = NULL;
xctx->inst[i].instname = NULL;
xctx->inst[i].lab = NULL;
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, xctx->uslot[slot].iptr[i].prop_ptr);
my_strdup2(_ALLOC_ID_, &xctx->inst[i].name, xctx->uslot[slot].iptr[i].name);
my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, xctx->uslot[slot].iptr[i].instname);
my_strdup(_ALLOC_ID_, &xctx->inst[i].lab, xctx->uslot[slot].iptr[i].lab);
my_strdup(594, &xctx->inst[i].prop_ptr, xctx->uslot[slot].iptr[i].prop_ptr);
my_strdup2(595, &xctx->inst[i].name, xctx->uslot[slot].iptr[i].name);
my_strdup2(596, &xctx->inst[i].instname, xctx->uslot[slot].iptr[i].instname);
my_strdup(597, &xctx->inst[i].lab, xctx->uslot[slot].iptr[i].lab);
}
/* symbols */
xctx->maxs = xctx->symbols = xctx->uslot[slot].symbols;
xctx->sym = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(xSymbol));
xctx->sym = my_calloc(598, xctx->symbols, sizeof(xSymbol));
for(i = 0;i<xctx->symbols;i++) {
sym = &xctx->uslot[slot].symptr[i];
@ -585,20 +585,20 @@ void mem_pop_undo(int redo, int set_modify_status)
xctx->sym[i].prop_ptr = NULL;
xctx->sym[i].type = NULL;
xctx->sym[i].templ = NULL;
my_strdup2(_ALLOC_ID_, &xctx->sym[i].name, sym->name);
my_strdup2(_ALLOC_ID_, &xctx->sym[i].type, sym->type);
my_strdup2(_ALLOC_ID_, &xctx->sym[i].templ, sym->templ);
my_strdup2(_ALLOC_ID_, &xctx->sym[i].prop_ptr, sym->prop_ptr);
my_strdup2(599, &xctx->sym[i].name, sym->name);
my_strdup2(600, &xctx->sym[i].type, sym->type);
my_strdup2(601, &xctx->sym[i].templ, sym->templ);
my_strdup2(602, &xctx->sym[i].prop_ptr, sym->prop_ptr);
xctx->sym[i].line = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
xctx->sym[i].poly = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
xctx->sym[i].arc = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
xctx->sym[i].rect = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
xctx->sym[i].lines = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].rects = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].arcs = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].polygons = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].text = my_calloc(_ALLOC_ID_, xctx->sym[i].texts, sizeof(xText));
xctx->sym[i].line = my_calloc(603, cadlayers, sizeof(xLine *));
xctx->sym[i].poly = my_calloc(604, cadlayers, sizeof(xPoly *));
xctx->sym[i].arc = my_calloc(605, cadlayers, sizeof(xArc *));
xctx->sym[i].rect = my_calloc(606, cadlayers, sizeof(xRect *));
xctx->sym[i].lines = my_calloc(607, cadlayers, sizeof(int));
xctx->sym[i].rects = my_calloc(608, cadlayers, sizeof(int));
xctx->sym[i].arcs = my_calloc(609, cadlayers, sizeof(int));
xctx->sym[i].polygons = my_calloc(610, cadlayers, sizeof(int));
xctx->sym[i].text = my_calloc(611, xctx->sym[i].texts, sizeof(xText));
memcpy(xctx->sym[i].lines, sym->lines, sizeof(sym->lines[0]) * cadlayers);
memcpy(xctx->sym[i].rects, sym->rects, sizeof(sym->rects[0]) * cadlayers);
@ -607,41 +607,41 @@ void mem_pop_undo(int redo, int set_modify_status)
for(c = 0;c<cadlayers;c++) {
/* symbol lines */
xctx->sym[i].line[c] = my_calloc(_ALLOC_ID_, sym->lines[c], sizeof(xLine));
xctx->sym[i].line[c] = my_calloc(612, sym->lines[c], sizeof(xLine));
for(j = 0; j < xctx->sym[i].lines[c]; j++) {
xctx->sym[i].line[c][j] = sym->line[c][j];
xctx->sym[i].line[c][j].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, & xctx->sym[i].line[c][j].prop_ptr, sym->line[c][j].prop_ptr);
my_strdup(613, & xctx->sym[i].line[c][j].prop_ptr, sym->line[c][j].prop_ptr);
}
/* symbol rects */
xctx->sym[i].rect[c] = my_calloc(_ALLOC_ID_, sym->rects[c], sizeof(xRect));
xctx->sym[i].rect[c] = my_calloc(614, sym->rects[c], sizeof(xRect));
for(j = 0; j < xctx->sym[i].rects[c]; j++) {
xctx->sym[i].rect[c][j] = sym->rect[c][j];
xctx->sym[i].rect[c][j].prop_ptr = NULL;
xctx->sym[i].rect[c][j].extraptr = NULL;
my_strdup(_ALLOC_ID_, & xctx->sym[i].rect[c][j].prop_ptr, sym->rect[c][j].prop_ptr);
my_strdup(615, & xctx->sym[i].rect[c][j].prop_ptr, sym->rect[c][j].prop_ptr);
}
/* symbol arcs */
xctx->sym[i].arc[c] = my_calloc(_ALLOC_ID_, sym->arcs[c], sizeof(xArc));
xctx->sym[i].arc[c] = my_calloc(616, sym->arcs[c], sizeof(xArc));
for(j = 0; j < xctx->sym[i].arcs[c]; j++) {
xctx->sym[i].arc[c][j] = sym->arc[c][j];
xctx->sym[i].arc[c][j].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, & xctx->sym[i].arc[c][j].prop_ptr, sym->arc[c][j].prop_ptr);
my_strdup(617, & xctx->sym[i].arc[c][j].prop_ptr, sym->arc[c][j].prop_ptr);
}
/* symbol polygons */
xctx->sym[i].poly[c] = my_calloc(_ALLOC_ID_, sym->polygons[c], sizeof(xPoly));
xctx->sym[i].poly[c] = my_calloc(618, sym->polygons[c], sizeof(xPoly));
for(j = 0; j < xctx->sym[i].polygons[c]; j++) {
int points = sym->poly[c][j].points;
xctx->sym[i].poly[c][j] = sym->poly[c][j];
xctx->sym[i].poly[c][j].prop_ptr = NULL;
xctx->sym[i].poly[c][j].x = my_malloc(_ALLOC_ID_, points * sizeof(double));
xctx->sym[i].poly[c][j].y = my_malloc(_ALLOC_ID_, points * sizeof(double));
xctx->sym[i].poly[c][j].selected_point = my_malloc(_ALLOC_ID_, points * sizeof(unsigned short));
xctx->sym[i].poly[c][j].x = my_malloc(619, points * sizeof(double));
xctx->sym[i].poly[c][j].y = my_malloc(620, points * sizeof(double));
xctx->sym[i].poly[c][j].selected_point = my_malloc(621, points * sizeof(unsigned short));
memcpy(xctx->sym[i].poly[c][j].x, sym->poly[c][j].x, points * sizeof(double));
memcpy(xctx->sym[i].poly[c][j].y, sym->poly[c][j].y, points * sizeof(double));
memcpy(xctx->sym[i].poly[c][j].selected_point, sym->poly[c][j].selected_point,
points * sizeof(unsigned short));
my_strdup(_ALLOC_ID_, & xctx->sym[i].poly[c][j].prop_ptr, sym->poly[c][j].prop_ptr);
my_strdup(622, & xctx->sym[i].poly[c][j].prop_ptr, sym->poly[c][j].prop_ptr);
}
}
/* symbol texts */
@ -650,33 +650,33 @@ void mem_pop_undo(int redo, int set_modify_status)
xctx->sym[i].text[j].prop_ptr = NULL;
xctx->sym[i].text[j].txt_ptr = NULL;
xctx->sym[i].text[j].font = NULL;
my_strdup(_ALLOC_ID_, &xctx->sym[i].text[j].prop_ptr, sym->text[j].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->sym[i].text[j].txt_ptr, sym->text[j].txt_ptr);
my_strdup(_ALLOC_ID_, &xctx->sym[i].text[j].font, sym->text[j].font);
my_strdup(623, &xctx->sym[i].text[j].prop_ptr, sym->text[j].prop_ptr);
my_strdup(624, &xctx->sym[i].text[j].txt_ptr, sym->text[j].txt_ptr);
my_strdup(625, &xctx->sym[i].text[j].font, sym->text[j].font);
}
}
/* texts */
xctx->maxt = xctx->texts = xctx->uslot[slot].texts;
xctx->text = my_calloc(_ALLOC_ID_, xctx->texts, sizeof(xText));
xctx->text = my_calloc(626, xctx->texts, sizeof(xText));
for(i = 0;i<xctx->texts;i++) {
xctx->text[i] = xctx->uslot[slot].tptr[i];
xctx->text[i].txt_ptr = NULL;
xctx->text[i].font = NULL;
xctx->text[i].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, &xctx->text[i].prop_ptr, xctx->uslot[slot].tptr[i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->text[i].txt_ptr, xctx->uslot[slot].tptr[i].txt_ptr);
my_strdup(_ALLOC_ID_, &xctx->text[i].font, xctx->uslot[slot].tptr[i].font);
my_strdup(627, &xctx->text[i].prop_ptr, xctx->uslot[slot].tptr[i].prop_ptr);
my_strdup(628, &xctx->text[i].txt_ptr, xctx->uslot[slot].tptr[i].txt_ptr);
my_strdup(629, &xctx->text[i].font, xctx->uslot[slot].tptr[i].font);
}
/* wires */
xctx->maxw = xctx->wires = xctx->uslot[slot].wires;
xctx->wire = my_calloc(_ALLOC_ID_, xctx->wires, sizeof(xWire));
xctx->wire = my_calloc(630, xctx->wires, sizeof(xWire));
for(i = 0;i<xctx->wires;i++) {
xctx->wire[i] = xctx->uslot[slot].wptr[i];
xctx->wire[i].prop_ptr = NULL;
xctx->wire[i].node = NULL;
my_strdup(_ALLOC_ID_, &xctx->wire[i].prop_ptr, xctx->uslot[slot].wptr[i].prop_ptr);
my_strdup(631, &xctx->wire[i].prop_ptr, xctx->uslot[slot].wptr[i].prop_ptr);
}
/* unnecessary since in_memory_undo saves all symbols */
/* link_symbols_to_instances(-1); */

View File

@ -71,7 +71,7 @@ static void child_handler(int signum)
int main(int argc, char **argv)
{
int i;
my_strdup(_ALLOC_ID_, &xschem_executable, argv[0]);
my_strdup(632, &xschem_executable, argv[0]);
signal(SIGINT, sig_handler);
signal(SIGSEGV, sig_handler);
signal(SIGILL, sig_handler);
@ -94,10 +94,10 @@ int main(int argc, char **argv)
cli_opt_argc = argc;
cli_opt_argv = my_malloc(_ALLOC_ID_, cli_opt_argc * sizeof(char *));
cli_opt_argv = my_malloc(633, cli_opt_argc * sizeof(char *));
for(i = 0; i < cli_opt_argc; i++) {
cli_opt_argv[i] = NULL;
my_strdup(_ALLOC_ID_, &cli_opt_argv[i], argv[i]);
my_strdup(634, &cli_opt_argv[i], argv[i]);
}

View File

@ -104,8 +104,8 @@ void check_collapsing_objects()
{
if(xctx->wire[i].x1==xctx->wire[i].x2 && xctx->wire[i].y1 == xctx->wire[i].y2)
{
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->wire[i].node);
my_free(635, &xctx->wire[i].prop_ptr);
my_free(636, &xctx->wire[i].node);
found=1;
j++;
continue;
@ -125,7 +125,7 @@ void check_collapsing_objects()
{
if(xctx->line[c][i].x1==xctx->line[c][i].x2 && xctx->line[c][i].y1 == xctx->line[c][i].y2)
{
my_free(_ALLOC_ID_, &xctx->line[c][i].prop_ptr);
my_free(637, &xctx->line[c][i].prop_ptr);
found=1;
j++;
continue;
@ -144,7 +144,7 @@ void check_collapsing_objects()
{
if(xctx->rect[c][i].x1==xctx->rect[c][i].x2 || xctx->rect[c][i].y1 == xctx->rect[c][i].y2)
{
my_free(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr);
my_free(638, &xctx->rect[c][i].prop_ptr);
set_rect_extraptr(0, &xctx->rect[c][i]);
found=1;
j++;
@ -296,8 +296,8 @@ void draw_selection(GC g, int interruptable)
break;
case POLYGON:
{
double *x = my_malloc(_ALLOC_ID_, sizeof(double) *xctx->poly[c][n].points);
double *y = my_malloc(_ALLOC_ID_, sizeof(double) *xctx->poly[c][n].points);
double *x = my_malloc(639, sizeof(double) *xctx->poly[c][n].points);
double *y = my_malloc(640, sizeof(double) *xctx->poly[c][n].points);
if(xctx->poly[c][n].sel==SELECTED || xctx->poly[c][n].sel==SELECTED1) {
for(k=0;k<xctx->poly[c][n].points; k++) {
if( xctx->poly[c][n].sel==SELECTED || xctx->poly[c][n].selected_point[k]) {
@ -317,8 +317,8 @@ void draw_selection(GC g, int interruptable)
}
drawtemppolygon(g, NOW, x, y, xctx->poly[c][n].points);
}
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
my_free(641, &x);
my_free(642, &y);
}
break;
@ -497,7 +497,7 @@ void find_inst_to_be_redrawn(int what)
dbg(1,"find_inst_to_be_redrawn(): what=%d\n", what);
if(what & 16) {
my_free(_ALLOC_ID_, &xctx->inst_redraw_table);
my_free(643, &xctx->inst_redraw_table);
xctx->inst_redraw_table_size = 0;
if((s_pnetname || xctx->hilight_nets)) int_hash_free(&xctx->node_redraw_table);
return;
@ -530,7 +530,7 @@ void find_inst_to_be_redrawn(int what)
} /* if(!(what & 8)) */
if(!xctx->inst_redraw_table || xctx->instances > xctx->inst_redraw_table_size) {
my_realloc(_ALLOC_ID_, &xctx->inst_redraw_table, xctx->instances * sizeof(unsigned char));
my_realloc(644, &xctx->inst_redraw_table, xctx->instances * sizeof(unsigned char));
xctx->inst_redraw_table_size = xctx->instances;
}
for(i=0; i < xctx->instances; i++) {
@ -631,11 +631,11 @@ void copy_objects(int what)
xctx->move_rot = xctx->move_flip = 0;
xctx->deltax = xctx->deltay = 0.;
xctx->ui_state&=~STARTCOPY;
my_strdup(_ALLOC_ID_, &str, user_conf_dir);
my_strcat(_ALLOC_ID_, &str, "/.selection.sch");
my_strdup(645, &str, user_conf_dir);
my_strcat(646, &str, "/.selection.sch");
xunlink(str);
update_symbol_bboxes(0, 0);
my_free(_ALLOC_ID_, &str);
my_free(647, &str);
}
if(what & RUBBER) /* draw objects while moving */
{
@ -795,8 +795,8 @@ void copy_objects(int what)
{
xPoly *p = &xctx->poly[c][n];
double bx1 = 0.0, by1 = 0.0, bx2 = 0.0, by2 = 0.0;
double *x = my_malloc(_ALLOC_ID_, sizeof(double) *p->points);
double *y = my_malloc(_ALLOC_ID_, sizeof(double) *p->points);
double *x = my_malloc(648, sizeof(double) *p->points);
double *y = my_malloc(649, sizeof(double) *p->points);
int j;
for(j=0; j<p->points; j++) {
if( p->sel==SELECTED || p->selected_point[j]) {
@ -820,8 +820,8 @@ void copy_objects(int what)
xctx->sel_array[i].n=xctx->polygons[c];
store_poly(-1, x, y, p->points, c, p->sel, p->prop_ptr);
p->sel=0;
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
my_free(650, &x);
my_free(651, &y);
}
break;
case ARC:
@ -893,7 +893,7 @@ void copy_objects(int what)
xctx->text[n].x0, xctx->text[n].y0, xctx->rx1,xctx->ry1);
}
xctx->text[xctx->texts].txt_ptr=NULL;
my_strdup(_ALLOC_ID_, &xctx->text[xctx->texts].txt_ptr,xctx->text[n].txt_ptr);
my_strdup(652, &xctx->text[xctx->texts].txt_ptr,xctx->text[n].txt_ptr);
xctx->text[n].sel=0;
dbg(2, "copy_objects(): current str=%s\n",
xctx->text[xctx->texts].txt_ptr);
@ -905,7 +905,7 @@ void copy_objects(int what)
xctx->text[xctx->texts].sel=SELECTED;
xctx->text[xctx->texts].prop_ptr=NULL;
xctx->text[xctx->texts].font=NULL;
my_strdup(_ALLOC_ID_, &xctx->text[xctx->texts].prop_ptr, xctx->text[n].prop_ptr);
my_strdup(653, &xctx->text[xctx->texts].prop_ptr, xctx->text[n].prop_ptr);
set_text_flags(&xctx->text[xctx->texts]);
xctx->text[xctx->texts].xscale=xctx->text[n].xscale;
xctx->text[xctx->texts].yscale=xctx->text[n].yscale;
@ -961,13 +961,13 @@ void copy_objects(int what)
xctx->inst[xctx->instances].lab=NULL;
xctx->inst[xctx->instances].node=NULL;
xctx->inst[xctx->instances].name=NULL;
my_strdup2(_ALLOC_ID_, &xctx->inst[xctx->instances].name, xctx->inst[n].name);
my_strdup(_ALLOC_ID_, &xctx->inst[xctx->instances].prop_ptr, xctx->inst[n].prop_ptr);
my_strdup2(654, &xctx->inst[xctx->instances].name, xctx->inst[n].name);
my_strdup(655, &xctx->inst[xctx->instances].prop_ptr, xctx->inst[n].prop_ptr);
/*
* my_strdup2(_ALLOC_ID_, &xctx->inst[xctx->instances].instname, get_tok_value(xctx->inst[n].prop_ptr, "name",0));
* my_strdup2(656, &xctx->inst[xctx->instances].instname, get_tok_value(xctx->inst[n].prop_ptr, "name",0));
*/
xctx->inst[xctx->instances].instname = NULL; /* will be set in new_prop_string() */
my_strdup(_ALLOC_ID_, &xctx->inst[xctx->instances].lab, xctx->inst[n].lab);
my_strdup(657, &xctx->inst[xctx->instances].lab, xctx->inst[n].lab);
xctx->inst[n].sel=0;
xctx->inst[xctx->instances].embed = xctx->inst[n].embed;
xctx->inst[xctx->instances].flags = xctx->inst[n].flags;

View File

@ -30,7 +30,7 @@ static void instdelete(int n, int x, int y)
prevptr = &xctx->inst_spatial_table[x][y];
while( (*prevptr)->n != n) prevptr = &(*prevptr)->next;
saveptr = (*prevptr)->next;
my_free(_ALLOC_ID_, prevptr);
my_free(658, prevptr);
*prevptr = saveptr;
}
@ -38,7 +38,7 @@ static void instinsert(int n, int x, int y)
{
Instentry *ptr, *newptr;
ptr=xctx->inst_spatial_table[x][y];
newptr=my_malloc(_ALLOC_ID_, sizeof(Instentry));
newptr=my_malloc(659, sizeof(Instentry));
newptr->next=ptr;
newptr->n=n;
xctx->inst_spatial_table[x][y]=newptr;
@ -50,7 +50,7 @@ static Instentry *delinstentry(Instentry *t)
Instentry *tmp;
while( t ) {
tmp = t->next;
my_free(_ALLOC_ID_, &t);
my_free(660, &t);
t = tmp;
}
return NULL;
@ -132,7 +132,7 @@ static void instpindelete(int n,int pin, int x, int y)
while(ptr) {
if(ptr->n == n && ptr->pin == pin) {
saveptr = ptr->next;
my_free(_ALLOC_ID_, &ptr);
my_free(661, &ptr);
*prevptr = saveptr;
return;
}
@ -147,7 +147,7 @@ static void instpininsert(int n,int pin, double x0, double y0, int x, int y)
Instpinentry *ptr, *newptr;
ptr=xctx->instpin_spatial_table[x][y];
newptr=my_malloc(_ALLOC_ID_, sizeof(Instpinentry));
newptr=my_malloc(662, sizeof(Instpinentry));
newptr->next=ptr;
newptr->n=n;
newptr->x0=x0;
@ -164,7 +164,7 @@ static Instpinentry *delinstpinentry(Instpinentry *t)
while(t) {
tmp = t->next;
my_free(_ALLOC_ID_, &t);
my_free(663, &t);
t = tmp;
}
return NULL;
@ -187,7 +187,7 @@ static void wiredelete(int n, int x, int y)
prevptr = &xctx->wire_spatial_table[x][y];
while( (*prevptr)->n != n) prevptr = &(*prevptr)->next;
saveptr = (*prevptr)->next;
my_free(_ALLOC_ID_, prevptr);
my_free(664, prevptr);
*prevptr = saveptr;
}
@ -196,7 +196,7 @@ static void wireinsert(int n, int x, int y)
Wireentry *ptr, *newptr;
ptr=xctx->wire_spatial_table[x][y];
newptr=my_malloc(_ALLOC_ID_, sizeof(Wireentry));
newptr=my_malloc(665, sizeof(Wireentry));
newptr->next=ptr;
newptr->n=n;
xctx->wire_spatial_table[x][y]=newptr;
@ -209,7 +209,7 @@ static Wireentry *delwireentry(Wireentry *t)
while( t ) {
tmp = t->next;
my_free(_ALLOC_ID_, &t);
my_free(666, &t);
t = tmp;
}
return NULL;
@ -487,18 +487,18 @@ int record_global_node(int what, FILE *fp, char *node)
if(what == 3) return 0; /* node is not a global */
if(max_globals>=size_globals) {
size_globals+=CADCHUNKALLOC;
my_realloc(_ALLOC_ID_, &globals, size_globals*sizeof(char *) );
my_realloc(667, &globals, size_globals*sizeof(char *) );
}
globals[max_globals]=NULL;
my_strdup(_ALLOC_ID_, &globals[max_globals], node);
my_strdup(668, &globals[max_globals], node);
max_globals++;
} else if(what == 0 || what == 2) {
for(i=0;i<max_globals;i++) {
if(what == 0 && xctx->netlist_type == CAD_SPICE_NETLIST) fprintf(fp, ".GLOBAL %s\n", globals[i]);
if(what == 0 && xctx->netlist_type == CAD_TEDAX_NETLIST) fprintf(fp, "__GLOBAL__ %s\n", globals[i]);
my_free(_ALLOC_ID_, &globals[i]);
my_free(669, &globals[i]);
}
my_free(_ALLOC_ID_, &globals);
my_free(670, &globals);
size_globals=max_globals=0;
}
return 0;
@ -535,7 +535,7 @@ int get_unnamed_node(int what, int mult,int node)
dbg(2, "get_unnamed_node(): what=%d mult=%d node=%d\n", what, mult, node);
if(what==0) { /* initialize unnamed node data structures */
xctx->new_node=0;
my_free(_ALLOC_ID_, &xctx->node_mult);
my_free(671, &xctx->node_mult);
xctx->node_mult_size=0;
return 0;
}
@ -549,7 +549,7 @@ int get_unnamed_node(int what, int mult,int node)
if(xctx->new_node >= xctx->node_mult_size) { /* enlarge array and zero it */
int oldsize = xctx->node_mult_size;
xctx->node_mult_size = xctx->new_node + CADCHUNKALLOC;
my_realloc(_ALLOC_ID_, &xctx->node_mult, sizeof(xctx->node_mult[0]) * xctx->node_mult_size );
my_realloc(672, &xctx->node_mult, sizeof(xctx->node_mult[0]) * xctx->node_mult_size );
memset(xctx->node_mult + oldsize, 0, (xctx->node_mult_size - oldsize) * sizeof(xctx->node_mult[0]));
}
xctx->node_mult[xctx->new_node]=mult;
@ -585,7 +585,7 @@ static void name_generics()
dbg(2, "prepare_netlist_structs(): naming generics from attached labels\n");
if(for_netlist) for (i=0;i<instances;i++) { /* ... assign node fields on all (non label) instances */
if(inst[i].ptr<0) continue;
my_strdup(_ALLOC_ID_, &type,(inst[i].ptr+ xctx->sym)->type);
my_strdup(673, &type,(inst[i].ptr+ xctx->sym)->type);
if(type && !IS_LABEL_OR_PIN(type) ) {
if((generic_rects = (inst[i].ptr+ xctx->sym)->rects[GENERICLAYER]) > 0) {
rects = (inst[i].ptr+ xctx->sym)->rects[PINLAYER];
@ -609,12 +609,12 @@ static void name_generics()
if((inst[n].ptr+ xctx->sym)->type && inst[n].node[p] != NULL &&
!strcmp((inst[n].ptr+ xctx->sym)->type, "label")) {
dbg(2, "prepare_netlist_structs(): naming generic %s\n", inst[n].node[p]);
my_strdup(_ALLOC_ID_, &inst[i].node[j], get_tok_value(inst[n].prop_ptr,"value",0) );
my_strdup(674, &inst[i].node[j], get_tok_value(inst[n].prop_ptr,"value",0) );
if(!for_netlist) {
my_strdup(_ALLOC_ID_, &sig_type,"");
my_strdup(675, &sig_type,"");
bus_node_hash_lookup(inst[n].node[p],"", XINSERT, 1, sig_type,"", "","");
} else {
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(
my_strdup(676, &sig_type,get_tok_value(
(inst[i].ptr+ xctx->sym)->rect[GENERICLAYER][j-rects].prop_ptr, "sig_type",0));
/* insert generic label in hash table as a port so it will not */
/* be declared as a signal in the vhdl netlist. this is a workaround */
@ -630,7 +630,7 @@ static void name_generics()
} /* end if( rects=...>0) */
} /* end if(type not a label nor pin)... */
} /* end for(i...) */
if(type) my_free(_ALLOC_ID_, &type);
if(type) my_free(677, &type);
}
static void signal_short( const char *tag, const char *n1, const char *n2)
@ -659,7 +659,7 @@ static void set_inst_node(int i, int j, const char *node)
dbg(1, "set_inst_node(): inst %s pin %d <-- %s\n", inst[i].instname, j, node);
expandlabel(inst[i].instname, &inst_mult);
my_strdup(_ALLOC_ID_, &inst[i].node[j], node);
my_strdup(678, &inst[i].node[j], node);
if(!for_netlist) {
bus_node_hash_lookup(inst[i].node[j],"", XINSERT, 0,"","","","");
} else {
@ -741,8 +741,8 @@ static void wirecheck(int k) /* recursive routine */
touch(wire[n].x1, wire[n].y1, wire[n].x2, wire[n].y2, wire[k].x2, wire[k].y2);
if( touches ) {
if(!wire[n].node) {
my_strdup(_ALLOC_ID_, &wire[n].node, wire[k].node);
my_strdup(_ALLOC_ID_, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node));
my_strdup(679, &wire[n].node, wire[k].node);
my_strdup(680, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node));
name_attached_inst_to_net(n, tmpi, tmpj);
wirecheck(n); /* recursive check */
} else {
@ -762,8 +762,8 @@ static void name_attached_nets(double x0, double y0, int sqx, int sqy, const cha
int n = wptr->n;
if(touch(wire[n].x1, wire[n].y1, wire[n].x2, wire[n].y2, x0,y0)) {
if(!wire[n].node) {
my_strdup(_ALLOC_ID_, &wire[n].node, node);
my_strdup(_ALLOC_ID_, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node));
my_strdup(681, &wire[n].node, node);
my_strdup(682, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node));
wirecheck(n);
} else {
if(for_netlist>0) signal_short("Net", wire[n].node, node);
@ -812,8 +812,8 @@ static int find_pass_through_symbols(int what, int ninst)
int *symtable = NULL;
if(what == 0 ) { /* initialize */
pt_symbol = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(int));
symtable = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(int));
pt_symbol = my_calloc(683, xctx->symbols, sizeof(int));
symtable = my_calloc(684, xctx->symbols, sizeof(int));
for(i = 0; i < instances; i++) {
k = inst[i].ptr;
if( k < 0 || symtable[k] ) continue;
@ -829,13 +829,13 @@ static int find_pass_through_symbols(int what, int ninst)
int_hash_free(&table);
if(pt_symbol[k]) dbg(1, "duplicated pins: %s\n", xctx->sym[i].name);
}
my_free(_ALLOC_ID_, &symtable);
my_free(685, &symtable);
} else if(what ==1) { /* query */
k = inst[ninst].ptr;
if(k >=0 && pt_symbol[k]) return 1;
return 0;
} else if(what ==2) { /* cleanup */
my_free(_ALLOC_ID_, &pt_symbol);
my_free(686, &pt_symbol);
}
return -1;
}
@ -855,7 +855,7 @@ static void instcheck(int n, int p)
int k = inst[n].ptr;
int rects = xctx->sym[k].rects[PINLAYER];
char *pin_name = NULL;
my_strdup(_ALLOC_ID_, &pin_name, get_tok_value(xctx->sym[k].rect[PINLAYER][p].prop_ptr, "name", 0));
my_strdup(687, &pin_name, get_tok_value(xctx->sym[k].rect[PINLAYER][p].prop_ptr, "name", 0));
if(p >= rects) return;
for(j = 0; j < rects; j++) {
const char *other_pin;
@ -875,7 +875,7 @@ static void instcheck(int n, int p)
}
}
}
my_free(_ALLOC_ID_, &pin_name);
my_free(688, &pin_name);
}
}
@ -911,7 +911,7 @@ static void name_nodes_of_pins_labels_and_propagate()
/* name ipin opin label node fields from prop_ptr attributes */
if(inst[i].ptr<0) continue;
my_strdup(_ALLOC_ID_, &type,(inst[i].ptr+ xctx->sym)->type);
my_strdup(689, &type,(inst[i].ptr+ xctx->sym)->type);
if(print_erc && (!inst[i].instname || !inst[i].instname[0]) &&
!get_tok_value((inst[i].ptr+ xctx->sym)->templ, "name", 0)[0]
) {
@ -950,28 +950,28 @@ static void name_nodes_of_pins_labels_and_propagate()
strcmp(get_tok_value(inst[i].prop_ptr,"tedax_ignore",0),"true")==0 ) continue;
}
port=0;
my_strdup2(_ALLOC_ID_, &dir, "");
my_strdup2(690, &dir, "");
if(strcmp(type,"label")) { /* instance is a port (not a label) */
port=1;
/* 20071204 only define a dir property if instance is not a label */
if(for_netlist)
my_strdup2(_ALLOC_ID_, &dir, get_tok_value( (inst[i].ptr+ xctx->sym)->rect[PINLAYER][0].prop_ptr, "dir",0));
my_strdup2(691, &dir, get_tok_value( (inst[i].ptr+ xctx->sym)->rect[PINLAYER][0].prop_ptr, "dir",0));
}
else {
/* handle global nodes (global=1 set as symbol property) 28032003 */
my_strdup(_ALLOC_ID_, &global_node,get_tok_value((inst[i].ptr+ xctx->sym)->prop_ptr,"global",0));
my_strdup(692, &global_node,get_tok_value((inst[i].ptr+ xctx->sym)->prop_ptr,"global",0));
/*20071204 if instance is a label dont define a dir property for more precise erc checking */
}
/* obtain ipin/opin/label signal type (default: std_logic) */
if(for_netlist) {
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(inst[i].prop_ptr,"sig_type",0));
my_strdup(_ALLOC_ID_, &verilog_type,get_tok_value(inst[i].prop_ptr,"verilog_type",0));
my_strdup(_ALLOC_ID_, &value,get_tok_value(inst[i].prop_ptr,"value",0));
my_strdup(_ALLOC_ID_, &class,get_tok_value(inst[i].prop_ptr,"class",0));
my_strdup(693, &sig_type,get_tok_value(inst[i].prop_ptr,"sig_type",0));
my_strdup(694, &verilog_type,get_tok_value(inst[i].prop_ptr,"verilog_type",0));
my_strdup(695, &value,get_tok_value(inst[i].prop_ptr,"value",0));
my_strdup(696, &class,get_tok_value(inst[i].prop_ptr,"class",0));
}
my_strdup(_ALLOC_ID_, &inst[i].node[0], inst[i].lab);
my_strdup(697, &inst[i].node[0], inst[i].lab);
if(!(inst[i].node[0])) {
my_strdup(_ALLOC_ID_, &inst[i].node[0], get_tok_value((inst[i].ptr+ xctx->sym)->templ, "lab",0));
my_strdup(698, &inst[i].node[0], get_tok_value((inst[i].ptr+ xctx->sym)->templ, "lab",0));
dbg(1, "prepare_netlist_structs(): no lab attr on instance, pick from symbol: %s\n", inst[i].node[0]);
}
/* handle global nodes (global=1 set as symbol property) 28032003 */
@ -992,14 +992,14 @@ static void name_nodes_of_pins_labels_and_propagate()
name_attached_inst(i, x0, y0, sqx, sqy, inst[i].node[0]);
} /* if(type && ... */
} /* for(i=0;i<instances... */
my_free(_ALLOC_ID_, &dir);
my_free(_ALLOC_ID_, &type);
my_free(_ALLOC_ID_, &global_node);
my_free(699, &dir);
my_free(700, &type);
my_free(701, &global_node);
if(for_netlist) {
my_free(_ALLOC_ID_, &sig_type);
my_free(_ALLOC_ID_, &verilog_type);
my_free(_ALLOC_ID_, &value);
my_free(_ALLOC_ID_, &class);
my_free(702, &sig_type);
my_free(703, &verilog_type);
my_free(704, &value);
my_free(705, &class);
}
}
@ -1007,8 +1007,8 @@ static void set_unnamed_net(int i)
{
char tmp_str[30];
my_snprintf(tmp_str, S(tmp_str), "#net%d", get_unnamed_node(1,0,0));
my_strdup(_ALLOC_ID_, &xctx->wire[i].node, tmp_str);
my_strdup(_ALLOC_ID_, &xctx->wire[i].prop_ptr, subst_token(xctx->wire[i].prop_ptr, "lab", tmp_str));
my_strdup(706, &xctx->wire[i].node, tmp_str);
my_strdup(707, &xctx->wire[i].prop_ptr, subst_token(xctx->wire[i].prop_ptr, "lab", tmp_str));
/* insert unnamed wire name in hash table */
bus_node_hash_lookup(tmp_str, "", XINSERT, 0,"","","","");
wirecheck(i);
@ -1081,7 +1081,7 @@ static void reset_node_data_and_rehash()
(inst[i].ptr+ xctx->sym)->rects[GENERICLAYER];
if(rects > 0)
{
inst[i].node = my_malloc(_ALLOC_ID_, sizeof(char *) * rects);
inst[i].node = my_malloc(708, sizeof(char *) * rects);
for (j=0;j<rects;j++)
{
inst[i].node[j]=NULL;
@ -1135,8 +1135,8 @@ void delete_inst_node(int i)
if( rects > 0 )
{
for(j=0;j< rects ;j++)
my_free(_ALLOC_ID_, &xctx->inst[i].node[j]);
my_free(_ALLOC_ID_, &xctx->inst[i].node );
my_free(709, &xctx->inst[i].node[j]);
my_free(710, &xctx->inst[i].node );
}
}
@ -1151,7 +1151,7 @@ void delete_netlist_structs(void)
}
for(i=0;i<xctx->wires;i++)
{
my_free(_ALLOC_ID_, &xctx->wire[i].node);
my_free(711, &xctx->wire[i].node);
}
/* erase inst and wire topological hash tables */
del_inst_pin_table();
@ -1318,21 +1318,21 @@ int sym_vs_sch_pins()
}
load_ascii_string(&tmp,fd);
symbol = match_symbol(name);
my_strdup(_ALLOC_ID_, &type, xctx->sym[symbol].type);
my_strdup(712, &type, xctx->sym[symbol].type);
if(type && IS_PIN(type)) {
my_strdup(_ALLOC_ID_, &lab, expandlabel(get_tok_value(tmp, "lab", 0), &mult));
my_strdup(713, &lab, expandlabel(get_tok_value(tmp, "lab", 0), &mult));
if(pin_cnt >= lab_array_size) {
lab_array_size += CADCHUNKALLOC;
my_realloc(_ALLOC_ID_, &lab_array, lab_array_size * sizeof(char *));
my_realloc(714, &lab_array, lab_array_size * sizeof(char *));
}
lab_array[pin_cnt] = NULL;
my_strdup(_ALLOC_ID_, &(lab_array[pin_cnt]), lab);
my_strdup(715, &(lab_array[pin_cnt]), lab);
pin_cnt++;
pin_match = 0;
for(j=0; j < rects; j++) {
my_strdup(_ALLOC_ID_, &pin_name,
my_strdup(716, &pin_name,
expandlabel(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "name", 0), &mult));
my_strdup(_ALLOC_ID_, &pin_dir, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "dir", 0));
my_strdup(717, &pin_dir, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "dir", 0));
if( pin_name && !strcmp(pin_name, lab)) {
if(!(
( !strcmp(type, "ipin") && !strcmp(pin_dir, "in") ) ||
@ -1406,7 +1406,7 @@ int sym_vs_sch_pins()
}
}
for(j=0; j < rects; j++) {
my_strdup(_ALLOC_ID_, &pin_name,
my_strdup(718, &pin_name,
expandlabel(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "name", 0), &mult));
pin_match = 0;
for(k=0; k<pin_cnt; k++) {
@ -1433,18 +1433,18 @@ int sym_vs_sch_pins()
}
if(lab_array_size) {
for(k=0;k<pin_cnt;k++) {
my_free(_ALLOC_ID_, &(lab_array[k]));
my_free(719, &(lab_array[k]));
}
my_free(_ALLOC_ID_, &lab_array);
my_free(720, &lab_array);
lab_array_size = 0;
pin_cnt=0;
}
} /* if( ... "subcircuit"... ) */
my_free(_ALLOC_ID_, &type);
my_free(_ALLOC_ID_, &tmp);
my_free(_ALLOC_ID_, &lab);
my_free(_ALLOC_ID_, &pin_name);
my_free(_ALLOC_ID_, &pin_dir);
my_free(721, &type);
my_free(722, &tmp);
my_free(723, &lab);
my_free(724, &pin_name);
my_free(725, &pin_dir);
} /* for(i=0;i<n_syms;i++) */
while(xctx->symbols > n_syms) remove_symbol(xctx->symbols - 1);

View File

@ -59,16 +59,16 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
if( what==XINSERT ) /* insert data */
{
s=sizeof( Node_hashentry );
entry=(Node_hashentry *)my_malloc(_ALLOC_ID_, s);
entry=(Node_hashentry *)my_malloc(726, s);
entry->next = NULL;
entry->token = entry->sig_type = entry->verilog_type =
entry->value = entry->class = entry->orig_tok = NULL;
my_strdup(_ALLOC_ID_, &(entry->token),token);
if(sig_type &&sig_type[0]) my_strdup(_ALLOC_ID_, &(entry->sig_type), sig_type);
if(verilog_type &&verilog_type[0]) my_strdup(_ALLOC_ID_, &(entry->verilog_type), verilog_type);
if(class && class[0]) my_strdup(_ALLOC_ID_, &(entry->class), class);
if(orig_tok && orig_tok[0]) my_strdup(_ALLOC_ID_, &(entry->orig_tok), orig_tok);
if(value && value[0]) my_strdup(_ALLOC_ID_, &(entry->value), value);
my_strdup(727, &(entry->token),token);
if(sig_type &&sig_type[0]) my_strdup(728, &(entry->sig_type), sig_type);
if(verilog_type &&verilog_type[0]) my_strdup(729, &(entry->verilog_type), verilog_type);
if(class && class[0]) my_strdup(730, &(entry->class), class);
if(orig_tok && orig_tok[0]) my_strdup(731, &(entry->orig_tok), orig_tok);
if(value && value[0]) my_strdup(732, &(entry->value), value);
entry->d.port=d.port;
entry->d.in=d.in;
entry->d.out=d.out;
@ -87,13 +87,13 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
if(what==XDELETE) /* remove token from the hash table ... */
{
saveptr=entry->next;
my_free(_ALLOC_ID_, &entry->token);
my_free(_ALLOC_ID_, &entry->verilog_type);
my_free(_ALLOC_ID_, &entry->sig_type);
my_free(_ALLOC_ID_, &entry->class);
my_free(_ALLOC_ID_, &entry->orig_tok);
my_free(_ALLOC_ID_, &entry->value);
my_free(_ALLOC_ID_, &entry);
my_free(733, &entry->token);
my_free(734, &entry->verilog_type);
my_free(735, &entry->sig_type);
my_free(736, &entry->class);
my_free(737, &entry->orig_tok);
my_free(738, &entry->value);
my_free(739, &entry);
*preventry=saveptr;
return NULL;
}
@ -104,11 +104,11 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
entry->d.out+=d.out;
entry->d.inout+=d.inout;
if(sig_type && sig_type[0] !='\0')
my_strdup(_ALLOC_ID_, &(entry->sig_type), sig_type);
my_strdup(740, &(entry->sig_type), sig_type);
if(verilog_type && verilog_type[0] !='\0')
my_strdup(_ALLOC_ID_, &(entry->verilog_type), verilog_type);
my_strdup(741, &(entry->verilog_type), verilog_type);
if(value && value[0] !='\0')
my_strdup(_ALLOC_ID_, &(entry->value), value);
my_strdup(742, &(entry->value), value);
dbg(3, "node_hash_lookup(): hashing %s : value=%s\n\n",
entry->token, entry->value? entry->value:"NULL");
return entry;
@ -132,12 +132,12 @@ Node_hashentry *bus_node_hash_lookup(const char *token, const char *dir, int wha
if(token==NULL || token[0] == 0) return NULL;
if( token[0] == '#')
{
my_strdup(_ALLOC_ID_, &string, token);
my_strdup(743, &string, token);
}
else
{
dbg(3, "bus_node_hash_lookup(): expanding node: %s\n", token);
my_strdup(_ALLOC_ID_, &string, expandlabel(token,&mult));
my_strdup(744, &string, expandlabel(token,&mult));
dbg(3, "bus_node_hash_lookup(): done expanding node: %s\n", token);
}
if(string==NULL) return NULL;
@ -159,7 +159,7 @@ Node_hashentry *bus_node_hash_lookup(const char *token, const char *dir, int wha
string_ptr++;
}
/* if something found return first pointer */
my_free(_ALLOC_ID_, &string);
my_free(745, &string);
return ptr2;
}
@ -169,13 +169,13 @@ static void node_hash_free_entry(Node_hashentry *entry)
while(entry) {
tmp = entry->next;
my_free(_ALLOC_ID_, &entry->token);
my_free(_ALLOC_ID_, &entry->verilog_type);
my_free(_ALLOC_ID_, &entry->sig_type);
my_free(_ALLOC_ID_, &entry->class);
my_free(_ALLOC_ID_, &entry->orig_tok);
my_free(_ALLOC_ID_, &entry->value);
my_free(_ALLOC_ID_, &entry);
my_free(746, &entry->token);
my_free(747, &entry->verilog_type);
my_free(748, &entry->sig_type);
my_free(749, &entry->class);
my_free(750, &entry->orig_tok);
my_free(751, &entry->value);
my_free(752, &entry);
entry = tmp;
}
}
@ -278,9 +278,9 @@ void print_vhdl_signals(FILE *fd)
dbg(2, "print_vhdl_signals(): node: %s mult: %d value=%s \n\n",
ptr->token,mult, ptr->value?ptr->value:"NULL");
if( ptr->class && ptr->class[0] )
my_strdup(_ALLOC_ID_, &class, ptr->class);
my_strdup(753, &class, ptr->class);
else
my_strdup(_ALLOC_ID_, &class, "signal");
my_strdup(754, &class, "signal");
if(mult>1) {
for(j=mult-1;j>=0;j--) {
fprintf(fd, "%s %s[%d] : ", class, ptr->token[0]=='#' ? ptr->token+1 : ptr->token,j);
@ -310,7 +310,7 @@ void print_vhdl_signals(FILE *fd)
}
}
if(found) fprintf(fd, "\n" );
my_free(_ALLOC_ID_, &class);
my_free(755, &class);
}

View File

@ -71,11 +71,11 @@ static void check_opt(char *opt, char *optval, int type)
} else if( (type == LONG && !strcmp("preinit", opt)) ) {
dbg(1, "process_options(): passing tcl command to interpreter: %s\n", optval);
if(optval) my_strdup(_ALLOC_ID_, &cli_opt_preinit_command, optval);
if(optval) my_strdup(756, &cli_opt_preinit_command, optval);
} else if( (type == LONG && !strcmp("tcl", opt)) ) {
dbg(1, "process_options(): passing tcl command to interpreter: %s\n", optval);
if(optval) my_strdup(_ALLOC_ID_, &cli_opt_tcl_command, optval);
if(optval) my_strdup(757, &cli_opt_tcl_command, optval);
} else if( (type == LONG && !strcmp("script", opt)) ) {
dbg(1, "process_options(): passing tcl script file to interpreter: %s\n", optval);
@ -83,7 +83,7 @@ static void check_opt(char *opt, char *optval, int type)
} else if( (type == LONG && !strcmp("command", opt)) ) {
dbg(1, "process_options(): passing tcl command to interpreter: %s\n", optval);
if(optval) my_strdup(_ALLOC_ID_, &cli_opt_tcl_post_command, optval);
if(optval) my_strdup(758, &cli_opt_tcl_post_command, optval);
} else if( (type == LONG && !strcmp("diff", opt)) ) {
dbg(1, "process_options(): diff with: %s\n", optval);

View File

@ -66,7 +66,7 @@ extern int yylex();
void clear_expandlabel_data(void)
{
my_free(_ALLOC_ID_, &dest_string.str);
my_free(759, &dest_string.str);
}
static void str_char_replace(char s[], char chr, char repl_chr)
@ -95,7 +95,7 @@ void parse(const char *s)
const char *expandlabel(const char *s, int *m)
{
YY_BUFFER_STATE buf;
my_free(_ALLOC_ID_, &dest_string.str); /* 30102004 delete 'memory' of previous execution */
my_free(760, &dest_string.str); /* 30102004 delete 'memory' of previous execution */
if(dbg_var >= 3) fprintf(errfp, "expandlabel(): entering\n");
buf=yy_scan_string(s);
@ -106,13 +106,13 @@ const char *expandlabel(const char *s, int *m)
size_t l;
yyparse_error = -1;
l = strlen(s)+400;
cmd = my_malloc(_ALLOC_ID_, l);
cmd = my_malloc(761, l);
fprintf(errfp, "syntax error in %s\n", s);
my_snprintf(cmd, l,
"tk_messageBox -icon error -type ok -parent [xschem get topwindow] "
"-message {Syntax error in identifier expansion: %s\nschematic:\n%s}", s, xctx->sch[xctx->currsch]);
if(has_x) tcleval(cmd);
my_free(_ALLOC_ID_, &cmd);
my_free(762, &cmd);
}
if(dbg_var >= 3)
@ -209,14 +209,14 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
/* recognize AA[aa:bb:33] or AA[33:cc:dd] or AA[aa..bb..11] .... */
({IDX_ID}{DDOT}{IDX_ID_N}{DDOT}{IDX_ID_N})|({IDX_ID_N}{DDOT}{IDX_ID}{DDOT}{IDX_ID_N})|({IDX_ID_N}{DDOT}{IDX_ID_N}{DDOT}{IDX_ID}) {
yylval.ptr.str=NULL;
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext);
my_strdup(763, &yylval.ptr.str, yytext);
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME3: |%s|\n", yytext);
return B_NAME;
}
({IDX_ID}{CLN}{IDX_ID_N}{CLN}{IDX_ID_N})|({IDX_ID_N}{CLN}{IDX_ID}{CLN}{IDX_ID_N})|({IDX_ID_N}{CLN}{IDX_ID_N}{CLN}{IDX_ID}) {
yylval.ptr.str=NULL;
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext);
my_strdup(764, &yylval.ptr.str, yytext);
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME2: |%s|\n", yytext);
return B_NAME;
}
@ -224,7 +224,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
/* recognize AA[width-1:0], AA[0:width-1], AA[width-1..4], AA[3..width+3], AA[aa:bb] AA[aa..bb] */
({IDX_ID}{CLN}{IDX_ID_N})|({IDX_ID_N}{CLN}{IDX_ID})|({IDX_ID}{DDOT}{IDX_ID_N})|({IDX_ID_N}{DDOT}{IDX_ID}) {
yylval.ptr.str=NULL;
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext);
my_strdup(765, &yylval.ptr.str, yytext);
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME1: |%s|\n", yytext);
return B_NAME;
}
@ -234,7 +234,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
^\*.* {
yylval.ptr.str=NULL; /*19102004 */
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_LINE: |%s|\n",yytext);
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
my_strdup(766, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
BEGIN(INITIAL);
return B_LINE;
}
@ -248,7 +248,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
/* a number: if not a multiplier nor a node index return as a node name */
{INT} {
yylval.ptr.str=NULL;
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext);
my_strdup(767, &yylval.ptr.str, yytext);
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME4: |%s|\n", yytext);
BEGIN(INITIAL);
return B_NAME;
@ -267,7 +267,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z
/* recognize the most esotheric identifiers */
{ID_NUM}|{ID_EXT_PARENTHESIS} {
yylval.ptr.str=NULL;/*19102004 */
my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
my_strdup(768, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
if(dbg_var >= 3) fprintf(errfp, "yylex(): B_NAME0: |%s|\n", yytext);
BEGIN(INITIAL);
return B_NAME;

View File

@ -64,7 +64,7 @@ static void merge_wire(FILE *fd)
}
load_ascii_string( &ptr, fd);
storeobject(-1, x1,y1,x2,y2,WIRE,0,SELECTED,ptr);
my_free(_ALLOC_ID_, &ptr);
my_free(769, &ptr);
select_wire(i, SELECTED, 1);
}
@ -177,17 +177,17 @@ static void merge_polygon(FILE *fd)
ptr[i].y=NULL;
ptr[i].selected_point=NULL;
ptr[i].prop_ptr=NULL;
ptr[i].x = my_calloc(_ALLOC_ID_, points, sizeof(double));
ptr[i].y = my_calloc(_ALLOC_ID_, points, sizeof(double));
ptr[i].selected_point= my_calloc(_ALLOC_ID_, points, sizeof(unsigned short));
ptr[i].x = my_calloc(770, points, sizeof(double));
ptr[i].y = my_calloc(771, points, sizeof(double));
ptr[i].selected_point= my_calloc(772, points, sizeof(unsigned short));
ptr[i].points=points;
ptr[i].sel=0;
for(j=0;j<points;j++) {
if(fscanf(fd, "%lf %lf ",&(ptr[i].x[j]), &(ptr[i].y[j]))<2) {
fprintf(errfp,"merge_polygon(): WARNING: missing fields for POLYGON points, ignoring.\n");
my_free(_ALLOC_ID_, &ptr[i].x);
my_free(_ALLOC_ID_, &ptr[i].y);
my_free(_ALLOC_ID_, &ptr[i].selected_point);
my_free(773, &ptr[i].x);
my_free(774, &ptr[i].y);
my_free(775, &ptr[i].selected_point);
read_line(fd, 0);
return;
}
@ -257,12 +257,12 @@ static void merge_inst(int k,FILE *fd)
load_ascii_string(&tmp, fd);
/* avoid as much as possible calls to rel_sym_path (slow) */
#ifdef __unix__
if(tmp[0] == '/') my_strdup(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(tmp));
else my_strdup(_ALLOC_ID_, &xctx->inst[i].name,tmp);
if(tmp[0] == '/') my_strdup(776, &xctx->inst[i].name, rel_sym_path(tmp));
else my_strdup(777, &xctx->inst[i].name,tmp);
#else
my_strdup(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(tmp));
my_strdup(778, &xctx->inst[i].name, rel_sym_path(tmp));
#endif
my_free(_ALLOC_ID_, &tmp);
my_free(779, &tmp);
if(fscanf(fd, "%lf %lf %hd %hd",&xctx->inst[i].x0, &xctx->inst[i].y0,&xctx->inst[i].rot, &xctx->inst[i].flip) < 4) {
fprintf(errfp,"WARNING: missing fields for INSTANCE object, ignoring.\n");
read_line(fd, 0);
@ -284,7 +284,7 @@ static void merge_inst(int k,FILE *fd)
if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"highlight",0), "true"))
xctx->inst[i].flags |= HILIGHT_CONN;
xctx->inst[i].embed = !strcmp(get_tok_value(xctx->inst[i].prop_ptr, "embed", 2), "true");
my_free(_ALLOC_ID_, &prop_ptr);
my_free(780, &prop_ptr);
xctx->instances++;
set_modify(1);
}
@ -407,7 +407,7 @@ void merge_file(int selection_load, const char ext[])
xctx->mousex_snap = 0.;
xctx->mousey_snap = 0.;
}
my_free(_ALLOC_ID_, &aux_ptr);
my_free(781, &aux_ptr);
link_symbols_to_instances(old); /* in case of paste/merge will set instances .sel to SELECTED */
fclose(fd);
xctx->ui_state |= STARTMERGE;

View File

@ -127,8 +127,8 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
quality_attr = get_tok_value(r->prop_ptr, "jpg_quality", 0);
if(quality_attr[0]) quality = atoi(quality_attr);
}
my_strdup(_ALLOC_ID_, &filter, get_tok_value(r->prop_ptr, "filter", 0));
image_data_len = my_strdup2(_ALLOC_ID_, &image_data64_ptr, get_tok_value(r->prop_ptr, "image_data", 0));
my_strdup(782, &filter, get_tok_value(r->prop_ptr, "filter", 0));
image_data_len = my_strdup2(783, &image_data64_ptr, get_tok_value(r->prop_ptr, "image_data", 0));
if (filter) {
size_t filtersize = 0;
@ -136,13 +136,13 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
closure.buffer = NULL;
filterdata = (char*)base64_decode(image_data64_ptr, image_data_len, &filtersize);
filter_data(filterdata, filtersize, (char**)&closure.buffer, &data_size, filter);
my_free(_ALLOC_ID_, &filterdata);
my_free(784, &filterdata);
}
else {
closure.buffer = base64_decode(image_data64_ptr, image_data_len, &data_size);
}
my_free(_ALLOC_ID_, &filter);
my_free(_ALLOC_ID_, &image_data64_ptr);
my_free(785, &filter);
my_free(786, &image_data64_ptr);
closure.pos = 0;
closure.size = data_size; /* should not be necessary */
surface = cairo_image_surface_create_from_png_stream(png_reader, &closure);
@ -151,7 +151,7 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
png_size_y = cairo_image_surface_get_height(surface);
cairo_surface_flush(surface);
my_free(_ALLOC_ID_, &closure.buffer);
my_free(787, &closure.buffer);
png_data = cairo_image_surface_get_data(surface);
invertImage = !strcmp(get_tok_value(r->prop_ptr, "InvertOnExport", 0), "true");
@ -245,7 +245,7 @@ void ps_drawPNG(xRect* r, double x1, double y1, double x2, double y2, int rot, i
fprintf(fd, "grestore\n");
cairo_surface_destroy(surface);
my_free(_ALLOC_ID_, &ascii85EncodedJpeg);
my_free(788, &ascii85EncodedJpeg);
free(jpgData);
#endif
}
@ -377,7 +377,7 @@ void ps_embedded_graph(xRect* r, double rx1, double ry1, double rx2, double ry2)
fprintf(fd, "grestore\n");
my_free(_ALLOC_ID_, &ascii85EncodedJpeg);
my_free(789, &ascii85EncodedJpeg);
#endif
}
@ -671,7 +671,7 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in
if(rot == 3 && flip == 1 ) { x=textx1;}
}
llength=0;
my_strdup2(_ALLOC_ID_, &sss, str);
my_strdup2(790, &sss, str);
tt=ss=sss;
for(;;) {
c=*ss;
@ -689,7 +689,7 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in
}
ss++;
}
my_free(_ALLOC_ID_, &sss);
my_free(791, &sss);
}
static void old_ps_draw_string(int gctext, const char *str,
@ -854,16 +854,16 @@ static void ps_draw_symbol(int n,int layer, int what, short tmp_flip, short rot,
polygon = ((xctx->inst[n].ptr+ xctx->sym)->poly[layer])[j];
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
int k;
double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points);
double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points);
double *x = my_malloc(792, sizeof(double) * polygon.points);
double *y = my_malloc(793, sizeof(double) * polygon.points);
for(k=0;k<polygon.points;k++) {
ROTATION(rot, flip, 0.0,0.0,polygon.x[k],polygon.y[k],x[k],y[k]);
x[k]+= x0;
y[k] += y0;
}
ps_drawpolygon(layer, NOW, x, y, polygon.points, polygon.fill, polygon.dash);
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
my_free(794, &x);
my_free(795, &y);
}
}
@ -998,7 +998,7 @@ void create_ps(char **psfile, int what)
}
}
setbuf(fd, NULL); /*To prevent buffer errors, still investigating cause. */
ps_colors=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Ps_color));
ps_colors=my_calloc(796, cadlayers, sizeof(Ps_color));
if(ps_colors==NULL){
fprintf(errfp, "create_ps(): calloc error\n");
return;
@ -1222,7 +1222,7 @@ void create_ps(char **psfile, int what)
fclose(fd);
}
tclsetboolvar("draw_grid", old_grid);
my_free(_ALLOC_ID_, &ps_colors);
my_free(797, &ps_colors);
}
int ps_draw(int what)

File diff suppressed because it is too large Load Diff

View File

@ -670,7 +670,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
char *str = NULL;
display_hilights(&str);
Tcl_SetResult(interp, str, TCL_VOLATILE);
my_free(_ALLOC_ID_, &str);
my_free(985, &str);
}
else if(!strcmp(argv[1], "draw_graph"))
{
@ -763,10 +763,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
l = expandlabel(argv[2], &tmp);
llen = strlen(l);
dbg(1, "l=%s\n", l ? l : "<NULL>");
result = my_malloc(_ALLOC_ID_, llen + 30);
result = my_malloc(986, llen + 30);
my_snprintf(result, llen + 30, "%s %d", l, tmp);
Tcl_SetResult(interp, result, TCL_VOLATILE);
my_free(_ALLOC_ID_, &result);
my_free(987, &result);
}
}
else { cmd_found = 0;}
@ -1148,7 +1148,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
Tcl_SetResult(interp, (xctx->inst[inst].ptr+ xctx->sym)->rect[PINLAYER][n].prop_ptr, TCL_VOLATILE);
} else {
tmp = 100 + strlen(argv[4]) + strlen(argv[5]);
subtok = my_malloc(_ALLOC_ID_,tmp);
subtok = my_malloc(988,tmp);
my_snprintf(subtok, tmp, "%s(%s)", argv[5], argv[4]);
value = get_tok_value(xctx->inst[inst].prop_ptr,subtok,0);
if(!value[0]) {
@ -1167,7 +1167,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
Tcl_SetResult(interp, (char *)value, TCL_VOLATILE);
}
my_free(_ALLOC_ID_, &subtok);
my_free(989, &subtok);
}
}
/* xschem getprop symbol lm358.sym [type] */
@ -1221,9 +1221,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(argc < 4) {Tcl_SetResult(interp, "Missing arguments", TCL_STATIC);return TCL_ERROR;}
if(argc == 5) t = atoi(argv[4]);
else t = 0;
my_strdup(_ALLOC_ID_, &s, get_tok_value(argv[2], argv[3], t));
my_strdup(990, &s, get_tok_value(argv[2], argv[3], t));
Tcl_SetResult(interp, s, TCL_VOLATILE);
my_free(_ALLOC_ID_, &s);
my_free(991, &s);
}
else if(!strcmp(argv[1], "get_tok_size") )
@ -1534,7 +1534,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
rct=symbol->rect[PINLAYER];
/* slotted devices: name= U1:2, pinnumber=2:5 */
slot = -1;
tmpstr = my_malloc(_ALLOC_ID_, sizeof(xctx->inst[i].instname));
tmpstr = my_malloc(992, sizeof(xctx->inst[i].instname));
if((ss=strchr(xctx->inst[i].instname, ':')) ) {
sscanf(ss+1, "%s", tmpstr);
if(isonlydigit(tmpstr)) {
@ -1557,7 +1557,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
piny0 += y0;
my_snprintf(num, S(num), "{%s} %g %g", get_tok_value(rct[p].prop_ptr, "name", 0), pinx0, piny0);
Tcl_SetResult(interp, num, TCL_VOLATILE);
my_free(_ALLOC_ID_, &tmpstr);
my_free(993, &tmpstr);
}
else if(!strcmp(argv[1], "instance_pins"))
@ -1575,10 +1575,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
pin = get_tok_value((xctx->inst[i].ptr+ xctx->sym)->rect[PINLAYER][p].prop_ptr, "name",0);
if(!pin[0]) pin = "--ERROR--";
my_mstrcat(655, &pins, "{", pin, "}", NULL);
if(p< no_of_pins-1) my_strcat(_ALLOC_ID_, &pins, " ");
if(p< no_of_pins-1) my_strcat(994, &pins, " ");
}
Tcl_SetResult(interp, pins, TCL_VOLATILE);
my_free(_ALLOC_ID_, &pins);
my_free(995, &pins);
}
else if(!strcmp(argv[1], "instance_pos"))
@ -1634,7 +1634,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
}
Tcl_SetResult(interp, pins ? pins : "", TCL_VOLATILE);
my_free(_ALLOC_ID_, &pins);
my_free(996, &pins);
}
else { cmd_found = 0;}
break;
@ -1673,7 +1673,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
Tcl_ResetResult(interp);
hier_psprint(&res, 2);
Tcl_SetResult(interp, res, TCL_VOLATILE);
my_free(_ALLOC_ID_, &res);
my_free(997, &res);
}
else if(!strcmp(argv[1], "list_hilights"))
@ -1739,7 +1739,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
dbg(1, "scheduler: undo_reset=%d\n", undo_reset);
load_schematic(load_symbols, f, undo_reset);
tclvareval("update_recent_file {", f, "}", NULL);
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch], ".");
my_strdup(998, &xctx->sch_path[xctx->currsch], ".");
xctx->sch_path_hash[xctx->currsch] = 0;
xctx->sch_inst_number[xctx->currsch] = 1;
if(nofullzoom) draw();
@ -2369,15 +2369,15 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
delete_inst_node(inst); /* 20180208 fix crashing bug: delete node info if changing symbol */
/* if number of pins is different we must delete these data *before* */
/* changing ysmbol, otherwise i might end up deleting non allocated data. */
my_strdup2(_ALLOC_ID_, &xctx->inst[inst].name, rel_sym_path(symbol));
my_strdup2(999, &xctx->inst[inst].name, rel_sym_path(symbol));
xctx->inst[inst].ptr=sym_number;
bbox(ADD, xctx->inst[inst].x1, xctx->inst[inst].y1, xctx->inst[inst].x2, xctx->inst[inst].y2);
my_strdup(_ALLOC_ID_, &name, xctx->inst[inst].instname);
my_strdup(1000, &name, xctx->inst[inst].instname);
if(name && name[0] )
{
/* 20110325 only modify prefix if prefix not NUL */
if(prefix) name[0]=(char)prefix; /* change prefix if changing symbol type; */
my_strdup(_ALLOC_ID_, &ptr,subst_token(xctx->inst[inst].prop_ptr, "name", name) );
my_strdup(1001, &ptr,subst_token(xctx->inst[inst].prop_ptr, "name", name) );
hash_all_names();
new_prop_string(inst, ptr,0, tclgetboolvar("disable_unique_names")); /* set new prop_ptr */
type=xctx->sym[xctx->inst[inst].ptr].type;
@ -2385,12 +2385,12 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(cond) xctx->inst[inst].flags|=2;
else {
xctx->inst[inst].flags &=~2;
my_strdup(_ALLOC_ID_, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0));
my_strdup(1002, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0));
}
xctx->inst[inst].embed = !strcmp(get_tok_value(xctx->inst[inst].prop_ptr, "embed", 2), "true");
my_free(_ALLOC_ID_, &ptr);
my_free(1003, &ptr);
}
my_free(_ALLOC_ID_, &name);
my_free(1004, &name);
/* new symbol bbox after prop changes (may change due to text length) */
symbol_bbox(inst, &xctx->inst[inst].x1, &xctx->inst[inst].y1, &xctx->inst[inst].x2, &xctx->inst[inst].y2);
bbox(ADD, xctx->inst[inst].x1, xctx->inst[inst].y1, xctx->inst[inst].x2, xctx->inst[inst].y2);
@ -2552,7 +2552,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(exists) {
viewer = atoi(tclgetvar("sim(spicewave,default)"));
my_snprintf(tcl_str, S(tcl_str), "sim(spicewave,%d,name)", viewer);
my_strdup(_ALLOC_ID_, &viewer_name, tclgetvar(tcl_str));
my_strdup(1005, &viewer_name, tclgetvar(tcl_str));
dbg(1, "send_to_viewer: viewer_name=%s\n", viewer_name);
if(strstr(viewer_name, "Gaw")) viewer=GAW;
else if(strstr(viewer_name, "Bespice")) viewer=BESPICE;
@ -2560,7 +2560,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
hilight_net(viewer);
redraw_hilights(0);
}
my_free(_ALLOC_ID_, &viewer_name);
my_free(1006, &viewer_name);
}
Tcl_ResetResult(interp);
}
@ -2586,12 +2586,12 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
xctx->draw_window=atoi(argv[3]);
}
else if(!strcmp(argv[2], "format")) {
my_strdup(_ALLOC_ID_, &xctx->format, argv[3]);
my_strdup(1007, &xctx->format, argv[3]);
}
else if(!strcmp(argv[2], "header_text")) {
if(!xctx->header_text || strcmp(xctx->header_text, argv[3])) {
set_modify(1); xctx->push_undo();
my_strdup2(_ALLOC_ID_, &xctx->header_text, argv[3]);
my_strdup2(1008, &xctx->header_text, argv[3]);
}
}
else if(!strcmp(argv[2], "hide_symbols")) {
@ -2668,10 +2668,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
{
char *s = NULL;
if(argc < 5) {Tcl_SetResult(interp, "Missing arguments", TCL_STATIC);return TCL_ERROR;}
my_strdup(_ALLOC_ID_, &s, argv[2]);
my_strdup(1009, &s, argv[2]);
set_different_token(&s, argv[3], argv[4], 0, 0);
Tcl_SetResult(interp, s, TCL_VOLATILE);
my_free(_ALLOC_ID_, &s);
my_free(1010, &s);
}
else if(!strcmp(argv[1], "set_modify"))
@ -2733,7 +2733,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(cond) xctx->inst[inst].flags|=2;
else {
xctx->inst[inst].flags &=~2;
my_strdup(_ALLOC_ID_, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0));
my_strdup(1011, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0));
}
xctx->inst[inst].embed = !strcmp(get_tok_value(xctx->inst[inst].prop_ptr, "embed", 2), "true");
if(!fast) {
@ -2788,14 +2788,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(strcmp(argv[6], get_tok_value(r->prop_ptr, argv[5], 0))) {
change_done = 1;
if(fast == 3 || fast == 0) xctx->push_undo();
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], argv[6]));
my_strdup2(1012, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], argv[6]));
}
} else {
get_tok_value(r->prop_ptr, argv[5], 0);
if(xctx->tok_size) {
change_done = 1;
if(fast == 3 || fast == 0) xctx->push_undo();
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], NULL)); /* delete attr */
my_strdup2(1013, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], NULL)); /* delete attr */
}
}
if(change_done) set_modify(1);
@ -2850,14 +2850,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(strcmp(argv[5], get_tok_value(t->prop_ptr, argv[4], 0))) {
change_done = 1;
if(fast == 3 || fast == 0) xctx->push_undo();
my_strdup2(_ALLOC_ID_, &t->prop_ptr, subst_token(t->prop_ptr, argv[4], argv[5]));
my_strdup2(1014, &t->prop_ptr, subst_token(t->prop_ptr, argv[4], argv[5]));
}
} else {
get_tok_value(t->prop_ptr, argv[4], 0);
if(xctx->tok_size) {
change_done = 1;
if(fast == 3 || fast == 0) xctx->push_undo();
my_strdup2(_ALLOC_ID_, &t->prop_ptr, subst_token(t->prop_ptr, argv[4], NULL)); /* delete attr */
my_strdup2(1015, &t->prop_ptr, subst_token(t->prop_ptr, argv[4], NULL)); /* delete attr */
}
}
if(change_done) set_modify(1);
@ -2900,9 +2900,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
{
char *s=NULL;
if(argc < 5) {Tcl_SetResult(interp, "Missing arguments", TCL_STATIC);return TCL_ERROR;}
my_strdup(_ALLOC_ID_, &s, subst_token(argv[2], argv[3], strcmp(argv[4], "NULL") ? argv[4] : NULL));
my_strdup(1016, &s, subst_token(argv[2], argv[3], strcmp(argv[4], "NULL") ? argv[4] : NULL));
Tcl_SetResult(interp, s, TCL_VOLATILE);
my_free(_ALLOC_ID_, &s);
my_free(1017, &s);
}
else if(!strcmp(argv[1], "symbol_in_new_window"))
@ -3296,10 +3296,10 @@ int tclvareval(const char *script, ...)
va_list args;
va_start(args, script);
size = my_strcat(_ALLOC_ID_, &str, script);
size = my_strcat(1018, &str, script);
dbg(1, "tclvareval(): script=%s, str=%s, size=%d\n", script, str, size);
while( (p = va_arg(args, const char *)) ) {
size = my_strcat(_ALLOC_ID_, &str, p);
size = my_strcat(1019, &str, p);
dbg(1, "tclvareval(): p=%s, str=%s, size=%d\n", p, str, size);
}
return_code = Tcl_EvalEx(interp, str, (int)size, TCL_EVAL_GLOBAL);
@ -3308,6 +3308,6 @@ int tclvareval(const char *script, ...)
dbg(0, "tclvareval(): error executing %s: %s\n", str, tclresult());
Tcl_ResetResult(interp);
}
my_free(_ALLOC_ID_, &str);
my_free(1020, &str);
return return_code;
}

View File

@ -233,7 +233,7 @@ static void del_rect_line_arc_poly(void)
if(c == GRIDLAYER) xctx->graph_lastsel = -1; /* invalidate last selected graph */
j++;
bbox(ADD, xctx->rect[c][i].x1, xctx->rect[c][i].y1, xctx->rect[c][i].x2, xctx->rect[c][i].y2);
my_free(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr);
my_free(1021, &xctx->rect[c][i].prop_ptr);
set_rect_extraptr(0, &xctx->rect[c][i]);
set_modify(1);
continue;
@ -260,7 +260,7 @@ static void del_rect_line_arc_poly(void)
bbox(ADD, xctx->line[c][i].x1, xctx->line[c][i].y1 , xctx->line[c][i].x2 , xctx->line[c][i].y2 );
}
set_modify(1);
my_free(_ALLOC_ID_, &xctx->line[c][i].prop_ptr);
my_free(1022, &xctx->line[c][i].prop_ptr);
continue;
}
if(j)
@ -284,7 +284,7 @@ static void del_rect_line_arc_poly(void)
arc_bbox(xctx->arc[c][i].x, xctx->arc[c][i].y, xctx->arc[c][i].r, xctx->arc[c][i].a, xctx->arc[c][i].b,
&tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
bbox(ADD, tmp.x1, tmp.y1, tmp.x2, tmp.y2);
my_free(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr);
my_free(1023, &xctx->arc[c][i].prop_ptr);
set_modify(1);
continue;
}
@ -312,10 +312,10 @@ static void del_rect_line_arc_poly(void)
}
j++;
bbox(ADD, x1, y1, x2, y2);
my_free(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->poly[c][i].x);
my_free(_ALLOC_ID_, &xctx->poly[c][i].y);
my_free(_ALLOC_ID_, &xctx->poly[c][i].selected_point);
my_free(1024, &xctx->poly[c][i].prop_ptr);
my_free(1025, &xctx->poly[c][i].x);
my_free(1026, &xctx->poly[c][i].y);
my_free(1027, &xctx->poly[c][i].selected_point);
/*fprintf(errfp, "bbox: %.16g %.16g %.16g %.16g\n", x1, y1, x2, y2); */
set_modify(1);
continue;
@ -368,9 +368,9 @@ void delete(int to_push_undo)
}
#endif
bbox(ADD, xx1, yy1, xx2, yy2 );
my_free(_ALLOC_ID_, &xctx->text[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->text[i].font);
my_free(_ALLOC_ID_, &xctx->text[i].txt_ptr);
my_free(1028, &xctx->text[i].prop_ptr);
my_free(1029, &xctx->text[i].font);
my_free(1030, &xctx->text[i].txt_ptr);
set_modify(1);
j++;
continue;
@ -392,12 +392,12 @@ void delete(int to_push_undo)
set_modify(1);
if(xctx->inst[i].prop_ptr != NULL)
{
my_free(_ALLOC_ID_, &xctx->inst[i].prop_ptr);
my_free(1031, &xctx->inst[i].prop_ptr);
}
delete_inst_node(i);
my_free(_ALLOC_ID_, &xctx->inst[i].name);
my_free(_ALLOC_ID_, &xctx->inst[i].instname);
my_free(_ALLOC_ID_, &xctx->inst[i].lab);
my_free(1032, &xctx->inst[i].name);
my_free(1033, &xctx->inst[i].instname);
my_free(1034, &xctx->inst[i].lab);
j++;
continue;
}
@ -432,8 +432,8 @@ void delete(int to_push_undo)
bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 );
}
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->wire[i].node);
my_free(1035, &xctx->wire[i].prop_ptr);
my_free(1036, &xctx->wire[i].node);
set_modify(1);
continue;

View File

@ -55,10 +55,10 @@ void hier_psprint(char **res, int what) /* netlister driver */
zoom_full(0, 0, 1, 0.97);
if(what & 1) ps_draw(2); /* page */
if(what & 2) { /* print cellname */
my_strcat(_ALLOC_ID_, res, hier_psprint_mtime(xctx->sch[xctx->currsch]));
my_strcat(_ALLOC_ID_, res, " {");
my_strcat(_ALLOC_ID_, res, xctx->sch[xctx->currsch]);
my_strcat(_ALLOC_ID_, res, "}\n");
my_strcat(1037, res, hier_psprint_mtime(xctx->sch[xctx->currsch]));
my_strcat(1038, res, " {");
my_strcat(1039, res, xctx->sch[xctx->currsch]);
my_strcat(1040, res, "}\n");
}
dbg(1,"--> %s\n", skip_dir( xctx->sch[xctx->currsch]) );
unselect_all(1);
@ -66,8 +66,8 @@ void hier_psprint(char **res, int what) /* netlister driver */
/* reload data without popping undo stack, this populates embedded symbols if any */
xctx->pop_undo(2, 0);
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], "->netlisting");
my_strdup(1041, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(1042, &xctx->sch_path[xctx->currsch+1], "->netlisting");
xctx->sch_path_hash[xctx->currsch+1] = 0;
xctx->currsch++;
subckt_name=NULL;
@ -76,13 +76,13 @@ void hier_psprint(char **res, int what) /* netlister driver */
int flag;
/* for printing we process also symbols that have *_ignore attribute */
if(!xctx->sym[i].type || !xctx->sym[i].name || !xctx->sym[i].name[0]) continue; /* can not descend into */
my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
my_strdup2(1043, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
if(what & 1) flag = check_lib(2, abs_path); /* noprint_libs */
else flag = check_lib(4, abs_path); /* nolist_libs */
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && flag)
{
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[i].name, 0));
my_strdup(1044, &subckt_name, get_cell(xctx->sym[i].name, 0));
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL)
{
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
@ -92,18 +92,18 @@ void hier_psprint(char **res, int what) /* netlister driver */
zoom_full(0, 0, 1, 0.97);
if(what & 1) ps_draw(2); /* page */
if(what & 2) { /* print cellname */
my_strcat(_ALLOC_ID_, res, hier_psprint_mtime(xctx->sch[xctx->currsch]));
my_strcat(_ALLOC_ID_, res, " {");
my_strcat(_ALLOC_ID_, res, xctx->sch[xctx->currsch]);
my_strcat(_ALLOC_ID_, res, "}\n");
my_strcat(1045, res, hier_psprint_mtime(xctx->sch[xctx->currsch]));
my_strcat(1046, res, " {");
my_strcat(1047, res, xctx->sch[xctx->currsch]);
my_strcat(1048, res, "}\n");
}
dbg(1,"--> %s\n", skip_dir( xctx->sch[xctx->currsch]) );
}
}
}
my_free(_ALLOC_ID_, &abs_path);
my_free(1049, &abs_path);
str_hash_free(&subckt_table);
my_free(_ALLOC_ID_, &subckt_name);
my_free(1050, &subckt_name);
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
xctx->currsch--;
unselect_all(1);
@ -122,18 +122,18 @@ static char *model_name(const char *m)
char *modelname = NULL;
int n;
size_t l = strlen(m) + 1;
my_strdup(_ALLOC_ID_, &m_lower, m);
my_strdup(1051, &m_lower, m);
strtolower(m_lower);
my_realloc(_ALLOC_ID_, &modelname, l);
my_realloc(_ALLOC_ID_, &model_name_result, l);
my_realloc(1052, &modelname, l);
my_realloc(1053, &model_name_result, l);
n = sscanf(m_lower, " %s %s", model_name_result, modelname);
if(n<2) my_strncpy(model_name_result, m_lower, l);
else {
/* build a hash key value with no spaces to make device_model attributes with different spaces equivalent*/
my_strcat(_ALLOC_ID_, &model_name_result, modelname);
my_strcat(1054, &model_name_result, modelname);
}
my_free(_ALLOC_ID_, &modelname);
my_free(_ALLOC_ID_, &m_lower);
my_free(1055, &modelname);
my_free(1056, &m_lower);
return model_name_result;
}
@ -156,7 +156,7 @@ static void spice_netlist(FILE *fd, int spice_stop )
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1057, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && IS_PIN(type) ) {
if(top_sub && !flag) {
fprintf(fd, "*.PININFO ");
@ -181,7 +181,7 @@ static void spice_netlist(FILE *fd, int spice_stop )
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1058, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && !IS_LABEL_OR_PIN(type) ) {
/* already done in global_spice_netlist */
@ -202,11 +202,11 @@ static void spice_netlist(FILE *fd, int spice_stop )
m = get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "device_model", 0);
if(m[0]) str_hash_lookup(&model_table, model_name(m), m, XINSERT);
}
my_free(_ALLOC_ID_, &model_name_result);
my_free(1059, &model_name_result);
}
}
}
my_free(_ALLOC_ID_, &type);
my_free(1060, &type);
}
if(!spice_stop && !xctx->netlist_count) redraw_hilights(0); /* draw_hilight_net(1); */
}
@ -272,11 +272,11 @@ void global_spice_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
my_strdup(1061, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1062, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
if( type && !strcmp(type,"netlist_commands") ) {
if(!place) {
my_strdup(_ALLOC_ID_, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
my_strdup(1063, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
}
if(place && !strcmp(place, "header" )) {
if(first == 0) fprintf(fd,"**** begin user header code\n");
@ -305,7 +305,7 @@ void global_spice_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1064, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
dbg(1, "global_spice_netlist(): |%s|\n", type);
/*
if( type && !strcmp(type,"netlist_options") ) {
@ -331,11 +331,11 @@ void global_spice_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
my_strdup(1065, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1066, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
if( type && !strcmp(type,"netlist_commands") ) {
if(!place) {
my_strdup(_ALLOC_ID_, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
my_strdup(1067, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
}
if(!place || (strcmp(place, "end") && strcmp(place, "header")) ) {
if(first == 0) fprintf(fd,"**** begin user architecture code\n");
@ -376,7 +376,7 @@ void global_spice_netlist(int global) /* netlister driver */
/* warning if two symbols perfectly overlapped */
warning_overlapped_symbols(0);
/* preserve current level instance flags before descending hierarchy for netlisting, restore later */
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
stored_flags = my_calloc(1068, xctx->instances, sizeof(unsigned int));
for(i=0;i<xctx->instances;i++) stored_flags[i] = xctx->inst[i].color;
if(global)
@ -388,8 +388,8 @@ void global_spice_netlist(int global) /* netlister driver */
dbg(1, "global_spice_netlist(): invoking pop_undo(2, 0)\n");
xctx->pop_undo(2, 0);
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], "->netlisting");
my_strdup(1069, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(1070, &xctx->sch_path[xctx->currsch+1], "->netlisting");
xctx->sch_path_hash[xctx->currsch+1] = 0;
xctx->currsch++;
@ -399,11 +399,11 @@ void global_spice_netlist(int global) /* netlister driver */
{
if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"spice_ignore",0),"true")==0 ) continue;
if(!xctx->sym[i].type) continue;
my_strdup(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
my_strdup(1071, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path))
{
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[i].name, 0));
my_strdup(1072, &subckt_name, get_cell(xctx->sym[i].name, 0));
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL)
{
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
@ -416,10 +416,10 @@ void global_spice_netlist(int global) /* netlister driver */
spice_block_netlist(fd, i);
}
}
my_free(_ALLOC_ID_, &abs_path);
my_free(1073, &abs_path);
}
str_hash_free(&subckt_table);
my_free(_ALLOC_ID_, &subckt_name);
my_free(1074, &subckt_name);
/*clear_drawing(); */
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
xctx->currsch--;
@ -437,7 +437,7 @@ void global_spice_netlist(int global) /* netlister driver */
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
propagate_hilights(1, 0, XINSERT_NOREPLACE);
draw_hilight_net(1);
my_free(_ALLOC_ID_, &stored_flags);
my_free(1075, &stored_flags);
/* print globals nodes found in netlist 28032003 */
if(!split_f) record_global_node(0,fd,NULL);
@ -452,15 +452,15 @@ void global_spice_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "spice_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
my_strdup(1076, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1077, &place,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,"place",0));
if( type && !strcmp(type,"netlist_commands") ) {
if(place && !strcmp(place, "end" )) {
if(first == 0) fprintf(fd,"**** begin user architecture code\n");
first++;
print_spice_element(fd, i) ;
} else {
my_strdup(_ALLOC_ID_, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
my_strdup(1078, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
if(place && !strcmp(place, "end" )) {
if(first == 0) fprintf(fd,"**** begin user architecture code\n");
first++;
@ -503,8 +503,8 @@ void global_spice_netlist(int global) /* netlister driver */
}
if(!debug_var) xunlink(netl_filename);
}
my_free(_ALLOC_ID_, &type);
my_free(_ALLOC_ID_, &place);
my_free(1079, &type);
my_free(1080, &place);
xctx->netlist_count = 0;
}
@ -547,7 +547,7 @@ void spice_block_netlist(FILE *fd, int i)
fprintf(fd, ".subckt %s ",skip_dir(xctx->sym[i].name));
print_spice_subckt_nodes(fd, i);
my_strdup(_ALLOC_ID_, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
my_strdup(1081, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
/* this is now done in print_spice_subckt_nodes */
/*
* fprintf(fd, "%s ", extra ? extra : "" );
@ -555,7 +555,7 @@ void spice_block_netlist(FILE *fd, int i)
/* 20081206 new get_sym_template does not return token=value pairs where token listed in extra */
fprintf(fd, "%s", get_sym_template(xctx->sym[i].templ, extra));
my_free(_ALLOC_ID_, &extra);
my_free(1082, &extra);
fprintf(fd, "\n");
spice_stop ? load_schematic(0,filename, 0) : load_schematic(1,filename, 0);
@ -617,12 +617,12 @@ Str_hashentry *str_hash_lookup(Str_hashtable *hashtable, const char *token, cons
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
{
s=sizeof( Str_hashentry );
entry=(Str_hashentry *)my_malloc(_ALLOC_ID_, s);
entry=(Str_hashentry *)my_malloc(1083, s);
entry->next=NULL;
entry->token=NULL;
entry->value=NULL;
my_strdup(_ALLOC_ID_, &entry->token, token);
my_strdup(_ALLOC_ID_, &entry->value, value);
my_strdup(1084, &entry->token, token);
my_strdup(1085, &entry->value, value);
entry->hash=hashcode;
*preventry=entry;
}
@ -633,13 +633,13 @@ Str_hashentry *str_hash_lookup(Str_hashtable *hashtable, const char *token, cons
if(what==XDELETE) /* remove token from the hash table ... */
{
saveptr=entry->next;
my_free(_ALLOC_ID_, &entry->token);
my_free(_ALLOC_ID_, &entry->value);
my_free(_ALLOC_ID_, &entry);
my_free(1086, &entry->token);
my_free(1087, &entry->value);
my_free(1088, &entry);
*preventry=saveptr;
}
else if(value && what == XINSERT ) {
my_strdup(_ALLOC_ID_, &entry->value, value);
my_strdup(1089, &entry->value, value);
}
return entry; /* found matching entry, return the address */
}
@ -654,7 +654,7 @@ void str_hash_init(Str_hashtable *hashtable, int size)
dbg(0, "str_hash_init(): Warning hash table not empty, possible data leak\n");
}
hashtable->size = size;
hashtable->table = my_calloc(_ALLOC_ID_, size, sizeof(Str_hashentry *));
hashtable->table = my_calloc(1090, size, sizeof(Str_hashentry *));
}
static void str_hash_free_entry(Str_hashentry *entry)
@ -662,9 +662,9 @@ static void str_hash_free_entry(Str_hashentry *entry)
Str_hashentry *tmp;
while( entry ) {
tmp = entry -> next;
my_free(_ALLOC_ID_, &(entry->token));
my_free(_ALLOC_ID_, &(entry->value));
my_free(_ALLOC_ID_, &entry);
my_free(1091, &(entry->token));
my_free(1092, &(entry->value));
my_free(1093, &entry);
entry = tmp;
}
}
@ -680,7 +680,7 @@ void str_hash_free(Str_hashtable *hashtable)
str_hash_free_entry( table[i] );
table[i] = NULL;
}
if(hashtable->table) my_free(_ALLOC_ID_, &(hashtable->table));
if(hashtable->table) my_free(1094, &(hashtable->table));
hashtable->size = 0;
}
}
@ -718,10 +718,10 @@ Int_hashentry *int_hash_lookup(Int_hashtable *hashtable, const char *token, cons
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
{
s=sizeof( Int_hashentry );
entry=(Int_hashentry *)my_malloc(_ALLOC_ID_, s);
entry=(Int_hashentry *)my_malloc(1095, s);
entry->next=NULL;
entry->token=NULL;
my_strdup(_ALLOC_ID_, &entry->token, token);
my_strdup(1096, &entry->token, token);
entry->value = value;
entry->hash=hashcode;
*preventry=entry;
@ -733,8 +733,8 @@ Int_hashentry *int_hash_lookup(Int_hashtable *hashtable, const char *token, cons
if(what==XDELETE) /* remove token from the hash table ... */
{
saveptr=entry->next;
my_free(_ALLOC_ID_, &entry->token);
my_free(_ALLOC_ID_, &entry);
my_free(1097, &entry->token);
my_free(1098, &entry);
*preventry=saveptr;
}
else if(what == XINSERT ) {
@ -753,7 +753,7 @@ void int_hash_init(Int_hashtable *hashtable, int size)
dbg(0, "int_hash_init(): Warning hash table not empty, possible data leak\n");
}
hashtable->size = size;
hashtable->table = my_calloc(_ALLOC_ID_, size, sizeof(Int_hashentry *));
hashtable->table = my_calloc(1099, size, sizeof(Int_hashentry *));
}
static void int_hash_free_entry(Int_hashentry *entry)
@ -761,8 +761,8 @@ static void int_hash_free_entry(Int_hashentry *entry)
Int_hashentry *tmp;
while( entry ) {
tmp = entry -> next;
my_free(_ALLOC_ID_, &(entry->token));
my_free(_ALLOC_ID_, &entry);
my_free(1100, &(entry->token));
my_free(1101, &entry);
entry = tmp;
}
}
@ -778,7 +778,7 @@ void int_hash_free(Int_hashtable *hashtable)
int_hash_free_entry( table[i] );
table[i] = NULL;
}
my_free(_ALLOC_ID_, &(hashtable->table));
my_free(1102, &(hashtable->table));
hashtable->size = 0;
}
}
@ -818,10 +818,10 @@ Ptr_hashentry *ptr_hash_lookup(Ptr_hashtable *hashtable, const char *token, void
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
{
s=sizeof( Ptr_hashentry );
entry=(Ptr_hashentry *)my_malloc(_ALLOC_ID_, s);
entry=(Ptr_hashentry *)my_malloc(1103, s);
entry->next=NULL;
entry->token=NULL;
my_strdup(_ALLOC_ID_, &entry->token, token);
my_strdup(1104, &entry->token, token);
entry->value = value;
entry->hash=hashcode;
*preventry=entry;
@ -833,8 +833,8 @@ Ptr_hashentry *ptr_hash_lookup(Ptr_hashtable *hashtable, const char *token, void
if(what==XDELETE) /* remove token from the hash table ... */
{
saveptr=entry->next;
my_free(_ALLOC_ID_, &entry->token);
my_free(_ALLOC_ID_, &entry);
my_free(1105, &entry->token);
my_free(1106, &entry);
*preventry=saveptr;
}
else if(what == XINSERT ) {
@ -853,7 +853,7 @@ void ptr_hash_init(Ptr_hashtable *hashtable, int size)
dbg(0, "ptr_hash_init(): Warning hash table not empty, possible data leak\n");
}
hashtable->size = size;
hashtable->table = my_calloc(_ALLOC_ID_, size, sizeof(Ptr_hashentry *));
hashtable->table = my_calloc(1107, size, sizeof(Ptr_hashentry *));
}
static void ptr_hash_free_entry(Ptr_hashentry *entry)
@ -861,8 +861,8 @@ static void ptr_hash_free_entry(Ptr_hashentry *entry)
Ptr_hashentry *tmp;
while( entry ) {
tmp = entry -> next;
my_free(_ALLOC_ID_, &(entry->token));
my_free(_ALLOC_ID_, &entry);
my_free(1108, &(entry->token));
my_free(1109, &entry);
entry = tmp;
}
}
@ -878,7 +878,7 @@ void ptr_hash_free(Ptr_hashtable *hashtable)
ptr_hash_free_entry( table[i] );
table[i] = NULL;
}
my_free(_ALLOC_ID_, &(hashtable->table));
my_free(1110, &(hashtable->table));
hashtable->size = 0;
}
}

View File

@ -28,7 +28,7 @@ void check_wire_storage(void)
if(xctx->wires >= xctx->maxw)
{
xctx->maxw=(1+xctx->wires / CADMAXWIRES)*CADMAXWIRES;
my_realloc(_ALLOC_ID_, &xctx->wire, sizeof(xWire)*xctx->maxw);
my_realloc(1111, &xctx->wire, sizeof(xWire)*xctx->maxw);
}
}
@ -37,7 +37,7 @@ void check_selected_storage(void)
if(xctx->lastsel >= xctx->maxsel)
{
xctx->maxsel=(1+xctx->lastsel / MAXGROUP) * MAXGROUP;
my_realloc(_ALLOC_ID_, &xctx->sel_array, sizeof(Selected)*xctx->maxsel);
my_realloc(1112, &xctx->sel_array, sizeof(Selected)*xctx->maxsel);
}
}
@ -46,7 +46,7 @@ void check_text_storage(void)
if(xctx->texts >= xctx->maxt)
{
xctx->maxt=(1 + xctx->texts / CADMAXTEXT) * CADMAXTEXT;
my_realloc(_ALLOC_ID_, &xctx->text, sizeof(xText)*xctx->maxt);
my_realloc(1113, &xctx->text, sizeof(xText)*xctx->maxt);
}
}
@ -58,42 +58,42 @@ void check_symbol_storage(void)
dbg(1, "check_symbol_storage(): more than maxs, %s\n",
xctx->sch[xctx->currsch] );
xctx->maxs=(1 + xctx->symbols / ELEMDEF) * ELEMDEF;
my_realloc(_ALLOC_ID_, &xctx->sym, sizeof(xSymbol)*xctx->maxs);
my_realloc(1114, &xctx->sym, sizeof(xSymbol)*xctx->maxs);
for(i=xctx->symbols;i<xctx->maxs;i++) {
xctx->sym[i].poly=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
xctx->sym[i].poly=my_calloc(1115, cadlayers, sizeof(xPoly *));
if(xctx->sym[i].poly==NULL){
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
}
xctx->sym[i].arc=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
xctx->sym[i].arc=my_calloc(1116, cadlayers, sizeof(xArc *));
if(xctx->sym[i].arc==NULL){
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
}
xctx->sym[i].line=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
xctx->sym[i].line=my_calloc(1117, cadlayers, sizeof(xLine *));
if(xctx->sym[i].line==NULL){
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
}
xctx->sym[i].rect=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
xctx->sym[i].rect=my_calloc(1118, cadlayers, sizeof(xRect *));
if(xctx->sym[i].rect==NULL){
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
}
xctx->sym[i].lines=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].lines=my_calloc(1119, cadlayers, sizeof(int));
if(xctx->sym[i].lines==NULL){
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
}
xctx->sym[i].rects=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].rects=my_calloc(1120, cadlayers, sizeof(int));
if(xctx->sym[i].rects==NULL){
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
}
xctx->sym[i].polygons=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].polygons=my_calloc(1121, cadlayers, sizeof(int));
if(xctx->sym[i].polygons==NULL){
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
}
xctx->sym[i].arcs=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].arcs=my_calloc(1122, cadlayers, sizeof(int));
if(xctx->sym[i].arcs==NULL){
fprintf(errfp, "check_symbol_storage(): calloc error\n");tcleval( "exit");
}
@ -109,7 +109,7 @@ void check_inst_storage(void)
if(xctx->instances >= xctx->maxi)
{
xctx->maxi=(1 + xctx->instances / ELEMINST) * ELEMINST;
my_realloc(_ALLOC_ID_, &xctx->inst, sizeof(xInstance)*xctx->maxi);
my_realloc(1123, &xctx->inst, sizeof(xInstance)*xctx->maxi);
#ifdef ZERO_REALLOC
memset(xctx->inst + xctx->instances, 0, sizeof(xInstance) * (xctx->maxi - xctx->instances));
#endif
@ -121,7 +121,7 @@ void check_arc_storage(int c)
if(xctx->arcs[c] >= xctx->maxa[c])
{
xctx->maxa[c]=(1 + xctx->arcs[c] / CADMAXOBJECTS) * CADMAXOBJECTS;
my_realloc(_ALLOC_ID_, &xctx->arc[c], sizeof(xArc)*xctx->maxa[c]);
my_realloc(1124, &xctx->arc[c], sizeof(xArc)*xctx->maxa[c]);
#ifdef ZERO_REALLOC
memset(xctx->arc[c] + xctx->arcs[c], 0, sizeof(xArc) * (xctx->maxa[c] - xctx->arcs[c]));
#endif
@ -133,7 +133,7 @@ void check_box_storage(int c)
if(xctx->rects[c] >= xctx->maxr[c])
{
xctx->maxr[c]=(1 + xctx->rects[c] / CADMAXOBJECTS) * CADMAXOBJECTS;
my_realloc(_ALLOC_ID_, &xctx->rect[c], sizeof(xRect)*xctx->maxr[c]);
my_realloc(1125, &xctx->rect[c], sizeof(xRect)*xctx->maxr[c]);
#ifdef ZERO_REALLOC
memset(xctx->rect[c] + xctx->rects[c], 0, sizeof(xRect) * (xctx->maxr[c] - xctx->rects[c]));
#endif
@ -145,7 +145,7 @@ void check_line_storage(int c)
if(xctx->lines[c] >= xctx->maxl[c])
{
xctx->maxl[c]=(1 + xctx->lines[c] / CADMAXOBJECTS) * CADMAXOBJECTS;
my_realloc(_ALLOC_ID_, &xctx->line[c], sizeof(xLine)*xctx->maxl[c]);
my_realloc(1126, &xctx->line[c], sizeof(xLine)*xctx->maxl[c]);
#ifdef ZERO_REALLOC
memset(xctx->line[c] + xctx->lines[c], 0, sizeof(xLine) * (xctx->maxl[c] - xctx->lines[c]));
#endif
@ -157,7 +157,7 @@ void check_polygon_storage(int c)
if(xctx->polygons[c] >= xctx->maxp[c])
{
xctx->maxp[c]=(1 + xctx->polygons[c] / CADMAXOBJECTS) * CADMAXOBJECTS;
my_realloc(_ALLOC_ID_, &xctx->poly[c], sizeof(xPoly)*xctx->maxp[c]);
my_realloc(1127, &xctx->poly[c], sizeof(xPoly)*xctx->maxp[c]);
#ifdef ZERO_REALLOC
memset(xctx->poly[c] + xctx->polygons[c], 0, sizeof(xPoly) * (xctx->maxp[c] - xctx->polygons[c]));
#endif
@ -185,7 +185,7 @@ void store_arc(int pos, double x, double y, double r, double a, double b,
xctx->arc[rectc][n].a = a;
xctx->arc[rectc][n].b = b;
xctx->arc[rectc][n].prop_ptr = NULL;
my_strdup(_ALLOC_ID_, &xctx->arc[rectc][n].prop_ptr, prop_ptr);
my_strdup(1128, &xctx->arc[rectc][n].prop_ptr, prop_ptr);
xctx->arc[rectc][n].sel = sel;
if( !strcmp(get_tok_value(xctx->arc[rectc][n].prop_ptr,"fill",0),"true") )
xctx->arc[rectc][n].fill =1;
@ -223,10 +223,10 @@ void store_poly(int pos, double *x, double *y, int points, unsigned int rectc,
xctx->poly[rectc][n].y=NULL;
xctx->poly[rectc][n].selected_point=NULL;
xctx->poly[rectc][n].prop_ptr=NULL;
xctx->poly[rectc][n].x= my_calloc(_ALLOC_ID_, points, sizeof(double));
xctx->poly[rectc][n].y= my_calloc(_ALLOC_ID_, points, sizeof(double));
xctx->poly[rectc][n].selected_point= my_calloc(_ALLOC_ID_, points, sizeof(unsigned short));
my_strdup(_ALLOC_ID_, &xctx->poly[rectc][n].prop_ptr, prop_ptr);
xctx->poly[rectc][n].x= my_calloc(1129, points, sizeof(double));
xctx->poly[rectc][n].y= my_calloc(1130, points, sizeof(double));
xctx->poly[rectc][n].selected_point= my_calloc(1131, points, sizeof(unsigned short));
my_strdup(1132, &xctx->poly[rectc][n].prop_ptr, prop_ptr);
for(j=0;j<points; j++) {
xctx->poly[rectc][n].x[j] = x[j];
xctx->poly[rectc][n].y[j] = y[j];
@ -276,7 +276,7 @@ void storeobject(int pos, double x1,double y1,double x2,double y2,
xctx->line[rectc][n].y1=y1;
xctx->line[rectc][n].y2=y2;
xctx->line[rectc][n].prop_ptr=NULL;
my_strdup(_ALLOC_ID_, &xctx->line[rectc][n].prop_ptr, prop_ptr);
my_strdup(1133, &xctx->line[rectc][n].prop_ptr, prop_ptr);
xctx->line[rectc][n].sel=sel;
if( prop_ptr && !strcmp(get_tok_value(prop_ptr, "bus", 0), "true") )
xctx->line[rectc][n].bus = 1;
@ -309,7 +309,7 @@ void storeobject(int pos, double x1,double y1,double x2,double y2,
xctx->rect[rectc][n].y2=y2;
xctx->rect[rectc][n].prop_ptr=NULL;
xctx->rect[rectc][n].extraptr=NULL;
my_strdup(_ALLOC_ID_, &xctx->rect[rectc][n].prop_ptr, prop_ptr);
my_strdup(1134, &xctx->rect[rectc][n].prop_ptr, prop_ptr);
xctx->rect[rectc][n].sel=sel;
if(prop_ptr && (dash = get_tok_value(prop_ptr,"dash",0))[0]) {
int d = atoi(dash);
@ -349,7 +349,7 @@ void storeobject(int pos, double x1,double y1,double x2,double y2,
xctx->wire[n].node=NULL;
xctx->wire[n].end1=0;
xctx->wire[n].end2=0;
my_strdup(_ALLOC_ID_, &xctx->wire[n].prop_ptr, prop_ptr);
my_strdup(1135, &xctx->wire[n].prop_ptr, prop_ptr);
if(prop_ptr && !strcmp(get_tok_value(prop_ptr,"bus",0), "true")) xctx->wire[n].bus=1;
else xctx->wire[n].bus=0;
xctx->wire[n].sel=sel;

View File

@ -291,7 +291,7 @@ static void svg_draw_string(int layer, const char *str, short rot, short flip, i
if(rot == 3 && flip == 1 ) { x=textx1;}
}
llength=0;
my_strdup2(_ALLOC_ID_, &sss, str);
my_strdup2(1136, &sss, str);
tt=ss=sss;
for(;;) {
c=*ss;
@ -309,7 +309,7 @@ static void svg_draw_string(int layer, const char *str, short rot, short flip, i
}
ss++;
}
my_free(_ALLOC_ID_, &sss);
my_free(1137, &sss);
}
@ -489,16 +489,16 @@ static void svg_draw_symbol(int c, int n,int layer,short tmp_flip, short rot,
polygon = (symptr->poly[layer])[j];
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
int k;
double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points);
double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points);
double *x = my_malloc(1138, sizeof(double) * polygon.points);
double *y = my_malloc(1139, sizeof(double) * polygon.points);
for(k=0;k<polygon.points;k++) {
ROTATION(rot, flip, 0.0,0.0,polygon.x[k],polygon.y[k],x[k],y[k]);
x[k]+= x0;
y[k] += y0;
}
svg_drawpolygon(c, NOW, x, y, polygon.points, polygon.fill, polygon.dash);
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
my_free(1140, &x);
my_free(1141, &y);
}
}
for(j=0;j< symptr->arcs[layer];j++) {
@ -647,7 +647,7 @@ void svg_draw(void)
else return;
}
svg_restore_lw();
svg_colors=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Svg_color));
svg_colors=my_calloc(1142, cadlayers, sizeof(Svg_color));
if(svg_colors==NULL){
fprintf(errfp, "svg_draw(): calloc error\n");
return;
@ -674,7 +674,7 @@ void svg_draw(void)
}
my_strncpy(xctx->plotfile,"", S(xctx->plotfile));
unused_layer = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
unused_layer = my_calloc(1143, cadlayers, sizeof(int));
#if 0
* /* Determine used layers. Disabled since we want hilight colors */
* for(c=0;c<cadlayers;c++) unused_layer[c] = 1;
@ -877,8 +877,8 @@ void svg_draw(void)
fprintf(fd, "</svg>\n");
fclose(fd);
tclsetboolvar("draw_grid", old_grid);
my_free(_ALLOC_ID_, &svg_colors);
my_free(_ALLOC_ID_, &unused_layer);
my_free(1144, &svg_colors);
my_free(1145, &unused_layer);
Tcl_SetResult(interp,"",TCL_STATIC);
}

View File

@ -40,7 +40,7 @@ static void tedax_netlist(FILE *fd, int tedax_stop )
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "tedax_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1146, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && IS_PIN(type) ) {
print_tedax_element(fd, i) ; /* this is the element line */
}
@ -52,7 +52,7 @@ static void tedax_netlist(FILE *fd, int tedax_stop )
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "tedax_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1147, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && !IS_LABEL_OR_PIN(type) ) {
/* already done in global_tedax_netlist */
@ -68,7 +68,7 @@ static void tedax_netlist(FILE *fd, int tedax_stop )
}
}
}
my_free(_ALLOC_ID_, &type);
my_free(1148, &type);
}
if(!tedax_stop && !xctx->netlist_count) redraw_hilights(0); /* draw_hilight_net(1); */
}
@ -92,7 +92,7 @@ static void tedax_block_netlist(FILE *fd, int i)
fprintf(fd, "begin netlist v1 %s\n",skip_dir(xctx->sym[i].name));
print_tedax_subckt(fd, i);
my_strdup(_ALLOC_ID_, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
my_strdup(1149, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
/* this is now done in print_spice_subckt */
/*
* fprintf(fd, "%s ", extra ? extra : "" );
@ -100,7 +100,7 @@ static void tedax_block_netlist(FILE *fd, int i)
/* 20081206 new get_sym_template does not return token=value pairs where token listed in extra */
fprintf(fd, "%s", get_sym_template(xctx->sym[i].templ, extra));
my_free(_ALLOC_ID_, &extra);
my_free(1150, &extra);
fprintf(fd, "\n");
load_schematic(1,filename, 0);
tedax_netlist(fd, tedax_stop);
@ -175,7 +175,7 @@ void global_tedax_netlist(int global) /* netlister driver */
/* warning if two symbols perfectly overlapped */
warning_overlapped_symbols(0);
/* preserve current level instance flags before descending hierarchy for netlisting, restore later */
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
stored_flags = my_calloc(1151, xctx->instances, sizeof(unsigned int));
for(i=0;i<xctx->instances;i++) stored_flags[i] = xctx->inst[i].color;
if(global) /* was if(global) ... 20180901 no hierarchical tEDAx netlist for now */
@ -186,8 +186,8 @@ void global_tedax_netlist(int global) /* netlister driver */
/* reload data without popping undo stack, this populates embedded symbols if any */
xctx->pop_undo(2, 0);
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], "->netlisting");
my_strdup(1152, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(1153, &xctx->sch_path[xctx->currsch+1], "->netlisting");
xctx->sch_path_hash[xctx->currsch+1] = 0;
xctx->currsch++;
@ -196,13 +196,13 @@ void global_tedax_netlist(int global) /* netlister driver */
{
if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"tedax_ignore",0),"true")==0 ) continue;
if(!xctx->sym[i].type) continue;
my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
my_strdup2(1154, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path))
{
tedax_block_netlist(fd, i);
}
}
my_free(_ALLOC_ID_, &abs_path);
my_free(1155, &abs_path);
/*clear_drawing(); */
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
xctx->currsch--;
@ -219,7 +219,7 @@ void global_tedax_netlist(int global) /* netlister driver */
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
propagate_hilights(1, 0, XINSERT_NOREPLACE);
draw_hilight_net(1);
my_free(_ALLOC_ID_, &stored_flags);
my_free(1156, &stored_flags);
/* print globals nodes found in netlist 28032003 */
record_global_node(0,fd,NULL);

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,7 @@ static void verilog_netlist(FILE *fd , int verilog_stop)
}
dbg(2, "verilog_netlist(): into the netlisting loop\n");
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1445, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type &&
( !IS_LABEL_OR_PIN(type) &&
strcmp(type,"netlist_commands")&&
@ -66,7 +66,7 @@ static void verilog_netlist(FILE *fd , int verilog_stop)
else print_verilog_element(fd, i) ; /* this is the element line */
}
}
my_free(_ALLOC_ID_, &type);
my_free(1446, &type);
}
dbg(1, "verilog_netlist(): end\n");
if(!verilog_stop && !xctx->netlist_count) redraw_hilights(0); /*draw_hilight_net(1); */
@ -129,14 +129,14 @@ void global_verilog_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1447, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"timescale")==0 || strcmp(type,"verilog_preprocessor")==0) )
{
str_tmp = get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr , fmt_attr, 2);
if(!str_tmp[0] && strcmp(fmt_attr, "verilog_format"))
str_tmp = get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_format", 2);
my_strdup(_ALLOC_ID_, &tmp_string, str_tmp);
my_strdup(1448, &tmp_string, str_tmp);
fprintf(fd, "%s\n", str_tmp ? translate(i, tmp_string) : "(NULL)");
}
}
@ -163,7 +163,7 @@ void global_verilog_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1449, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"opin"))==0)
{
if(tmp) fprintf(fd, " ,\n");
@ -181,7 +181,7 @@ void global_verilog_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1450, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"iopin"))==0)
{
if(tmp) fprintf(fd, " ,\n");
@ -199,7 +199,7 @@ void global_verilog_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1451, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"ipin"))==0)
{
if(tmp) fprintf(fd, " ,\n");
@ -231,12 +231,12 @@ void global_verilog_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1452, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"opin"))==0)
{
my_strdup(_ALLOC_ID_, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire"); /* 20070720 changed reg to wire */
my_strdup(1453, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
my_strdup(1454, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(1455, &sig_type,"wire"); /* 20070720 changed reg to wire */
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
fprintf(fd, " output %s ;\n", str_tmp ? str_tmp : "(NULL)");
fprintf(fd, " %s %s ", sig_type, str_tmp ? str_tmp : "(NULL)");
@ -254,12 +254,12 @@ void global_verilog_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1456, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"iopin"))==0)
{
my_strdup(_ALLOC_ID_, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire");
my_strdup(1457, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
my_strdup(1458, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(1459, &sig_type,"wire");
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
fprintf(fd, " inout %s ;\n", str_tmp ? str_tmp : "(NULL)");
fprintf(fd, " %s %s ", sig_type, str_tmp ? str_tmp : "(NULL)");
@ -277,12 +277,12 @@ void global_verilog_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1460, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"ipin"))==0)
{
my_strdup(_ALLOC_ID_, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire");
my_strdup(1461, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
my_strdup(1462, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(1463, &sig_type,"wire");
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
fprintf(fd, " input %s ;\n", str_tmp ? str_tmp : "<NULL>");
fprintf(fd, " %s %s ", sig_type, str_tmp ? str_tmp : "<NULL>");
@ -303,7 +303,7 @@ void global_verilog_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1464, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if(type && !strcmp(type,"netlist_commands")) {
fprintf(fd, "%s\n", get_tok_value(xctx->inst[i].prop_ptr,"value", 0));
}
@ -332,7 +332,7 @@ void global_verilog_netlist(int global) /* netlister driver */
/* warning if two symbols perfectly overlapped */
warning_overlapped_symbols(0);
/* preserve current level instance flags before descending hierarchy for netlisting, restore later */
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
stored_flags = my_calloc(1465, xctx->instances, sizeof(unsigned int));
for(i=0;i<xctx->instances;i++) stored_flags[i] = xctx->inst[i].color;
if(global)
@ -343,8 +343,8 @@ void global_verilog_netlist(int global) /* netlister driver */
/* reload data without popping undo stack, this populates embedded symbols if any */
xctx->pop_undo(2, 0);
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], "->netlisting");
my_strdup(1466, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(1467, &xctx->sch_path[xctx->currsch+1], "->netlisting");
xctx->sch_path_hash[xctx->currsch+1] = 0;
xctx->currsch++;
@ -354,10 +354,10 @@ void global_verilog_netlist(int global) /* netlister driver */
{
if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"verilog_ignore",0),"true")==0 ) continue;
if(!xctx->sym[i].type) continue;
my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
my_strdup2(1468, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path)) {
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[i].name, 0));
my_strdup(1469, &subckt_name, get_cell(xctx->sym[i].name, 0));
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL)
{
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
@ -371,9 +371,9 @@ void global_verilog_netlist(int global) /* netlister driver */
}
}
}
my_free(_ALLOC_ID_, &abs_path);
my_free(1470, &abs_path);
str_hash_free(&subckt_table);
my_free(_ALLOC_ID_, &subckt_name);
my_free(1471, &subckt_name);
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
xctx->currsch--;
unselect_all(1);
@ -388,7 +388,7 @@ void global_verilog_netlist(int global) /* netlister driver */
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
propagate_hilights(1, 0, XINSERT_NOREPLACE);
draw_hilight_net(1);
my_free(_ALLOC_ID_, &stored_flags);
my_free(1472, &stored_flags);
dbg(1, "global_verilog_netlist(): starting awk on netlist!\n");
if(!split_f) {
@ -403,10 +403,10 @@ void global_verilog_netlist(int global) /* netlister driver */
}
if(debug_var == 0 ) xunlink(netl_filename);
}
my_free(_ALLOC_ID_, &sig_type);
my_free(_ALLOC_ID_, &port_value);
my_free(_ALLOC_ID_, &tmp_string);
my_free(_ALLOC_ID_, &type);
my_free(1473, &sig_type);
my_free(1474, &port_value);
my_free(1475, &tmp_string);
my_free(1476, &type);
xctx->netlist_count = 0;
}
@ -454,8 +454,8 @@ void verilog_block_netlist(FILE *fd, int i)
} else {
Int_hashtable table = {NULL, 0};
int_hash_init(&table, 37);
my_strdup(_ALLOC_ID_, &extra, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
my_strdup(_ALLOC_ID_, &extra2, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
my_strdup(1477, &extra, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
my_strdup(1478, &extra2, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
fprintf(fd, "// sch_path: %s\n", filename);
verilog_stop? load_schematic(0,filename, 0) : load_schematic(1,filename, 0);
/* print verilog timescale and preprocessor directives 10102004 */
@ -467,32 +467,32 @@ void verilog_block_netlist(FILE *fd, int i)
if(!strcmp(get_tok_value( (xctx->inst[j].ptr+ xctx->sym)->prop_ptr, "verilog_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
my_strdup(1479, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
if( type && ( strcmp(type,"timescale")==0 || strcmp(type,"verilog_preprocessor")==0) )
{
str_tmp = get_tok_value( (xctx->inst[j].ptr+ xctx->sym)->prop_ptr, fmt_attr, 2);
if(!str_tmp[0] && strcmp(fmt_attr, "verilog_format"))
str_tmp = get_tok_value( (xctx->inst[j].ptr+ xctx->sym)->prop_ptr, "verilog_format", 2);
my_strdup(_ALLOC_ID_, &tmp_string, str_tmp);
my_strdup(1480, &tmp_string, str_tmp);
fprintf(fd, "%s\n", str_tmp ? translate(j, tmp_string) : "(NULL)");
}
}
my_strdup(_ALLOC_ID_, &verilogprefix,
my_strdup(1481, &verilogprefix,
get_tok_value(xctx->sym[i].prop_ptr, "verilogprefix", 0));
if(verilogprefix) {
my_strdup(_ALLOC_ID_, &symname, verilogprefix);
my_strcat(_ALLOC_ID_, &symname, skip_dir(xctx->sym[i].name));
my_strdup(1482, &symname, verilogprefix);
my_strcat(1483, &symname, skip_dir(xctx->sym[i].name));
} else {
my_strdup(_ALLOC_ID_, &symname, skip_dir(xctx->sym[i].name));
my_strdup(1484, &symname, skip_dir(xctx->sym[i].name));
}
my_free(_ALLOC_ID_, &verilogprefix);
my_free(1485, &verilogprefix);
fprintf(fd, "module %s (\n", symname);
my_free(_ALLOC_ID_, &symname);
my_free(1486, &symname);
/*print_generic(fd, "entity", i); */
dbg(1, "verilog_block_netlist(): entity ports\n");
@ -531,15 +531,15 @@ void verilog_block_netlist(FILE *fd, int i)
for(j=0;j<xctx->sym[i].rects[PINLAYER];j++)
{
if(strcmp(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"verilog_ignore",0), "true")) {
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(
my_strdup(1487, &sig_type,get_tok_value(
xctx->sym[i].rect[PINLAYER][j].prop_ptr,"verilog_type",0));
my_strdup(_ALLOC_ID_, &port_value,
my_strdup(1488, &port_value,
get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"value", 0) );
my_strdup(_ALLOC_ID_, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",0) );
my_strdup(1489, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",0) );
if(strcmp(dir_tmp,"in")){
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire"); /* 20070720 changed reg to wire */
if(!sig_type || sig_type[0]=='\0') my_strdup(1490, &sig_type,"wire"); /* 20070720 changed reg to wire */
} else {
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire");
if(!sig_type || sig_type[0]=='\0') my_strdup(1491, &sig_type,"wire");
}
str_tmp = get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"name",0);
if(!int_hash_lookup(&table, str_tmp, 1, XINSERT_NOREPLACE)) {
@ -574,7 +574,7 @@ void verilog_block_netlist(FILE *fd, int i)
if(xctx->netlist_count &&
!strcmp(get_tok_value(xctx->inst[l].prop_ptr, "only_toplevel", 0), "true")) continue;
my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
my_strdup(1492, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
if(type && !strcmp(type,"netlist_commands")) {
fprintf(fd, "%s\n", get_tok_value(xctx->inst[l].prop_ptr,"value", 0));
}
@ -585,13 +585,13 @@ void verilog_block_netlist(FILE *fd, int i)
}
fprintf(fd,"---- end user architecture code\n");
fprintf(fd, "endmodule\n");
my_free(_ALLOC_ID_, &dir_tmp);
my_free(_ALLOC_ID_, &sig_type);
my_free(_ALLOC_ID_, &port_value);
my_free(_ALLOC_ID_, &type);
my_free(_ALLOC_ID_, &tmp_string);
my_free(_ALLOC_ID_, &extra);
my_free(_ALLOC_ID_, &extra2);
my_free(1493, &dir_tmp);
my_free(1494, &sig_type);
my_free(1495, &port_value);
my_free(1496, &type);
my_free(1497, &tmp_string);
my_free(1498, &extra);
my_free(1499, &extra2);
} /* if(!sym_def[0]) */
if(split_f) {
int save;

View File

@ -63,7 +63,7 @@ static void vhdl_netlist(FILE *fd , int vhdl_stop)
if(!strcmp(get_tok_value( (xctx->inst[l].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
my_strdup(1500, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"attributes"))==0)
{
if(xctx->inst[l].prop_ptr) fprintf(fd, "\n%s\n", xctx->inst[l].prop_ptr);
@ -83,7 +83,7 @@ static void vhdl_netlist(FILE *fd , int vhdl_stop)
continue;
}
dbg(2, "vhdl_netlist(): into the netlisting loop\n");
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1501, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type &&
( !IS_LABEL_OR_PIN(type) &&
strcmp(type,"generic")&&
@ -106,7 +106,7 @@ static void vhdl_netlist(FILE *fd , int vhdl_stop)
}
}
}
if(type) my_free(_ALLOC_ID_, &type);
if(type) my_free(1502, &type);
dbg(1, "vhdl_netlist(): end\n");
if(!vhdl_stop && !xctx->netlist_count) redraw_hilights(0); /* draw_hilight_net(1); */
}
@ -167,7 +167,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1503, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"package"))==0)
{
if(xctx->inst[i].prop_ptr) { /* */
@ -186,7 +186,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1504, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"use"))==0)
{
if(xctx->inst[i].prop_ptr) fprintf(fd, "%s\n", xctx->inst[i].prop_ptr);
@ -255,9 +255,9 @@ void global_vhdl_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1505, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(1506, &sig_type,"std_logic");
my_strdup(1507, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"opin"))==0)
{
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
@ -276,9 +276,9 @@ void global_vhdl_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1508, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(1509, &sig_type,"std_logic");
my_strdup(1510, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"iopin"))==0)
{
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
@ -297,9 +297,9 @@ void global_vhdl_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1511, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(1512, &sig_type,"std_logic");
my_strdup(1513, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"ipin"))==0)
{
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
@ -319,7 +319,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1514, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"port_attributes"))==0)
{
if(xctx->inst[i].prop_ptr) fprintf(fd, "%s\n", xctx->inst[i].prop_ptr);
@ -339,7 +339,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
if( strcmp(get_tok_value(xctx->sym[j].prop_ptr,"vhdl_ignore",0),"true")==0 ) continue;
if(!xctx->sym[j].type || (strcmp(xctx->sym[j].type,"primitive")!=0 &&
strcmp(xctx->sym[j].type,"subcircuit")!=0)) continue;
my_strdup(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[j].name, ""));
my_strdup(1515, &abs_path, abs_sym_path(xctx->sym[j].name, ""));
if((
strcmp(xctx->sym[j].type,"subcircuit")==0 ||
strcmp(xctx->sym[j].type,"primitive")==0
@ -347,7 +347,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
)
{
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[j].name, 0));
my_strdup(1516, &subckt_name, get_cell(xctx->sym[j].name, 0));
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL) {
Int_hashtable table = {NULL, 0};
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
@ -360,12 +360,12 @@ void global_vhdl_netlist(int global) /* netlister driver */
for(i=0;i<xctx->sym[j].rects[PINLAYER];i++)
{
if(strcmp(get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"vhdl_ignore",0), "true")) {
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(
my_strdup(1517, &sig_type,get_tok_value(
xctx->sym[j].rect[PINLAYER][i].prop_ptr,"sig_type",0));
my_strdup(_ALLOC_ID_, &port_value,
my_strdup(1518, &port_value,
get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"value", 0) );
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
my_strdup(_ALLOC_ID_, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"dir",0) );
if(!sig_type || sig_type[0]=='\0') my_strdup(1519, &sig_type,"std_logic");
my_strdup(1520, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"dir",0) );
str_tmp = get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"name",0);
if(!int_hash_lookup(&table, str_tmp, 1, XINSERT_NOREPLACE)) {
if(!tmp) fprintf(fd, "port (\n");
@ -375,7 +375,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
fprintf(fd," := %s", port_value);
tmp=1;
}
my_free(_ALLOC_ID_, &dir_tmp);
my_free(1521, &dir_tmp);
}
}
int_hash_free(&table);
@ -383,10 +383,10 @@ void global_vhdl_netlist(int global) /* netlister driver */
fprintf(fd, "end component ;\n\n");
}
}
my_free(_ALLOC_ID_, &abs_path);
my_free(1522, &abs_path);
}
str_hash_free(&subckt_table);
my_free(_ALLOC_ID_, &subckt_name);
my_free(1523, &subckt_name);
dbg(1, "global_vhdl_netlist(): netlisting top level\n");
vhdl_netlist(fd, 0);
@ -398,7 +398,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
if(!strcmp(get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(1524, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if(type && !strcmp(type,"netlist_commands")) {
fprintf(fd, "%s\n", get_tok_value(xctx->inst[i].prop_ptr,"value", 0));
}
@ -426,7 +426,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
/* warning if two symbols perfectly overlapped */
warning_overlapped_symbols(0);
/* preserve current level instance flags before descending hierarchy for netlisting, restore later */
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
stored_flags = my_calloc(1525, xctx->instances, sizeof(unsigned int));
for(i=0;i<xctx->instances;i++) stored_flags[i] = xctx->inst[i].color;
if(global)
@ -438,8 +438,8 @@ void global_vhdl_netlist(int global) /* netlister driver */
/* reload data without popping undo stack, this populates embedded symbols if any */
xctx->pop_undo(2, 0);
/* link_symbols_to_instances(-1); */ /* done in xctx->pop_undo() */
my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], "->netlisting");
my_strdup(1526, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(1527, &xctx->sch_path[xctx->currsch+1], "->netlisting");
xctx->sch_path_hash[xctx->currsch+1] = 0;
xctx->currsch++;
@ -449,11 +449,11 @@ void global_vhdl_netlist(int global) /* netlister driver */
{
if( strcmp(get_tok_value(xctx->sym[i].prop_ptr,"vhdl_ignore",0),"true")==0 ) continue;
if(!xctx->sym[i].type) continue;
my_strdup(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
my_strdup(1528, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path))
{
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[i].name, 0));
my_strdup(1529, &subckt_name, get_cell(xctx->sym[i].name, 0));
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL)
{
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
@ -466,10 +466,10 @@ void global_vhdl_netlist(int global) /* netlister driver */
vhdl_block_netlist(fd, i);
}
}
my_free(_ALLOC_ID_, &abs_path);
my_free(1530, &abs_path);
}
str_hash_free(&subckt_table);
my_free(_ALLOC_ID_, &subckt_name);
my_free(1531, &subckt_name);
my_strncpy(xctx->sch[xctx->currsch] , "", S(xctx->sch[xctx->currsch]));
xctx->currsch--;
unselect_all(1);
@ -484,7 +484,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
for(i=0;i<xctx->instances; i++) xctx->inst[i].color = stored_flags[i];
propagate_hilights(1, 0, XINSERT_NOREPLACE);
draw_hilight_net(1);
my_free(_ALLOC_ID_, &stored_flags);
my_free(1532, &stored_flags);
dbg(1, "global_vhdl_netlist(): starting awk on netlist!\n");
if(!split_f) {
fclose(fd);
@ -498,9 +498,9 @@ void global_vhdl_netlist(int global) /* netlister driver */
}
if(!debug_var) xunlink(netl_filename);
}
my_free(_ALLOC_ID_, &sig_type);
my_free(_ALLOC_ID_, &type);
my_free(_ALLOC_ID_, &port_value);
my_free(1533, &sig_type);
my_free(1534, &type);
my_free(1535, &port_value);
xctx->netlist_count = 0;
}
@ -584,12 +584,12 @@ void vhdl_block_netlist(FILE *fd, int i)
for(j=0;j<xctx->sym[i].rects[PINLAYER];j++)
{
if(strcmp(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"vhdl_ignore",0), "true")) {
my_strdup(_ALLOC_ID_, &sig_type,
my_strdup(1536, &sig_type,
get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"sig_type",0));
my_strdup(_ALLOC_ID_, &port_value,
my_strdup(1537, &port_value,
get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"value", 0) );
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
my_strdup(_ALLOC_ID_, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",0) );
if(!sig_type || sig_type[0]=='\0') my_strdup(1538, &sig_type,"std_logic");
my_strdup(1539, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",0) );
str_tmp = get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"name",0);
if(!int_hash_lookup(&table, str_tmp, 1, XINSERT_NOREPLACE)) {
if(tmp) fprintf(fd, " ;\n");
@ -600,7 +600,7 @@ void vhdl_block_netlist(FILE *fd, int i)
fprintf(fd," := %s", port_value);
tmp=1;
}
my_free(_ALLOC_ID_, &dir_tmp);
my_free(1540, &dir_tmp);
}
}
int_hash_free(&table);
@ -614,7 +614,7 @@ void vhdl_block_netlist(FILE *fd, int i)
if(!strcmp(get_tok_value( (xctx->inst[l].ptr+ xctx->sym)->prop_ptr, "vhdl_ignore",0 ), "true") ) {
continue;
}
my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
my_strdup(1541, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"port_attributes"))==0)
{
if(xctx->inst[l].prop_ptr) fprintf(fd, "%s\n", xctx->inst[l].prop_ptr);
@ -637,7 +637,7 @@ void vhdl_block_netlist(FILE *fd, int i)
if(!xctx->sym[j].type || (strcmp(xctx->sym[j].type,"primitive")!=0 &&
strcmp(xctx->sym[j].type,"subcircuit")!=0))
continue;
my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
my_strdup2(1542, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
if(( strcmp(xctx->sym[j].type,"subcircuit")==0 || strcmp(xctx->sym[j].type,"primitive")==0) &&
check_lib(1, abs_path)
) {
@ -665,19 +665,19 @@ void vhdl_block_netlist(FILE *fd, int i)
for(k=0;k<xctx->sym[j].rects[PINLAYER];k++)
{
if(strcmp(get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"vhdl_ignore",0), "true")) {
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(
my_strdup(1543, &sig_type,get_tok_value(
xctx->sym[j].rect[PINLAYER][k].prop_ptr,"sig_type",0));
my_strdup(_ALLOC_ID_, &port_value,
my_strdup(1544, &port_value,
get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"value", 0) );
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"std_logic");
my_strdup(_ALLOC_ID_, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"dir",0) );
if(!sig_type || sig_type[0]=='\0') my_strdup(1545, &sig_type,"std_logic");
my_strdup(1546, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"dir",0) );
str_tmp = get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"name",0);
if(!int_hash_lookup(&table, str_tmp, 1, XINSERT_NOREPLACE)) {
if(!tmp) fprintf(fd, "port (\n");
if(tmp) fprintf(fd, " ;\n");
fprintf(fd," %s : %s %s",str_tmp, dir_tmp ? dir_tmp : "<NULL>", sig_type);
my_free(_ALLOC_ID_, &dir_tmp);
my_free(1547, &dir_tmp);
if(port_value &&port_value[0]) fprintf(fd," := %s", port_value);
tmp=1;
}
@ -689,7 +689,7 @@ void vhdl_block_netlist(FILE *fd, int i)
}
} /* for(j...) */
} /* if(!vhdl_stop) */
my_free(_ALLOC_ID_, &abs_path);
my_free(1548, &abs_path);
dbg(1, "vhdl_block_netlist(): netlisting %s\n", skip_dir( xctx->sch[xctx->currsch]));
vhdl_netlist(fd, vhdl_stop);
fprintf(fd,"//// begin user architecture code\n");
@ -703,7 +703,7 @@ void vhdl_block_netlist(FILE *fd, int i)
if(xctx->netlist_count &&
!strcmp(get_tok_value(xctx->inst[l].prop_ptr, "only_toplevel", 0), "true")) continue;
my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
my_strdup(1549, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
if(type && !strcmp(type,"netlist_commands")) {
fprintf(fd, "%s\n", get_tok_value(xctx->inst[l].prop_ptr,"value", 0));
}
@ -711,9 +711,9 @@ void vhdl_block_netlist(FILE *fd, int i)
if(xctx->schvhdlprop && xctx->schvhdlprop[0]) fprintf(fd, "%s\n", xctx->schvhdlprop);
fprintf(fd, "end arch_%s ;\n\n", skip_dir(xctx->sym[i].name) ); /* skip_dir( xctx->sch[xctx->currsch]) ); */
my_free(_ALLOC_ID_, &sig_type);
my_free(_ALLOC_ID_, &port_value);
my_free(_ALLOC_ID_, &type);
my_free(1550, &sig_type);
my_free(1551, &port_value);
my_free(1552, &type);
} /* if(!sym_def[0]) */
if(split_f) {
int save;

View File

@ -290,7 +290,7 @@ static void init_color_array(double dim, double dim_bg)
if(g>0xff) g=0xff;
if(b>0xff) b=0xff;
my_snprintf(s, S(s), "#%02x%02x%02x", r, g, b);
my_strdup(_ALLOC_ID_, &xctx->color_array[i], s);
my_strdup(1553, &xctx->color_array[i], s);
}
}
@ -322,64 +322,64 @@ static void free_xschem_data()
xctx->delete_undo();
free_simdata();
my_free(_ALLOC_ID_, &xctx->node_table);
my_free(_ALLOC_ID_, &xctx->inst_table);
my_free(_ALLOC_ID_, &xctx->hilight_table);
my_free(1554, &xctx->node_table);
my_free(1555, &xctx->inst_table);
my_free(1556, &xctx->hilight_table);
my_free(_ALLOC_ID_, &xctx->wire);
my_free(_ALLOC_ID_, &xctx->text);
my_free(_ALLOC_ID_, &xctx->inst);
my_free(1557, &xctx->wire);
my_free(1558, &xctx->text);
my_free(1559, &xctx->inst);
for(i=0;i<cadlayers;i++) {
my_free(_ALLOC_ID_, &xctx->rect[i]);
my_free(_ALLOC_ID_, &xctx->line[i]);
my_free(_ALLOC_ID_, &xctx->poly[i]);
my_free(_ALLOC_ID_, &xctx->arc[i]);
my_free(1560, &xctx->rect[i]);
my_free(1561, &xctx->line[i]);
my_free(1562, &xctx->poly[i]);
my_free(1563, &xctx->arc[i]);
}
for(i=0;i<xctx->maxs;i++) {
my_free(_ALLOC_ID_, &xctx->sym[i].line);
my_free(_ALLOC_ID_, &xctx->sym[i].rect);
my_free(_ALLOC_ID_, &xctx->sym[i].arc);
my_free(_ALLOC_ID_, &xctx->sym[i].poly);
my_free(_ALLOC_ID_, &xctx->sym[i].lines);
my_free(_ALLOC_ID_, &xctx->sym[i].polygons);
my_free(_ALLOC_ID_, &xctx->sym[i].arcs);
my_free(_ALLOC_ID_, &xctx->sym[i].rects);
my_free(1564, &xctx->sym[i].line);
my_free(1565, &xctx->sym[i].rect);
my_free(1566, &xctx->sym[i].arc);
my_free(1567, &xctx->sym[i].poly);
my_free(1568, &xctx->sym[i].lines);
my_free(1569, &xctx->sym[i].polygons);
my_free(1570, &xctx->sym[i].arcs);
my_free(1571, &xctx->sym[i].rects);
}
my_free(_ALLOC_ID_, &xctx->sym);
my_free(_ALLOC_ID_, &xctx->rect);
my_free(_ALLOC_ID_, &xctx->line);
my_free(_ALLOC_ID_, &xctx->poly);
my_free(_ALLOC_ID_, &xctx->arc);
my_free(_ALLOC_ID_, &xctx->rects);
my_free(_ALLOC_ID_, &xctx->polygons);
my_free(_ALLOC_ID_, &xctx->arcs);
my_free(_ALLOC_ID_, &xctx->lines);
my_free(_ALLOC_ID_, &xctx->maxr);
my_free(_ALLOC_ID_, &xctx->maxp);
my_free(_ALLOC_ID_, &xctx->maxa);
my_free(_ALLOC_ID_, &xctx->maxl);
my_free(_ALLOC_ID_, &xctx->sel_array);
my_free(1572, &xctx->sym);
my_free(1573, &xctx->rect);
my_free(1574, &xctx->line);
my_free(1575, &xctx->poly);
my_free(1576, &xctx->arc);
my_free(1577, &xctx->rects);
my_free(1578, &xctx->polygons);
my_free(1579, &xctx->arcs);
my_free(1580, &xctx->lines);
my_free(1581, &xctx->maxr);
my_free(1582, &xctx->maxp);
my_free(1583, &xctx->maxa);
my_free(1584, &xctx->maxl);
my_free(1585, &xctx->sel_array);
for(i=0;i<CADMAXHIER;i++) {
if(xctx->sch_path[i]) my_free(_ALLOC_ID_, &xctx->sch_path[i]);
if(xctx->hier_attr[i].templ) my_free(_ALLOC_ID_, &xctx->hier_attr[i].templ);
if(xctx->hier_attr[i].prop_ptr) my_free(_ALLOC_ID_, &xctx->hier_attr[i].prop_ptr);
if(xctx->hier_attr[i].symname) my_free(_ALLOC_ID_, &xctx->hier_attr[i].symname);
if(xctx->sch_path[i]) my_free(1586, &xctx->sch_path[i]);
if(xctx->hier_attr[i].templ) my_free(1587, &xctx->hier_attr[i].templ);
if(xctx->hier_attr[i].prop_ptr) my_free(1588, &xctx->hier_attr[i].prop_ptr);
if(xctx->hier_attr[i].symname) my_free(1589, &xctx->hier_attr[i].symname);
}
my_free(_ALLOC_ID_, &xctx->gridpoint);
my_free(_ALLOC_ID_, &xctx->biggridpoint);
my_free(_ALLOC_ID_, &xctx->gc);
my_free(_ALLOC_ID_, &xctx->gcstipple);
for(i=0;i<cadlayers;i++) my_free(_ALLOC_ID_, &xctx->color_array[i]);
my_free(_ALLOC_ID_, &xctx->color_array);
my_free(_ALLOC_ID_, &xctx->enable_layer);
my_free(_ALLOC_ID_, &xctx->active_layer);
my_free(_ALLOC_ID_, &xctx->top_path);
my_free(_ALLOC_ID_, &xctx->current_win_path);
my_free(_ALLOC_ID_, &xctx->fill_type);
my_free(_ALLOC_ID_, &xctx->format);
if(xctx->inst_redraw_table) my_free(_ALLOC_ID_, &xctx->inst_redraw_table);
my_free(_ALLOC_ID_, &xctx);
my_free(1590, &xctx->gridpoint);
my_free(1591, &xctx->biggridpoint);
my_free(1592, &xctx->gc);
my_free(1593, &xctx->gcstipple);
for(i=0;i<cadlayers;i++) my_free(1594, &xctx->color_array[i]);
my_free(1595, &xctx->color_array);
my_free(1596, &xctx->enable_layer);
my_free(1597, &xctx->active_layer);
my_free(1598, &xctx->top_path);
my_free(1599, &xctx->current_win_path);
my_free(1600, &xctx->fill_type);
my_free(1601, &xctx->format);
if(xctx->inst_redraw_table) my_free(1602, &xctx->inst_redraw_table);
my_free(1603, &xctx);
}
static void create_gc(void)
@ -409,7 +409,7 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
{
int i, j;
xctx = my_calloc(_ALLOC_ID_, 1, sizeof(Xschem_ctx));
xctx = my_calloc(1604, 1, sizeof(Xschem_ctx));
xctx->cur_undo_ptr = 0;
xctx->head_undo_ptr = 0;
xctx->tail_undo_ptr = 0;
@ -498,10 +498,10 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
xctx->inst_spatial_table[i][j] = NULL;
}
}
xctx->node_table = my_calloc(_ALLOC_ID_, HASHSIZE, sizeof(Node_hashentry *));
xctx->node_table = my_calloc(1605, HASHSIZE, sizeof(Node_hashentry *));
xctx->inst_table.table = NULL;
xctx->inst_table.size = 0;
xctx->hilight_table = my_calloc(_ALLOC_ID_, HASHSIZE, sizeof(Hilight_hashentry *));
xctx->hilight_table = my_calloc(1606, HASHSIZE, sizeof(Hilight_hashentry *));
xctx->inst_redraw_table = NULL;
xctx->inst_redraw_table_size = 0;
@ -551,30 +551,30 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
xctx->hier_attr[i].symname = NULL;
xctx->hier_attr[i].fd = NULL;
}
my_strdup(_ALLOC_ID_, &xctx->sch_path[0],".");
my_strdup(1607, &xctx->sch_path[0],".");
xctx->sch_inst_number[0] = 1;
xctx->maxt=CADMAXTEXT;
xctx->maxw=CADMAXWIRES;
xctx->maxi=ELEMINST;
xctx->maxs=ELEMDEF;
xctx->text=my_calloc(_ALLOC_ID_, xctx->maxt,sizeof(xText));
xctx->wire=my_calloc(_ALLOC_ID_, xctx->maxw,sizeof(xWire));
xctx->inst=my_calloc(_ALLOC_ID_, xctx->maxi , sizeof(xInstance) );
xctx->sym=my_calloc(_ALLOC_ID_, xctx->maxs , sizeof(xSymbol) );
xctx->text=my_calloc(1608, xctx->maxt,sizeof(xText));
xctx->wire=my_calloc(1609, xctx->maxw,sizeof(xWire));
xctx->inst=my_calloc(1610, xctx->maxi , sizeof(xInstance) );
xctx->sym=my_calloc(1611, xctx->maxs , sizeof(xSymbol) );
for(i=0;i<xctx->maxs;i++) {
xctx->sym[i].line=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
xctx->sym[i].poly=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
xctx->sym[i].arc=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
xctx->sym[i].rect=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
xctx->sym[i].lines=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].rects=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].arcs=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].polygons=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->sym[i].line=my_calloc(1612, cadlayers, sizeof(xLine *));
xctx->sym[i].poly=my_calloc(1613, cadlayers, sizeof(xPoly *));
xctx->sym[i].arc=my_calloc(1614, cadlayers, sizeof(xArc *));
xctx->sym[i].rect=my_calloc(1615, cadlayers, sizeof(xRect *));
xctx->sym[i].lines=my_calloc(1616, cadlayers, sizeof(int));
xctx->sym[i].rects=my_calloc(1617, cadlayers, sizeof(int));
xctx->sym[i].arcs=my_calloc(1618, cadlayers, sizeof(int));
xctx->sym[i].polygons=my_calloc(1619, cadlayers, sizeof(int));
}
xctx->maxr=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->maxa=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->maxp=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->maxl=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->maxr=my_calloc(1620, cadlayers, sizeof(int));
xctx->maxa=my_calloc(1621, cadlayers, sizeof(int));
xctx->maxp=my_calloc(1622, cadlayers, sizeof(int));
xctx->maxl=my_calloc(1623, cadlayers, sizeof(int));
for(i=0;i<cadlayers;i++)
{
xctx->maxr[i]=CADMAXOBJECTS;
@ -582,25 +582,25 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
xctx->maxl[i]=CADMAXOBJECTS;
xctx->maxa[i]=CADMAXOBJECTS;
}
xctx->rect=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
xctx->line=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
xctx->poly=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
xctx->arc=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
xctx->rect=my_calloc(1624, cadlayers, sizeof(xRect *));
xctx->line=my_calloc(1625, cadlayers, sizeof(xLine *));
xctx->poly=my_calloc(1626, cadlayers, sizeof(xPoly *));
xctx->arc=my_calloc(1627, cadlayers, sizeof(xArc *));
for(i=0;i<cadlayers;i++)
{
xctx->rect[i]=my_calloc(_ALLOC_ID_, xctx->maxr[i],sizeof(xRect));
xctx->arc[i]=my_calloc(_ALLOC_ID_, xctx->maxa[i],sizeof(xArc));
xctx->poly[i]=my_calloc(_ALLOC_ID_, xctx->maxp[i],sizeof(xPoly));
xctx->line[i]=my_calloc(_ALLOC_ID_, xctx->maxl[i],sizeof(xLine));
xctx->rect[i]=my_calloc(1628, xctx->maxr[i],sizeof(xRect));
xctx->arc[i]=my_calloc(1629, xctx->maxa[i],sizeof(xArc));
xctx->poly[i]=my_calloc(1630, xctx->maxp[i],sizeof(xPoly));
xctx->line[i]=my_calloc(1631, xctx->maxl[i],sizeof(xLine));
}
xctx->rects=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->polygons=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->arcs=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->lines=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->rects=my_calloc(1632, cadlayers, sizeof(int));
xctx->polygons=my_calloc(1633, cadlayers, sizeof(int));
xctx->arcs=my_calloc(1634, cadlayers, sizeof(int));
xctx->lines=my_calloc(1635, cadlayers, sizeof(int));
xctx->maxsel=MAXGROUP;
xctx->sel_array=my_calloc(_ALLOC_ID_, xctx->maxsel, sizeof(Selected));
xctx->biggridpoint=(XSegment*)my_calloc(_ALLOC_ID_, CADMAXGRIDPOINTS,sizeof(XSegment));
xctx->gridpoint=(XPoint*)my_calloc(_ALLOC_ID_, CADMAXGRIDPOINTS,sizeof(XPoint));
xctx->sel_array=my_calloc(1636, xctx->maxsel, sizeof(Selected));
xctx->biggridpoint=(XSegment*)my_calloc(1637, CADMAXGRIDPOINTS,sizeof(XSegment));
xctx->gridpoint=(XPoint*)my_calloc(1638, CADMAXGRIDPOINTS,sizeof(XPoint));
xctx->enable_drill = 0;
xctx->prev_set_modify = -1;
xctx->pending_fullzoom = 0;
@ -620,21 +620,21 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
xctx->edit_sym_i = -1;
xctx->netlist_commands = 0;
xctx->draw_pixmap = 1;
xctx->gc=my_calloc(_ALLOC_ID_, cadlayers, sizeof(GC));
xctx->gcstipple=my_calloc(_ALLOC_ID_, cadlayers, sizeof(GC));
xctx->color_array=my_calloc(_ALLOC_ID_, cadlayers, sizeof(char*));
xctx->enable_layer=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->gc=my_calloc(1639, cadlayers, sizeof(GC));
xctx->gcstipple=my_calloc(1640, cadlayers, sizeof(GC));
xctx->color_array=my_calloc(1641, cadlayers, sizeof(char*));
xctx->enable_layer=my_calloc(1642, cadlayers, sizeof(int));
xctx->n_active_layers = 0;
xctx->active_layer=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->active_layer=my_calloc(1643, cadlayers, sizeof(int));
xctx->hide_symbols = 0;
xctx->netlist_type = CAD_SPICE_NETLIST;
xctx->format = NULL; /* custom format string for netlist, otherwise use
* "format", "verilog_format", "vhdl_format", "tedax_format" */
xctx->top_path = NULL;
xctx->current_win_path = NULL;
my_strdup2(_ALLOC_ID_, &xctx->top_path, top_path);
my_strdup2(_ALLOC_ID_, &xctx->current_win_path, win_path);
xctx->fill_type=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
my_strdup2(1644, &xctx->top_path, top_path);
my_strdup2(1645, &xctx->current_win_path, win_path);
xctx->fill_type=my_calloc(1646, cadlayers, sizeof(int));
xctx->case_insensitive = 0;
xctx->show_hidden_texts = 0;
xctx->x_strcmp = strcmp;
@ -697,7 +697,7 @@ int compare_schematics(const char *f)
/* HASH SCHEMATIC 1 */
for(i = 0; i < xctx->instances; i++) {
l = 1024 + strlen(xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
my_realloc(_ALLOC_ID_, &s, l);
my_realloc(1647, &s, l);
my_snprintf(s, l, "C %s %g %g %d %d %s", xctx->inst[i].name,
xctx->inst[i].x0, xctx->inst[i].y0, xctx->inst[i].rot, xctx->inst[i].flip,
xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
@ -706,7 +706,7 @@ int compare_schematics(const char *f)
for(i=0;i<xctx->wires;i++)
{
l =1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : "");
my_realloc(_ALLOC_ID_, &s, l);
my_realloc(1648, &s, l);
my_snprintf(s, l, "N %g %g %g %g", xctx->wire[i].x1, xctx->wire[i].y1,
xctx->wire[i].x2, xctx->wire[i].y2);
int_hash_lookup(&table1, s, i, XINSERT_NOREPLACE);
@ -759,7 +759,7 @@ int compare_schematics(const char *f)
/* HASH SCHEMATIC 2 , CHECK SCHEMATIC 2 WITH SCHEMATIC 1 */
for(i = 0; i < xctx->instances; i++) {
l = 1024 + strlen(xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
my_realloc(_ALLOC_ID_, &s, l);
my_realloc(1649, &s, l);
my_snprintf(s, l, "C %s %g %g %d %d %s", xctx->inst[i].name,
xctx->inst[i].x0, xctx->inst[i].y0, xctx->inst[i].rot, xctx->inst[i].flip,
xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
@ -776,7 +776,7 @@ int compare_schematics(const char *f)
for(i=0;i<xctx->wires;i++)
{
l =1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : "");
my_realloc(_ALLOC_ID_, &s, l);
my_realloc(1650, &s, l);
my_snprintf(s, l, "N %g %g %g %g", xctx->wire[i].x1, xctx->wire[i].y1,
xctx->wire[i].x2, xctx->wire[i].y2);
int_hash_lookup(&table2, s, i, XINSERT_NOREPLACE);
@ -805,7 +805,7 @@ int compare_schematics(const char *f)
/* CHECK SCHEMATIC 1 WITH SCHEMATIC 2*/
for(i = 0; i < xctx->instances; i++) {
l = 1024 + strlen(xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
my_realloc(_ALLOC_ID_,&s, l);
my_realloc(1651,&s, l);
my_snprintf(s, l, "C %s %g %g %d %d %s", xctx->inst[i].name,
xctx->inst[i].x0, xctx->inst[i].y0, xctx->inst[i].rot, xctx->inst[i].flip,
xctx->inst[i].prop_ptr ? xctx->inst[i].prop_ptr : "");
@ -819,7 +819,7 @@ int compare_schematics(const char *f)
for(i=0;i<xctx->wires;i++)
{
l = 1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : "");
my_realloc(_ALLOC_ID_, &s, l);
my_realloc(1652, &s, l);
my_snprintf(s, l, "N %g %g %g %g", xctx->wire[i].x1, xctx->wire[i].y1,
xctx->wire[i].x2, xctx->wire[i].y2);
found = int_hash_lookup(&table2, s, i, XLOOKUP);
@ -833,7 +833,7 @@ int compare_schematics(const char *f)
int_hash_free(&table2);
rebuild_selected_array();
draw_selection(xctx->gc[SELLAYER], 0);
my_free(_ALLOC_ID_, &s);
my_free(1653, &s);
return ret;
}
@ -863,18 +863,18 @@ static void xwin_exit(void)
#else
for(i = 0; i < cadlayers; i++) Tk_FreePixmap(display, pixmap[i]);
#endif
my_free(_ALLOC_ID_, &pixmap);
my_free(1654, &pixmap);
}
dbg(1, "xwin_exit(): clearing drawing data structures\n");
/* global context - graphic preferences/settings */
for(i=0;i<cadlayers;i++) {
my_free(_ALLOC_ID_, &pixdata[i]);
my_free(1655, &pixdata[i]);
}
my_free(_ALLOC_ID_, &pixdata);
my_free(_ALLOC_ID_, &cli_opt_tcl_command);
my_free(_ALLOC_ID_, &cli_opt_preinit_command);
my_free(_ALLOC_ID_, &cli_opt_tcl_post_command);
my_free(1656, &pixdata);
my_free(1657, &cli_opt_tcl_command);
my_free(1658, &cli_opt_preinit_command);
my_free(1659, &cli_opt_tcl_post_command);
clear_expandlabel_data();
get_sym_template(NULL, NULL); /* clear static data in function */
list_tokens(NULL, 0); /* clear static data in function */
@ -885,17 +885,17 @@ static void xwin_exit(void)
tcl_hook2(NULL); /* clear static data in function */
save_ascii_string(NULL, NULL, 0); /* clear static data in function */
dbg(1, "xwin_exit(): removing font\n");
for(i=0;i<127;i++) my_free(_ALLOC_ID_, &character[i]);
for(i=0;i<127;i++) my_free(1660, &character[i]);
dbg(1, "xwin_exit(): closed display\n");
my_strncpy(cli_opt_filename, "", S(cli_opt_filename));
my_free(_ALLOC_ID_, &xschem_executable);
my_free(1661, &xschem_executable);
record_global_node(2, NULL, NULL); /* delete global node array */
dbg(1, "xwin_exit(): deleted undo buffer\n");
/* delete cmdline stuff */
for(i = 0 ; i < cli_opt_argc; i++) {
my_free(_ALLOC_ID_, &cli_opt_argv[i]);
my_free(1662, &cli_opt_argv[i]);
}
my_free(_ALLOC_ID_, &cli_opt_argv);
my_free(1663, &cli_opt_argv);
if(errfp!=stderr) fclose(errfp);
errfp=stderr;
if(!detach) printf("\n");
@ -1142,7 +1142,7 @@ void preview_window(const char *what, const char *win_path, const char *fname)
if(current_file) {
delete_schematic_data(1);
}
my_strdup(_ALLOC_ID_, &current_file, fname);
my_strdup(1664, &current_file, fname);
xctx = NULL; /* reset for preview */
alloc_xschem_data(".dialog", ".dialog.drw"); /* alloc data into xctx */
init_pixdata(); /* populate xctx->fill_type array that is used in create_gc() to set fill styles */
@ -1168,7 +1168,7 @@ void preview_window(const char *what, const char *win_path, const char *fname)
}
Tk_DestroyWindow(tkpre_window);
my_free(_ALLOC_ID_, &current_file);
my_free(1665, &current_file);
xctx = save_xctx; /* restore schematic */
save_xctx = NULL;
set_modify(-1);
@ -2017,22 +2017,22 @@ int Tcl_AppInit(Tcl_Interp *inter)
if (atoi(tclresult()) == 0)
{
running_in_src_dir = 1; /* no bin, so it's running in Visual studio source directory*/
my_strdup(_ALLOC_ID_, &up_hier, "../../..");
my_strdup(1666, &up_hier, "../../..");
}
else my_strdup(_ALLOC_ID_, &up_hier, "..");
/* my_strcat(_ALLOC_ID_, &win_xschem_library_path, "."); */
else my_strdup(1667, &up_hier, "..");
/* my_strcat(1668, &win_xschem_library_path, "."); */
for (i = 0; i < WIN_XSCHEM_LIBRARY_PATH_NUM; ++i) {
my_snprintf(tmp, S(tmp),"%s/%s/%s", install_dir, up_hier, WIN_XSCHEM_LIBRARY_PATH[i]);
if (i > 0) my_strcat(_ALLOC_ID_, &win_xschem_library_path, "\;");
my_strcat(_ALLOC_ID_, &win_xschem_library_path, tmp);
if (i > 0) my_strcat(1669, &win_xschem_library_path, "\;");
my_strcat(1670, &win_xschem_library_path, tmp);
}
my_snprintf(tmp, S(tmp), "set tmp2 {%s}; "
"while {[regsub {([^/]*\\.*[^./]+[^/]*)/\\.\\./?} $tmp2 {} tmp2]} {}; ", win_xschem_library_path);
const char *result2 = tcleval(tmp);
const char *win_xschem_library_path_clean = tclgetvar("tmp2");
tclsetvar("XSCHEM_LIBRARY_PATH", win_xschem_library_path_clean);
my_free(_ALLOC_ID_, &win_xschem_library_path);
my_free(_ALLOC_ID_, &up_hier);
my_free(1671, &win_xschem_library_path);
my_free(1672, &up_hier);
char *xschem_sharedir=NULL;
if ((xschem_sharedir=getenv("XSCHEM_SHAREDIR")) != NULL) {
if (!stat(xschem_sharedir, &buf)) {
@ -2219,7 +2219,7 @@ int Tcl_AppInit(Tcl_Interp *inter)
/* */
/* resolve absolute pathname of xschem (argv[0]) for future usage */
my_strdup(_ALLOC_ID_, &xschem_executable, get_file_path(xschem_executable));
my_strdup(1673, &xschem_executable, get_file_path(xschem_executable));
dbg(1, "Tcl_AppInit(): resolved xschem_executable=%s\n", xschem_executable);
@ -2249,12 +2249,12 @@ int Tcl_AppInit(Tcl_Interp *inter)
alloc_xschem_data("", ".drw");
/* global context / graphic preferences/settings */
pixdata=my_calloc(_ALLOC_ID_, cadlayers, sizeof(char*));
pixdata=my_calloc(1674, cadlayers, sizeof(char*));
for(i=0;i<cadlayers;i++)
{
pixdata[i]=my_calloc(_ALLOC_ID_, 32, sizeof(char));
pixdata[i]=my_calloc(1675, 32, sizeof(char));
}
if(has_x) pixmap=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Pixmap));
if(has_x) pixmap=my_calloc(1676, cadlayers, sizeof(Pixmap));
my_strncpy(xctx->plotfile, cli_opt_plotfile, S(xctx->plotfile));
xctx->draw_window = tclgetintvar("draw_window");

View File

@ -368,7 +368,7 @@ do { \
register size_t __str_alloc_tmp__ = add; \
if( __str_alloc_tmp__ >= *size) { \
*size = __str_alloc_tmp__ + CADCHUNKALLOC; \
my_realloc(_ALLOC_ID_, dest_string, *size); \
my_realloc(1677, dest_string, *size); \
} \
} while(0)