From 391464bab95dba48e1cfae409894676793c5dbe2 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 6 Sep 2024 22:19:36 +0200 Subject: [PATCH] fix another small memory leak due to tclvareval("xschem exit...")--> use tcleval() --- src/actions.c | 392 +++++++++--------- src/callback.c | 142 +++---- src/check.c | 28 +- src/draw.c | 300 +++++++------- src/editprop.c | 142 +++---- src/expandlabel.y | 102 ++--- src/findnet.c | 6 +- src/font.c | 4 +- src/hash_iterator.c | 12 +- src/hilight.c | 248 ++++++------ src/in_memory_undo.c | 294 +++++++------- src/main.c | 6 +- src/move.c | 50 +-- src/netlist.c | 156 ++++---- src/node_hash.c | 68 ++-- src/options.c | 6 +- src/parselabel.l | 26 +- src/paste.c | 30 +- src/psprint.c | 28 +- src/save.c | 514 ++++++++++++------------ src/scheduler.c | 200 +++++----- src/select.c | 48 +-- src/spice_netlist.c | 176 ++++----- src/store.c | 34 +- src/svgdraw.c | 28 +- src/tedax_netlist.c | 30 +- src/token.c | 894 +++++++++++++++++++++--------------------- src/verilog_netlist.c | 122 +++--- src/vhdl_netlist.c | 110 +++--- src/xinit.c | 230 +++++------ src/xschem.h | 2 +- 31 files changed, 2219 insertions(+), 2209 deletions(-) diff --git a/src/actions.c b/src/actions.c index 83e3f5be..7d46442a 100644 --- a/src/actions.c +++ b/src/actions.c @@ -52,11 +52,11 @@ unsigned int hash_file(const char *f, int skip_path_lines) * skip also .include /path/to/some/file */ if(skip_path_lines && n > 14) { if(!strncmp(line+2, " sch_path: ", 11) || !strncmp(line+2, " sym_path: ", 11) ) { - my_free(_ALLOC_ID_, &line); + my_free(0, &line); continue; } if(!strncmp(line, ".include ", 9) || !strncmp(line, ".INCLUDE ", 9) ) { - my_free(_ALLOC_ID_, &line); + my_free(1, &line); continue; } } @@ -73,7 +73,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); } /* while(line ....) */ if(cr) h += (h << 5) + '\r'; /* file ends with \r not followed by \n: keep it */ fclose(fd); @@ -122,7 +122,7 @@ const char *get_text_floater(int i) txt_ptr = xctx->text[i].floater_ptr; } else { /* cache floater translated text to avoid re-evaluating every time schematic is drawn */ - my_strdup2(_ALLOC_ID_, &xctx->text[i].floater_ptr, translate(inst, xctx->text[i].txt_ptr)); + my_strdup2(3, &xctx->text[i].floater_ptr, translate(inst, xctx->text[i].txt_ptr)); txt_ptr = xctx->text[i].floater_ptr; } dbg(1, "floater: %s\n",txt_ptr); @@ -131,8 +131,8 @@ const char *get_text_floater(int i) * (but name=something or floater=something attribute must be present) and text * matches tcleval(...) or contains '@' */ if(strstr(txt_ptr, "tcleval(") == txt_ptr || strchr(txt_ptr, '@')) { - /* my_strdup2(_ALLOC_ID_, &xctx->text[i].floater_ptr, tcl_hook2(xctx->text[i].txt_ptr)); */ - my_strdup2(_ALLOC_ID_, &xctx->text[i].floater_ptr, translate(-1, xctx->text[i].txt_ptr)); + /* my_strdup2(4, &xctx->text[i].floater_ptr, tcl_hook2(xctx->text[i].txt_ptr)); */ + my_strdup2(5, &xctx->text[i].floater_ptr, translate(-1, xctx->text[i].txt_ptr)); txt_ptr = xctx->text[i].floater_ptr; } } @@ -188,7 +188,7 @@ int set_modify(int mod) for(i = 0; i < xctx->texts; i++) if(xctx->text[i].flags & TEXT_FLOATER) { floaters++; - my_free(_ALLOC_ID_, &xctx->text[i].floater_ptr); /* clear floater cached value */ + my_free(6, &xctx->text[i].floater_ptr); /* clear floater cached value */ } int_hash_free(&xctx->floater_inst_table); } @@ -232,16 +232,16 @@ char *escape_chars(const char *source, const char *charset) size_t slen, size; if(!source) { - if(dest) my_free(_ALLOC_ID_, &dest); + if(dest) my_free(7, &dest); return NULL; } slen = strlen(source); size = slen + 1; - my_realloc(_ALLOC_ID_, &dest, size); + my_realloc(8, &dest, size); while(source && source[s]) { if(d >= size - 2) { size += 2; - my_realloc(_ALLOC_ID_, &dest, size); + my_realloc(9, &dest, size); } if(!strcmp(charset, "")) { switch(source[s]) { @@ -627,7 +627,7 @@ void ask_new_file(void) load_schematic(1, f, 1, 1); tclvareval("update_recent_file {", f, "}", NULL); if(xctx->portmap[xctx->currsch].table) str_hash_free(&xctx->portmap[xctx->currsch]); - my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch],"."); + my_strdup(10, &xctx->sch_path[xctx->currsch],"."); xctx->sch_path_hash[xctx->currsch] = 0; xctx->sch_inst_number[xctx->currsch] = 1; zoom_full(1, 0, 1 + 2 * tclgetboolvar("zoom_full_center"), 0.97); @@ -645,77 +645,77 @@ void remove_symbol(int j) xSymbol save; dbg(1,"clearing symbol %d: %s\n", j, 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].parent_prop_ptr); - my_free(_ALLOC_ID_, &xctx->sym[j].type); - my_free(_ALLOC_ID_, &xctx->sym[j].name); + my_free(11, &xctx->sym[j].prop_ptr); + my_free(12, &xctx->sym[j].templ); + my_free(13, &xctx->sym[j].parent_prop_ptr); + my_free(14, &xctx->sym[j].type); + my_free(15, &xctx->sym[j].name); /* /20150409 */ for(c=0;csym[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(16, &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(17, &xctx->sym[j].poly[c][i].x); + my_free(18, &xctx->sym[j].poly[c][i].y); + my_free(19, &xctx->sym[j].poly[c][i].selected_point); } - my_free(_ALLOC_ID_, &xctx->sym[j].poly[c]); + my_free(20, &xctx->sym[j].poly[c]); xctx->sym[j].polygons[c] = 0; for(i=0;isym[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(21, &xctx->sym[j].line[c][i].prop_ptr); } } - my_free(_ALLOC_ID_, &xctx->sym[j].line[c]); + my_free(22, &xctx->sym[j].line[c]); xctx->sym[j].lines[c] = 0; for(i=0;isym[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(23, &xctx->sym[j].arc[c][i].prop_ptr); } } - my_free(_ALLOC_ID_, &xctx->sym[j].arc[c]); + my_free(24, &xctx->sym[j].arc[c]); xctx->sym[j].arcs[c] = 0; for(i=0;isym[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(25, &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(26, &xctx->sym[j].rect[c]); xctx->sym[j].rects[c] = 0; } for(i=0;isym[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(27, &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(28, &xctx->sym[j].text[i].txt_ptr); dbg(1, "remove_symbol(): freeing symbol %d text_ptr %d\n", j, i); } if(xctx->sym[j].text[i].font != NULL) { - my_free(_ALLOC_ID_, &xctx->sym[j].text[i].font); + my_free(29, &xctx->sym[j].text[i].font); } if(xctx->sym[j].text[i].floater_instname != NULL) { - my_free(_ALLOC_ID_, &xctx->sym[j].text[i].floater_instname); + my_free(30, &xctx->sym[j].text[i].floater_instname); } if(xctx->sym[j].text[i].floater_ptr != NULL) { - my_free(_ALLOC_ID_, &xctx->sym[j].text[i].floater_ptr); + my_free(31, &xctx->sym[j].text[i].floater_ptr); } } - my_free(_ALLOC_ID_, &xctx->sym[j].text); + my_free(32, &xctx->sym[j].text); - my_free(_ALLOC_ID_, &xctx->sym[j].line); - my_free(_ALLOC_ID_, &xctx->sym[j].rect); - my_free(_ALLOC_ID_, &xctx->sym[j].arc); - my_free(_ALLOC_ID_, &xctx->sym[j].poly); - my_free(_ALLOC_ID_, &xctx->sym[j].lines); - my_free(_ALLOC_ID_, &xctx->sym[j].polygons); - my_free(_ALLOC_ID_, &xctx->sym[j].arcs); - my_free(_ALLOC_ID_, &xctx->sym[j].rects); + my_free(33, &xctx->sym[j].line); + my_free(34, &xctx->sym[j].rect); + my_free(35, &xctx->sym[j].arc); + my_free(36, &xctx->sym[j].poly); + my_free(37, &xctx->sym[j].lines); + my_free(38, &xctx->sym[j].polygons); + my_free(39, &xctx->sym[j].arcs); + my_free(40, &xctx->sym[j].rects); xctx->sym[j].texts = 0; @@ -774,10 +774,10 @@ int set_sym_flags(xSymbol *sym) { const char *ptr; sym->flags = 0; - my_strdup2(_ALLOC_ID_, &sym->templ, + my_strdup2(41, &sym->templ, get_tok_value(sym->prop_ptr, "template", 0)); - my_strdup2(_ALLOC_ID_, &sym->type, + my_strdup2(42, &sym->type, get_tok_value(sym->prop_ptr, "type",0)); if(!strboolcmp(get_tok_value(sym->prop_ptr,"highlight",0), "true")) @@ -823,14 +823,14 @@ int set_inst_flags(xInstance *inst) { const char *ptr; inst->flags &= IGNORE_INST; /* do not clear IGNORE_INST bit, used in draw_symbol() */ - my_strdup2(_ALLOC_ID_, &inst->instname, get_tok_value(inst->prop_ptr, "name", 0)); + my_strdup2(43, &inst->instname, get_tok_value(inst->prop_ptr, "name", 0)); dbg(1, "set_inst_flags(): instname=%s\n", inst->instname); if(inst->ptr >=0) { char *type = xctx->sym[inst->ptr].type; int cond= type && IS_LABEL_SH_OR_PIN(type); if(cond) { inst->flags |= PIN_OR_LABEL; - my_strdup2(_ALLOC_ID_, &(inst->lab), get_tok_value(inst->prop_ptr,"lab",0)); + my_strdup2(44, &(inst->lab), get_tok_value(inst->prop_ptr,"lab",0)); } } @@ -886,7 +886,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(45, &t->font, get_tok_value(t->prop_ptr, "font", 0)); str = get_tok_value(t->prop_ptr, "hcenter", 0); t->hcenter = strboolcmp(str, "true") ? 0 : 1; str = get_tok_value(t->prop_ptr, "vcenter", 0); @@ -906,7 +906,7 @@ int set_text_flags(xText *t) str = get_tok_value(t->prop_ptr, "name", 0); if(!xctx->tok_size) str = get_tok_value(t->prop_ptr, "floater", 0); t->flags |= xctx->tok_size ? TEXT_FLOATER : 0; - my_strdup2(_ALLOC_ID_, &t->floater_instname, str); + my_strdup2(46, &t->floater_instname, str); } return 0; } @@ -935,7 +935,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(47, sizeof(xEmb_image)); d->image = NULL; drptr->extraptr = d; } @@ -947,7 +947,7 @@ int set_rect_extraptr(int what, xRect *drptr) if(d->image) { cairo_surface_destroy(d->image); } - my_free(_ALLOC_ID_, &drptr->extraptr); + my_free(48, &drptr->extraptr); } } } @@ -961,57 +961,57 @@ 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(49, &xctx->schtedaxprop); + my_free(50, &xctx->schsymbolprop); + my_free(51, &xctx->schprop); + my_free(52, &xctx->schvhdlprop); + my_free(53, &xctx->version_string); + if(xctx->header_text) my_free(54, &xctx->header_text); + my_free(55, &xctx->schverilogprop); for(i=0;iwires; ++i) { - my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr); - my_free(_ALLOC_ID_, &xctx->wire[i].node); + my_free(56, &xctx->wire[i].prop_ptr); + my_free(57, &xctx->wire[i].node); } xctx->wires = 0; for(i=0;iinstances; ++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(58, &xctx->inst[i].prop_ptr); + my_free(59, &xctx->inst[i].name); + my_free(60, &xctx->inst[i].instname); + my_free(61, &xctx->inst[i].lab); delete_inst_node(i); } xctx->instances = 0; for(i=0;itexts; ++i) { - my_free(_ALLOC_ID_, &xctx->text[i].font); - my_free(_ALLOC_ID_, &xctx->text[i].floater_instname); - my_free(_ALLOC_ID_, &xctx->text[i].floater_ptr); - my_free(_ALLOC_ID_, &xctx->text[i].prop_ptr); - my_free(_ALLOC_ID_, &xctx->text[i].txt_ptr); + my_free(62, &xctx->text[i].font); + my_free(63, &xctx->text[i].floater_instname); + my_free(64, &xctx->text[i].floater_ptr); + my_free(65, &xctx->text[i].prop_ptr); + my_free(66, &xctx->text[i].txt_ptr); } xctx->texts = 0; for(i=0;ilines[i]; ++j) { - my_free(_ALLOC_ID_, &xctx->line[i][j].prop_ptr); + my_free(67, &xctx->line[i][j].prop_ptr); } for(j=0;jrects[i]; ++j) { - my_free(_ALLOC_ID_, &xctx->rect[i][j].prop_ptr); + my_free(68, &xctx->rect[i][j].prop_ptr); set_rect_extraptr(0, &xctx->rect[i][j]); } for(j=0;jarcs[i]; ++j) { - my_free(_ALLOC_ID_, &xctx->arc[i][j].prop_ptr); + my_free(69, &xctx->arc[i][j].prop_ptr); } for(j=0;jpolygons[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(70, &xctx->poly[i][j].x); + my_free(71, &xctx->poly[i][j].y); + my_free(72, &xctx->poly[i][j].prop_ptr); + my_free(73, &xctx->poly[i][j].selected_point); } xctx->lines[i] = 0; xctx->arcs[i] = 0; @@ -1281,8 +1281,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_first lab_pin.sym]")); - my_strdup(_ALLOC_ID_, &symname_wire, tcleval("rel_sym_path [find_file_first lab_wire.sym]")); + my_strdup(74, &symname_pin, tcleval("rel_sym_path [find_file_first lab_pin.sym]")); + my_strdup(75, &symname_wire, tcleval("rel_sym_path [find_file_first lab_wire.sym]")); if(symname_pin && symname_wire) { rebuild_selected_array(); k = xctx->lastsel; @@ -1290,8 +1290,8 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710 prepare_netlist_structs(0); for(j=0;jsel_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(76, &prop, xctx->inst[xctx->sel_array[j].n].instname); + my_strcat(77, &prop, "_"); tclsetvar("custom_label_prefix",prop); if(interactive && !do_all_inst) { @@ -1299,7 +1299,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710 tcleval("attach_labels_to_inst"); if(!strcmp(tclgetvar("tctx::rcode"),"") ) { bbox(END, 0., 0., 0., 0.); - my_free(_ALLOC_ID_, &prop); + my_free(78, &prop); return; } } @@ -1313,7 +1313,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710 use_label_prefix = tclgetboolvar("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(79, &type,(xctx->inst[xctx->sel_array[j].n].ptr+ xctx->sym)->type); if( type && IS_LABEL_OR_PIN(type) ) { continue; } @@ -1333,7 +1333,7 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710 rct=symbol->rect[PINLAYER]; for(i=0;i labname=%s\n", labname); pinx0 = (rct[i].x1+rct[i].x2)/2; @@ -1377,13 +1377,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(81, &prop, "name=p1 lab="); if(use_label_prefix) { - my_strcat(_ALLOC_ID_, &prop, (char *)tclgetvar("custom_label_prefix")); + my_strcat(82, &prop, (char *)tclgetvar("custom_label_prefix")); } /* /20171005 */ - my_strcat(_ALLOC_ID_, &prop, labname); + my_strcat(83, &prop, labname); dir ^= flip; /* 20101129 20111030 */ if(rotated_text ==-1) { rot1=rot; @@ -1402,9 +1402,9 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710 } } if(first_call == 0) set_modify(1); - my_free(_ALLOC_ID_, &prop); - my_free(_ALLOC_ID_, &labname); - my_free(_ALLOC_ID_, &type); + my_free(84, &prop); + my_free(85, &labname); + my_free(86, &type); if(!found) return; /* draw things */ if(!first_call) { @@ -1416,8 +1416,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(87, &symname_pin); + my_free(88, &symname_wire); } void delete_files(void) @@ -1517,7 +1517,7 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, short rot xctx->inst[n].name=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(89, &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; */ @@ -1639,8 +1639,8 @@ int copy_hierarchy_data(const char *from_win_path, const char *to_win_path) hier_attr = from->hier_attr; to->currsch = from->currsch; for(i = 0; i <= from->currsch; i++) { - my_strdup2(_ALLOC_ID_, &to->sch[i], sch[i]); - my_strdup2(_ALLOC_ID_, &to->sch_path[i], sch_path[i]); + my_strdup2(90, &to->sch[i], sch[i]); + my_strdup2(91, &to->sch_path[i], sch_path[i]); to->sch_path_hash[i] = sch_path_hash[i]; to->sch_inst_number[i] = sch_inst_number[i]; to->previous_instance[i] = previous_instance[i]; @@ -1652,9 +1652,9 @@ int copy_hierarchy_data(const char *from_win_path, const char *to_win_path) to->hier_attr[i].rot = hier_attr[i].rot; to->hier_attr[i].flip = hier_attr[i].flip; to->hier_attr[i].fd = NULL; /* Never used outside load_sym_def() */ - my_strdup2(_ALLOC_ID_, &to->hier_attr[i].prop_ptr, hier_attr[i].prop_ptr); - my_strdup2(_ALLOC_ID_, &to->hier_attr[i].templ, hier_attr[i].templ); - my_strdup2(_ALLOC_ID_, &to->hier_attr[i].symname, hier_attr[i].symname); + my_strdup2(92, &to->hier_attr[i].prop_ptr, hier_attr[i].prop_ptr); + my_strdup2(93, &to->hier_attr[i].templ, hier_attr[i].templ); + my_strdup2(94, &to->hier_attr[i].symname, hier_attr[i].symname); if(to->portmap[i].table) str_hash_free(&to->portmap[i]); str_hash_init(&to->portmap[i], HASHSIZE); for(j = 0; j < HASHSIZE; j++) { @@ -1663,10 +1663,10 @@ int copy_hierarchy_data(const char *from_win_path, const char *to_win_path) tonext = &(to->portmap[i].table[j]); while(*fromnext) { Str_hashentry *e; - e = my_calloc(_ALLOC_ID_, 1, sizeof(Str_hashentry)); + e = my_calloc(95, 1, sizeof(Str_hashentry)); e->hash = (*fromnext)->hash; - my_strdup2(_ALLOC_ID_, &e->token, (*fromnext)->token); - my_strdup2(_ALLOC_ID_, &e->value, (*fromnext)->value); + my_strdup2(96, &e->token, (*fromnext)->token); + my_strdup2(97, &e->value, (*fromnext)->value); *tonext = e; fromnext = &( (*fromnext)->next ); tonext = &( (*tonext)->next ); @@ -1746,7 +1746,7 @@ void launcher(void) else if(xctx->sel_array[0].type==LINE) prop_ptr = xctx->line[c][n].prop_ptr; else if(xctx->sel_array[0].type==WIRE) prop_ptr = xctx->wire[n].prop_ptr; else if(xctx->sel_array[0].type==xTEXT) prop_ptr = xctx->text[n].prop_ptr; - my_strdup2(_ALLOC_ID_, &command, get_tok_value(prop_ptr,"tclcommand",0)); + my_strdup2(98, &command, get_tok_value(prop_ptr,"tclcommand",0)); my_strncpy(program, get_tok_value(prop_ptr,"program",0), S(program)); /* handle backslashes */ url = get_tok_value(prop_ptr,"url",0); /* handle backslashes */ dbg(1, "launcher(): url=%s\n", url); @@ -1763,7 +1763,7 @@ void launcher(void) dbg(0, "%s\n", msg); if(has_x) tclvareval("alert_ {", msg, "} {}", NULL); } - my_free(_ALLOC_ID_, &command); + my_free(99, &command); tcleval("after 300"); select_object(mx,my,0, 0, NULL); } @@ -1817,59 +1817,59 @@ void copy_symbol(xSymbol *dest_sym, xSymbol *src_sym) dest_sym->type = NULL; dest_sym->templ = NULL; dest_sym->parent_prop_ptr = NULL; - my_strdup2(_ALLOC_ID_, &dest_sym->name, src_sym->name); - my_strdup2(_ALLOC_ID_, &dest_sym->type, src_sym->type); - my_strdup2(_ALLOC_ID_, &dest_sym->templ, src_sym->templ); - my_strdup(_ALLOC_ID_, &dest_sym->parent_prop_ptr, src_sym->parent_prop_ptr); - my_strdup2(_ALLOC_ID_, &dest_sym->prop_ptr, src_sym->prop_ptr); + my_strdup2(100, &dest_sym->name, src_sym->name); + my_strdup2(101, &dest_sym->type, src_sym->type); + my_strdup2(102, &dest_sym->templ, src_sym->templ); + my_strdup(103, &dest_sym->parent_prop_ptr, src_sym->parent_prop_ptr); + my_strdup2(104, &dest_sym->prop_ptr, src_sym->prop_ptr); - dest_sym->line = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *)); - dest_sym->poly = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *)); - dest_sym->arc = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *)); - dest_sym->rect = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *)); - dest_sym->lines = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int)); - dest_sym->rects = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int)); - dest_sym->arcs = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int)); - dest_sym->polygons = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int)); + dest_sym->line = my_calloc(105, cadlayers, sizeof(xLine *)); + dest_sym->poly = my_calloc(106, cadlayers, sizeof(xPoly *)); + dest_sym->arc = my_calloc(107, cadlayers, sizeof(xArc *)); + dest_sym->rect = my_calloc(108, cadlayers, sizeof(xRect *)); + dest_sym->lines = my_calloc(109, cadlayers, sizeof(int)); + dest_sym->rects = my_calloc(110, cadlayers, sizeof(int)); + dest_sym->arcs = my_calloc(111, cadlayers, sizeof(int)); + dest_sym->polygons = my_calloc(112, cadlayers, sizeof(int)); - dest_sym->text = my_calloc(_ALLOC_ID_, src_sym->texts, sizeof(xText)); + dest_sym->text = my_calloc(113, src_sym->texts, sizeof(xText)); memcpy(dest_sym->lines, src_sym->lines, sizeof(dest_sym->lines[0]) * cadlayers); memcpy(dest_sym->rects, src_sym->rects, sizeof(dest_sym->rects[0]) * cadlayers); memcpy(dest_sym->arcs, src_sym->arcs, sizeof(dest_sym->arcs[0]) * cadlayers); memcpy(dest_sym->polygons, src_sym->polygons, sizeof(dest_sym->polygons[0]) * cadlayers); for(c = 0;cline[c] = my_calloc(_ALLOC_ID_, src_sym->lines[c], sizeof(xLine)); + dest_sym->line[c] = my_calloc(114, src_sym->lines[c], sizeof(xLine)); for(j = 0; j < src_sym->lines[c]; ++j) { dest_sym->line[c][j] = src_sym->line[c][j]; dest_sym->line[c][j].prop_ptr = NULL; - my_strdup(_ALLOC_ID_, &dest_sym->line[c][j].prop_ptr, src_sym->line[c][j].prop_ptr); + my_strdup(115, &dest_sym->line[c][j].prop_ptr, src_sym->line[c][j].prop_ptr); } /* symbol rects */ - dest_sym->rect[c] = my_calloc(_ALLOC_ID_, src_sym->rects[c], sizeof(xRect)); + dest_sym->rect[c] = my_calloc(116, src_sym->rects[c], sizeof(xRect)); for(j = 0; j < src_sym->rects[c]; ++j) { dest_sym->rect[c][j] = src_sym->rect[c][j]; dest_sym->rect[c][j].prop_ptr = NULL; dest_sym->rect[c][j].extraptr = NULL; - my_strdup(_ALLOC_ID_, &dest_sym->rect[c][j].prop_ptr, src_sym->rect[c][j].prop_ptr); + my_strdup(117, &dest_sym->rect[c][j].prop_ptr, src_sym->rect[c][j].prop_ptr); } /* symbol arcs */ - dest_sym->arc[c] = my_calloc(_ALLOC_ID_, src_sym->arcs[c], sizeof(xArc)); + dest_sym->arc[c] = my_calloc(118, src_sym->arcs[c], sizeof(xArc)); for(j = 0; j < src_sym->arcs[c]; ++j) { dest_sym->arc[c][j] = src_sym->arc[c][j]; dest_sym->arc[c][j].prop_ptr = NULL; - my_strdup(_ALLOC_ID_, &dest_sym->arc[c][j].prop_ptr, src_sym->arc[c][j].prop_ptr); + my_strdup(119, &dest_sym->arc[c][j].prop_ptr, src_sym->arc[c][j].prop_ptr); } /* symbol polygons */ - dest_sym->poly[c] = my_calloc(_ALLOC_ID_, src_sym->polygons[c], sizeof(xPoly)); + dest_sym->poly[c] = my_calloc(120, src_sym->polygons[c], sizeof(xPoly)); for(j = 0; j < src_sym->polygons[c]; ++j) { int points = src_sym->poly[c][j].points; dest_sym->poly[c][j] = src_sym->poly[c][j]; dest_sym->poly[c][j].prop_ptr = NULL; - dest_sym->poly[c][j].x = my_malloc(_ALLOC_ID_, points * sizeof(double)); - dest_sym->poly[c][j].y = my_malloc(_ALLOC_ID_, points * sizeof(double)); - dest_sym->poly[c][j].selected_point = my_malloc(_ALLOC_ID_, points * sizeof(unsigned short)); - my_strdup(_ALLOC_ID_, &dest_sym->poly[c][j].prop_ptr, src_sym->poly[c][j].prop_ptr); + dest_sym->poly[c][j].x = my_malloc(121, points * sizeof(double)); + dest_sym->poly[c][j].y = my_malloc(122, points * sizeof(double)); + dest_sym->poly[c][j].selected_point = my_malloc(123, points * sizeof(unsigned short)); + my_strdup(124, &dest_sym->poly[c][j].prop_ptr, src_sym->poly[c][j].prop_ptr); memcpy(dest_sym->poly[c][j].x, src_sym->poly[c][j].x, points * sizeof(double)); memcpy(dest_sym->poly[c][j].y, src_sym->poly[c][j].y, points * sizeof(double)); memcpy(dest_sym->poly[c][j].selected_point, src_sym->poly[c][j].selected_point, @@ -1884,12 +1884,12 @@ void copy_symbol(xSymbol *dest_sym, xSymbol *src_sym) dest_sym->text[j].font = NULL; dest_sym->text[j].floater_instname = NULL; dest_sym->text[j].floater_ptr = NULL; - my_strdup2(_ALLOC_ID_, &dest_sym->text[j].prop_ptr, src_sym->text[j].prop_ptr); - my_strdup2(_ALLOC_ID_, &dest_sym->text[j].floater_ptr, src_sym->text[j].floater_ptr); + my_strdup2(125, &dest_sym->text[j].prop_ptr, src_sym->text[j].prop_ptr); + my_strdup2(126, &dest_sym->text[j].floater_ptr, src_sym->text[j].floater_ptr); dbg(1, "copy_symbol1(): allocating sym %d text %d\n", dest_sym - xctx->sym, j); - my_strdup2(_ALLOC_ID_, &dest_sym->text[j].txt_ptr, src_sym->text[j].txt_ptr); - my_strdup2(_ALLOC_ID_, &dest_sym->text[j].font, src_sym->text[j].font); - my_strdup2(_ALLOC_ID_, &dest_sym->text[j].floater_instname, src_sym->text[j].floater_instname); + my_strdup2(127, &dest_sym->text[j].txt_ptr, src_sym->text[j].txt_ptr); + my_strdup2(128, &dest_sym->text[j].font, src_sym->text[j].font); + my_strdup2(129, &dest_sym->text[j].floater_instname, src_sym->text[j].floater_instname); } } @@ -1914,9 +1914,9 @@ void toggle_ignore(void) remove = 0; if(!strboolcmp(get_tok_value(xctx->inst[i].prop_ptr, attr, 0), "true")) remove = 1; if(remove) { - my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, attr, NULL)); + my_strdup(130, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, attr, NULL)); } else { - my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, attr, "true")); + my_strdup(131, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, attr, "true")); } set_inst_flags(&xctx->inst[i]); set_modify(1); @@ -1954,10 +1954,10 @@ void get_additional_symbols(int what) char symbol_base_sch[PATH_MAX] = ""; /* copy instance based *_sym_def attributes to symbol */ - my_strdup(_ALLOC_ID_, &spice_sym_def, get_tok_value(xctx->inst[i].prop_ptr,"spice_sym_def",6)); - my_strdup(_ALLOC_ID_, &verilog_sym_def, get_tok_value(xctx->inst[i].prop_ptr,"verilog_sym_def",4)); - my_strdup(_ALLOC_ID_, &vhdl_sym_def, get_tok_value(xctx->inst[i].prop_ptr,"vhdl_sym_def",4)); - my_strdup2(_ALLOC_ID_, &sch, tcl_hook2( + my_strdup(132, &spice_sym_def, get_tok_value(xctx->inst[i].prop_ptr,"spice_sym_def",6)); + my_strdup(133, &verilog_sym_def, get_tok_value(xctx->inst[i].prop_ptr,"verilog_sym_def",4)); + my_strdup(134, &vhdl_sym_def, get_tok_value(xctx->inst[i].prop_ptr,"vhdl_sym_def",4)); + my_strdup2(135, &sch, tcl_hook2( str_replace( get_tok_value(xctx->inst[i].prop_ptr,"schematic",2), "@symname", get_cell(xctx->inst[i].name, 0), '\\'))); dbg(1, "get_additional_symbols(): inst=%d sch=%s\n",i, sch); @@ -1973,7 +1973,7 @@ void get_additional_symbols(int what) char *symname_attr = NULL; int ignore_schematic = 0; xSymbol *symptr = xctx->inst[i].ptr + xctx->sym; - my_strdup2(_ALLOC_ID_, &default_schematic, get_tok_value(symptr->prop_ptr,"default_schematic",0)); + my_strdup2(136, &default_schematic, get_tok_value(symptr->prop_ptr,"default_schematic",0)); ignore_schematic = !strcmp(default_schematic, "ignore"); dbg(1, "get_additional_symbols(): inst=%d, sch=%s\n", i, sch); @@ -1981,22 +1981,22 @@ void get_additional_symbols(int what) is_gen = is_generator(sch); if(is_gen) { - my_strdup2(_ALLOC_ID_, &sym, sch); + my_strdup2(137, &sym, sch); dbg(1, "get_additional_symbols(): generator\n"); } else { - my_strdup2(_ALLOC_ID_, &sym, add_ext(rel_sym_path(sch), ".sym")); + my_strdup2(138, &sym, add_ext(rel_sym_path(sch), ".sym")); } - my_strdup2(_ALLOC_ID_, &templ, get_tok_value(symptr->prop_ptr, "template", 0)); - my_mstrcat(_ALLOC_ID_, &symname_attr, "symname=", get_cell(sym, 0), NULL); - my_mstrcat(_ALLOC_ID_, &symname_attr, " symref=", get_sym_name(i, 9999, 1, 1), NULL); - my_strdup(_ALLOC_ID_, &spice_sym_def, + my_strdup2(139, &templ, get_tok_value(symptr->prop_ptr, "template", 0)); + my_mstrcat(140, &symname_attr, "symname=", get_cell(sym, 0), NULL); + my_mstrcat(141, &symname_attr, " symref=", get_sym_name(i, 9999, 1, 1), NULL); + my_strdup(142, &spice_sym_def, translate3(spice_sym_def, 1, xctx->inst[i].prop_ptr, templ, symname_attr)); dbg(1, "get_additional_symbols(): spice_sym_def=%s\n", spice_sym_def); - my_free(_ALLOC_ID_, &templ); - my_free(_ALLOC_ID_, &symname_attr); + my_free(143, &templ); + my_free(144, &symname_attr); /* if instance symbol has default_schematic set to ignore copy the symbol anyway, since * the base symbol will not be netlisted by *_block_netlist() */ found = ignore_schematic ? NULL : int_hash_lookup(&sym_table, sym, 0, XLOOKUP); @@ -2007,43 +2007,43 @@ void get_additional_symbols(int what) check_symbol_storage(); copy_symbol(&xctx->sym[j], symptr); xctx->sym[j].base_name = symptr->name; - my_strdup(_ALLOC_ID_, &xctx->sym[j].name, sym); + my_strdup(145, &xctx->sym[j].name, sym); - my_strdup(_ALLOC_ID_, &xctx->sym[j].parent_prop_ptr, xctx->inst[i].prop_ptr); + my_strdup(146, &xctx->sym[j].parent_prop_ptr, xctx->inst[i].prop_ptr); /* the copied symbol will not inherit the default_schematic attribute otherwise it will also * be skipped */ if(default_schematic) { - my_strdup(_ALLOC_ID_, &xctx->sym[j].prop_ptr, + my_strdup(147, &xctx->sym[j].prop_ptr, subst_token(xctx->sym[j].prop_ptr, "default_schematic", NULL)); /* delete attribute */ } /* if symbol has no corresponding schematic file use symbol base schematic */ if(!is_gen && symbol_base_sch[0]) { - my_strdup(_ALLOC_ID_, &xctx->sym[j].prop_ptr, + my_strdup(148, &xctx->sym[j].prop_ptr, subst_token(xctx->sym[j].prop_ptr, "schematic", symbol_base_sch)); } if(spice_sym_def) { - my_strdup(_ALLOC_ID_, &xctx->sym[j].prop_ptr, + my_strdup(149, &xctx->sym[j].prop_ptr, subst_token(xctx->sym[j].prop_ptr, "spice_sym_def", spice_sym_def)); } if(verilog_sym_def) { - my_strdup(_ALLOC_ID_, &xctx->sym[j].prop_ptr, + my_strdup(150, &xctx->sym[j].prop_ptr, subst_token(xctx->sym[j].prop_ptr, "verilog_sym_def", verilog_sym_def)); } if(vhdl_sym_def) { - my_strdup(_ALLOC_ID_, &xctx->sym[j].prop_ptr, + my_strdup(151, &xctx->sym[j].prop_ptr, subst_token(xctx->sym[j].prop_ptr, "vhdl_sym_def", vhdl_sym_def)); } xctx->symbols++; } else { j = found->value; } - my_free(_ALLOC_ID_, &sym); - my_free(_ALLOC_ID_, &default_schematic); + my_free(152, &sym); + my_free(153, &default_schematic); } - my_free(_ALLOC_ID_, &sch); - my_free(_ALLOC_ID_, &spice_sym_def); - my_free(_ALLOC_ID_, &vhdl_sym_def); - my_free(_ALLOC_ID_, &verilog_sym_def); + my_free(154, &sch); + my_free(155, &spice_sym_def); + my_free(156, &vhdl_sym_def); + my_free(157, &verilog_sym_def); } int_hash_free(&sym_table); } else { /* end */ @@ -2071,11 +2071,11 @@ void get_sch_from_sym(char *filename, xSymbol *sym, int inst, int fallback) } dbg(1, "get_sch_from_sym(): current_dirname= %s\n", xctx->current_dirname); dbg(1, "get_sch_from_sym(): symbol %s inst=%d web_url=%d\n", sym->name, inst, web_url); - if(inst >= 0) my_strdup(_ALLOC_ID_, &str_tmp, get_tok_value(xctx->inst[inst].prop_ptr, "schematic", 2)); - if(!str_tmp) my_strdup2(_ALLOC_ID_, &str_tmp, get_tok_value(sym->prop_ptr, "schematic", 2)); + if(inst >= 0) my_strdup(158, &str_tmp, get_tok_value(xctx->inst[inst].prop_ptr, "schematic", 2)); + if(!str_tmp) my_strdup2(159, &str_tmp, get_tok_value(sym->prop_ptr, "schematic", 2)); if(str_tmp[0]) { /* schematic attribute in symbol or instance was given */ /* @symname in schematic attribute will be replaced with symbol name */ - my_strdup2(_ALLOC_ID_, &sch, tcl_hook2(str_replace(str_tmp, "@symname", + my_strdup2(160, &sch, tcl_hook2(str_replace(str_tmp, "@symname", get_cell(sym->name, 0), '\\'))); if(is_generator(sch)) { /* generator: return as is */ my_strncpy(filename, sch, PATH_MAX); @@ -2122,7 +2122,7 @@ void get_sch_from_sym(char *filename, xSymbol *sym, int inst, int fallback) } } } - if(sch) my_free(_ALLOC_ID_, &sch); + if(sch) my_free(161, &sch); if(web_url && filename[0] && xschem_web_dirname[0]) { char sympath[PATH_MAX]; @@ -2139,7 +2139,7 @@ void get_sch_from_sym(char *filename, xSymbol *sym, int inst, int fallback) my_strncpy(filename, sympath, PATH_MAX); } } - my_free(_ALLOC_ID_, &str_tmp); + my_free(162, &str_tmp); dbg(1, "get_sch_from_sym(): sym->name=%s, filename=%s\n", sym->name, filename); } @@ -2202,9 +2202,9 @@ int descend_schematic(int instnumber, int fallback, int alert) dbg(1, "descend_schematic(): selected instname=%s\n", xctx->inst[n].instname); if(xctx->inst[n].instname && xctx->inst[n].instname[0]) { - my_strdup2(_ALLOC_ID_, &str, expandlabel(xctx->inst[n].instname, &inst_mult)); + my_strdup2(163, &str, expandlabel(xctx->inst[n].instname, &inst_mult)); } else { - my_strdup2(_ALLOC_ID_, &str, ""); + my_strdup2(164, &str, ""); inst_mult = 1; } prepare_netlist_structs(0); /* for portmap feature (mapping subcircuit nodes connected to @@ -2221,7 +2221,7 @@ int descend_schematic(int instnumber, int fallback, int alert) inum = tclresult(); dbg(1, "descend_schematic(): inum=%s\n", inum); if(!inum[0]) { - my_free(_ALLOC_ID_, &str); + my_free(165, &str); return 0; } inst_number=atoi(inum); @@ -2233,7 +2233,7 @@ int descend_schematic(int instnumber, int fallback, int alert) if(inst_number <1 || inst_number > inst_mult) inst_number = 1; } - my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]); + my_strdup(166, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]); xctx->sch_path_hash[xctx->currsch+1] =0; if(xctx->portmap[xctx->currsch + 1].table) str_hash_free(&xctx->portmap[xctx->currsch + 1]); str_hash_init(&xctx->portmap[xctx->currsch + 1], HASHSIZE); @@ -2249,40 +2249,40 @@ int descend_schematic(int instnumber, int fallback, int alert) if(!pin_name[0]) continue; if(!xctx->inst[n].node[i]) continue; - my_strdup2(_ALLOC_ID_, &pin_node, expandlabel(pin_name, &mult)); - my_strdup2(_ALLOC_ID_, &net_node, expandlabel(xctx->inst[n].node[i], &net_mult)); + my_strdup2(167, &pin_node, expandlabel(pin_name, &mult)); + my_strdup2(168, &net_node, expandlabel(xctx->inst[n].node[i], &net_mult)); p_n_s1 = pin_node; for(k = 1; k<=mult; ++k) { single_p = my_strtok_r(p_n_s1, ",", "", 0, &p_n_s2); p_n_s1 = NULL; - my_strdup2(_ALLOC_ID_, &single_n, + my_strdup2(169, &single_n, find_nth(net_node, ",", "", 0, ((inst_number - 1) * mult + k - 1) % net_mult + 1)); single_n_ptr = single_n; if(single_n_ptr[0] == '#') { if(mult > 1) { - my_mstrcat(_ALLOC_ID_, &single_n, "[", my_itoa((inst_mult - inst_number + 1) * mult - k), "]", NULL); + my_mstrcat(170, &single_n, "[", my_itoa((inst_mult - inst_number + 1) * mult - k), "]", NULL); } single_n_ptr = single_n + 1; } str_hash_lookup(&xctx->portmap[xctx->currsch + 1], single_p, single_n_ptr, XINSERT); dbg(1, "descend_schematic(): %s: %s ->%s\n", xctx->inst[n].instname, single_p, single_n_ptr); } - if(single_n) my_free(_ALLOC_ID_, &single_n); - my_free(_ALLOC_ID_, &net_node); - my_free(_ALLOC_ID_, &pin_node); + if(single_n) my_free(171, &single_n); + my_free(172, &net_node); + my_free(173, &pin_node); } - my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].prop_ptr, + my_strdup(174, &xctx->hier_attr[xctx->currsch].prop_ptr, xctx->inst[n].prop_ptr); - my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].templ, + my_strdup(175, &xctx->hier_attr[xctx->currsch].templ, get_tok_value((xctx->inst[n].ptr+ xctx->sym)->prop_ptr, "template", 0)); dbg(1,"descend_schematic(): inst_number=%d\n", inst_number); - my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], find_nth(str, ",", "", 0, inst_number)); - my_free(_ALLOC_ID_, &str); + my_strcat(176, &xctx->sch_path[xctx->currsch+1], find_nth(str, ",", "", 0, inst_number)); + my_free(177, &str); dbg(1,"descend_schematic(): inst_number=%d\n", inst_number); - my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], "."); + my_strcat(178, &xctx->sch_path[xctx->currsch+1], "."); xctx->sch_inst_number[xctx->currsch] = 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); @@ -2352,13 +2352,13 @@ void go_back(int confirm) /* 20171006 add confirm */ load_sym_def(xctx->sch[xctx->currsch], NULL); from_embedded_sym=1; } - my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]); + my_free(179, &xctx->sch[xctx->currsch]); if(xctx->portmap[xctx->currsch].table) str_hash_free(&xctx->portmap[xctx->currsch]); xctx->sch_path_hash[xctx->currsch] = 0; xctx->currsch--; - my_free(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].prop_ptr); - my_free(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].templ); + my_free(180, &xctx->hier_attr[xctx->currsch].prop_ptr); + my_free(181, &xctx->hier_attr[xctx->currsch].templ); save_modified = xctx->modified; /* we propagate modified flag (cleared by load_schematic */ /* by default) to parent schematic if going back from embedded symbol */ @@ -2405,8 +2405,8 @@ void clear_schematic(int cancel, int symbol) else my_snprintf(name, S(name), "%s-%d.sym", "untitled", i); if(stat(name, &buf)) break; } - my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]); - my_mstrcat(_ALLOC_ID_, &xctx->sch[xctx->currsch], pwd_dir, "/", name, NULL); + my_free(182, &xctx->sch[xctx->currsch]); + my_mstrcat(183, &xctx->sch[xctx->currsch], pwd_dir, "/", name, NULL); my_strncpy(xctx->current_name, name, S(xctx->current_name)); } else { xctx->netlist_type = CAD_SPICE_NETLIST; @@ -2416,8 +2416,8 @@ void clear_schematic(int cancel, int symbol) else my_snprintf(name, S(name), "%s-%d.sch", "untitled", i); if(stat(name, &buf)) break; } - my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]); - my_mstrcat(_ALLOC_ID_, &xctx->sch[xctx->currsch], pwd_dir, "/", name, NULL); + my_free(184, &xctx->sch[xctx->currsch]); + my_mstrcat(185, &xctx->sch[xctx->currsch], pwd_dir, "/", name, NULL); my_strncpy(xctx->current_name, name, S(xctx->current_name)); } draw(); @@ -2567,7 +2567,7 @@ void calc_drawing_bbox(xRect *boundbox, int selected) ++count; updatebbox(count,boundbox,&rect); } - my_free(_ALLOC_ID_, &estr); + my_free(186, &estr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); @@ -3089,7 +3089,7 @@ void change_layer() else if(type==xTEXT && xctx->text[n].sel==SELECTED) { if(xctx->rectcolor != xctx->text[n].layer) { char *p; - my_strdup2(_ALLOC_ID_, &xctx->text[n].prop_ptr, + my_strdup2(187, &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; @@ -3338,8 +3338,8 @@ void new_polygon(int what, double mousex_snap, double mousey_snap) 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(188, &xctx->nl_polyx, sizeof(double)*xctx->nl_maxpoints); + my_realloc(189, &xctx->nl_polyy, sizeof(double)*xctx->nl_maxpoints); } if( what & PLACE ) { @@ -3392,8 +3392,8 @@ void new_polygon(int what, double mousex_snap, double mousey_snap) drawtemppolygon(xctx->gc[xctx->rectcolor], NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points, 0); xctx->ui_state &= ~STARTPOLYGON; drawpolygon(xctx->rectcolor, NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points, 0, 0, 0); - my_free(_ALLOC_ID_, &xctx->nl_polyx); - my_free(_ALLOC_ID_, &xctx->nl_polyy); + my_free(190, &xctx->nl_polyx); + my_free(191, &xctx->nl_polyy); xctx->nl_maxpoints = xctx->nl_points = 0; } if(what & RUBBER) @@ -3439,7 +3439,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(192, &s, str); str_ptr = s; while( s && s[c] ) { if(s[c] == '\n') { @@ -3462,7 +3462,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(193, &s); hh = hh*fext.height * cairo_font_line_spacing; *cairo_longest_line = ww; @@ -3607,7 +3607,7 @@ int create_text(int draw_text, double x, double y, int rot, int flip, const char t->floater_ptr = NULL; t->font=NULL; t->floater_instname=NULL; - my_strdup2(_ALLOC_ID_, &t->txt_ptr, txt); + my_strdup2(194, &t->txt_ptr, txt); t->x0=x; t->y0=y; t->rot=(short int) rot; @@ -3615,7 +3615,7 @@ int create_text(int draw_text, double x, double y, int rot, int flip, const char t->sel=0; t->xscale= hsize; t->yscale= vsize; - my_strdup(_ALLOC_ID_, &t->prop_ptr, props); + my_strdup(195, &t->prop_ptr, props); /* debug ... */ /* t->prop_ptr=NULL; */ dbg(1, "create_text(): done text input\n"); diff --git a/src/callback.c b/src/callback.c index a20e1c82..a10b7722 100644 --- a/src/callback.c +++ b/src/callback.c @@ -390,7 +390,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int c = G_X(xctx->mousex); if(gr->logx) c = pow(10, c); if(r->flags & 4) { /* private_cursor */ - my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(c))); + my_strdup(196, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(c))); } else { xctx->graph_cursor1_x = c; } @@ -404,7 +404,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int c = G_X(xctx->mousex); if(gr->logx) c = pow(10, c); if(r->flags & 4) { /* private_cursor */ - my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(c))); + my_strdup(197, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(c))); } else { xctx->graph_cursor2_x = c; } @@ -499,7 +499,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int cursor1 = atof_spice(tclresult()); here(cursor1); if(r->flags & 4) { - my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(cursor1))); + my_strdup(198, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(cursor1))); } else { xctx->graph_cursor1_x = cursor1; } @@ -529,7 +529,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int tclvareval("input_line {Pos:} {} ", dtoa_eng(cursor2), NULL); cursor2 = atof_spice(tclresult()); if(r->flags & 4) { - my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(cursor2))); + my_strdup(199, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(cursor2))); } else { xctx->graph_cursor2_x = cursor2; } @@ -554,7 +554,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int if(gr->logx) c = pow(10, c); if(r->flags & 4) { if(!get_tok_value(r->prop_ptr, "cursor1_x", 0)[0]) { - my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(c))); + my_strdup(200, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(c))); } } else { xctx->graph_cursor1_x = c; @@ -572,7 +572,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int if(gr->logx) c = pow(10, c); if(r->flags & 4) { if(!get_tok_value(r->prop_ptr, "cursor2_x", 0)[0]) { - my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(c))); + my_strdup(201, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(c))); } } else { xctx->graph_cursor2_x = c; @@ -623,12 +623,12 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int cursor1 = tmp; if(r->flags & 4) { - my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(cursor1))); + my_strdup(202, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(cursor1))); } else { xctx->graph_cursor1_x = cursor1; } if(r->flags & 4) { - my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(cursor2))); + my_strdup(203, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(cursor2))); } else { xctx->graph_cursor2_x = cursor2; } @@ -697,11 +697,11 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int char *sim_type = NULL; int switched = 0; - my_strdup2(_ALLOC_ID_, &rawfile, get_tok_value(r->prop_ptr, "rawfile", 0)); - my_strdup2(_ALLOC_ID_, &sim_type, get_tok_value(r->prop_ptr, "sim_type", 0)); + my_strdup2(204, &rawfile, get_tok_value(r->prop_ptr, "rawfile", 0)); + my_strdup2(205, &sim_type, get_tok_value(r->prop_ptr, "sim_type", 0)); if(rawfile[0] && sim_type[0]) switched = extra_rawfile(2, rawfile, sim_type, -1.0, -1.0); - my_free(_ALLOC_ID_, &rawfile); - my_free(_ALLOC_ID_, &sim_type); + my_free(206, &rawfile); + my_free(207, &sim_type); idx = get_raw_index(find_nth(get_tok_value(r->prop_ptr, "sweep", 0), ", ", "\"", 0, 1), NULL); dset = dataset == -1 ? 0 : dataset; @@ -812,8 +812,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(208, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1))); + my_strdup(209, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2))); xctx->my_double_save = xctx->mousey_snap; need_redraw = 1; } @@ -823,8 +823,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(210, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1))); + my_strdup(211, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2))); xctx->my_double_save = xctx->mousey_snap; need_redraw = 1; } @@ -840,8 +840,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(212, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(213, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -855,16 +855,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(214, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1))); + my_strdup(215, &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(216, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1))); + my_strdup(217, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2))); need_redraw = 1; } } @@ -875,8 +875,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(218, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(219, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -890,7 +890,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int int floaters = there_are_floaters(); 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(220, &r->prop_ptr, subst_token(r->prop_ptr, "dataset", my_itoa(track_dset))); } /* do this here to update texts printing current dataset in graph @@ -921,8 +921,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(221, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1))); + my_strdup(222, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2))); need_redraw = 1; } } else { @@ -930,8 +930,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(223, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(224, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -943,16 +943,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(225, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1))); + my_strdup(226, &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(227, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1))); + my_strdup(228, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2))); need_redraw = 1; } } @@ -963,8 +963,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(229, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(230, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -980,8 +980,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(231, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1))); + my_strdup(232, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2))); need_redraw = 1; } } else { @@ -989,8 +989,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(233, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(234, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -1005,8 +1005,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(235, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1))); + my_strdup(236, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2))); need_redraw = 1; } else { @@ -1017,8 +1017,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(237, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1))); + my_strdup(238, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2))); need_redraw = 1; } } @@ -1028,8 +1028,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(239, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(240, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -1041,8 +1041,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(241, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(242, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -1058,8 +1058,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(243, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1))); + my_strdup(244, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2))); need_redraw = 1; } else { double m = G_Y(xctx->mousey); @@ -1069,8 +1069,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(245, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1))); + my_strdup(246, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2))); need_redraw = 1; } } @@ -1080,8 +1080,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(247, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(248, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -1093,8 +1093,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(249, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(250, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -1142,8 +1142,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(251, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(252, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } } @@ -1171,8 +1171,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int if(xx1 == xx2) xx2 += 1e-6; */ 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(253, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(254, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); need_redraw = 1; } else if(i == xctx->graph_master) { clear_graphpan_at_end = 1; @@ -1610,9 +1610,9 @@ static int edit_polygon_point(int state) if(state & ShiftMask) { xctx->push_undo(); points++; - my_realloc(_ALLOC_ID_, &p->x, sizeof(double) * points); - my_realloc(_ALLOC_ID_, &p->y, sizeof(double) * points); - my_realloc(_ALLOC_ID_, &p->selected_point, sizeof(unsigned short) * points); + my_realloc(255, &p->x, sizeof(double) * points); + my_realloc(256, &p->y, sizeof(double) * points); + my_realloc(257, &p->selected_point, sizeof(unsigned short) * points); p->selected_point[i] = 0; for(j = points - 2; j > i; j--) { p->x[j + 1] = p->x[j]; @@ -1636,9 +1636,9 @@ static int edit_polygon_point(int state) p->y[j] = p->y[j + 1]; p->selected_point[j] = p->selected_point[j + 1]; } - my_realloc(_ALLOC_ID_, &p->x, sizeof(double) * points); - my_realloc(_ALLOC_ID_, &p->y, sizeof(double) * points); - my_realloc(_ALLOC_ID_, &p->selected_point, sizeof(unsigned short) * points); + my_realloc(258, &p->x, sizeof(double) * points); + my_realloc(259, &p->y, sizeof(double) * points); + my_realloc(260, &p->selected_point, sizeof(unsigned short) * points); p->points = points; p->sel = SELECTED; return 1; @@ -1986,12 +1986,12 @@ static int grabscreen(const char *winpath, int event, int mx, int my, KeySym key dbg(1, "closure.size = %ld\n", closure.size); encoded_data = base64_encode((unsigned char *)closure.buffer, closure.size, &olength, 0); dbg(1, "olength = %ld\n", olength); - my_free(_ALLOC_ID_, &closure.buffer); - my_mstrcat(_ALLOC_ID_, &prop, "flags=image,unscaled\nalpha=0.8\nimage_data=", encoded_data, NULL); - my_free(_ALLOC_ID_, &encoded_data); + my_free(261, &closure.buffer); + my_mstrcat(262, &prop, "flags=image,unscaled\nalpha=0.8\nimage_data=", encoded_data, NULL); + my_free(263, &encoded_data); storeobject(-1, xctx->mousex_snap, xctx->mousey_snap, xctx->mousex_snap + grab_w, xctx->mousey_snap + grab_h, xRECT, GRIDLAYER, SELECTED, prop); - my_free(_ALLOC_ID_, &prop); + my_free(264, &prop); xctx->need_reb_sel_arr=1; rebuild_selected_array(); move_objects(START,0,0,0); @@ -3092,11 +3092,11 @@ int rstate; /* (reduced state, without ShiftMask) */ if(!tool) { tool = tclgetintvar("sim(spicewave,default)"); my_snprintf(str, S(str), "sim(spicewave,%d,name)", tool); - my_strdup(_ALLOC_ID_, &tool_name, tclgetvar(str)); + my_strdup(265, &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(266, &tool_name); } } if(tool) { diff --git a/src/check.c b/src/check.c index 5ed485c8..22d0dc2c 100644 --- a/src/check.c +++ b/src/check.c @@ -217,14 +217,14 @@ void trim_wires(void) xctx->wire[j].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(267, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[j].prop_ptr); if(!strboolcmp(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(268, &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); @@ -240,7 +240,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(269, &wireflag, xctx->wires*sizeof(unsigned short)); memset(wireflag, 0, xctx->wires*sizeof(unsigned short)); for(i=0;iwires; ++i) { if(wireflag[i]) continue; @@ -283,8 +283,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(270, &xctx->wire[i].prop_ptr); + my_free(271, &xctx->wire[i].node); continue; } if(j) { @@ -301,7 +301,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(272, &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)); */ @@ -380,8 +380,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(273, &xctx->wire[i].prop_ptr); + my_free(274, &xctx->wire[i].node); continue; } if(j) { @@ -403,7 +403,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(275, &wireflag); update_conn_cues(WIRELAYER, 0, 0); } @@ -499,7 +499,7 @@ void break_wires_at_point(double x0, double y0, int align) 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(276, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr); if(!strboolcmp(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0), "true")) xctx->wire[xctx->wires].bus=1; else @@ -509,7 +509,7 @@ void break_wires_at_point(double x0, double y0, int align) dbg(1, "break_wires_at_pins(): hashing new wire %d: %g %g %g %g\n", xctx->wires, xctx->wire[xctx->wires].x1, xctx->wire[xctx->wires].y1, xctx->wire[xctx->wires].x2, xctx->wire[xctx->wires].y2); - my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].node, xctx->wire[i].node); + my_strdup(277, &xctx->wire[xctx->wires].node, xctx->wire[i].node); xctx->need_reb_sel_arr=1; xctx->wires++; xctx->wire[i].x1 = x0; @@ -576,7 +576,7 @@ void break_wires_at_pins(int remove) xctx->wire[xctx->wires].y2=y0; xctx->wire[xctx->wires].sel=xctx->wire[i].sel; xctx->wire[xctx->wires].prop_ptr=NULL; - my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr); + my_strdup(278, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr); if(!strboolcmp(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0), "true")) xctx->wire[xctx->wires].bus=1; else @@ -586,7 +586,7 @@ void break_wires_at_pins(int remove) dbg(1, "break_wires_at_pins(): hashing new wire %d: %g %g %g %g\n", xctx->wires, xctx->wire[xctx->wires].x1, xctx->wire[xctx->wires].y1, xctx->wire[xctx->wires].x2, xctx->wire[xctx->wires].y2); - my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].node, xctx->wire[i].node); + my_strdup(279, &xctx->wire[xctx->wires].node, xctx->wire[i].node); xctx->need_reb_sel_arr=1; xctx->wires++; } else { @@ -672,7 +672,7 @@ void break_wires_at_pins(int remove) xctx->wire[xctx->wires].sel=SELECTED; set_first_sel(WIRE, xctx->wires, 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(280, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr); if(!strboolcmp(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0), "true")) xctx->wire[xctx->wires].bus=1; else diff --git a/src/draw.c b/src/draw.c index 6a2d4334..1c7bc86e 100644 --- a/src/draw.c +++ b/src/draw.c @@ -277,7 +277,7 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in &textx1,&texty1,&textx2,&texty2, &no_of_lines, &longest_line); if(!textclip(xctx->areax1,xctx->areay1,xctx->areax2, xctx->areay2,textx1,texty1,textx2,texty2)) { - my_free(_ALLOC_ID_, &estr); + my_free(281, &estr); return; } @@ -309,7 +309,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, estr); + my_strdup2(282, &sss, estr); tt=ss=sss; for(;;) { c=*ss; @@ -330,8 +330,8 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in } ++ss; } - my_free(_ALLOC_ID_, &sss); - my_free(_ALLOC_ID_, &estr); + my_free(283, &sss); + my_free(284, &estr); } #else /* !HAS_CAIRO */ @@ -365,7 +365,7 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in &textx1,&texty1,&textx2,&texty2, &no_of_lines, &longest_line); if(!textclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2, textx1,texty1,textx2,texty2)) { - my_free(_ALLOC_ID_, &estr); + my_free(285, &estr); return; } x1=textx1;y1=texty1; @@ -401,7 +401,7 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in ++pos; a += FONTWIDTH+FONTWHITESPACE; } - my_free(_ALLOC_ID_, &estr); + my_free(286, &estr); } } @@ -420,11 +420,11 @@ void draw_temp_string(GC gctext, int what, const char *str, short rot, short fli dbg(2, "draw_string(): string=%s\n",estr); if(!text_bbox(estr, xscale, yscale, rot, flip, hcenter, vcenter, x1,y1, &textx1,&texty1,&textx2,&texty2, &tmp, &dtmp)) { - my_free(_ALLOC_ID_, &estr); + my_free(287, &estr); return; } drawtemprect(gctext,what, textx1,texty1,textx2,texty2); - my_free(_ALLOC_ID_, &estr); + my_free(288, &estr); } void get_sym_text_layer(int inst, int text_n, int *layer) @@ -648,16 +648,16 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot, polygon = &(symptr->poly[layer])[j]; bezier = !strboolcmp(get_tok_value(polygon->prop_ptr, "bezier", 0), "true"); dash = (disabled == 1) ? 3 : polygon->dash; - x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points); - y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points); + x = my_malloc(289, sizeof(double) * polygon->points); + y = my_malloc(290, sizeof(double) * polygon->points); for(k=0;kpoints; ++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, dash, bezier); /* added fill */ - my_free(_ALLOC_ID_, &x); - my_free(_ALLOC_ID_, &y); + my_free(291, &x); + my_free(292, &y); } for(j=0;j< symptr->arcs[layer]; ++j) { @@ -774,17 +774,17 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot, } #endif dbg(1, "draw_symbol(): drawing string: before translate(): text.txt_ptr=%s\n", text.txt_ptr); - my_strdup2(_ALLOC_ID_, &txtptr, translate(n, text.txt_ptr)); + my_strdup2(293, &txtptr, translate(n, text.txt_ptr)); /* do another round of substitutions if some @var are found, but if not found leave @var as is */ dbg(1, "draw_symbol(): drawing string: str=%s prop=%s\n", txtptr, text.prop_ptr ? text.prop_ptr : "NULL"); - my_strdup2(_ALLOC_ID_, &txtptr, translate3(txtptr, 1, xctx->inst[n].prop_ptr, + my_strdup2(294, &txtptr, translate3(txtptr, 1, xctx->inst[n].prop_ptr, xctx->sym[xctx->inst[n].ptr].templ, NULL )); dbg(1, "draw_symbol(): after translate3: str=%s\n", txtptr); draw_string(textlayer, what, txtptr, (text.rot + ( (flip && (text.rot & 1) ) ? rot+2 : rot) ) & 0x3, flip^text.flip, text.hcenter, text.vcenter, x0+x1, y0+y1, xscale, yscale); - my_free(_ALLOC_ID_, &txtptr); + my_free(295, &txtptr); #if HAS_CAIRO!=1 drawrect(textlayer, END, 0.0, 0.0, 0.0, 0.0, 0, -1, -1); drawline(textlayer, END, 0.0, 0.0, 0.0, 0.0, 0, NULL); @@ -895,16 +895,16 @@ void draw_temp_symbol(int what, GC gc, int n,int layer,short tmp_flip, short rot bezier = !strboolcmp(get_tok_value(polygon->prop_ptr, "bezier", 0), "true"); { /* 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(296, sizeof(double) * polygon->points); + double *y = my_malloc(297, sizeof(double) * polygon->points); for(k=0;kpoints; ++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, bezier); - my_free(_ALLOC_ID_, &x); - my_free(_ALLOC_ID_, &y); + my_free(298, &x); + my_free(299, &y); } } @@ -945,15 +945,15 @@ void draw_temp_symbol(int what, GC gc, int n,int layer,short tmp_flip, short rot #if HAS_CAIRO==1 customfont = set_text_custom_font(&text); #endif - my_strdup2(_ALLOC_ID_, &txtptr, translate(n, text.txt_ptr)); + my_strdup2(300, &txtptr, translate(n, text.txt_ptr)); /* do another round of substitutions if some @var are found, but if not found leave @var as is */ - my_strdup2(_ALLOC_ID_, &txtptr, translate3(txtptr, 1, xctx->inst[n].prop_ptr, + my_strdup2(301, &txtptr, translate3(txtptr, 1, xctx->inst[n].prop_ptr, xctx->sym[xctx->inst[n].ptr].templ, NULL )); dbg(1, "draw_temp_symbol(): after translate3: str=%s\n", txtptr); if(txtptr[0]) draw_temp_string(gc, what, txtptr, (text.rot + ( (flip && (text.rot & 1) ) ? rot+2 : rot) ) & 0x3, flip^text.flip, text.hcenter, text.vcenter, x0+x1, y0+y1, xscale, yscale); - my_free(_ALLOC_ID_, &txtptr); + my_free(302, &txtptr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); @@ -1790,10 +1790,10 @@ void drawbezier(Drawable w, GC gc, int c, double *x, double *y, int points, int double x0, x1, x2, y0, y1, y2; if(points == 0 && x == NULL && y == NULL) { /* cleanup */ - my_free(_ALLOC_ID_, &p); + my_free(303, &p); return; } - if(!p) p = my_malloc(_ALLOC_ID_, psize * sizeof(XPoint)); + if(!p) p = my_malloc(304, psize * sizeof(XPoint)); i = 0; for(b = 0; b < points - 2; b++) { if(points == 3) { /* 3 points: only one bezier */ @@ -1830,7 +1830,7 @@ void drawbezier(Drawable w, GC gc, int c, double *x, double *y, int points, int yp = (1 - t) * (1 - t) * y0 + 2 * (1 - t) * t * y1 + t * t * y2; if(i >= psize) { psize *= 2; - my_realloc(_ALLOC_ID_, &p, psize * sizeof(XPoint)); + my_realloc(305, &p, psize * sizeof(XPoint)); } p[i].x = (short)X_TO_SCREEN(xp); p[i].y = (short)Y_TO_SCREEN(yp); @@ -1865,7 +1865,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(306, sizeof(XPoint) * points); if(what) { for(i=0;igc[c], XLINEWIDTH(xctx->lw) ,LineSolid, LINECAP , LINEJOIN); } - my_free(_ALLOC_ID_, &p); + my_free(307, &p); } /* flags: bit 0: bezier @@ -1949,14 +1949,14 @@ void drawtemppolygon(GC gc, int what, double *x, double *y, int points, int flag if(bezier) { drawbezier(xctx->window, gc, 0, x, y, points, 0); } else { - p = my_malloc(_ALLOC_ID_, sizeof(XPoint) * points); + p = my_malloc(308, sizeof(XPoint) * points); for(i=0;iwindow, gc, p, points, CoordModeOrigin); - my_free(_ALLOC_ID_, &p); + my_free(309, &p); } } } @@ -2263,9 +2263,9 @@ static SPICE_DATA **get_bus_idx_array(const char *ntok, int *n_bits) *n_bits = count_items(ntok, ";,", "") - 1; dbg(1, "get_bus_idx_array(): ntok=%s\n", ntok); dbg(1, "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(310, (*n_bits) * sizeof(SPICE_DATA *)); p = 0; - my_strdup2(_ALLOC_ID_, &ntok_copy, ntok); + my_strdup2(311, &ntok_copy, ntok); nptr = ntok_copy; my_strtok_r(nptr, ";,", "", 0, &saven); /*strip off bus name (1st field) */ while( (bit_name = my_strtok_r(NULL, ";, \n", "", 0, &saven)) ) { @@ -2279,7 +2279,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(312, &ntok_copy); return idx_arr; } @@ -2318,12 +2318,12 @@ int graph_fullxzoom(int i, Graph_ctx *gr, int dataset) if(autoload == 0) autoload = 2; ptr = get_tok_value(r->prop_ptr,"rawfile",0); if(!ptr[0]) { - if(raw && raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, raw->rawfile); - else my_strdup2(_ALLOC_ID_, &custom_rawfile, ""); + if(raw && raw->rawfile) my_strdup2(313, &custom_rawfile, raw->rawfile); + else my_strdup2(314, &custom_rawfile, ""); } else { - my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr); + my_strdup2(315, &custom_rawfile, ptr); } - my_strdup2(_ALLOC_ID_, &sim_type, get_tok_value(r->prop_ptr,"sim_type",0)); + my_strdup2(316, &sim_type, get_tok_value(r->prop_ptr,"sim_type",0)); if((i == xctx->graph_master) && custom_rawfile[0]) { extra_rawfile(autoload, custom_rawfile, sim_type[0] ? sim_type : xctx->raw->sim_type, -1.0, -1.0); } @@ -2334,13 +2334,13 @@ int graph_fullxzoom(int i, Graph_ctx *gr, int dataset) ptr = get_tok_value(xctx->rect[GRIDLAYER][xctx->graph_master].prop_ptr,"rawfile",0); if(!ptr[0]) { - if(raw && raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, raw->rawfile); - else my_strdup2(_ALLOC_ID_, &custom_rawfile, ""); + if(raw && raw->rawfile) my_strdup2(317, &custom_rawfile, raw->rawfile); + else my_strdup2(318, &custom_rawfile, ""); } else { - my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr); + my_strdup2(319, &custom_rawfile, ptr); } - my_strdup2(_ALLOC_ID_, &sim_type, + my_strdup2(320, &sim_type, get_tok_value(xctx->rect[GRIDLAYER][xctx->graph_master].prop_ptr,"sim_type",0)); if(custom_rawfile[0]) { extra_rawfile(autoload, custom_rawfile, sim_type[0] ? sim_type : xctx->raw->sim_type, -1.0, -1.0); @@ -2371,12 +2371,12 @@ int graph_fullxzoom(int i, Graph_ctx *gr, int dataset) 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(321, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1))); + my_strdup(322, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2))); if(sch_waves_loaded()!= -1 && custom_rawfile[0]) extra_rawfile(5, NULL, NULL, -1.0, -1.0); - my_free(_ALLOC_ID_, &custom_rawfile); - my_free(_ALLOC_ID_, &sim_type); + my_free(323, &custom_rawfile); + my_free(324, &sim_type); need_redraw = 1; if(save_npoints != -1) { /* restore multiple OP points from artificial dc sweep */ @@ -2415,18 +2415,18 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset) autoload = !strboolcmp(get_tok_value(r->prop_ptr,"autoload",0), "1"); if(autoload == 0) autoload = 2; dbg(1, "graph_fullyzoom(): graph_dataset=%d\n", graph_dataset); - 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(325, &node, get_tok_value(r->prop_ptr,"node",0)); + my_strdup2(326, &sweep, get_tok_value(r->prop_ptr,"sweep",0)); ptr = get_tok_value(r->prop_ptr,"rawfile",0); if(!ptr[0]) { - if(raw && raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, raw->rawfile); - else my_strdup2(_ALLOC_ID_, &custom_rawfile, ""); + if(raw && raw->rawfile) my_strdup2(327, &custom_rawfile, raw->rawfile); + else my_strdup2(328, &custom_rawfile, ""); } else { - my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr); + my_strdup2(329, &custom_rawfile, ptr); } - my_strdup2(_ALLOC_ID_, &sim_type, get_tok_value(r->prop_ptr,"sim_type",0)); + my_strdup2(330, &sim_type, get_tok_value(r->prop_ptr,"sim_type",0)); save_extra_idx = xctx->extra_idx; nptr = node; @@ -2444,7 +2444,7 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset) } raw = xctx->raw; - my_strdup2(_ALLOC_ID_, &nd, find_nth(ntok, "%", "\"", 0, 2)); + my_strdup2(331, &nd, find_nth(ntok, "%", "\"", 0, 2)); /* if % is specified after node name, is the dataset number to plot in graph */ if(nd[0]) { int pos = 1; @@ -2453,25 +2453,25 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset) char *node_rawfile = NULL; char *node_sim_type = NULL; tclvareval("subst {", find_nth(nd, "\n ", "\"", 0, pos), "}", NULL); - my_strdup2(_ALLOC_ID_, &node_rawfile, tclresult()); + my_strdup2(332, &node_rawfile, tclresult()); tclvareval("subst {", find_nth(nd, "\n ", "\"", 0, pos + 1), "}", NULL); - my_strdup2(_ALLOC_ID_, &node_sim_type, tclresult()[0] ? tclresult() : + my_strdup2(333, &node_sim_type, tclresult()[0] ? tclresult() : sim_type[0] ? sim_type : xctx->raw->sim_type); dbg(1, "node_rawfile=|%s| node_sim_type=|%s|\n", node_rawfile, node_sim_type); if(node_rawfile && node_rawfile[0]) { extra_rawfile(autoload, node_rawfile, node_sim_type, -1.0, -1.0); raw = xctx->raw; } - my_free(_ALLOC_ID_, &node_rawfile); - my_free(_ALLOC_ID_, &node_sim_type); + my_free(334, &node_rawfile); + my_free(335, &node_sim_type); } if(pos == 2) node_dataset = atoi(nd); else node_dataset = -1; dbg(1, "nd=|%s|, node_dataset = %d\n", nd, node_dataset); - my_strdup(_ALLOC_ID_, &ntok_copy, find_nth(ntok, "%", "\"", 4, 1)); + my_strdup(336, &ntok_copy, find_nth(ntok, "%", "\"", 4, 1)); } else { node_dataset = -1; - my_strdup(_ALLOC_ID_, &ntok_copy, ntok); + my_strdup(337, &ntok_copy, ntok); } /* transform multiple OP points into a dc sweep */ @@ -2483,14 +2483,14 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset) raw->npoints[0] = raw->allpoints; } - my_free(_ALLOC_ID_, &nd); + my_free(338, &nd); dbg(1, "ntok=|%s|\nntok_copy=|%s|\nnode_dataset=%d\n", ntok, ntok_copy, node_dataset); tmp_ptr = find_nth(ntok_copy, ";", "\"", 4, 2); if(strstr(tmp_ptr, ",")) { tmp_ptr = find_nth(tmp_ptr, ",", "\"", 4, 1); /* also trim spaces */ - my_strdup2(_ALLOC_ID_, &bus_msb, trim_chars(tmp_ptr, "\n ")); + my_strdup2(339, &bus_msb, trim_chars(tmp_ptr, "\n ")); } dbg(1, "ntok_copy=|%s|, bus_msb=|%s|\n", ntok_copy, bus_msb ? bus_msb : "NULL"); stok = my_strtok_r(sptr, "\n\t ", "\"", 0, &saves); @@ -2504,9 +2504,9 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset) if(!bus_msb) { char *express = NULL; if(strstr(ntok_copy, ";")) { - my_strdup2(_ALLOC_ID_, &express, find_nth(ntok_copy, ";", "\"", 0, 2)); + my_strdup2(340, &express, find_nth(ntok_copy, ";", "\"", 0, 2)); } else { - my_strdup2(_ALLOC_ID_, &express, ntok_copy); + my_strdup2(341, &express, ntok_copy); } if(strpbrk(express, " \n\t")) { /* we *need* to recalculate the expression column for any new expression @@ -2515,7 +2515,7 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset) } else { v = get_raw_index(express, NULL); } - my_free(_ALLOC_ID_, &express); + my_free(342, &express); dbg(1, "graph_fullyzoom(): v=%d\n", v); } if(xctx->raw && v >= 0) { @@ -2558,7 +2558,7 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset) sweepvar_wrap++; } /* for(dset...) */ } - if(bus_msb) my_free(_ALLOC_ID_, &bus_msb); + if(bus_msb) my_free(343, &bus_msb); if(save_npoints != -1) { /* restore multiple OP points from artificial dc sweep */ raw->datasets = save_datasets; raw->npoints[0] = save_npoints; @@ -2573,18 +2573,18 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset) 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_free(_ALLOC_ID_, &custom_rawfile); - my_free(_ALLOC_ID_, &sim_type); - if(ntok_copy) my_free(_ALLOC_ID_, &ntok_copy); - 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(344, &node); + my_free(345, &sweep); + my_free(346, &custom_rawfile); + my_free(347, &sim_type); + if(ntok_copy) my_free(348, &ntok_copy); + my_strdup(349, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(min))); + my_strdup(350, &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(351, &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(352, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", get_tok_value(r->prop_ptr, "y2", 0) )); need_redraw = 1; } @@ -3115,18 +3115,18 @@ static void draw_graph_variables(int wcnt, int wave_color, int n_nodes, int swee char *alias_ptr = NULL; dbg(1, "ntok=%s\n", ntok); if(strstr(ntok, ";")) { - my_strdup2(_ALLOC_ID_, &alias_ptr, find_nth(ntok, ";", "\"", 0, 1)); - my_strdup2(_ALLOC_ID_, &ntok_ptr, find_nth(ntok, ";", "\"", 0, 2)); + my_strdup2(353, &alias_ptr, find_nth(ntok, ";", "\"", 0, 1)); + my_strdup2(354, &ntok_ptr, find_nth(ntok, ";", "\"", 0, 2)); } else { - my_strdup2(_ALLOC_ID_, &alias_ptr, ntok); - my_strdup2(_ALLOC_ID_, &ntok_ptr, ntok); + my_strdup2(355, &alias_ptr, ntok); + my_strdup2(356, &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(357, &alias_ptr); + my_free(358, &ntok_ptr); } if(gr->digital) { double xt = gr->x1 - 15 * gr->txtsizelab; @@ -3262,8 +3262,8 @@ int embed_rawfile(const char *rawfile) xInstance *i = &xctx->inst[xctx->sel_array[0].n]; xctx->push_undo(); 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(359, &i->prop_ptr, subst_token(i->prop_ptr, "spice_data", ptr)); + my_free(360, &ptr); set_modify(1); } return res; @@ -3288,9 +3288,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(361, &node, get_tok_value(r->prop_ptr,"node",0)); + my_strdup2(362, &color, get_tok_value(r->prop_ptr,"color",0)); + my_strdup2(363, &sweep, get_tok_value(r->prop_ptr,"sweep",0)); nptr = node; cptr = color; sptr = sweep; @@ -3328,10 +3328,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(364, &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(365, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave))); } } } @@ -3353,19 +3353,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(366, &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(367, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave))); } } } } ++wcnt; } /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", 0, &saven)) ) */ - my_free(_ALLOC_ID_, &node); - my_free(_ALLOC_ID_, &color); - my_free(_ALLOC_ID_, &sweep); + my_free(368, &node); + my_free(369, &color); + my_free(370, &sweep); return ret; } @@ -3466,18 +3466,18 @@ 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(371, &node, get_tok_value(r->prop_ptr,"node",0)); + my_strdup2(372, &sweep, get_tok_value(r->prop_ptr,"sweep",0)); ptr = get_tok_value(r->prop_ptr,"rawfile",0); if(!ptr[0]) { - if(raw && raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, raw->rawfile); - else my_strdup2(_ALLOC_ID_, &custom_rawfile, ""); + if(raw && raw->rawfile) my_strdup2(373, &custom_rawfile, raw->rawfile); + else my_strdup2(374, &custom_rawfile, ""); } else { - my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr); + my_strdup2(375, &custom_rawfile, ptr); } - my_strdup2(_ALLOC_ID_, &sim_type, get_tok_value(r->prop_ptr,"sim_type",0)); + my_strdup2(376, &sim_type, get_tok_value(r->prop_ptr,"sim_type",0)); if(sch_waves_loaded()!= -1 && custom_rawfile[0]) { extra_rawfile(autoload, custom_rawfile, sim_type[0] ? sim_type : xctx->raw->sim_type, -1.0, -1.0); } @@ -3504,9 +3504,9 @@ int find_closest_wave(int i, Graph_ctx *gr) expression = 0; if(raw->values) { if(strstr(ntok, ";")) { - my_strdup2(_ALLOC_ID_, &express, find_nth(ntok, ";", "\"", 0, 2)); + my_strdup2(377, &express, find_nth(ntok, ";", "\"", 0, 2)); } else { - my_strdup2(_ALLOC_ID_, &express, ntok); + my_strdup2(378, &express, ntok); } if(strpbrk(express, " \n\t")) { expression = 1; @@ -3590,14 +3590,14 @@ int find_closest_wave(int i, Graph_ctx *gr) ++wcnt; } /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", 0, &saven)) ) */ dbg(0, "closest dataset=%d\n", closest_dataset); - if(express) my_free(_ALLOC_ID_, &express); + if(express) my_free(379, &express); if(sch_waves_loaded()!= -1 && custom_rawfile[0]) extra_rawfile(5, NULL, NULL, -1.0, -1.0); - my_free(_ALLOC_ID_, &custom_rawfile); - my_free(_ALLOC_ID_, &sim_type); + my_free(380, &custom_rawfile); + my_free(381, &sim_type); - my_free(_ALLOC_ID_, &node); - my_free(_ALLOC_ID_, &sweep); + my_free(382, &node); + my_free(383, &sweep); return closest_dataset; } @@ -3683,18 +3683,18 @@ 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(384, &node, get_tok_value(r->prop_ptr,"node",0)); + my_strdup2(385, &color, get_tok_value(r->prop_ptr,"color",0)); + my_strdup2(386, &sweep, get_tok_value(r->prop_ptr,"sweep",0)); ptr = get_tok_value(r->prop_ptr,"rawfile",0); if(!ptr[0]) { - if(xctx->raw && xctx->raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, xctx->raw->rawfile); - else my_strdup2(_ALLOC_ID_, &custom_rawfile, ""); + if(xctx->raw && xctx->raw->rawfile) my_strdup2(387, &custom_rawfile, xctx->raw->rawfile); + else my_strdup2(388, &custom_rawfile, ""); } else { - my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr); + my_strdup2(389, &custom_rawfile, ptr); } - my_strdup2(_ALLOC_ID_, &sim_type, get_tok_value(r->prop_ptr,"sim_type",0)); + my_strdup2(390, &sim_type, get_tok_value(r->prop_ptr,"sim_type",0)); dbg(1, "draw_graph(): graph %d: custom_rawfile=%s autoload=%d sim_type=%s\n", i, custom_rawfile, autoload, sim_type); save_extra_idx = xctx->extra_idx; @@ -3719,7 +3719,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) continue; } } - my_strdup2(_ALLOC_ID_, &nd, find_nth(ntok, "%", "\"", 0, 2)); + my_strdup2(391, &nd, find_nth(ntok, "%", "\"", 0, 2)); if(wcnt >= n_nodes) { dbg(0, "draw_graph(): WARNING: wcnt (wave #) >= n_nodes (counted # of waves)\n"); dbg(0, "draw_graph(): n_nodes=%d\n", n_nodes); @@ -3735,29 +3735,29 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) char *node_rawfile = NULL; char *node_sim_type = NULL; tclvareval("subst {", find_nth(nd, "\n ", "\"", 0, pos), "}", NULL); - my_strdup2(_ALLOC_ID_, &node_rawfile, tclresult()); + my_strdup2(392, &node_rawfile, tclresult()); tclvareval("subst {", find_nth(nd, "\n ", "\"", 0, pos + 1), "}", NULL); - my_strdup2(_ALLOC_ID_, &node_sim_type, tclresult()[0] ? tclresult() : + my_strdup2(393, &node_sim_type, tclresult()[0] ? tclresult() : sim_type[0] ? sim_type : xctx->raw->sim_type); dbg(1, "node_rawfile=|%s| node_sim_type=|%s|\n", node_rawfile, node_sim_type); if(node_rawfile && node_rawfile[0]) { if(extra_rawfile(autoload, node_rawfile, node_sim_type, -1.0, -1.0) == 0) { - my_free(_ALLOC_ID_, &node_rawfile); - my_free(_ALLOC_ID_, &node_sim_type); - my_free(_ALLOC_ID_, &nd); + my_free(394, &node_rawfile); + my_free(395, &node_sim_type); + my_free(396, &nd); continue; } } - my_free(_ALLOC_ID_, &node_rawfile); - my_free(_ALLOC_ID_, &node_sim_type); + my_free(397, &node_rawfile); + my_free(398, &node_sim_type); } if(pos == 2) node_dataset = atoi(nd); else node_dataset = -1; dbg(1, "nd=|%s|, node_dataset = %d\n", nd, node_dataset); - my_strdup(_ALLOC_ID_, &ntok_copy, find_nth(ntok, "%", "\"", 4, 1)); + my_strdup(399, &ntok_copy, find_nth(ntok, "%", "\"", 4, 1)); } else { node_dataset = -1; - my_strdup(_ALLOC_ID_, &ntok_copy, ntok); + my_strdup(400, &ntok_copy, ntok); } /* transform multiple OP points into a dc sweep */ @@ -3770,14 +3770,14 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) xctx->raw->npoints[0] = xctx->raw->allpoints; } - my_free(_ALLOC_ID_, &nd); + my_free(401, &nd); dbg(1, "ntok=|%s|\nntok_copy=|%s|\nnode_dataset=%d\n", ntok, ntok_copy, node_dataset); tmp_ptr = find_nth(ntok_copy, ";", "\"", 4, 2); if(strstr(tmp_ptr, ",")) { tmp_ptr = find_nth(tmp_ptr, ",", "\"", 4, 1); /* also trim spaces */ - my_strdup2(_ALLOC_ID_, &bus_msb, trim_chars(tmp_ptr, "\n ")); + my_strdup2(402, &bus_msb, trim_chars(tmp_ptr, "\n ")); } dbg(1, "ntok_copy=|%s|, bus_msb=|%s|\n", ntok_copy, bus_msb ? bus_msb : "NULL"); ctok = my_strtok_r(cptr, " ", "", 0, &savec); @@ -3799,9 +3799,9 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) expression = 0; if(xctx->raw && xctx->raw->values && !bus_msb) { if(strstr(ntok_copy, ";")) { - my_strdup2(_ALLOC_ID_, &express, find_nth(ntok_copy, ";", "\"", 0, 2)); + my_strdup2(403, &express, find_nth(ntok_copy, ";", "\"", 0, 2)); } else { - my_strdup2(_ALLOC_ID_, &express, ntok_copy); + my_strdup2(404, &express, ntok_copy); } dbg(1, "express=|%s|\n", express); if(strpbrk(express, " \n\t")) { @@ -3850,7 +3850,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) ofs_end = ofs + xctx->raw->npoints[dset]; first = -1; poly_npoints = 0; - my_realloc(_ALLOC_ID_, &point, xctx->raw->npoints[dset] * sizeof(XPoint)); + my_realloc(405, &point, xctx->raw->npoints[dset] * sizeof(XPoint)); /* Process "npoints" simulation items * p loop split repeated 2 timed (for x and y points) to preserve cache locality */ prev_x = 0; @@ -3935,11 +3935,11 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) show_node_measures(measure_p, measure_x, measure_prev_x, bus_msb, wave_color, idx, idx_arr, n_bits, n_nodes, ntok_copy, wcnt, gr, r, cursor1); - my_free(_ALLOC_ID_, &point); - if(idx_arr) my_free(_ALLOC_ID_, &idx_arr); + my_free(406, &point); + if(idx_arr) my_free(407, &idx_arr); } /* if( expression || (idx = get_raw_index(bus_msb ? bus_msb : express, NULL)) != -1 ) */ ++wcnt; - if(bus_msb) my_free(_ALLOC_ID_, &bus_msb); + if(bus_msb) my_free(408, &bus_msb); if(save_npoints != -1) { /* restore multiple OP points from artificial dc sweep */ xctx->raw->datasets = save_datasets; xctx->raw->npoints[0] = save_npoints; @@ -3950,14 +3950,14 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) } } /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", 0, &saven)) ) */ - if(ntok_copy) my_free(_ALLOC_ID_, &ntok_copy); - if(express) my_free(_ALLOC_ID_, &express); + if(ntok_copy) my_free(409, &ntok_copy); + if(express) my_free(410, &express); /* if(sch_waves_loaded()!= -1 && custom_rawfile[0]) extra_rawfile(5, NULL, NULL, -1.0, -1.0); */ - my_free(_ALLOC_ID_, &custom_rawfile); - my_free(_ALLOC_ID_, &sim_type); - my_free(_ALLOC_ID_, &node); - my_free(_ALLOC_ID_, &color); - my_free(_ALLOC_ID_, &sweep); + my_free(411, &custom_rawfile); + my_free(412, &sim_type); + my_free(413, &node); + my_free(414, &color); + my_free(415, &sweep); } /* if(flags & 8) */ /* * bbox(START, 0.0, 0.0, 0.0, 0.0); @@ -4063,7 +4063,7 @@ cairo_status_t png_writer(void *in_closure, const unsigned char *in_data, unsign 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(416, &closure->buffer, closure->pos + length + 65536); closure->size = closure->pos + length + 65536; } memcpy(closure->buffer + closure->pos, in_data, length); @@ -4209,9 +4209,9 @@ int edit_image(int what, xRect *r) /* put base64 encoded data to rect image_data attribute */ encoded_data = base64_encode((unsigned char *)closure.buffer, closure.size, &olength, 0); - my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", encoded_data)); - my_free(_ALLOC_ID_, &closure.buffer); - my_free(_ALLOC_ID_, &encoded_data); + my_strdup2(417, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", encoded_data)); + my_free(418, &closure.buffer); + my_free(419, &encoded_data); } dbg(1, "size_x = %d, size_y = %d, stride = %d\n", size_x, size_y, stride); return 1; @@ -4245,7 +4245,7 @@ static cairo_surface_t *get_surface_from_file(const char *filename, const char * fd = fopen(filename, fopen_read_mode); if(fd) { size_t bytes_read; - filedata = my_malloc(_ALLOC_ID_, filesize); + filedata = my_malloc(420, filesize); if((bytes_read = fread(filedata, 1, filesize, fd)) < filesize) { filesize = bytes_read; dbg(0, "get_surface_from_file(): less bytes read than expected from %s, got %ld bytes\n", @@ -4264,11 +4264,11 @@ static cairo_surface_t *get_surface_from_file(const char *filename, const char * size_t filtered_img_size = 0; char *filtered_img_data = NULL; filter_data(filedata, filesize, &filtered_img_data, &filtered_img_size, filter); - my_free(_ALLOC_ID_, &filedata); + my_free(421, &filedata); closure.buffer = (unsigned char *)filtered_img_data; closure.size = filtered_img_size; closure.pos = 0; - my_free(_ALLOC_ID_, &filter); + my_free(422, &filter); } else { /* no filter attribute */ closure.buffer = (unsigned char *)filedata; filedata = NULL; @@ -4294,7 +4294,7 @@ static cairo_surface_t *get_surface_from_file(const char *filename, const char * if(!surface || cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) { if(jpg != 1) dbg(0, "draw_image(): failure creating image surface from %s\n", filename); if(surface) cairo_surface_destroy(surface); - my_free(_ALLOC_ID_, &closure.buffer); + my_free(423, &closure.buffer); *buffer = NULL; *size = 0; return NULL; @@ -4337,7 +4337,7 @@ static cairo_surface_t *get_surface_from_b64data(const char *attr, size_t attr_l if(surface) cairo_surface_destroy(surface); surface = NULL; } - my_free(_ALLOC_ID_, &closure.buffer); + my_free(424, &closure.buffer); return surface; } #endif /* HAS_CAIRO==1 */ @@ -4390,16 +4390,16 @@ int draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2, char *encoded_data = NULL; size_t olength; - my_strdup(_ALLOC_ID_, &filter, get_tok_value(r->prop_ptr, "filter", 0)); + my_strdup(425, &filter, get_tok_value(r->prop_ptr, "filter", 0)); emb_ptr->image = get_surface_from_file(filename, filter, &buffer, &size); if(!emb_ptr->image) { return 0; } /* put base64 encoded data to rect image_data attribute */ encoded_data = base64_encode((unsigned char *)buffer, size, &olength, 0); - my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", encoded_data)); - my_free(_ALLOC_ID_, &encoded_data); - my_free(_ALLOC_ID_, &buffer); + my_strdup2(426, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", encoded_data)); + my_free(427, &encoded_data); + my_free(428, &buffer); } else { /* no emb_ptr->image and no "image_data" attribute */ return 0; } @@ -4551,7 +4551,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(429, &closure.buffer); cairo_surface_destroy(png_sfc); xctx->draw_pixmap=1; xctx->draw_window=save_draw_window; @@ -4573,7 +4573,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(430, &ptr); #endif } diff --git a/src/editprop.c b/src/editprop.c index 6d7c3f75..1173cbdd 100644 --- a/src/editprop.c +++ b/src/editprop.c @@ -127,7 +127,7 @@ char *my_fgets(FILE *fd, size_t *line_len) if(line_len) *line_len = 0; while(fgets(buf, SIZE, fd)) { - my_strcat(_ALLOC_ID_, &s, buf); + my_strcat(431, &s, buf); len = strlen(buf); if(line_len) *line_len += len; if(buf[len - 1] == '\n') break; @@ -193,7 +193,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(432, dest); dbg(3,"my_strdup(%d,): freed destination ptr\n", id); } @@ -206,7 +206,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(433, dest); } if(src!=NULL && src[0]!='\0') { @@ -236,7 +236,7 @@ char *my_expand(const char *s, int tabstop) if(!s) { return NULL; } - my_strcat2(_ALLOC_ID_, &t, ""); + my_strcat2(434, &t, ""); while(*sptr) { if(*sptr == '\t') { int i; @@ -249,7 +249,7 @@ char *my_expand(const char *s, int tabstop) pad[1] = '\0'; spos++; } - my_strcat2(_ALLOC_ID_, &t, pad); + my_strcat2(435, &t, pad); if(*sptr == '\n') spos = 0; sptr++; } @@ -427,7 +427,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(436, dest); dbg(3,"my_strdup2(%d,): freed destination ptr\n", id); } return 0; @@ -776,11 +776,11 @@ 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_strdup(437, &xctx->inst[i].prop_ptr, ptr); if(get_tok_value(ptr, "name",0)[0]) { - my_strdup(_ALLOC_ID_, &tmp, xctx->inst[i].prop_ptr); + my_strdup(438, &tmp, xctx->inst[i].prop_ptr); new_prop_string(i, tmp, tclgetboolvar("disable_unique_names")); /* sets also inst[].instname */ - my_free(_ALLOC_ID_, &tmp); + my_free(439, &tmp); } } @@ -941,7 +941,7 @@ static int edit_rect_property(int x) fprintf(errfp, "edit_rect_property() : unknown parameter x=%d\n",x); return 0; } - my_strdup(_ALLOC_ID_, &oldprop, xctx->rect[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr); + my_strdup(440, &oldprop, xctx->rect[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr); if(oldprop && oldprop[0]) { tclsetvar("retval",oldprop); } else { @@ -965,7 +965,7 @@ static int edit_rect_property(int x) if(oldprop && preserve == 1) { set_different_token(&xctx->rect[c][n].prop_ptr, (char *) tclgetvar("retval"), oldprop); } else { - my_strdup(_ALLOC_ID_, &xctx->rect[c][n].prop_ptr, + my_strdup(441, &xctx->rect[c][n].prop_ptr, (char *) tclgetvar("retval")); } set_rect_flags(&xctx->rect[c][n]); /* set cached .flags bitmask from attributes */ @@ -1019,7 +1019,7 @@ static int edit_rect_property(int x) bbox(END , 0.0 , 0.0 , 0.0 , 0.0); } } - my_free(_ALLOC_ID_, &oldprop); + my_free(442, &oldprop); return modified; } @@ -1029,7 +1029,7 @@ static int edit_line_property(void) const char *dash; int preserve, modified = 0; char *oldprop=NULL; - my_strdup(_ALLOC_ID_, &oldprop, xctx->line[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr); + my_strdup(443, &oldprop, xctx->line[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr); if(oldprop && oldprop[0]) { tclsetvar("retval", oldprop); } else { @@ -1051,7 +1051,7 @@ static int edit_line_property(void) if(oldprop && preserve == 1) { set_different_token(&xctx->line[c][n].prop_ptr, (char *) tclgetvar("retval"), oldprop); } else { - my_strdup(_ALLOC_ID_, &xctx->line[c][n].prop_ptr, + my_strdup(444, &xctx->line[c][n].prop_ptr, (char *) tclgetvar("retval")); } xctx->line[c][n].bus = !strboolcmp(get_tok_value(xctx->line[c][n].prop_ptr,"bus",0), "true"); @@ -1073,7 +1073,7 @@ static int edit_line_property(void) bbox(END , 0.0 , 0.0 , 0.0 , 0.0); modified = 1; } - my_free(_ALLOC_ID_, &oldprop); + my_free(445, &oldprop); return modified; } @@ -1085,7 +1085,7 @@ static int 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(446, &oldprop, xctx->wire[xctx->sel_array[0].n].prop_ptr); if(oldprop && oldprop[0]) { tclsetvar("retval", oldprop); } else { @@ -1111,7 +1111,7 @@ static int edit_wire_property(void) if(oldprop && preserve == 1) { set_different_token(&xctx->wire[k].prop_ptr, (char *) tclgetvar("retval"), oldprop); } else { - my_strdup(_ALLOC_ID_, &xctx->wire[k].prop_ptr,(char *) tclgetvar("retval")); + my_strdup(447, &xctx->wire[k].prop_ptr,(char *) tclgetvar("retval")); } bus_ptr = get_tok_value(xctx->wire[k].prop_ptr,"bus",0); if(!strboolcmp(bus_ptr, "true")) { @@ -1137,7 +1137,7 @@ static int edit_wire_property(void) bbox(END , 0.0 , 0.0 , 0.0 , 0.0); modified = 1; } - my_free(_ALLOC_ID_, &oldprop); + my_free(448, &oldprop); return modified; } @@ -1150,7 +1150,7 @@ static int edit_arc_property(void) const char *dash, *fill_ptr; int preserve, modified = 0; - my_strdup(_ALLOC_ID_, &oldprop, xctx->arc[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr); + my_strdup(449, &oldprop, xctx->arc[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr); if(oldprop && oldprop[0]) { tclsetvar("retval", oldprop); } else { @@ -1173,7 +1173,7 @@ static int edit_arc_property(void) set_different_token(&xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"), oldprop); } else { - my_strdup(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval")); + my_strdup(450, &xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval")); } old_fill = xctx->arc[c][i].fill; fill_ptr = get_tok_value(xctx->arc[c][i].prop_ptr,"fill",0); @@ -1225,7 +1225,7 @@ static int edit_polygon_property(void) int preserve, modified = 0; 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(451, &oldprop, xctx->poly[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr); if(oldprop && oldprop[0]) { tclsetvar("retval", oldprop); } else { @@ -1248,7 +1248,7 @@ static int edit_polygon_property(void) if(oldprop && preserve == 1) { set_different_token(&xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval"), oldprop); } else { - my_strdup(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval")); + my_strdup(452, &xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval")); } old_fill = xctx->poly[c][i].fill; old_dash = xctx->poly[c][i].dash; @@ -1315,7 +1315,7 @@ static int 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(453, &oldprop, xctx->text[sel].prop_ptr); if(oldprop && oldprop[0]) tclsetvar("props", oldprop); else @@ -1370,7 +1370,7 @@ static int edit_text_property(int x) xctx->text[sel].yscale, (short)rot, (short)flip, xctx->text[sel].hcenter, xctx->text[sel].vcenter, xctx->text[sel].x0, xctx->text[sel].y0, &xx1,&yy1,&xx2,&yy2, &tmp, &dtmp); - my_free(_ALLOC_ID_, &estr); + my_free(454, &estr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); @@ -1379,7 +1379,7 @@ static int edit_text_property(int x) /* dbg(1, "edit_property(): text props=%s text=%s\n", tclgetvar("props"), tclgetvar("retval")); */ if(text_changed) { double cg; - my_free(_ALLOC_ID_, &xctx->text[sel].floater_ptr); + my_free(455, &xctx->text[sel].floater_ptr); cg = tclgetdoublevar("cadgrid"); c = xctx->rects[PINLAYER]; for(l=0;lrect[PINLAYER][l].prop_ptr, + my_strdup(456, &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(457, &xctx->rect[PINLAYER][l].prop_ptr, subst_token(xctx->rect[PINLAYER][l].prop_ptr, "name", (char *) tclgetvar("retval")) ); } } } - my_strdup2(_ALLOC_ID_, &xctx->text[sel].txt_ptr, (char *) tclgetvar("retval")); + my_strdup2(458, &xctx->text[sel].txt_ptr, (char *) tclgetvar("retval")); } if(props_changed) { if(oldprop && preserve) set_different_token(&xctx->text[sel].prop_ptr, (char *) tclgetvar("props"), oldprop); else - my_strdup(_ALLOC_ID_, &xctx->text[sel].prop_ptr,(char *) tclgetvar("props")); + my_strdup(459, &xctx->text[sel].prop_ptr,(char *) tclgetvar("props")); - my_free(_ALLOC_ID_, &xctx->text[sel].floater_ptr); + my_free(460, &xctx->text[sel].floater_ptr); set_text_flags(&xctx->text[sel]); } if(text_changed || props_changed) { @@ -1427,7 +1427,7 @@ static int edit_text_property(int x) } /* for(k=0;klastsel; ++k) */ draw(); } - my_free(_ALLOC_ID_, &oldprop); + my_free(461, &oldprop); return modified; } @@ -1447,9 +1447,9 @@ int drc_check(int i) end = i + 1; } for(j = start; j < end; j++) { - my_strdup(_ALLOC_ID_, &drc, get_tok_value(xctx->sym[xctx->inst[j].ptr].prop_ptr, "drc", 2)); + my_strdup(462, &drc, get_tok_value(xctx->sym[xctx->inst[j].ptr].prop_ptr, "drc", 2)); if(drc) { - my_strdup(_ALLOC_ID_, &res, translate3(drc, 1, + my_strdup(463, &res, translate3(drc, 1, xctx->inst[j].prop_ptr, xctx->sym[xctx->inst[j].ptr].templ, NULL)); dbg(1, "drc_check(): res = |%s|, drc=|%s|\n", res, drc); if(res) { @@ -1460,13 +1460,13 @@ int drc_check(int i) result = tcleval(replace_res); if(result && result[0]) { ret = 1; - my_mstrcat(_ALLOC_ID_, &check_result, result, NULL); + my_mstrcat(464, &check_result, result, NULL); } } } } - if(drc) my_free(_ALLOC_ID_, &drc); - if(res) my_free(_ALLOC_ID_, &res); + if(drc) my_free(465, &drc); + if(res) my_free(466, &res); if(check_result) { if(has_x) { /* tclvareval("alert_ {", check_result, "} {}", NULL); */ @@ -1475,7 +1475,7 @@ int drc_check(int i) } else { dbg(0, "%s\n", check_result); } - my_free(_ALLOC_ID_, &check_result); + my_free(467, &check_result); } return ret; } @@ -1500,19 +1500,19 @@ static int update_symbol(const char *result, int x, int selected_inst) *ii = selected_inst; if(!result) { dbg(1, "update_symbol(): edit symbol prop aborted\n"); - my_free(_ALLOC_ID_, &xctx->old_prop); + my_free(468, &xctx->old_prop); return 0; } /* create new_prop updated attribute string */ if(*netl_com && x==1) { - my_strdup(_ALLOC_ID_, &new_prop, + my_strdup(469, &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(470, &new_prop, (char *) tclgetvar("retval")); dbg(1, "update_symbol(): new_prop=%s\n", new_prop); } my_strncpy(symbol, (char *) tclgetvar("symbol") , S(symbol)); @@ -1540,18 +1540,18 @@ static int update_symbol(const char *result, int x, int selected_inst) /* 20171220 calculate bbox before changes to correctly redraw areas */ /* must be recalculated as cairo text extents vary with zoom factor. */ symbol_bbox(*ii, &xctx->inst[*ii].x1, &xctx->inst[*ii].y1, &xctx->inst[*ii].x2, &xctx->inst[*ii].y2); - my_strdup2(_ALLOC_ID_, &old_translated_sym, translate(*ii, xctx->inst[*ii].name)); + my_strdup2(471, &old_translated_sym, translate(*ii, xctx->inst[*ii].name)); /* update property string from tcl dialog */ if(!no_change_props) { if(only_different) { char * ss=NULL; - my_strdup(_ALLOC_ID_, &ss, xctx->inst[*ii].prop_ptr); + my_strdup(472, &ss, xctx->inst[*ii].prop_ptr); if( set_different_token(&ss, new_prop, xctx->old_prop) ) { if(!pushed) { xctx->push_undo(); pushed=1;} - my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, ss); + my_strdup(473, &xctx->inst[*ii].prop_ptr, ss); } - my_free(_ALLOC_ID_, &ss); + my_free(474, &ss); } else { if(new_prop) { @@ -1560,11 +1560,11 @@ static int update_symbol(const char *result, int x, int selected_inst) xctx->inst[*ii].prop_ptr, new_prop); if(!pushed) { xctx->push_undo(); pushed=1;} dbg(1, "update_symbol(): *ii=%d, new_prop=%s\n", *ii, new_prop ? new_prop : "NULL"); - my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, new_prop); + my_strdup(475, &xctx->inst[*ii].prop_ptr, new_prop); } } else { if(!pushed) { xctx->push_undo(); pushed=1;} - my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, ""); + my_strdup(476, &xctx->inst[*ii].prop_ptr, ""); } } } @@ -1573,7 +1573,7 @@ static int update_symbol(const char *result, int x, int selected_inst) * to use for inst name (from symbol template) */ prefix = 0; sym_number = -1; - my_strdup2(_ALLOC_ID_, &translated_sym, translate(*ii, symbol)); + my_strdup2(477, &translated_sym, translate(*ii, symbol)); dbg(1, "update_symbol: %s -- %s\n", translated_sym, old_translated_sym); if(changed_symbol || ( !strcmp(symbol, xctx->inst[*ii].name) && strcmp(translated_sym, old_translated_sym) ) ) { @@ -1589,23 +1589,23 @@ static int update_symbol(const char *result, int x, int selected_inst) 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(478, &xctx->inst[*ii].name, rel_sym_path(symbol)); xctx->inst[*ii].ptr=sym_number; /* update instance to point to new symbol */ } - my_free(_ALLOC_ID_, &translated_sym); - my_free(_ALLOC_ID_, &old_translated_sym); + my_free(479, &translated_sym); + my_free(480, &old_translated_sym); /* if symbol changed ensure instance name (with new prefix char) is unique */ /* preserve backslashes in name ---------0---------------------------------->. */ - my_strdup(_ALLOC_ID_, &name, get_tok_value(xctx->inst[*ii].prop_ptr, "name", 1)); + my_strdup(481, &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); /* change prefix if changing symbol type; */ if(prefix && old_prefix && old_prefix != prefix) { name[0]=(char)prefix; - my_strdup(_ALLOC_ID_, &ptr, subst_token(xctx->inst[*ii].prop_ptr, "name", name) ); + my_strdup(482, &ptr, subst_token(xctx->inst[*ii].prop_ptr, "name", name) ); } else { - my_strdup(_ALLOC_ID_, &ptr, xctx->inst[*ii].prop_ptr); + my_strdup(483, &ptr, xctx->inst[*ii].prop_ptr); } /* set unique name of current inst */ if(!pushed) { xctx->push_undo(); pushed=1;} @@ -1636,10 +1636,10 @@ static int update_symbol(const char *result, int x, int selected_inst) /* redraw symbol with new props */ set_modify(-2); /* reset floaters caches */ draw(); - 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(484, &name); + my_free(485, &ptr); + my_free(486, &new_prop); + my_free(487, &xctx->old_prop); return modified; } @@ -1666,12 +1666,12 @@ static int edit_symbol_property(int x, int first_sel) else { tclsetvar("retval",""); } - my_strdup(_ALLOC_ID_, &xctx->old_prop, xctx->inst[*ii].prop_ptr); + my_strdup(488, &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(489, &result, tclresult()); } else { /* edit_vi_netlist_prop will replace \" with " before editing, @@ -1680,11 +1680,11 @@ static int edit_symbol_property(int x, int first_sel) 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(490, &result, tclresult()); } dbg(1, "edit_symbol_property(): before update_symbol, modified=%d\n", xctx->modified); modified = update_symbol(result, x, *ii); - my_free(_ALLOC_ID_, &result); + my_free(491, &result); dbg(1, "edit_symbol_property(): done update_symbol, modified=%d\n", modified); *ii=-1; return modified; @@ -1780,7 +1780,7 @@ char *str_replace(const char *str, const char *rep, const char *with, int escape int cond; if(s==NULL || rep == NULL || with == NULL || rep[0] == '\0') { - my_free(_ALLOC_ID_, &result); + my_free(492, &result); size = 0; return NULL; } @@ -1789,7 +1789,7 @@ char *str_replace(const char *str, const char *rep, const char *with, int escape dbg(1, "str_replace(): %s, %s, %s\n", s, rep, with); if( size == 0 ) { size = CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &result, size); + my_realloc(493, &result, size); } while(*s) { STR_ALLOC(&result, result_pos + with_len + 1, &size); @@ -1814,7 +1814,7 @@ char *str_chars_replace(const char *str, const char *replace_set, const char wit { char *res = NULL; char *s; - my_strdup(_ALLOC_ID_, &res, str); + my_strdup(494, &res, str); s = res; dbg(1, "*str_chars_replace(): %s\n", res); while( *s) { @@ -1881,9 +1881,9 @@ void edit_property(int x) dbg(1, "edit_property(): done executing edit_vi_prop, result=%s\n",tclresult()); dbg(1, "edit_property(): tctx::rcode=%s\n",tclgetvar("tctx::rcode") ); - my_strdup(_ALLOC_ID_, &new_prop, (char *) tclgetvar("retval")); + my_strdup(495, &new_prop, (char *) tclgetvar("retval")); tclsetvar("retval", new_prop); - my_free(_ALLOC_ID_, &new_prop); + my_free(496, &new_prop); if(strcmp(tclgetvar("tctx::rcode"),"") ) @@ -1892,31 +1892,31 @@ void edit_property(int x) (!xctx->schsymbolprop || strcmp(xctx->schsymbolprop, tclgetvar("retval") ) ) ) { xctx->push_undo(); modified = 1; - my_strdup(_ALLOC_ID_, &xctx->schsymbolprop, (char *) tclgetvar("retval")); + my_strdup(497, &xctx->schsymbolprop, (char *) tclgetvar("retval")); } else if(xctx->netlist_type==CAD_VERILOG_NETLIST && (!xctx->schverilogprop || strcmp(xctx->schverilogprop, tclgetvar("retval") ) ) ) { modified = 1; xctx->push_undo(); - my_strdup(_ALLOC_ID_, &xctx->schverilogprop, (char *) tclgetvar("retval")); + my_strdup(498, &xctx->schverilogprop, (char *) tclgetvar("retval")); } else if(xctx->netlist_type==CAD_SPICE_NETLIST && (!xctx->schprop || strcmp(xctx->schprop, tclgetvar("retval") ) ) ) { modified = 1; xctx->push_undo(); - my_strdup(_ALLOC_ID_, &xctx->schprop, (char *) tclgetvar("retval")); + my_strdup(499, &xctx->schprop, (char *) tclgetvar("retval")); } else if(xctx->netlist_type==CAD_TEDAX_NETLIST && (!xctx->schtedaxprop || strcmp(xctx->schtedaxprop, tclgetvar("retval") ) ) ) { modified = 1; xctx->push_undo(); - my_strdup(_ALLOC_ID_, &xctx->schtedaxprop, (char *) tclgetvar("retval")); + my_strdup(500, &xctx->schtedaxprop, (char *) tclgetvar("retval")); } else if(xctx->netlist_type==CAD_VHDL_NETLIST && (!xctx->schvhdlprop || strcmp(xctx->schvhdlprop, tclgetvar("retval") ) ) ) { modified = 1; xctx->push_undo(); - my_strdup(_ALLOC_ID_, &xctx->schvhdlprop, (char *) tclgetvar("retval")); + my_strdup(501, &xctx->schvhdlprop, (char *) tclgetvar("retval")); } } diff --git a/src/expandlabel.y b/src/expandlabel.y index 1b4c639f..e6b7a951 100644 --- a/src/expandlabel.y +++ b/src/expandlabel.y @@ -70,13 +70,13 @@ static char *expandlabel_strdup(char *src) char *ptr; if(src==NULL || src[0]=='\0') { ptr=NULL; - my_strdup(_ALLOC_ID_, &ptr,""); + my_strdup(502, &ptr,""); return ptr; } else { ptr=NULL; - my_strdup(_ALLOC_ID_, &ptr,src); + my_strdup(503, &ptr,src); dbg(3, "expandlabel_strdup(): duplicated %lu string %s\n",(unsigned long)ptr,src); return ptr; } @@ -90,7 +90,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(504, 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); @@ -105,7 +105,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(505, 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); @@ -128,7 +128,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(506, (len+1)*n); str[0]='\0'; for(pos=s;pos<=s+len;pos++) { if(*pos==',' || *pos=='\0') { @@ -162,7 +162,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(507, (len+1)*n); for(i=1;i<=n;i++) { /* strcpy(pos,s); */ @@ -181,8 +181,8 @@ static char *expandlabel_strbus_suffix(char *s, int *n, char *suffix) int tmplen; char *res=NULL; char *tmp=NULL; - my_realloc(_ALLOC_ID_, &res, n[0] * (strlen(s) + strlen(suffix) + 30)); - my_realloc(_ALLOC_ID_, &tmp, strlen(s) + strlen(suffix) + 30); + my_realloc(508, &res, n[0] * (strlen(s) + strlen(suffix) + 30)); + my_realloc(509, &tmp, strlen(s) + strlen(suffix) + 30); l=0; for(i=1;iinst[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(553, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if(!type) continue; no_of_pin_rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER]; @@ -241,7 +241,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(554, &type); } static void find_closest_arc(double mx,double my) @@ -371,7 +371,7 @@ static void find_closest_text(double mx,double my) xctx->text[i].hcenter, xctx->text[i].vcenter, xctx->text[i].x0, xctx->text[i].y0, &xx1,&yy1, &xx2,&yy2, &tmp, &dtmp); - my_free(_ALLOC_ID_, &estr); + my_free(555, &estr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); diff --git a/src/font.c b/src/font.c index 749b563e..52096003 100644 --- a/src/font.c +++ b/src/font.c @@ -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(556, 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;ilastsel; ++i) @@ -60,6 +60,6 @@ void compile_font(void) clear_drawing(); unselect_all(1); xctx->currsch = 0; - my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]); + my_free(557, &xctx->sch[xctx->currsch]); } diff --git a/src/hash_iterator.c b/src/hash_iterator.c index 9334f7c4..d180d08b 100644 --- a/src/hash_iterator.c +++ b/src/hash_iterator.c @@ -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(558, &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(559, &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(560, &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(561, &ctx->wireflag); return NULL; } } @@ -139,7 +139,7 @@ void init_object_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, do ctx->objectflag = NULL; dbg(3, "init_object_iterator(): objects=%d\n", xctx->n_hash_objects); if(xctx->n_hash_objects) { - my_realloc(_ALLOC_ID_, &ctx->objectflag, xctx->n_hash_objects * sizeof(unsigned short)); + my_realloc(562, &ctx->objectflag, xctx->n_hash_objects * sizeof(unsigned short)); memset(ctx->objectflag, 0, xctx->n_hash_objects * sizeof(unsigned short)); } /* calculate square 4 1st corner of drawing area */ @@ -182,7 +182,7 @@ Objectentry *object_iterator_next(Iterator_ctx *ctx) ctx->tmpj = ctx->j % NBOXES; if(ctx->tmpj < 0) ctx->tmpj += NBOXES; ctx->objectptr = xctx->object_spatial_table[ctx->tmpi][ctx->tmpj]; } else { - my_free(_ALLOC_ID_, &ctx->objectflag); + my_free(563, &ctx->objectflag); return NULL; } } diff --git a/src/hilight.c b/src/hilight.c index 5c6fd02f..a9d6adc2 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -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(564, &entry->token); + my_free(565, &entry->path); + my_free(566, &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(567, s ); entry->next = NULL; - entry->token = my_malloc(_ALLOC_ID_, lent); + entry->token = my_malloc(568, lent); memcpy(entry->token, token, lent); - entry->path = my_malloc(_ALLOC_ID_, lenp); + entry->path = my_malloc(569, 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(570, &entry->token); + my_free(571, &entry->path); + my_free(572, &entry); *preventry=saveptr; } else if(what == XINSERT ) { entry->oldvalue = entry->value; @@ -137,13 +137,13 @@ Hilight_hashentry *inst_hilight_hash_lookup(int i, int value, int what) Hilight_hashentry *entry; if(IS_LABEL_SH_OR_PIN( (xctx->inst[i].ptr+xctx->sym)->type )) label = 1; 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(573, len); /* instance name uglyfication: add a space at beginning so it will never match a valid net name */ /* use 2 spaces for pins/labels to distinguish from other instances */ if(label) my_snprintf(inst_tok, len, " %s", token); else my_snprintf(inst_tok, len, " %s", token); entry = hilight_hash_lookup(inst_tok, value, what); - my_free(_ALLOC_ID_, &inst_tok); + my_free(574, &inst_tok); return entry; } @@ -166,7 +166,7 @@ Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int wha if(!ptr1) xctx->some_nets_added = 1; return ptr1; } - my_strdup(_ALLOC_ID_, &string, expandlabel(token,&mult)); + my_strdup(575, &string, expandlabel(token,&mult)); if(string==NULL) { return NULL; } @@ -190,7 +190,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(576, &string); return ptr2; } @@ -201,9 +201,9 @@ Hilight_hashentry *hier_hilight_hash_lookup(const char *token, int value, const char *oldpath = xctx->sch_path[xctx->currsch]; xctx->sch_path_hash[xctx->currsch] = 0; xctx->sch_path[xctx->currsch] = NULL; - my_strdup2(_ALLOC_ID_, &xctx->sch_path[xctx->currsch], path); + my_strdup2(577, &xctx->sch_path[xctx->currsch], path); entry = bus_hilight_hash_lookup(token, value, what); - my_free(_ALLOC_ID_, &xctx->sch_path[xctx->currsch]); + my_free(578, &xctx->sch_path[xctx->currsch]); xctx->sch_path[xctx->currsch] = oldpath; xctx->sch_path_hash[xctx->currsch] = 0; return entry; @@ -231,11 +231,11 @@ void display_hilights(int what, char **str) dbg(1, "what=%d, instance=%d, token=%s\n", what, instance, ptr); if( ((what & 1) && !instance) || ((what & 2) && instance) ) { if(instance) ptr++; /* skip uglyfication space */ - 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, ptr); - my_strcat(_ALLOC_ID_, str,"}"); + if(!first) my_strcat(579, str, " "); + my_strcat(580, str,"{"); + my_strcat(581, str, entry->path+1); + my_strcat(582, str, ptr); + my_strcat(583, str,"}"); first = 0; } skip: @@ -279,7 +279,7 @@ int hilight_graph_node(const char *node, int col) ++path_skip; } - my_strdup2(_ALLOC_ID_, &n, node); + my_strdup2(584, &n, node); nptr = n; dbg(1, "hilight_graph_node(): path_skip=%s, %s: %d\n", path_skip, node, col); @@ -296,12 +296,12 @@ int hilight_graph_node(const char *node, int col) path3 = nptr; nptr = ptr2 + 1; if(!strstr(path_skip, path3)) - my_mstrcat(_ALLOC_ID_, &path2, path, path3, ".", NULL); + my_mstrcat(585, &path2, path, path3, ".", NULL); else - my_strdup2(_ALLOC_ID_, &path2, path); + my_strdup2(586, &path2, path); } else { - my_strdup2(_ALLOC_ID_, &path2, path); + my_strdup2(587, &path2, path); } if(current) { nptr--; @@ -313,8 +313,8 @@ int hilight_graph_node(const char *node, int col) dbg(1, "hilight_graph_node(): propagate_hilights(), col=%d\n", col); propagate_hilights(1, 0, XINSERT_NOREPLACE); } - my_free(_ALLOC_ID_, &n); - my_free(_ALLOC_ID_, &path2); + my_free(588, &n); + my_free(589, &path2); return 1; } @@ -398,12 +398,12 @@ void create_plot_cmd(void) if(exists) { viewer = tclgetintvar("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(590, &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(591, &viewer_name); } if(!exists || !viewer) return; my_snprintf(plotfile, S(plotfile), "%s/xplot", tclgetvar("netlist_dir")); @@ -438,24 +438,24 @@ void create_plot_cmd(void) fprintf(fd, "%s", str); fprintf(fd, "\n"); first = 1; - my_free(_ALLOC_ID_, &str); + my_free(592, &str); } fprintf(fd, "set color%d=rgb:%s\n", idx, color_str); if(first) { - my_strcat(_ALLOC_ID_, &str, "plot "); + my_strcat(593, &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(594, &str, "\""); + my_strcat(595, &str, (entry->path)+1); + my_strcat(596, &str, tok); + my_strcat(597, &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(598, &t, tok); + my_strdup2(599, &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); @@ -468,15 +468,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(600, &p); + my_free(601, &t); } if(viewer == BESPICE) { 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(602, &t, tok); + my_strdup2(603, &p, (entry->path)+1); /* bespice command syntax : add_voltage_on_spice_node_to_plot
[] @@ -488,8 +488,8 @@ void create_plot_cmd(void) "{add_voltage_on_spice_node_to_plot * \"\" \"", p, t, "\" 0 ", color_str, "}", NULL); - my_free(_ALLOC_ID_, &p); - my_free(_ALLOC_ID_, &t); + my_free(604, &p); + my_free(605, &t); } } entry = entry->next; @@ -498,7 +498,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(606, &str); fclose(fd); } if(viewer == GAW) { @@ -538,16 +538,16 @@ void hilight_net_pin_mismatches(void) for(k=0; klastsel; ++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(607, &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;ihilight_nets) propagate_hilights(1, 0, XINSERT_NOREPLACE); redraw_hilights(0); } @@ -592,12 +592,12 @@ void hilight_parent_pins(void) { char *p_n_s1, *p_n_s2; if(!xctx->inst[i].node || !xctx->inst[i].node[j]) continue; - my_strdup(_ALLOC_ID_, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult)); + my_strdup(615, &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); dbg(1, "pin_name=%s\n", pin_name); if(!pin_name[0]) continue; - my_strdup(_ALLOC_ID_, &pin_node, expandlabel(pin_name, &mult)); + my_strdup(616, &pin_node, expandlabel(pin_name, &mult)); dbg(1, "hilight_parent_pins(): pin_node=%s\n", pin_node); p_n_s1 = pin_node; @@ -628,8 +628,8 @@ void hilight_parent_pins(void) } } } - my_free(_ALLOC_ID_, &pin_node); - my_free(_ALLOC_ID_, &net_node); + my_free(617, &pin_node); + my_free(618, &net_node); } void hilight_child_pins(void) @@ -660,11 +660,11 @@ void hilight_child_pins(void) dbg(1, "hilight_child_pins(): inst_number=%d\n", inst_number); if(!xctx->inst[i].node || !xctx->inst[i].node[j]) continue; - my_strdup(_ALLOC_ID_, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult)); + my_strdup(619, &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(620, &pin_node, expandlabel(pin_name, &mult)); dbg(1, "hilight_child_pins(): pin_node=%s\n", pin_node); p_n_s1 = pin_node; for(k = 1; k<=mult; ++k) { @@ -683,8 +683,8 @@ void hilight_child_pins(void) p_n_s1 = NULL; } /* for(k..) */ } - my_free(_ALLOC_ID_, &pin_node); - my_free(_ALLOC_ID_, &net_node); + my_free(621, &pin_node); + my_free(622, &net_node); } @@ -774,7 +774,7 @@ int search(const char *tok, const char *val, int sub, int sel, int match_case) } 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(623, &tmpname,get_tok_value((xctx->inst[i].ptr+ xctx->sym)->prop_ptr,tok+6,0)); has_token = xctx->tok_size; if(tmpname) { str = tmpname; @@ -1019,7 +1019,7 @@ int search(const char *tok, const char *val, int sub, int sel, int match_case) regfree(&re); #endif xctx->draw_window = save_draw; - my_free(_ALLOC_ID_, &tmpname); + my_free(624, &tmpname); return found; } @@ -1050,10 +1050,10 @@ static void drill_hilight(int mode) if(xctx->inst[i].node && xctx->inst[i].node[j] && strstr(xctx->inst[i].node[j], "#net") == xctx->inst[i].node[j]) { - my_strdup2(_ALLOC_ID_, &netname,xctx->inst[i].node[j]); + my_strdup2(625, &netname,xctx->inst[i].node[j]); } else { /* mult here will be set to pin multiplicity */ - my_strdup2(_ALLOC_ID_, &netname, net_name(i, j, &mult, 1, 0)); + my_strdup2(626, &netname, net_name(i, j, &mult, 1, 0)); } /* mult here will be set to net multiplicity */ expandlabel(netname, &mult); @@ -1066,7 +1066,7 @@ static void drill_hilight(int mode) xctx->inst[i].color = entry->value; inst_hilight_hash_lookup(i, entry->value, XINSERT_NOREPLACE); } - my_strdup(_ALLOC_ID_, &propagate_str, get_tok_value(rct[j].prop_ptr, "propag", 0)); + my_strdup(627, &propagate_str, get_tok_value(rct[j].prop_ptr, "propag", 0)); if(propagate_str) { int n = 1; const char *propag; @@ -1084,9 +1084,9 @@ static void drill_hilight(int mode) if(xctx->inst[i].node && xctx->inst[i].node[propagate] && strstr(xctx->inst[i].node[propagate], "#net") == xctx->inst[i].node[propagate]) { - my_strdup2(_ALLOC_ID_, &propagated_net,xctx->inst[i].node[propagate]); + my_strdup2(628, &propagated_net,xctx->inst[i].node[propagate]); } else { - my_strdup2(_ALLOC_ID_, &propagated_net, net_name(i, propagate, &mult2, 1, 0)); + my_strdup2(629, &propagated_net, net_name(i, propagate, &mult2, 1, 0)); } netbitname = find_nth(propagated_net, ",", "", 0, k); dbg(1, "netbitname=%s\n", netbitname); @@ -1102,9 +1102,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(630, &netname); + if(propagated_net) my_free(631, &propagated_net); + if(propagate_str) my_free(632, &propagate_str); } int hilight_netname(const char *name) @@ -1143,9 +1143,9 @@ static void send_net_to_bespice(int simtype, const char *node) sprintf(color_str, "#%02x%02x%02x", 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(633, &p, xctx->sch_path[xctx->currsch]+1); for(k=1; k<=tok_mult; ++k) { - my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", "", 0, k)); + my_strdup(634, &t, find_nth(expanded_tok, ",", "", 0, k)); /* bespice command syntax : add_voltage_on_spice_node_to_plot
[] plot name is "*" => automatic @@ -1157,8 +1157,8 @@ static void send_net_to_bespice(int simtype, const char *node) p, t, "\" 0 ", color_str, "}", NULL); } - my_free(_ALLOC_ID_, &p); - my_free(_ALLOC_ID_, &t); + my_free(635, &p); + my_free(636, &t); } } @@ -1182,7 +1182,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(637, &p, xctx->sch_path[xctx->currsch]+1); path = p; start_level = sch_waves_loaded(); if(path) { @@ -1195,20 +1195,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, ",", "", 0, k)); + my_strdup(638, &t, find_nth(expanded_tok, ",", "", 0, 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(639, s, ss); } else { /* Xyce */ my_snprintf(ss, S(ss), "%s%s %d", path, t, c); - my_strcat(_ALLOC_ID_, s, ss); + my_strcat(640, s, ss); } } - my_free(_ALLOC_ID_, &p); - my_free(_ALLOC_ID_, &t); + my_free(641, &p); + my_free(642, &t); } } @@ -1233,11 +1233,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(643, &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, ",", "", 0, k)); + my_strdup(644, &t, find_nth(expanded_tok, ",", "", 0, k)); strtolower(t); if(simtype == 0 ) { /* ngspice */ tclvareval("puts $gaw_fd {copyvar v(", path, t, @@ -1247,8 +1247,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(645, &p); + my_free(646, &t); } } @@ -1269,9 +1269,9 @@ static void send_current_to_bespice(int simtype, const char *node) sprintf(color_str, "#%02x%02x%02x", 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(647, &p, xctx->sch_path[xctx->currsch]+1); for(k=1; k<=tok_mult; ++k) { - my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", "", 0, k)); + my_strdup(648, &t, find_nth(expanded_tok, ",", "", 0, k)); /* bespice command syntax : add_current_through_spice_device_to_plot
[] plot name is "*" => automatic @@ -1283,8 +1283,8 @@ static void send_current_to_bespice(int simtype, const char *node) p, t, "\" 0 ", color_str, "}", NULL); } - my_free(_ALLOC_ID_, &p); - my_free(_ALLOC_ID_, &t); + my_free(649, &p); + my_free(650, &t); } static void send_current_to_graph(char **s, int simtype, const char *node) @@ -1299,7 +1299,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(651, &p, xctx->sch_path[xctx->currsch]+1); path = p; start_level = sch_waves_loaded(); if(path) { @@ -1313,22 +1313,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, ",", "", 0, k)); + my_strdup(652, &t, find_nth(expanded_tok, ",", "", 0, 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(653, 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(654, s, ss); } } - my_free(_ALLOC_ID_, &p); - my_free(_ALLOC_ID_, &t); + my_free(655, &p); + my_free(656, &t); } static void send_current_to_gaw(int simtype, const char *node) @@ -1348,12 +1348,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(657, &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, ",", "", 0, k)); + my_strdup(658, &t, find_nth(expanded_tok, ",", "", 0, k)); strtolower(t); if(!simtype) { /* spice */ tclvareval("puts $gaw_fd {copyvar i(", there_is_hierarchy ? "v." : "", path, t, @@ -1373,8 +1373,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(659, &p); + my_free(660, &t); } /* hilight/clear pin/label instances attached to hilight nets, or instances with "highlight=true" @@ -1649,21 +1649,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(661, &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(662, &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(663, &xctx->simdata[i].pin[j].function, get_tok_value(symbol->prop_ptr, function, 0)); + my_strdup(664, &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; @@ -1679,12 +1679,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(665, &xctx->simdata[i].pin[j].function); + my_free(666, &xctx->simdata[i].pin[j].go_to); } - if(npin) my_free(_ALLOC_ID_, &xctx->simdata[i].pin); + if(npin) my_free(667, &xctx->simdata[i].pin); } - my_free(_ALLOC_ID_, &xctx->simdata); + my_free(668, &xctx->simdata); } xctx->simdata_ninst = 0; } @@ -1809,7 +1809,7 @@ static void propagate_logic() if( tclresult()[0] == '1') break; ++iter; } /* while(1) */ - /* my_free(_ALLOC_ID_, &propagated_net); */ + /* my_free(669, &propagated_net); */ } void logic_set(int value, int num, const char *net_name) @@ -1949,7 +1949,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(670, &s); } if(!incr_hi) incr_hilight_color(); if(xctx->hilight_nets) propagate_hilights(1, 0, XINSERT_NOREPLACE); @@ -2067,7 +2067,7 @@ char *resolved_net(const char *net) /* global node ? return as is */ if(net && record_global_node(3, NULL, net)) { - my_strdup(_ALLOC_ID_, &rnet, net); + my_strdup(671, &rnet, net); return rnet; } if(net) { @@ -2091,18 +2091,18 @@ char *resolved_net(const char *net) } } dbg(1, "path=%s\n", path); - my_strdup2(_ALLOC_ID_, &exp_net, expandlabel(net, &mult)); + my_strdup2(672, &exp_net, expandlabel(net, &mult)); n_s1 = exp_net; for(k = 0; k < mult; k++) { char *net_name = my_strtok_r(n_s1, ",", "", 0, &n_s2); level = xctx->currsch; n_s1 = NULL; - my_strdup2(_ALLOC_ID_, &resolved_net, net_name); + my_strdup2(673, &resolved_net, net_name); dbg(1, "resolved_net(): resolved_net=%s\n", resolved_net); if(xctx->currsch > 0) { /* check if net passed by attribute instead of by port */ const char *ptr = get_tok_value(xctx->hier_attr[xctx->currsch - 1].prop_ptr, resolved_net, 0); if(ptr && ptr[0]) { - my_strdup2(_ALLOC_ID_, &resolved_net, ptr); + my_strdup2(674, &resolved_net, ptr); level--; dbg(1, "lcc[%d].prop_ptr=%s\n", xctx->currsch - 1, xctx->hier_attr[xctx->currsch - 1].prop_ptr); dbg(1, "resolved_net(): resolved_net=%s\n", resolved_net); @@ -2111,13 +2111,13 @@ char *resolved_net(const char *net) while(level > start_level) { /* get net from parent nets attached to port if resolved_net is a port */ entry = str_hash_lookup(&xctx->portmap[level], resolved_net, NULL, XLOOKUP); if(entry) { - my_strdup2(_ALLOC_ID_, &resolved_net, entry->value); + my_strdup2(675, &resolved_net, entry->value); dbg(1, "resolved_net(): while loop: resolved_net=%s\n", resolved_net); } else break; level--; } - my_strdup2(_ALLOC_ID_, &path2, path); + my_strdup2(676, &path2, path); skip = start_level; path2_ptr = path2; if(level == start_level) path2_ptr[0] = '\0'; @@ -2132,15 +2132,15 @@ char *resolved_net(const char *net) dbg(1, "path2=%s level=%d start_level=%d\n", path2, level, start_level); if(record_global_node(3, NULL, resolved_net)) { - my_strdup2(_ALLOC_ID_, &rnet, resolved_net); + my_strdup2(677, &rnet, resolved_net); } else { - my_mstrcat(_ALLOC_ID_, &rnet, path2, resolved_net, NULL); + my_mstrcat(678, &rnet, path2, resolved_net, NULL); } - if(k < mult - 1) my_strcat(_ALLOC_ID_, &rnet, ","); + if(k < mult - 1) my_strcat(679, &rnet, ","); } - if(resolved_net) my_free(_ALLOC_ID_, &resolved_net); - my_free(_ALLOC_ID_, &path2); - my_free(_ALLOC_ID_, &exp_net); + if(resolved_net) my_free(680, &resolved_net); + my_free(681, &path2); + my_free(682, &exp_net); } dbg(1, "resolved_net(): got %s, return %s\n", net, rnet); return rnet; @@ -2261,14 +2261,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(683, &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(684, &filetmp2); return; } - my_strdup(_ALLOC_ID_, &filetmp1, filename_ptr); + my_strdup(685, &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); @@ -2341,8 +2341,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(686, &filetmp1); + my_free(687, &filetmp2); } void list_hilights(int all) diff --git a/src/in_memory_undo.c b/src/in_memory_undo.c index 07497d74..ce346e32 100644 --- a/src/in_memory_undo.c +++ b/src/in_memory_undo.c @@ -28,9 +28,9 @@ static void free_undo_lines(int slot) for(c = 0;cuslot[slot].lines[c]; ++i) { - my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr[c][i].prop_ptr); + my_free(688, &xctx->uslot[slot].lptr[c][i].prop_ptr); } - my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr[c]); + my_free(689, &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;cuslot[slot].rects[c]; ++i) { - my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr[c][i].prop_ptr); + my_free(690, &xctx->uslot[slot].bptr[c][i].prop_ptr); } - my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr[c]); + my_free(691, &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;cuslot[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(692, &xctx->uslot[slot].pptr[c][i].prop_ptr); + my_free(693, &xctx->uslot[slot].pptr[c][i].x); + my_free(694, &xctx->uslot[slot].pptr[c][i].y); + my_free(695, &xctx->uslot[slot].pptr[c][i].selected_point); } - my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c]); + my_free(696, &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;cuslot[slot].arcs[c]; ++i) { - my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr[c][i].prop_ptr); + my_free(697, &xctx->uslot[slot].aptr[c][i].prop_ptr); } - my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr[c]); + my_free(698, &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;iuslot[slot].wires; ++i) { - my_free(_ALLOC_ID_, &xctx->uslot[slot].wptr[i].prop_ptr); + my_free(699, &xctx->uslot[slot].wptr[i].prop_ptr); } - my_free(_ALLOC_ID_, &xctx->uslot[slot].wptr); + my_free(700, &xctx->uslot[slot].wptr); xctx->uslot[slot].wires = 0; } @@ -93,13 +93,13 @@ static void free_undo_texts(int slot) int i; for(i = 0;iuslot[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(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].floater_instname); - my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].floater_ptr); + my_free(701, &xctx->uslot[slot].tptr[i].prop_ptr); + my_free(702, &xctx->uslot[slot].tptr[i].txt_ptr); + my_free(703, &xctx->uslot[slot].tptr[i].font); + my_free(704, &xctx->uslot[slot].tptr[i].floater_instname); + my_free(705, &xctx->uslot[slot].tptr[i].floater_ptr); } - my_free(_ALLOC_ID_, &xctx->uslot[slot].tptr); + my_free(706, &xctx->uslot[slot].tptr); xctx->uslot[slot].texts = 0; } @@ -108,12 +108,12 @@ static void free_undo_instances(int slot) int i; for(i = 0;iuslot[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(707, &xctx->uslot[slot].iptr[i].name); + my_free(708, &xctx->uslot[slot].iptr[i].prop_ptr); + my_free(709, &xctx->uslot[slot].iptr[i].instname); + my_free(710, &xctx->uslot[slot].iptr[i].lab); } - my_free(_ALLOC_ID_, &xctx->uslot[slot].iptr); + my_free(711, &xctx->uslot[slot].iptr); xctx->uslot[slot].instances = 0; } @@ -125,77 +125,77 @@ 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(_ALLOC_ID_, &sym->parent_prop_ptr); + my_free(712, &sym->name); + my_free(713, &sym->prop_ptr); + my_free(714, &sym->type); + my_free(715, &sym->templ); + my_free(716, &sym->parent_prop_ptr); for(c = 0;cpolygons[c]; ++j) { if(sym->poly[c][j].prop_ptr != NULL) { - my_free(_ALLOC_ID_, &sym->poly[c][j].prop_ptr); + my_free(717, &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(718, &sym->poly[c][j].x); + my_free(719, &sym->poly[c][j].y); + my_free(720, &sym->poly[c][j].selected_point); } - my_free(_ALLOC_ID_, &sym->poly[c]); + my_free(721, &sym->poly[c]); sym->polygons[c] = 0; for(j = 0;jlines[c]; ++j) { if(sym->line[c][j].prop_ptr != NULL) { - my_free(_ALLOC_ID_, &sym->line[c][j].prop_ptr); + my_free(722, &sym->line[c][j].prop_ptr); } } - my_free(_ALLOC_ID_, &sym->line[c]); + my_free(723, &sym->line[c]); sym->lines[c] = 0; for(j = 0;jarcs[c]; ++j) { if(sym->arc[c][j].prop_ptr != NULL) { - my_free(_ALLOC_ID_, &sym->arc[c][j].prop_ptr); + my_free(724, &sym->arc[c][j].prop_ptr); } } - my_free(_ALLOC_ID_, &sym->arc[c]); + my_free(725, &sym->arc[c]); sym->arcs[c] = 0; for(j = 0;jrects[c]; ++j) { if(sym->rect[c][j].prop_ptr != NULL) { - my_free(_ALLOC_ID_, &sym->rect[c][j].prop_ptr); + my_free(726, &sym->rect[c][j].prop_ptr); } } - my_free(_ALLOC_ID_, &sym->rect[c]); + my_free(727, &sym->rect[c]); sym->rects[c] = 0; } for(j = 0;jtexts; ++j) { if(sym->text[j].prop_ptr != NULL) { - my_free(_ALLOC_ID_, &sym->text[j].prop_ptr); + my_free(728, &sym->text[j].prop_ptr); } if(sym->text[j].txt_ptr != NULL) { - my_free(_ALLOC_ID_, &sym->text[j].txt_ptr); + my_free(729, &sym->text[j].txt_ptr); } if(sym->text[j].font != NULL) { - my_free(_ALLOC_ID_, &sym->text[j].font); + my_free(730, &sym->text[j].font); } if(sym->text[j].floater_instname != NULL) { - my_free(_ALLOC_ID_, &sym->text[j].floater_instname); + my_free(731, &sym->text[j].floater_instname); } if(sym->text[j].floater_ptr != NULL) { - my_free(_ALLOC_ID_, &sym->text[j].floater_ptr); + my_free(732, &sym->text[j].floater_ptr); } } - my_free(_ALLOC_ID_, &sym->text); + my_free(733, &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(734, &sym->line); + my_free(735, &sym->rect); + my_free(736, &sym->poly); + my_free(737, &sym->arc); + my_free(738, &sym->lines); + my_free(739, &sym->rects); + my_free(740, &sym->polygons); + my_free(741, &sym->arcs); } - my_free(_ALLOC_ID_, &xctx->uslot[slot].symptr); + my_free(742, &xctx->uslot[slot].symptr); xctx->uslot[slot].symbols = 0; } @@ -206,14 +206,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;slotuslot[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(743, cadlayers, sizeof(int)); + xctx->uslot[slot].rects = my_calloc(744, cadlayers, sizeof(int)); + xctx->uslot[slot].arcs = my_calloc(745, cadlayers, sizeof(int)); + xctx->uslot[slot].polygons = my_calloc(746, cadlayers, sizeof(int)); + xctx->uslot[slot].lptr = my_calloc(747, cadlayers, sizeof(xLine *)); + xctx->uslot[slot].bptr = my_calloc(748, cadlayers, sizeof(xRect *)); + xctx->uslot[slot].aptr = my_calloc(749, cadlayers, sizeof(xArc *)); + xctx->uslot[slot].pptr = my_calloc(750, cadlayers, sizeof(xPoly *)); } xctx->undo_initialized = 1; } @@ -248,14 +248,14 @@ void mem_delete_undo(void) if(!xctx->undo_initialized) return; mem_clear_undo(); for(slot = 0;slotuslot[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(751, &xctx->uslot[slot].lines); + my_free(752, &xctx->uslot[slot].rects); + my_free(753, &xctx->uslot[slot].arcs); + my_free(754, &xctx->uslot[slot].polygons); + my_free(755, &xctx->uslot[slot].lptr); + my_free(756, &xctx->uslot[slot].bptr); + my_free(757, &xctx->uslot[slot].aptr); + my_free(758, &xctx->uslot[slot].pptr); } xctx->undo_initialized = 0; } @@ -268,11 +268,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(759, &xctx->uslot[slot].gptr, xctx->schvhdlprop); + my_strdup(760, &xctx->uslot[slot].vptr, xctx->schverilogprop); + my_strdup(761, &xctx->uslot[slot].sptr, xctx->schprop); + my_strdup(762, &xctx->uslot[slot].kptr, xctx->schsymbolprop); + my_strdup(763, &xctx->uslot[slot].eptr, xctx->schtedaxprop); free_undo_lines(slot); free_undo_rects(slot); @@ -288,15 +288,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;cuslot[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(764, xctx->lines[c], sizeof(xLine)); + xctx->uslot[slot].bptr[c] = my_calloc(765, xctx->rects[c], sizeof(xRect)); + xctx->uslot[slot].pptr[c] = my_calloc(766, xctx->polygons[c], sizeof(xPoly)); + xctx->uslot[slot].aptr[c] = my_calloc(767, 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(768, xctx->wires, sizeof(xWire)); + xctx->uslot[slot].tptr = my_calloc(769, xctx->texts, sizeof(xText)); + xctx->uslot[slot].iptr = my_calloc(770, xctx->instances, sizeof(xInstance)); + xctx->uslot[slot].symptr = my_calloc(771, xctx->symbols, sizeof(xSymbol)); xctx->uslot[slot].texts = xctx->texts; xctx->uslot[slot].instances = xctx->instances; xctx->uslot[slot].symbols = xctx->symbols; @@ -307,34 +307,34 @@ void mem_push_undo(void) for(i = 0;ilines[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(772, &xctx->uslot[slot].lptr[c][i].prop_ptr, xctx->line[c][i].prop_ptr); } /* rects */ for(i = 0;irects[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(773, &xctx->uslot[slot].bptr[c][i].prop_ptr, xctx->rect[c][i].prop_ptr); } /* arcs */ for(i = 0;iarcs[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(774, &xctx->uslot[slot].aptr[c][i].prop_ptr, xctx->arc[c][i].prop_ptr); } /*polygons */ for(i = 0;ipolygons[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(775, points * sizeof(double)); + xctx->uslot[slot].pptr[c][i].y = my_malloc(776, points * sizeof(double)); + xctx->uslot[slot].pptr[c][i].selected_point = my_malloc(777, 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(778, &xctx->uslot[slot].pptr[c][i].prop_ptr, xctx->poly[c][i].prop_ptr); } } /* instances */ @@ -345,10 +345,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_strdup2(_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_strdup2(_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_strdup2(779, &xctx->uslot[slot].iptr[i].lab, xctx->inst[i].lab); + my_strdup2(780, &xctx->uslot[slot].iptr[i].instname, xctx->inst[i].instname); + my_strdup2(781, &xctx->uslot[slot].iptr[i].prop_ptr, xctx->inst[i].prop_ptr); + my_strdup2(782, &xctx->uslot[slot].iptr[i].name, xctx->inst[i].name); } /* symbols */ @@ -363,11 +363,11 @@ void mem_push_undo(void) xctx->uslot[slot].tptr[i].font = NULL; xctx->uslot[slot].tptr[i].floater_instname = NULL; xctx->uslot[slot].tptr[i].floater_ptr = NULL; - my_strdup2(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].prop_ptr, xctx->text[i].prop_ptr); - my_strdup2(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].txt_ptr, xctx->text[i].txt_ptr); - my_strdup2(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].font, xctx->text[i].font); - my_strdup2(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].floater_instname, xctx->text[i].floater_instname); - my_strdup2(_ALLOC_ID_, &xctx->uslot[slot].tptr[i].floater_ptr, xctx->text[i].floater_ptr); + my_strdup2(783, &xctx->uslot[slot].tptr[i].prop_ptr, xctx->text[i].prop_ptr); + my_strdup2(784, &xctx->uslot[slot].tptr[i].txt_ptr, xctx->text[i].txt_ptr); + my_strdup2(785, &xctx->uslot[slot].tptr[i].font, xctx->text[i].font); + my_strdup2(786, &xctx->uslot[slot].tptr[i].floater_instname, xctx->text[i].floater_instname); + my_strdup2(787, &xctx->uslot[slot].tptr[i].floater_ptr, xctx->text[i].floater_ptr); } /* wires */ @@ -375,7 +375,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(788, &xctx->uslot[slot].wptr[i].prop_ptr, xctx->wire[i].prop_ptr); } @@ -416,78 +416,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(789, &xctx->wire); + my_free(790, &xctx->text); + my_free(791, &xctx->inst); for(i = 0;irect[i]); - my_free(_ALLOC_ID_, &xctx->line[i]); - my_free(_ALLOC_ID_, &xctx->poly[i]); - my_free(_ALLOC_ID_, &xctx->arc[i]); + my_free(792, &xctx->rect[i]); + my_free(793, &xctx->line[i]); + my_free(794, &xctx->poly[i]); + my_free(795, &xctx->arc[i]); } remove_symbols(); for(i = 0;imaxs; ++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(796, &xctx->sym[i].line); + my_free(797, &xctx->sym[i].rect); + my_free(798, &xctx->sym[i].arc); + my_free(799, &xctx->sym[i].poly); + my_free(800, &xctx->sym[i].lines); + my_free(801, &xctx->sym[i].polygons); + my_free(802, &xctx->sym[i].arcs); + my_free(803, &xctx->sym[i].rects); } - my_free(_ALLOC_ID_, &xctx->sym); + my_free(804, &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(805, &xctx->schvhdlprop, xctx->uslot[slot].gptr); + my_strdup(806, &xctx->schverilogprop, xctx->uslot[slot].vptr); + my_strdup(807, &xctx->schprop, xctx->uslot[slot].sptr); + my_strdup(808, &xctx->schsymbolprop, xctx->uslot[slot].kptr); + my_strdup(809, &xctx->schtedaxprop, xctx->uslot[slot].eptr); for(c = 0;cmaxl[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(810, xctx->lines[c], sizeof(xLine)); for(i = 0;ilines[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(811, &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(812, xctx->rects[c], sizeof(xRect)); for(i = 0;irects[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(813, &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(814, xctx->arcs[c], sizeof(xArc)); for(i = 0;iarcs[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(815, &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(816, xctx->polygons[c], sizeof(xPoly)); for(i = 0;ipolygons[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(817, &xctx->poly[c][i].prop_ptr, xctx->uslot[slot].pptr[c][i].prop_ptr); + xctx->poly[c][i].x = my_malloc(818, points * sizeof(double)); + xctx->poly[c][i].y = my_malloc(819, points * sizeof(double)); + xctx->poly[c][i].selected_point = my_malloc(820, 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, @@ -497,22 +497,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(821, xctx->instances, sizeof(xInstance)); for(i = 0;iinstances; ++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_strdup2(_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_strdup2(_ALLOC_ID_, &xctx->inst[i].lab, xctx->uslot[slot].iptr[i].lab); + my_strdup2(822, &xctx->inst[i].prop_ptr, xctx->uslot[slot].iptr[i].prop_ptr); + my_strdup2(823, &xctx->inst[i].name, xctx->uslot[slot].iptr[i].name); + my_strdup2(824, &xctx->inst[i].instname, xctx->uslot[slot].iptr[i].instname); + my_strdup2(825, &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(826, xctx->symbols, sizeof(xSymbol)); for(i = 0;isymbols; ++i) { copy_symbol(&xctx->sym[i], &xctx->uslot[slot].symptr[i]); @@ -520,7 +520,7 @@ void mem_pop_undo(int redo, int set_modify_status) /* texts */ xctx->maxt = xctx->texts = xctx->uslot[slot].texts; - xctx->text = my_calloc(_ALLOC_ID_, xctx->texts, sizeof(xText)); + xctx->text = my_calloc(827, xctx->texts, sizeof(xText)); for(i = 0;itexts; ++i) { xctx->text[i] = xctx->uslot[slot].tptr[i]; xctx->text[i].txt_ptr = NULL; @@ -528,21 +528,21 @@ void mem_pop_undo(int redo, int set_modify_status) xctx->text[i].floater_instname = NULL; xctx->text[i].floater_ptr = NULL; xctx->text[i].prop_ptr = NULL; - my_strdup2(_ALLOC_ID_, &xctx->text[i].prop_ptr, xctx->uslot[slot].tptr[i].prop_ptr); - my_strdup2(_ALLOC_ID_, &xctx->text[i].txt_ptr, xctx->uslot[slot].tptr[i].txt_ptr); - my_strdup2(_ALLOC_ID_, &xctx->text[i].font, xctx->uslot[slot].tptr[i].font); - my_strdup2(_ALLOC_ID_, &xctx->text[i].floater_instname, xctx->uslot[slot].tptr[i].floater_instname); - my_strdup2(_ALLOC_ID_, &xctx->text[i].floater_ptr, xctx->uslot[slot].tptr[i].floater_ptr); + my_strdup2(828, &xctx->text[i].prop_ptr, xctx->uslot[slot].tptr[i].prop_ptr); + my_strdup2(829, &xctx->text[i].txt_ptr, xctx->uslot[slot].tptr[i].txt_ptr); + my_strdup2(830, &xctx->text[i].font, xctx->uslot[slot].tptr[i].font); + my_strdup2(831, &xctx->text[i].floater_instname, xctx->uslot[slot].tptr[i].floater_instname); + my_strdup2(832, &xctx->text[i].floater_ptr, xctx->uslot[slot].tptr[i].floater_ptr); } /* wires */ xctx->maxw = xctx->wires = xctx->uslot[slot].wires; - xctx->wire = my_calloc(_ALLOC_ID_, xctx->wires, sizeof(xWire)); + xctx->wire = my_calloc(833, xctx->wires, sizeof(xWire)); for(i = 0;iwires; ++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(834, &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); */ diff --git a/src/main.c b/src/main.c index e501e19f..e09403a0 100644 --- a/src/main.c +++ b/src/main.c @@ -118,17 +118,17 @@ int main(int argc, char **argv) } #endif - my_strdup(_ALLOC_ID_, &xschem_executable, argv[0]); + my_strdup(835, &xschem_executable, argv[0]); if(debug_var>=1 && !has_x) fprintf(errfp, "main(): no DISPLAY set, assuming no X available\n"); /* if cli_opt_detach is 1 no interactive command shell is created ... * using cli_opt_detach if no windowing exists (has_x == 0) is non sense so do nothing */ - cli_opt_argv = my_malloc(_ALLOC_ID_, cli_opt_argc * sizeof(char *)); + cli_opt_argv = my_malloc(836, 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(837, &cli_opt_argv[i], argv[i]); } diff --git a/src/move.c b/src/move.c index 6c06be17..a1cbf4ca 100644 --- a/src/move.c +++ b/src/move.c @@ -32,7 +32,7 @@ void flip_rotate_ellipse(xRect *r, int rot, int flip) if(flip) { r->ellipse_a = 180 - r->ellipse_a - r->ellipse_b; my_snprintf(str, S(str), "%d,%d", r->ellipse_a, r->ellipse_b); - my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ellipse", str)); + my_strdup2(838, &r->prop_ptr, subst_token(r->prop_ptr, "ellipse", str)); } if(rot) { if(rot == 3) { @@ -44,7 +44,7 @@ void flip_rotate_ellipse(xRect *r, int rot, int flip) } r->ellipse_a %= 360; my_snprintf(str, S(str), "%d,%d", r->ellipse_a, r->ellipse_b); - my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ellipse", str)); + my_strdup2(839, &r->prop_ptr, subst_token(r->prop_ptr, "ellipse", str)); } } } @@ -133,8 +133,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(840, &xctx->wire[i].prop_ptr); + my_free(841, &xctx->wire[i].node); found=1; ++j; continue; @@ -154,7 +154,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(842, &xctx->line[c][i].prop_ptr); found=1; ++j; continue; @@ -173,7 +173,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(843, &xctx->rect[c][i].prop_ptr); set_rect_extraptr(0, &xctx->rect[c][i]); found=1; ++j; @@ -334,8 +334,8 @@ void draw_selection(GC g, int interruptable) case POLYGON: { int bezier; - 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(844, sizeof(double) *xctx->poly[c][n].points); + double *y = my_malloc(845, sizeof(double) *xctx->poly[c][n].points); bezier = 2 + !strboolcmp(get_tok_value(xctx->poly[c][n].prop_ptr, "bezier", 0), "true"); if(xctx->poly[c][n].sel==SELECTED || xctx->poly[c][n].sel==SELECTED1) { for(k=0;kpoly[c][n].points; ++k) { @@ -356,8 +356,8 @@ void draw_selection(GC g, int interruptable) } drawtemppolygon(g, NOW, x, y, xctx->poly[c][n].points, bezier); } - my_free(_ALLOC_ID_, &x); - my_free(_ALLOC_ID_, &y); + my_free(846, &x); + my_free(847, &y); } break; @@ -698,8 +698,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(848, sizeof(double) *p->points); + double *y = my_malloc(849, sizeof(double) *p->points); int j; for(j=0; jpoints; ++j) { if( p->sel==SELECTED || p->selected_point[j]) { @@ -722,8 +722,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(850, &x); + my_free(851, &y); } break; case ARC: @@ -787,7 +787,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_strdup2(_ALLOC_ID_, &xctx->text[xctx->texts].txt_ptr,xctx->text[n].txt_ptr); + my_strdup2(852, &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); @@ -802,9 +802,9 @@ void copy_objects(int what) xctx->text[xctx->texts].font=NULL; xctx->text[xctx->texts].floater_instname=NULL; xctx->text[xctx->texts].floater_ptr=NULL; - my_strdup2(_ALLOC_ID_, &xctx->text[xctx->texts].prop_ptr, xctx->text[n].prop_ptr); - my_strdup2(_ALLOC_ID_, &xctx->text[xctx->texts].floater_ptr, xctx->text[n].floater_ptr); - my_strdup2(_ALLOC_ID_, &xctx->text[xctx->texts].floater_instname, xctx->text[n].floater_instname); + my_strdup2(853, &xctx->text[xctx->texts].prop_ptr, xctx->text[n].prop_ptr); + my_strdup2(854, &xctx->text[xctx->texts].floater_ptr, xctx->text[n].floater_ptr); + my_strdup2(855, &xctx->text[xctx->texts].floater_instname, xctx->text[n].floater_instname); 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; @@ -820,7 +820,7 @@ void copy_objects(int what) xctx->text[l].hcenter, xctx->text[l].vcenter, xctx->text[l].x0, xctx->text[l].y0, &xctx->rx1,&xctx->ry1, &xctx->rx2,&xctx->ry2, &tmpi, &dtmp); - my_free(_ALLOC_ID_, &estr); + my_free(856, &estr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); @@ -858,9 +858,9 @@ 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_strdup2(_ALLOC_ID_, &xctx->inst[xctx->instances].prop_ptr, xctx->inst[n].prop_ptr); - my_strdup2(_ALLOC_ID_, &xctx->inst[xctx->instances].lab, xctx->inst[n].lab); + my_strdup2(857, &xctx->inst[xctx->instances].name, xctx->inst[n].name); + my_strdup2(858, &xctx->inst[xctx->instances].prop_ptr, xctx->inst[n].prop_ptr); + my_strdup2(859, &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; @@ -872,7 +872,7 @@ void copy_objects(int what) xctx->inst[xctx->instances].rot = (xctx->inst[xctx->instances].rot + ( (xctx->move_flip && (xctx->inst[xctx->instances].rot & 1) ) ? xctx->move_rot+2 : xctx->move_rot) ) & 0x3; xctx->inst[xctx->instances].flip = (xctx->move_flip? !xctx->inst[n].flip:xctx->inst[n].flip); - my_strdup2(_ALLOC_ID_, &xctx->inst[xctx->instances].instname, xctx->inst[n].instname); + my_strdup2(860, &xctx->inst[xctx->instances].instname, xctx->inst[n].instname); /* the newpropcnt argument is zero for the 1st call and used in */ /* new_prop_string() for cleaning some internal caches. */ if(!newpropcnt) hash_names(-1, XINSERT); @@ -1272,7 +1272,7 @@ void move_objects(int what, int merge, double dx, double dy) xctx->text[n].yscale, xctx->text[n].rot,xctx->text[n].flip, xctx->text[n].hcenter, xctx->text[n].vcenter, xctx->text[n].x0, xctx->text[n].y0, &xctx->rx1,&xctx->ry1, &xctx->rx2,&xctx->ry2, &tmpint, &dtmp); - my_free(_ALLOC_ID_, &estr); + my_free(861, &estr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); @@ -1299,7 +1299,7 @@ void move_objects(int what, int merge, double dx, double dy) xctx->text[n].yscale, xctx->text[n].rot,xctx->text[n].flip, xctx->text[n].hcenter, xctx->text[n].vcenter, xctx->text[n].x0, xctx->text[n].y0, &xctx->rx1,&xctx->ry1, &xctx->rx2,&xctx->ry2, &tmpint, &dtmp); - my_free(_ALLOC_ID_, &estr); + my_free(862, &estr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); diff --git a/src/netlist.c b/src/netlist.c index 17463c0e..ebef1123 100644 --- a/src/netlist.c +++ b/src/netlist.c @@ -33,7 +33,7 @@ static void instdelete(int n, int x, int y) while(ptr) { if(ptr->n == n) { saveptr = ptr->next; - my_free(_ALLOC_ID_, &ptr); + my_free(863, &ptr); *prevptr = saveptr; return; } @@ -46,7 +46,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(864, sizeof(Instentry)); newptr->next=ptr; newptr->n=n; xctx->inst_spatial_table[x][y]=newptr; @@ -58,7 +58,7 @@ static Instentry *delinstentry(Instentry *t) Instentry *tmp; while( t ) { tmp = t->next; - my_free(_ALLOC_ID_, &t); + my_free(865, &t); t = tmp; } return NULL; @@ -140,7 +140,7 @@ static Objectentry *delobjectentry(Objectentry *t) Objectentry *tmp; while( t ) { tmp = t->next; - my_free(_ALLOC_ID_, &t); + my_free(866, &t); t = tmp; } return NULL; @@ -169,7 +169,7 @@ static void objectdelete(int type, int n, int c, int x, int y) while(ptr) { if(ptr->n == n && ptr->type == type && ptr->c == c ) { saveptr = ptr->next; - my_free(_ALLOC_ID_, &ptr); + my_free(867, &ptr); *prevptr = saveptr; return; } @@ -182,7 +182,7 @@ static void objectinsert(int type, int n, int c, int x, int y) { Objectentry *ptr, *newptr; ptr=xctx->object_spatial_table[x][y]; - newptr=my_malloc(_ALLOC_ID_, sizeof(Instentry)); + newptr=my_malloc(868, sizeof(Instentry)); newptr->next=ptr; newptr->type=type; newptr->n=n; @@ -243,7 +243,7 @@ void hash_object(int what, int type, int n, int c) xctx->text[n].hcenter, xctx->text[n].vcenter, xctx->text[n].x0, xctx->text[n].y0, &x1,&y1, &x2,&y2, &tmpi, &tmpd); - my_free(_ALLOC_ID_, &estr); + my_free(869, &estr); break; default: skip = 1; @@ -330,7 +330,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(870, &ptr); *prevptr = saveptr; return; } @@ -345,7 +345,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(871, sizeof(Instpinentry)); newptr->next=ptr; newptr->n=n; newptr->x0=x0; @@ -362,7 +362,7 @@ static Instpinentry *delinstpinentry(Instpinentry *t) while(t) { tmp = t->next; - my_free(_ALLOC_ID_, &t); + my_free(872, &t); t = tmp; } return NULL; @@ -387,7 +387,7 @@ static void wiredelete(int n, int x, int y) while(ptr) { if(ptr->n == n) { saveptr = ptr->next; - my_free(_ALLOC_ID_, &ptr); + my_free(873, &ptr); *prevptr = saveptr; return; } @@ -401,7 +401,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(874, sizeof(Wireentry)); newptr->next=ptr; newptr->n=n; xctx->wire_spatial_table[x][y]=newptr; @@ -414,7 +414,7 @@ static Wireentry *delwireentry(Wireentry *t) while( t ) { tmp = t->next; - my_free(_ALLOC_ID_, &t); + my_free(875, &t); t = tmp; } return NULL; @@ -705,10 +705,10 @@ int record_global_node(int what, FILE *fp, const char *node) if(what == 3) return 0; /* node is not a global */ if(xctx->max_globals >= xctx->size_globals) { xctx->size_globals+=CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &xctx->globals, xctx->size_globals*sizeof(char *) ); + my_realloc(876, &xctx->globals, xctx->size_globals*sizeof(char *) ); } xctx->globals[xctx->max_globals]=NULL; - my_strdup(_ALLOC_ID_, &xctx->globals[xctx->max_globals], node); + my_strdup(877, &xctx->globals[xctx->max_globals], node); xctx->max_globals++; } else if(what == 0) { for(i = 0;i < xctx->max_globals; ++i) { @@ -717,9 +717,9 @@ int record_global_node(int what, FILE *fp, const char *node) } } else if(what == 2) { for(i=0;imax_globals; ++i) { - my_free(_ALLOC_ID_, &xctx->globals[i]); + my_free(878, &xctx->globals[i]); } - my_free(_ALLOC_ID_, &xctx->globals); + my_free(879, &xctx->globals); xctx->size_globals = xctx->max_globals=0; } @@ -757,7 +757,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(880, &xctx->node_mult); xctx->node_mult_size=0; return 0; } @@ -771,7 +771,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(881, &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; @@ -807,7 +807,7 @@ static void name_generics() dbg(2, "name_generics(): naming generics from attached labels\n"); if(for_netlist) for (i=0;isym)->type); + my_strdup(882, &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]; @@ -833,12 +833,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, "name_generics(): 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(883, &inst[i].node[j], get_tok_value(inst[n].prop_ptr,"value",0) ); if(!for_netlist) { - my_strdup(_ALLOC_ID_, &sig_type,""); + my_strdup(884, &sig_type,""); bus_node_hash_lookup(inst[n].node[p],"", XINSERT, 1, sig_type,"", "",""); } else { - my_strdup(_ALLOC_ID_, &sig_type, + my_strdup(885, &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 */ @@ -854,7 +854,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(886, &type); } static int signal_short( const char *tag, const char *n1, const char *n2) @@ -887,7 +887,7 @@ static void set_inst_node(int i, int j, const char *node) if(!inst[i].node) return; 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(887, &inst[i].node[j], node); skip = skip_instance(i, 1, netlist_lvs_ignore); if(!for_netlist || skip) { bus_node_hash_lookup(inst[i].node[j],"", XINSERT, 0,"","","",""); @@ -973,8 +973,8 @@ static int 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(888, &wire[n].node, wire[k].node); + my_strdup(889, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node)); err |= name_attached_inst_to_net(n, tmpi, tmpj); err |= wirecheck(n); /* recursive check */ } else { @@ -996,8 +996,8 @@ static int name_attached_nets(double x0, double y0, int sqx, int sqy, const char 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(890, &wire[n].node, node); + my_strdup(891, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", wire[n].node)); err |= wirecheck(n); } else { if(for_netlist>0) err |= signal_short("Net", wire[n].node, node); @@ -1097,8 +1097,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(892, xctx->symbols, sizeof(int)); + symtable = my_calloc(893, xctx->symbols, sizeof(int)); for(i = 0; i < instances; ++i) { k = inst[i].ptr; if( k < 0 || symtable[k] ) continue; @@ -1114,13 +1114,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[k].name); } - my_free(_ALLOC_ID_, &symtable); + my_free(894, &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(895, &pt_symbol); } return -1; } @@ -1169,7 +1169,7 @@ static int instcheck(int n, int p) char *node_base_name = NULL; const char *tap; if(inst[n].node && inst[n].node[0] && inst[n].node[0][0] == '#') { - my_free(_ALLOC_ID_, &inst[n].node[0]); /* bus tap forces net name on pin 0 (the tap) */ + my_free(896, &inst[n].node[0]); /* bus tap forces net name on pin 0 (the tap) */ } /* delete any previously set unnamed net */ if(!inst[n].node[0]) { /* still unnamed */ /* tap = get_tok_value(inst[n].prop_ptr, "lab", 0); */ @@ -1189,12 +1189,12 @@ static int instcheck(int n, int p) } else { nptr = inst[n].node[p]; } - node_base_name = my_malloc(_ALLOC_ID_, strlen(inst[n].node[p]) + 1); + node_base_name = my_malloc(897, strlen(inst[n].node[p]) + 1); sscanf(nptr, "%[^[]", node_base_name); - my_strcat(_ALLOC_ID_, &node_base_name, tap); + my_strcat(898, &node_base_name, tap); } else { - my_strdup2(_ALLOC_ID_, &node_base_name, tap); + my_strdup2(899, &node_base_name, tap); } set_inst_node(n, 0, node_base_name); get_inst_pin_coord(n, 0, &x0, &y0); @@ -1205,7 +1205,7 @@ static int instcheck(int n, int p) if(for_netlist>0) err |= signal_short("Bus tap", inst[n].node[p], inst[n].node[0]); } dbg(1, "instcheck: bus tap node: p=%d, %s, tap=%s\n", p, inst[n].node[p], inst[n].node[0]); - my_free(_ALLOC_ID_, &node_base_name); + my_free(900, &node_base_name); } @@ -1213,7 +1213,7 @@ static int instcheck(int n, int p) else if(shorted_inst || find_pass_through_symbols(1, n)) { int k = inst[n].ptr; 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(901, &pin_name, get_tok_value(xctx->sym[k].rect[PINLAYER][p].prop_ptr, "name", 0)); if(p >= rects) return 1; for(j = 0; j < rects; ++j) { const char *other_pin; @@ -1237,7 +1237,7 @@ static int instcheck(int n, int p) } } } - my_free(_ALLOC_ID_, &pin_name); + my_free(902, &pin_name); } return err; } @@ -1274,7 +1274,7 @@ static int name_nodes_of_pins_labels_and_propagate() for (i=0;isym)->type); + my_strdup(903, &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] ) { @@ -1313,32 +1313,32 @@ static int name_nodes_of_pins_labels_and_propagate() } #endif port=0; - my_strdup2(_ALLOC_ID_, &dir, ""); + my_strdup2(904, &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, + my_strdup2(905, &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].prop_ptr,"global",0)); + my_strdup(906, &global_node,get_tok_value(inst[i].prop_ptr,"global",0)); if(!xctx->tok_size) { - my_strdup(_ALLOC_ID_, &global_node,get_tok_value((inst[i].ptr+ xctx->sym)->prop_ptr,"global",0)); + my_strdup(907, &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(908, &sig_type,get_tok_value(inst[i].prop_ptr,"sig_type",0)); + my_strdup(909, &verilog_type,get_tok_value(inst[i].prop_ptr,"verilog_type",0)); + my_strdup(910, &value,get_tok_value(inst[i].prop_ptr,"value",0)); + my_strdup(911, &class,get_tok_value(inst[i].prop_ptr,"class",0)); } - my_strdup(_ALLOC_ID_, &inst[i].node[0], inst[i].lab); + my_strdup(912, &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(913, &inst[i].node[0], get_tok_value((inst[i].ptr+ xctx->sym)->templ, "lab",0)); dbg(1, "name_nodes_of_pins_labels_and_propagate(): no lab attr on instance, pick from symbol: %s\n", inst[i].node[0]); } @@ -1360,14 +1360,14 @@ static int name_nodes_of_pins_labels_and_propagate() err |= name_attached_inst(i, x0, y0, sqx, sqy, inst[i].node[0]); } /* if(type && ... */ } /* for(i=0;iwire[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(921, &xctx->wire[i].node, tmp_str); + my_strdup(922, &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,"","","",""); err |= wirecheck(i); @@ -1470,7 +1470,7 @@ static int 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(923, sizeof(char *) * rects); for (j=0;j 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(924, &xctx->inst[i].node[j]); + my_free(925, &xctx->inst[i].node ); } } @@ -1548,7 +1548,7 @@ void delete_netlist_structs(void) } for(i=0;iwires; ++i) { - my_free(_ALLOC_ID_, &xctx->wire[i].node); + my_free(926, &xctx->wire[i].node); } /* erase inst and wire topological hash tables */ del_inst_pin_table(); @@ -1751,21 +1751,21 @@ int sym_vs_sch_pins(int all) } symbol = match_symbol(name); - my_strdup(_ALLOC_ID_, &type, xctx->sym[symbol].type); + my_strdup(927, &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(928, &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(929, &lab_array, lab_array_size * sizeof(char *)); } lab_array[pin_cnt] = NULL; - my_strdup(_ALLOC_ID_, &(lab_array[pin_cnt]), lab); + my_strdup(930, &(lab_array[pin_cnt]), lab); pin_cnt++; pin_match = 0; for(j=0; j < rects; ++j) { - my_strdup(_ALLOC_ID_, &pin_name, + my_strdup(931, &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(932, &pin_dir, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "dir", 0)); if( pin_name && !strcmp(pin_name, lab)) { @@ -1852,7 +1852,7 @@ int sym_vs_sch_pins(int all) } } for(j=0; j < rects; ++j) { - my_strdup(_ALLOC_ID_, &pin_name, + my_strdup(933, &pin_name, expandlabel(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "name", 0), &mult)); pin_match = 0; for(k=0; ksymbols > n_syms) remove_symbol(xctx->symbols - 1); diff --git a/src/node_hash.c b/src/node_hash.c index 3b27f010..dba207ed 100644 --- a/src/node_hash.c +++ b/src/node_hash.c @@ -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(941, 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(942, &(entry->token),token); + if(sig_type &&sig_type[0]) my_strdup(943, &(entry->sig_type), sig_type); + if(verilog_type &&verilog_type[0]) my_strdup(944, &(entry->verilog_type), verilog_type); + if(class && class[0]) my_strdup(945, &(entry->class), class); + if(orig_tok && orig_tok[0]) my_strdup(946, &(entry->orig_tok), orig_tok); + if(value && value[0]) my_strdup(947, &(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(948, &entry->token); + my_free(949, &entry->verilog_type); + my_free(950, &entry->sig_type); + my_free(951, &entry->class); + my_free(952, &entry->orig_tok); + my_free(953, &entry->value); + my_free(954, &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(955, &(entry->sig_type), sig_type); if(verilog_type && verilog_type[0] !='\0') - my_strdup(_ALLOC_ID_, &(entry->verilog_type), verilog_type); + my_strdup(956, &(entry->verilog_type), verilog_type); if(value && value[0] !='\0') - my_strdup(_ALLOC_ID_, &(entry->value), value); + my_strdup(957, &(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(958, &string, token); } else { dbg(3, "bus_node_hash_lookup(): expanding node: %s\n", token); - my_strdup(_ALLOC_ID_, &string, expandlabel(token,&mult)); + my_strdup(959, &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(960, &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(961, &entry->token); + my_free(962, &entry->verilog_type); + my_free(963, &entry->sig_type); + my_free(964, &entry->class); + my_free(965, &entry->orig_tok); + my_free(966, &entry->value); + my_free(967, &entry); entry = tmp; } } @@ -280,9 +280,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(968, &class, ptr->class); else - my_strdup(_ALLOC_ID_, &class, "signal"); + my_strdup(969, &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); @@ -312,7 +312,7 @@ void print_vhdl_signals(FILE *fd) } } if(found) fprintf(fd, "\n" ); - my_free(_ALLOC_ID_, &class); + my_free(970, &class); } @@ -378,18 +378,18 @@ void list_nets(char **result) prepare_netlist_structs(1); for(i = 0; i < xctx->instances; i++) { if(skip_instance(i, 0, netlist_lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(971, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if(type && xctx->inst[i].node && IS_PIN(type)) { - my_mstrcat(_ALLOC_ID_, result, + my_mstrcat(972, result, "{", get_tok_value(xctx->inst[i].prop_ptr, "lab", 0), " ", type, "}\n", NULL); } } - if(type) my_free(_ALLOC_ID_, &type); + if(type) my_free(973, &type); for(i=0;inode_table[i]; while(ptr) { if(!ptr->d.port) { - my_mstrcat(_ALLOC_ID_, result, + my_mstrcat(974, result, "{", ptr->token, " ", "net", "}\n", NULL); } ptr = ptr->next; diff --git a/src/options.c b/src/options.c index f218b717..83bed16f 100644 --- a/src/options.c +++ b/src/options.c @@ -74,11 +74,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(975, &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(976, &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); @@ -86,7 +86,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(977, &cli_opt_tcl_post_command, optval); } else if( (type == LONG && !strcmp("diff", opt)) ) { dbg(1, "process_options(): diff with: %s\n", optval); diff --git a/src/parselabel.l b/src/parselabel.l index 3a217ec1..3ec9c216 100644 --- a/src/parselabel.l +++ b/src/parselabel.l @@ -66,7 +66,7 @@ extern int yylex(); void clear_expandlabel_data(void) { - my_free(_ALLOC_ID_, &dest_string.str); + my_free(978, &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(979, &dest_string.str); /* 30102004 delete 'memory' of previous execution */ if(!s) { *m = -1; @@ -104,7 +104,7 @@ const char *expandlabel(const char *s, int *m) if(parselabel_debug >= 3) fprintf(errfp, "expandlabel(): entering\n"); if(!strpbrk(s, "*,.:") || s[0] == '$') { /* shortcut: nothing to parse / expand */ *m = 1; - my_strdup2(_ALLOC_ID_, &dest_string.str, s); + my_strdup2(980, &dest_string.str, s); if(xctx->netlist_type == CAD_SPICE_NETLIST && bus_char[0] && bus_char[1]) { str_char_replace(dest_string.str, '[', bus_char[0]); str_char_replace(dest_string.str, ']', bus_char[1]); @@ -119,13 +119,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(981, 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(982, &cmd); } if(parselabel_debug >= 3) @@ -138,7 +138,7 @@ const char *expandlabel(const char *s, int *m) } } else { *m=-1; - my_strdup2(_ALLOC_ID_, &dest_string.str, s); + my_strdup2(983, &dest_string.str, s); } return dest_string.str; } @@ -203,7 +203,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z /* recognize characters after a bus label: AA[33:31]_xx --> _xx */ {IDX_ID_N} { yylval.ptr.str=NULL;/*19102004 */ - my_strdup(_ALLOC_ID_, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */ + my_strdup(984, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */ if(parselabel_debug >= 3) fprintf(errfp, "yylex(): B_TRAILER: |%s|\n", yytext); BEGIN(INITIAL); return B_TRAILER; @@ -243,14 +243,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(985, &yylval.ptr.str, yytext); if(parselabel_debug >= 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(986, &yylval.ptr.str, yytext); if(parselabel_debug >= 3) fprintf(errfp, "yylex(): B_NAME2: |%s|\n", yytext); return B_NAME; } @@ -258,7 +258,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(987, &yylval.ptr.str, yytext); if(parselabel_debug >= 3) fprintf(errfp, "yylex(): B_NAME1: |%s|\n", yytext); return B_NAME; } @@ -268,7 +268,7 @@ ID_EXT_PARENTHESIS ([-~"#+/=_a-zA-Z][-#!@\\/:.=_+a-zA-Z0-9]*\([-~"#!@\\/:.=_+a-z ^\*.* { yylval.ptr.str=NULL; /*19102004 */ if(parselabel_debug >= 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(988, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */ BEGIN(INITIAL); return B_LINE; } @@ -282,7 +282,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(989, &yylval.ptr.str, yytext); if(parselabel_debug >= 3) fprintf(errfp, "yylex(): B_NAME4: |%s|\n", yytext); BEGIN(INITIAL); return B_NAME; @@ -301,7 +301,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(990, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */ if(parselabel_debug >= 3) fprintf(errfp, "yylex(): B_NAME0: |%s|\n", yytext); BEGIN(INITIAL); return B_NAME; diff --git a/src/paste.c b/src/paste.c index f462da7c..7b3d5432 100644 --- a/src/paste.c +++ b/src/paste.c @@ -65,7 +65,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(991, &ptr); select_wire(i, SELECTED, 1); } @@ -201,17 +201,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(992, points, sizeof(double)); + ptr[i].y = my_calloc(993, points, sizeof(double)); + ptr[i].selected_point= my_calloc(994, points, sizeof(unsigned short)); ptr[i].points=points; ptr[i].sel=0; for(j=0;jinst[i].name, rel_sym_path(tmp)); - else my_strdup(_ALLOC_ID_, &xctx->inst[i].name,tmp); + if(tmp[0] == '/') my_strdup(998, &xctx->inst[i].name, rel_sym_path(tmp)); + else my_strdup(999, &xctx->inst[i].name,tmp); #else - my_strdup(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(tmp)); + my_strdup(1000, &xctx->inst[i].name, rel_sym_path(tmp)); #endif - my_free(_ALLOC_ID_, &tmp); + my_free(1001, &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); @@ -305,14 +305,14 @@ static void merge_inst(int k,FILE *fd) xctx->inst[i].lab=NULL; /* assigned in link_symbols_to_instances */ xctx->inst[i].node=NULL; load_ascii_string(&prop_ptr,fd); - my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, prop_ptr); + my_strdup(1002, &xctx->inst[i].prop_ptr, prop_ptr); set_inst_flags(&xctx->inst[i]); if(!k) hash_names(-1, XINSERT); new_prop_string(i, prop_ptr, tclgetboolvar("disable_unique_names")); /* will also assign .instname */ /* the final tmp argument is zero for the 1st call and used in */ /* new_prop_string() for cleaning some internal caches. */ hash_names(i, XINSERT); - my_free(_ALLOC_ID_, &prop_ptr); + my_free(1003, &prop_ptr); xctx->instances++; } @@ -376,7 +376,7 @@ void merge_file(int selection_load, const char ext[]) cmd = get_generator_command(name); if(cmd) { fd = popen(cmd, "r"); - my_free(_ALLOC_ID_, &cmd); + my_free(1004, &cmd); } else fd = NULL; } else { fd=fopen(name, fopen_read_mode); @@ -460,7 +460,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(1005, &aux_ptr); link_symbols_to_instances(old); /* in case of paste/merge will set instances .sel to SELECTED */ if(generator) pclose(fd); else fclose(fd); diff --git a/src/psprint.c b/src/psprint.c index 42303014..850ea1dc 100644 --- a/src/psprint.c +++ b/src/psprint.c @@ -223,7 +223,7 @@ int ps_embedded_image(xRect* r, double x1, double y1, double x2, double y2, int fprintf(fd, "~>\n"); fprintf(fd, "grestore\n"); - my_free(_ALLOC_ID_, &ascii85EncodedJpeg); + my_free(1006, &ascii85EncodedJpeg); free(jpgData); #endif return 1; @@ -368,7 +368,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(1007, &ascii85EncodedJpeg); #endif } @@ -686,7 +686,7 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in if(!textclip(xctx->areax1,xctx->areay1,xctx->areax2, xctx->areay2,textx1,texty1,textx2,texty2)) { - my_free(_ALLOC_ID_, &estr); + my_free(1008, &estr); return; } if(hcenter) { @@ -710,7 +710,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, estr); + my_strdup2(1009, &sss, estr); tt=ss=sss; for(;;) { c=*ss; @@ -728,8 +728,8 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in } ++ss; } - my_free(_ALLOC_ID_, &sss); - my_free(_ALLOC_ID_, &estr); + my_free(1010, &sss); + my_free(1011, &estr); } static void old_ps_draw_string(int gctext, const char *str, @@ -757,7 +757,7 @@ static void old_ps_draw_string(int gctext, const char *str, #endif if(!textclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,rx1,ry1,rx2,ry2)) { - my_free(_ALLOC_ID_, &estr); + my_free(1012, &estr); return; } set_ps_colors(gctext); @@ -790,7 +790,7 @@ static void old_ps_draw_string(int gctext, const char *str, } ++pos; } - my_free(_ALLOC_ID_, &estr); + my_free(1013, &estr); } static void ps_drawgrid() @@ -903,8 +903,8 @@ static void ps_draw_symbol(int c, int n,int layer, int what, short tmp_flip, sho polygon = &((xctx->inst[n].ptr+ xctx->sym)->poly[layer])[j]; { /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */ int k, bezier; - double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points); - double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points); + double *x = my_malloc(1014, sizeof(double) * polygon->points); + double *y = my_malloc(1015, sizeof(double) * polygon->points); for(k=0;kpoints; ++k) { ROTATION(rot, flip, 0.0,0.0,polygon->x[k],polygon->y[k],x[k],y[k]); x[k]+= x0; @@ -912,8 +912,8 @@ static void ps_draw_symbol(int c, int n,int layer, int what, short tmp_flip, sho } bezier = !strboolcmp(get_tok_value(polygon->prop_ptr, "bezier", 0), "true"); ps_drawpolygon(c, NOW, x, y, polygon->points, polygon->fill, polygon->dash, bezier); - my_free(_ALLOC_ID_, &x); - my_free(_ALLOC_ID_, &y); + my_free(1016, &x); + my_free(1017, &y); } } @@ -1067,7 +1067,7 @@ void create_ps(char **psfile, int what, int fullzoom, int eps) } } setbuf(fd, NULL); /*To prevent buffer errors, still investigating cause. */ - ps_colors=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Ps_color)); + ps_colors=my_calloc(1018, cadlayers, sizeof(Ps_color)); if(ps_colors==NULL){ fprintf(errfp, "create_ps(): calloc error\n"); return; @@ -1393,7 +1393,7 @@ void create_ps(char **psfile, int what, int fullzoom, int eps) fclose(fd); } tclsetboolvar("draw_grid", old_grid); - my_free(_ALLOC_ID_, &ps_colors); + my_free(1019, &ps_colors); /* restore original size and zoom factor */ diff --git a/src/save.c b/src/save.c index 7e2ea834..4d96bd24 100644 --- a/src/save.c +++ b/src/save.c @@ -38,11 +38,11 @@ char **parse_cmd_string(const char *cmd, int *argc) char *cmd_ptr, *cmd_save; dbg(1, "parse_cmd_string(): cmd=|%s|\n", cmd ? cmd : "NULL"); if(!cmd || !cmd[0]) { - if(cmd_copy) my_free(_ALLOC_ID_, &cmd_copy); + if(cmd_copy) my_free(1020, &cmd_copy); return NULL; } *argc = 0; - my_strdup2(_ALLOC_ID_, &cmd_copy, cmd); + my_strdup2(1021, &cmd_copy, cmd); cmd_ptr = cmd_copy; while( (argv[*argc] = my_strtok_r(cmd_ptr, " \t", "'\"", 0, &cmd_save)) ) { cmd_ptr = NULL; @@ -146,7 +146,7 @@ int filter_data(const char *din, const size_t ilen, close(p1[1]); if(!ret) { oalloc = bufsize + 1; /* add extra space for final '\0' */ - *dout = my_malloc(_ALLOC_ID_, oalloc); + *dout = my_malloc(1022, oalloc); *olen = 0; while( (n = read(p2[0], *dout + *olen, bufsize)) > 0) { *olen += n; @@ -155,14 +155,14 @@ int filter_data(const char *din, const size_t ilen, oalloc = *olen + bufsize + 1; /* add extra space for final '\0' */ oalloc = ((oalloc << 2) + oalloc) >> 2; /* size up 1.25x */ dbg(1, "filter_data() read %ld bytes, reallocate dout to %ld bytes, bufsize=%ld\n", n, oalloc, bufsize); - my_realloc(_ALLOC_ID_, dout, oalloc); + my_realloc(1023, dout, oalloc); } } if(*olen) (*dout)[*olen] = '\0'; /* so (if ascii) it can be used as a string */ } if(n < 0 || !*olen) { if(oalloc) { - my_free(_ALLOC_ID_, dout); + my_free(1024, dout); *olen = 0; } fprintf(stderr, "no data read\n"); @@ -210,7 +210,7 @@ char *base64_encode(const unsigned char *data, const size_t input_length, size_t *output_length = 4 * ((input_length + 2) / 3); alloc_length = (1 + (*output_length / 4096)) * 4096; - encoded_data = my_malloc(_ALLOC_ID_, alloc_length); + encoded_data = my_malloc(1025, alloc_length); if (encoded_data == NULL) return NULL; cnt = 0; @@ -222,7 +222,7 @@ char *base64_encode(const unsigned char *data, const size_t input_length, size_t if(j + 10 >= alloc_length) { dbg(1, "alloc-length=%ld, j=%d, output_length=%ld\n", alloc_length, j, *output_length); alloc_length += 4096; - my_realloc(_ALLOC_ID_, &encoded_data, alloc_length); + my_realloc(1026, &encoded_data, alloc_length); } if(brk && ( (cnt & 31) == 0) ) { *output_length += 1; @@ -269,7 +269,7 @@ unsigned char *base64_decode(const char *data, const size_t input_length, size_t padding = 0; if (data[input_length - 1] == '=') padding++; if (data[input_length - 2] == '=') padding++; - decoded_data = my_malloc(_ALLOC_ID_, *output_length); + decoded_data = my_malloc(1027, *output_length); if (decoded_data == NULL) return NULL; cnt = 0; for (i = 0, j = 0; i < input_length;) { @@ -312,12 +312,12 @@ unsigned char *ascii85_encode(const unsigned char *data, const size_t input_leng int padding = (4-(input_length % 4))%4; static unsigned int pow85[] = {1, 85, 7225, 614125, 52200625}; - unsigned char *paddedData = my_calloc(_ALLOC_ID_, input_length+padding, 1); + unsigned char *paddedData = my_calloc(1028, input_length+padding, 1); unsigned char *encoded_data; int i, idx = 0; memcpy( paddedData, data, input_length); *output_length = 5*(input_length+padding)/4; - encoded_data = my_malloc(_ALLOC_ID_, *output_length +1); + encoded_data = my_malloc(1029, *output_length +1); encoded_data[*output_length]=0; for (i = 0; i < input_length+padding; i+=4) { @@ -350,7 +350,7 @@ unsigned char *ascii85_encode(const unsigned char *data, const size_t input_leng encoded_data[idx]=b85_enc[encoded_data[idx]]; ++idx; } - my_free(_ALLOC_ID_, &paddedData); + my_free(1030, &paddedData); *output_length-=padding; encoded_data[*output_length]=0; return encoded_data; @@ -365,7 +365,7 @@ void transpose_matrix(double *a, int r, int c) int begin; /* holds start of cycle */ int i; double tmp; - char *done = my_calloc(_ALLOC_ID_, r, c); /* hash to mark moved elements */ + char *done = my_calloc(1031, r, c); /* hash to mark moved elements */ done[0] = done[size] = 1; /* first and last matrix elements are not moved. */ i = 1; @@ -382,7 +382,7 @@ void transpose_matrix(double *a, int r, int c) /* Get Next Move */ for (i = 1; i < size && done[i]; i++) ; } - my_free(_ALLOC_ID_, &done); + my_free(1032, &done); } @@ -412,7 +412,7 @@ static void read_binary_block(FILE *fd, Raw *raw, int ac) /* we store 4 variables (mag, phase, real and imag) but raw file has only real and imag */ if(ac) rawvars >>= 1; /* read buffer */ - tmp = my_calloc(_ALLOC_ID_, rawvars, (sizeof(double *) )); + tmp = my_calloc(1033, rawvars, (sizeof(double *) )); /* if sweep1 and sweep2 are given calculate actual npoints that will be loaded */ npoints = raw->npoints[raw->datasets]; @@ -434,9 +434,9 @@ static void read_binary_block(FILE *fd, Raw *raw, int ac) offset += raw->npoints[p]; } /* allocate storage for binary block, add one data column for custom data plots */ - if(!raw->values) raw->values = my_calloc(_ALLOC_ID_, raw->nvars + 1, sizeof(SPICE_DATA *)); + if(!raw->values) raw->values = my_calloc(1034, raw->nvars + 1, sizeof(SPICE_DATA *)); for(p = 0 ; p <= raw->nvars; p++) { - my_realloc(_ALLOC_ID_, + my_realloc(1035, &raw->values[p], (offset + npoints) * sizeof(SPICE_DATA)); } /* read binary block */ @@ -478,7 +478,7 @@ static void read_binary_block(FILE *fd, Raw *raw, int ac) p++; } raw->npoints[raw->datasets] = npoints; /* if sweeep1 and sweep2 are given less points are read */ - my_free(_ALLOC_ID_, &tmp); + my_free(1036, &tmp); } /* parse ascii raw header section: @@ -529,7 +529,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type) if(!my_strcasecmp(type, "sp")) type = "ac"; } while((line = my_fgets(fd, NULL))) { - my_strdup2(_ALLOC_ID_, &lowerline, line); + my_strdup2(1037, &lowerline, line); strtolower(lowerline); /* this is an ASCII raw file. We don't handle this (yet) */ if(!strcmp(line, "Values:\n") || !strcmp(line, "Values:\r\n")) { @@ -545,7 +545,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type) /* after this line comes the binary blob made of nvars * npoints * sizeof(double) bytes */ if(!strcmp(line, "Binary:\n") || !strcmp(line, "Binary:\r\n")) { if(sim_type) { - my_strdup(_ALLOC_ID_, &raw->sim_type, sim_type); + my_strdup(1038, &raw->sim_type, sim_type); done_header = 1; dbg(dbglev, "read_dataset(): read binary block, nvars=%d npoints=%d\n", nvars, npoints); read_binary_block(fd, raw, ac); @@ -626,7 +626,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type) goto read_dataset_done; } if(sim_type) { - my_realloc(_ALLOC_ID_, &raw->npoints, (raw->datasets+1) * sizeof(int)); + my_realloc(1039, &raw->npoints, (raw->datasets+1) * sizeof(int)); raw->npoints[raw->datasets] = npoints; /* multi-point OP is equivalent to a DC sweep. Change sim_type */ if(raw->npoints[raw->datasets] > 1 && !strcmp(sim_type, "op") ) { @@ -673,7 +673,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type) goto read_dataset_done; } if(sim_type) { - my_realloc(_ALLOC_ID_, &raw->npoints, (raw->datasets+1) * sizeof(int)); + my_realloc(1040, &raw->npoints, (raw->datasets+1) * sizeof(int)); raw->npoints[raw->datasets] = npoints; /* multi-point OP is equivalent to a DC sweep. Change sim_type */ if(raw->npoints[raw->datasets] > 1 && !strcmp(sim_type, "op") ) { @@ -684,9 +684,9 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type) if(sim_type && !done_header && variables) { char *ptr; /* get the list of lines with index and node name */ - if(!raw->names) raw->names = my_calloc(_ALLOC_ID_, raw->nvars, sizeof(char *)); - if(!raw->cursor_b_val) raw->cursor_b_val = my_calloc(_ALLOC_ID_, raw->nvars, sizeof(double)); - my_realloc(_ALLOC_ID_, &varname, strlen(line) + 1) ; + if(!raw->names) raw->names = my_calloc(1041, raw->nvars, sizeof(char *)); + if(!raw->cursor_b_val) raw->cursor_b_val = my_calloc(1042, raw->nvars, sizeof(double)); + my_realloc(1043, &varname, strlen(line) + 1) ; n = sscanf(line, "%d %s", &i, varname); /* read index and name of saved waveform */ if(n < 2) { dbg(0, "read_dataset(): WAARNING: malformed raw file, aborting\n"); @@ -703,31 +703,31 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type) ++ptr; } if(ac || (sim_type && !strcmp(sim_type, "ac")) ) { /* AC */ - my_strcat(_ALLOC_ID_, &raw->names[i << 2], varname); + my_strcat(1044, &raw->names[i << 2], varname); int_hash_lookup(&raw->table, raw->names[i << 2], (i << 2), XINSERT_NOREPLACE); if(strstr(varname, "v(") == varname /* || strstr(varname, "i(") == varname */) { - my_mstrcat(_ALLOC_ID_, &raw->names[(i << 2) + 1], "ph(", varname + 2, NULL); + my_mstrcat(1045, &raw->names[(i << 2) + 1], "ph(", varname + 2, NULL); } else { - my_mstrcat(_ALLOC_ID_, &raw->names[(i << 2) + 1], "ph(", varname, ")", NULL); + my_mstrcat(1046, &raw->names[(i << 2) + 1], "ph(", varname, ")", NULL); } int_hash_lookup(&raw->table, raw->names[(i << 2) + 1], (i << 2) + 1, XINSERT_NOREPLACE); if(strstr(varname, "v(") == varname /* || strstr(varname, "i(") == varname */) { - my_mstrcat(_ALLOC_ID_, &raw->names[(i << 2) + 2], "re(", varname + 2, NULL); + my_mstrcat(1047, &raw->names[(i << 2) + 2], "re(", varname + 2, NULL); } else { - my_mstrcat(_ALLOC_ID_, &raw->names[(i << 2) + 2], "re(", varname, ")", NULL); + my_mstrcat(1048, &raw->names[(i << 2) + 2], "re(", varname, ")", NULL); } int_hash_lookup(&raw->table, raw->names[(i << 2) + 2], (i << 2) + 2, XINSERT_NOREPLACE); if(strstr(varname, "v(") == varname /* || strstr(varname, "i(") == varname */) { - my_mstrcat(_ALLOC_ID_, &raw->names[(i << 2) + 3], "im(", varname + 2, NULL); + my_mstrcat(1049, &raw->names[(i << 2) + 3], "im(", varname + 2, NULL); } else { - my_mstrcat(_ALLOC_ID_, &raw->names[(i << 2) + 3], "im(", varname, ")", NULL); + my_mstrcat(1050, &raw->names[(i << 2) + 3], "im(", varname, ")", NULL); } int_hash_lookup(&raw->table, raw->names[(i << 2) + 3], (i << 2) + 3, XINSERT_NOREPLACE); } else { - my_strcat(_ALLOC_ID_, &raw->names[i], varname); + my_strcat(1051, &raw->names[i], varname); int_hash_lookup(&raw->table, raw->names[i], i, XINSERT_NOREPLACE); } /* use hash table to store index number of variables */ @@ -737,12 +737,12 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type) if(sim_type && !strncmp(line, "Variables:", 10)) { variables = 1 ; } - my_free(_ALLOC_ID_, &line); + my_free(1052, &line); } /* while((line = my_fgets(fd, NULL)) */ read_dataset_done: - if(line) my_free(_ALLOC_ID_, &line); - if(lowerline) my_free(_ALLOC_ID_, &lowerline); - if(varname) my_free(_ALLOC_ID_, &varname); + if(line) my_free(1053, &line); + if(lowerline) my_free(1054, &lowerline); + if(varname) my_free(1055, &varname); if(exit_status == 1 && raw->datasets && raw->npoints) { dbg(dbglev, "raw file read: datasets=%d, last dataset points=%d, nvars=%d\n", raw->datasets, raw->npoints[raw->datasets-1], raw->nvars); @@ -764,24 +764,24 @@ void free_rawfile(Raw **rawptr, int dr) dbg(0, "free_rawfile(): clearing data\n"); if(raw->names) { for(i = 0 ; i < raw->nvars; ++i) { - my_free(_ALLOC_ID_, &raw->names[i]); + my_free(1056, &raw->names[i]); } - my_free(_ALLOC_ID_, &raw->names); - my_free(_ALLOC_ID_, &raw->cursor_b_val); + my_free(1057, &raw->names); + my_free(1058, &raw->cursor_b_val); } if(raw->values) { /* free also extra column for custom data plots */ for(i = 0 ; i <= raw->nvars; ++i) { - my_free(_ALLOC_ID_, &raw->values[i]); + my_free(1059, &raw->values[i]); } - my_free(_ALLOC_ID_, &raw->values); + my_free(1060, &raw->values); } - if(raw->sim_type) my_free(_ALLOC_ID_, &raw->sim_type); - if(raw->npoints) my_free(_ALLOC_ID_, &raw->npoints); - if(raw->rawfile) my_free(_ALLOC_ID_, &raw->rawfile); - if(raw->schname) my_free(_ALLOC_ID_, &raw->schname); + if(raw->sim_type) my_free(1061, &raw->sim_type); + if(raw->npoints) my_free(1062, &raw->npoints); + if(raw->rawfile) my_free(1063, &raw->rawfile); + if(raw->schname) my_free(1064, &raw->schname); if(raw->table.table) int_hash_free(&raw->table); - my_free(_ALLOC_ID_, rawptr); + my_free(1065, rawptr); if(has_x) { tclvareval("set tctx::", xctx->current_win_path, "_waves $simulate_bg", NULL); @@ -807,13 +807,13 @@ char *base64_from_file(const char *f, size_t *length) fd = fopen(f, fopen_read_mode); if(fd) { size_t bytes_read; - s = my_malloc(_ALLOC_ID_, len); + s = my_malloc(1066, len); if((bytes_read = fread(s, 1, len, fd)) < len) { dbg(0, "base64_from_file(): less bytes FROM %S, got %ld bytes\n", f, bytes_read); } fclose(fd); b64s = base64_encode(s, len, length, 1); - my_free(_ALLOC_ID_, &s); + my_free(1067, &s); } else { dbg(0, "base64_from_file(): failed to open file %s for reading\n", f); @@ -852,7 +852,7 @@ int raw_read_from_attr(Raw **rawptr, const char *type, double sweep1, double swe s = base64_decode(b64_spice_data, length, &decoded_length); fwrite(s, decoded_length, 1, fd); fclose(fd); - my_free(_ALLOC_ID_, &s); + my_free(1068, &s); res = raw_read(tmp_filename, rawptr, type, sweep1, sweep2); unlink(tmp_filename); } else { @@ -872,15 +872,15 @@ int raw_add_vector(const char *varname, const char *expr) if(!int_hash_lookup(&raw->table, varname, 0, XLOOKUP)) { raw->nvars++; - my_realloc(_ALLOC_ID_, &raw->names, raw->nvars * sizeof(char *)); - my_realloc(_ALLOC_ID_, &raw->cursor_b_val, raw->nvars * sizeof(double)); + my_realloc(1069, &raw->names, raw->nvars * sizeof(char *)); + my_realloc(1070, &raw->cursor_b_val, raw->nvars * sizeof(double)); raw->cursor_b_val[raw->nvars - 1] = 0.0; raw->names[raw->nvars - 1] = NULL; - my_strdup2(_ALLOC_ID_, &raw->names[raw->nvars - 1], varname); + my_strdup2(1071, &raw->names[raw->nvars - 1], varname); int_hash_lookup(&raw->table, raw->names[raw->nvars - 1], raw->nvars - 1, XINSERT_NOREPLACE); - my_realloc(_ALLOC_ID_, &raw->values, (raw->nvars + 1) * sizeof(SPICE_DATA *)); + my_realloc(1072, &raw->values, (raw->nvars + 1) * sizeof(SPICE_DATA *)); raw->values[raw->nvars] = NULL; - my_realloc(_ALLOC_ID_, &raw->values[raw->nvars], raw->allpoints * sizeof(SPICE_DATA)); + my_realloc(1073, &raw->values[raw->nvars], raw->allpoints * sizeof(SPICE_DATA)); res = 1; } if(expr) { @@ -909,7 +909,7 @@ int raw_read(const char *f, Raw **rawptr, const char *type, double sweep1, doubl return res; } dbg(1, "raw_read(): type=%s\n", type ? type : "NULL"); - *rawptr = my_calloc(_ALLOC_ID_, 1, sizeof(Raw)); + *rawptr = my_calloc(1074, 1, sizeof(Raw)); raw = *rawptr; raw->level = -1; raw->annot_p = -1; @@ -923,8 +923,8 @@ int raw_read(const char *f, Raw **rawptr, const char *type, double sweep1, doubl if((res = read_dataset(fd, rawptr, type)) == 1) { int i; set_modify(-2); /* clear text floater caches */ - my_strdup2(_ALLOC_ID_, &raw->rawfile, f); - my_strdup2(_ALLOC_ID_, &raw->schname, xctx->sch[xctx->currsch]); + my_strdup2(1075, &raw->rawfile, f); + my_strdup2(1076, &raw->schname, xctx->sch[xctx->currsch]); raw->level = xctx->currsch; raw->allpoints = 0; for(i = 0; i < raw->datasets; ++i) { @@ -964,18 +964,18 @@ int raw_deletevar(const char *name) if(n < 0) return ret; dbg(1, "n=%d, %s \n", n, entry->token); int_hash_lookup(&raw->table, entry->token, 0, XDELETE); - my_free(_ALLOC_ID_, &raw->names[n]); + my_free(1077, &raw->names[n]); for(i = n + 1; i < raw->nvars; i++) { int_hash_lookup(&raw->table, raw->names[i], i - 1, XINSERT); /* update hash table */ raw->names[i - 1] = raw->names[i]; } - my_free(_ALLOC_ID_, &raw->values[n]); + my_free(1078, &raw->values[n]); for(i = n + 1; i <= raw->nvars; i++) { raw->values[i - 1] = raw->values[i]; } raw->nvars--; - my_realloc(_ALLOC_ID_, &raw->names, sizeof(char *) * raw->nvars); - my_realloc(_ALLOC_ID_, &raw->values, sizeof(SPICE_DATA *) * raw->nvars + 1); + my_realloc(1079, &raw->names, sizeof(char *) * raw->nvars); + my_realloc(1080, &raw->values, sizeof(SPICE_DATA *) * raw->nvars + 1); ret = 1; return ret; } @@ -1011,7 +1011,7 @@ int new_rawfile(const char *name, const char *type, const char *sweepvar, if(i >= xctx->extra_raw_n) { /* file not already loaded: read it and switch to it */ double t; - xctx->raw = my_calloc(_ALLOC_ID_, 1, sizeof(Raw)); + xctx->raw = my_calloc(1081, 1, sizeof(Raw)); raw = xctx->raw; raw->level = -1; raw->sweep1 = -1.0; @@ -1020,21 +1020,21 @@ int new_rawfile(const char *name, const char *type, const char *sweepvar, raw->annot_sweep_idx = -1; int_hash_init(&raw->table, HASHSIZE); - my_strdup2(_ALLOC_ID_, &raw->rawfile, name); - my_strdup2(_ALLOC_ID_, &raw->schname, xctx->sch[xctx->currsch]); - my_strdup(_ALLOC_ID_, &raw->sim_type, type); + my_strdup2(1082, &raw->rawfile, name); + my_strdup2(1083, &raw->schname, xctx->sch[xctx->currsch]); + my_strdup(1084, &raw->sim_type, type); raw->level = xctx->currsch; - my_realloc(_ALLOC_ID_, &raw->npoints, 1 * sizeof(int)); /* for now assume only one dataset */ + my_realloc(1085, &raw->npoints, 1 * sizeof(int)); /* for now assume only one dataset */ raw->datasets = 1; raw->allpoints = number; raw->npoints[0] = number; raw->nvars = 1; - raw->values = my_calloc(_ALLOC_ID_, raw->nvars + 1, sizeof(SPICE_DATA *)); - raw->values[0] = my_calloc(_ALLOC_ID_, number, sizeof(SPICE_DATA)); - raw->values[1] = my_calloc(_ALLOC_ID_, number, sizeof(SPICE_DATA)); - raw->names = my_calloc(_ALLOC_ID_, raw->nvars, sizeof(char *)); - raw->cursor_b_val = my_calloc(_ALLOC_ID_, raw->nvars, sizeof(double)); - my_strdup2(_ALLOC_ID_, &raw->names[0], sweepvar); + raw->values = my_calloc(1086, raw->nvars + 1, sizeof(SPICE_DATA *)); + raw->values[0] = my_calloc(1087, number, sizeof(SPICE_DATA)); + raw->values[1] = my_calloc(1088, number, sizeof(SPICE_DATA)); + raw->names = my_calloc(1089, raw->nvars, sizeof(char *)); + raw->cursor_b_val = my_calloc(1090, raw->nvars, sizeof(double)); + my_strdup2(1091, &raw->names[0], sweepvar); int_hash_lookup(&raw->table, raw->names[0], 0, XINSERT_NOREPLACE); for(i = 0; i < number; i++) { @@ -1096,7 +1096,7 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d save = xctx->raw; xctx->raw = NULL; read_ret = table_read(f); - my_strdup(_ALLOC_ID_, &xctx->raw->sim_type, type); + my_strdup(1092, &xctx->raw->sim_type, type); if(read_ret) { xctx->extra_raw_arr[xctx->extra_raw_n] = xctx->raw; xctx->extra_prev_idx = xctx->extra_idx; @@ -1316,7 +1316,7 @@ int table_read(const char *f) dbg(0, "table_read(): must clear current data file before loading new\n"); return 0; } - xctx->raw = my_calloc(_ALLOC_ID_, 1, sizeof(Raw)); + xctx->raw = my_calloc(1093, 1, sizeof(Raw)); raw = xctx->raw; raw->level = -1; raw->annot_p = -1; @@ -1358,7 +1358,7 @@ int table_read(const char *f) } if(!raw->datasets || (prev_prev_empty == 1 && prev_empty == 1) ) { raw->datasets++; - my_realloc(_ALLOC_ID_, &raw->npoints, raw->datasets * sizeof(int)); + my_realloc(1094, &raw->npoints, raw->datasets * sizeof(int)); dataset_points = 0; } prev_prev_empty = prev_empty = 0; @@ -1372,9 +1372,9 @@ int table_read(const char *f) line_ptr = NULL; /* dbg(1,"%s ", line_tok); */ if(nline == 0) { /* header line */ - my_realloc(_ALLOC_ID_, &raw->names, (field + 1) * sizeof(char *)); + my_realloc(1095, &raw->names, (field + 1) * sizeof(char *)); raw->names[field] = NULL; - my_strcat(_ALLOC_ID_, &raw->names[field], line_tok); + my_strcat(1096, &raw->names[field], line_tok); int_hash_lookup(&raw->table, raw->names[field], field, XINSERT_NOREPLACE); raw->nvars = field + 1; } else { /* data line */ @@ -1396,19 +1396,19 @@ int table_read(const char *f) ++nline; if(nline == 1) { int f; - raw->values = my_calloc(_ALLOC_ID_, raw->nvars + 1, sizeof(SPICE_DATA *)); + raw->values = my_calloc(1097, raw->nvars + 1, sizeof(SPICE_DATA *)); for(f = 0; f <= raw->nvars; f++) { /* one extra column for wave expressions */ - my_realloc(_ALLOC_ID_, &raw->values[f], lines * sizeof(SPICE_DATA)); + my_realloc(1098, &raw->values[f], lines * sizeof(SPICE_DATA)); } } clear: - my_free(_ALLOC_ID_, &line); + my_free(1099, &line); } /* while(line ....) */ raw->allpoints = 0; if(res == 1) { int i; - my_strdup2(_ALLOC_ID_, &raw->rawfile, f); - my_strdup2(_ALLOC_ID_, &raw->schname, xctx->sch[xctx->currsch]); + my_strdup2(1100, &raw->rawfile, f); + my_strdup2(1101, &raw->schname, xctx->sch[xctx->currsch]); raw->level = xctx->currsch; raw->allpoints = 0; for(i = 0; i < raw->datasets; ++i) { @@ -1420,7 +1420,7 @@ int table_read(const char *f) } else { dbg(0, "table_read(): no useful data found\n"); } - raw->cursor_b_val = my_calloc(_ALLOC_ID_, raw->nvars, sizeof(double)); + raw->cursor_b_val = my_calloc(1102, raw->nvars, sizeof(double)); fclose(fd); return res; } @@ -1488,18 +1488,18 @@ static double ravg_store(int what , int i, int p, int last, double value) } else if(what == 1) { if(i >= imax) { int new_size = i + 4; - my_realloc(_ALLOC_ID_, &arr, sizeof(double *) * new_size); + my_realloc(1103, &arr, sizeof(double *) * new_size); for(j = imax; j < new_size; ++j) { - arr[j] = my_calloc(_ALLOC_ID_, last + 1, sizeof(double)); + arr[j] = my_calloc(1104, last + 1, sizeof(double)); } imax = new_size; } arr[i][p] = value; } else if(what == 0 && imax) { for(j = 0; j < imax; ++j) { - my_free(_ALLOC_ID_, &arr[j]); + my_free(1105, &arr[j]); } - my_free(_ALLOC_ID_, &arr); + my_free(1106, &arr); imax = 0; } return 0.0; @@ -1586,13 +1586,13 @@ int plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr, c y = xctx->raw->values[yidx]; /* provided index */ } } - my_strdup2(_ALLOC_ID_, &ntok_copy, expr); + my_strdup2(1107, &ntok_copy, expr); ntok_ptr = ntok_copy; dbg(1, "plot_raw_custom_data(): expr=%s, first=%d, last=%d\n", expr, first, last); while( (n = my_strtok_r(ntok_ptr, " \t\n", "", 0, &ntok_save)) ) { if(stackptr1 >= STACKMAX -2) { dbg(0, "stack overflow in graph expression parsing. Interrupted\n"); - my_free(_ALLOC_ID_, &ntok_copy); + my_free(1108, &ntok_copy); return -1; } ntok_ptr = NULL; @@ -1674,7 +1674,7 @@ int plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr, c idx = get_raw_index(n, NULL); if(idx == -1) { dbg(1, "plot_raw_custom_data(): no data found: %s\n", n); - my_free(_ALLOC_ID_, &ntok_copy); + my_free(1109, &ntok_copy); return -1; /* no data found in raw file */ } stack1[stackptr1].i = SPICE_NODE; @@ -1682,7 +1682,7 @@ int plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr, c stackptr1++; } } /* while(n = my_strtok_r(...) */ - my_free(_ALLOC_ID_, &ntok_copy); + my_free(1110, &ntok_copy); for(p = first ; p <= last; p++) { stackptr2 = 0; for(i = 0; i < stackptr1; ++i) { @@ -2100,7 +2100,7 @@ void read_record(int firstchar, FILE *fp, int dbg_level) } } dbg(dbg_level, "END SKIP RECORD\n"); - my_free(_ALLOC_ID_, &str); + my_free(1111, &str); } /* skip line of text from file, stopping before '\n' or EOF */ @@ -2229,7 +2229,7 @@ void save_ascii_string(const char *ptr, FILE *fd, int newline) if(ptr == NULL) { if( fd == NULL) { /* used to clear static data */ - my_free(_ALLOC_ID_, &strbuf); + my_free(1112, &strbuf); strbuf_size = 0; return; } @@ -2238,11 +2238,11 @@ void save_ascii_string(const char *ptr, FILE *fd, int newline) return; } len = strlen(ptr) + CADCHUNKALLOC; - if(strbuf_size < len ) my_realloc(_ALLOC_ID_, &strbuf, (strbuf_size = len)); + if(strbuf_size < len ) my_realloc(1113, &strbuf, (strbuf_size = len)); strbuf[strbuf_pos++] = '{'; while( (c = *ptr++) ) { - if(strbuf_pos > strbuf_size - 6) my_realloc(_ALLOC_ID_, &strbuf, (strbuf_size += CADCHUNKALLOC)); + if(strbuf_pos > strbuf_size - 6) my_realloc(1114, &strbuf, (strbuf_size += CADCHUNKALLOC)); if( c=='\\' || c=='{' || c=='}') strbuf[strbuf_pos++] = '\\'; strbuf[strbuf_pos++] = (char)c; } @@ -2332,7 +2332,7 @@ static void save_inst(FILE *fd, int select_only) dbg(1, "save_inst(): saving instances\n"); inst=xctx->inst; oldversion = !strcmp(xctx->file_version, "1.0"); - embedded_saved = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(int)); + embedded_saved = my_calloc(1115, xctx->symbols, sizeof(int)); for(i=0;iinstances; ++i) { int ptr = inst[i].ptr; @@ -2344,9 +2344,9 @@ static void save_inst(FILE *fd, int select_only) if(ptr >=0) xctx->sym[ptr].flags &=~EMBEDDED; fputs("C ", fd); if(oldversion) { - my_strdup2(_ALLOC_ID_, &tmp, add_ext(inst[i].name, ".sym")); + my_strdup2(1116, &tmp, add_ext(inst[i].name, ".sym")); save_ascii_string(tmp, fd, 0); - my_free(_ALLOC_ID_, &tmp); + my_free(1117, &tmp); } else { save_ascii_string(inst[i].name, fd, 0); } @@ -2360,7 +2360,7 @@ static void save_inst(FILE *fd, int select_only) xctx->sym[ptr].flags |= EMBEDDED; } } - my_free(_ALLOC_ID_, &embedded_saved); + my_free(1118, &embedded_saved); } static void save_wire(FILE *fd, int select_only) @@ -2472,12 +2472,12 @@ static void write_xschem_file(FILE *fd) size_t tmpstring_size; char *header_ptr = xctx->header_text ? xctx->header_text : ""; tmpstring_size = strlen(header_ptr) + 100; - tmpstring = my_malloc(_ALLOC_ID_, tmpstring_size); + tmpstring = my_malloc(1119, tmpstring_size); my_snprintf(tmpstring, tmpstring_size, "xschem version=%s file_version=%s\n%s", XSCHEM_VERSION, XSCHEM_FILE_VERSION, header_ptr); fprintf(fd, "v "); save_ascii_string(tmpstring, fd, 1); - my_free(_ALLOC_ID_, &tmpstring); + my_free(1120, &tmpstring); if(xctx->schvhdlprop && !xctx->schsymbolprop) { get_tok_value(xctx->schvhdlprop,"type",0); @@ -2584,12 +2584,12 @@ static void load_inst(int k, FILE *fd) xctx->inst[i].name=NULL; /* avoid as much as possible calls to rel_sym_path (slow) */ #ifdef __unix__ - if(name[0] == '/') my_strdup2(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(name)); - else my_strdup2(_ALLOC_ID_, &xctx->inst[i].name, name); + if(name[0] == '/') my_strdup2(1121, &xctx->inst[i].name, rel_sym_path(name)); + else my_strdup2(1122, &xctx->inst[i].name, name); #else - my_strdup2(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(name)); + my_strdup2(1123, &xctx->inst[i].name, rel_sym_path(name)); #endif - my_free(_ALLOC_ID_, &tmp); + my_free(1124, &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"); @@ -2603,14 +2603,14 @@ static void load_inst(int k, FILE *fd) xctx->inst[i].lab=NULL; /* assigned in link_symbols_to_instances */ xctx->inst[i].node=NULL; load_ascii_string(&prop_ptr,fd); - my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, prop_ptr); + my_strdup(1125, &xctx->inst[i].prop_ptr, prop_ptr); set_inst_flags(&xctx->inst[i]); dbg(2, "load_inst(): n=%d name=%s prop=%s\n", i, xctx->inst[i].name? xctx->inst[i].name:"", xctx->inst[i].prop_ptr? xctx->inst[i].prop_ptr:""); xctx->instances++; } - my_free(_ALLOC_ID_, &prop_ptr); + my_free(1126, &prop_ptr); } static void load_polygon(FILE *fd) @@ -2638,17 +2638,17 @@ static void load_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(1127, points, sizeof(double)); + ptr[i].y = my_calloc(1128, points, sizeof(double)); + ptr[i].selected_point= my_calloc(1129, points, sizeof(unsigned short)); ptr[i].points=points; ptr[i].sel=0; for(j=0;jversion_string, "xschem")) && (ptr2 - xctx->version_string < 50)) { - my_strdup2(_ALLOC_ID_, &ptr, subst_token(xctx->version_string, "xschem", NULL)); + my_strdup2(1133, &ptr, subst_token(xctx->version_string, "xschem", NULL)); } - my_strdup2(_ALLOC_ID_, &ptr, subst_token(ptr, "version", NULL)); - my_strdup2(_ALLOC_ID_, &ptr, subst_token(ptr, "file_version", NULL)); + my_strdup2(1134, &ptr, subst_token(ptr, "version", NULL)); + my_strdup2(1135, &ptr, subst_token(ptr, "file_version", NULL)); ptr2 = ptr; while(*ptr2 == ' ' || *ptr2 =='\t') ptr2++; /* strip leading spaces */ if(*ptr2 == '\n') ptr2++; /* strip leading newline */ - my_strdup2(_ALLOC_ID_, &xctx->header_text, ptr2); - my_free(_ALLOC_ID_,&ptr); + my_strdup2(1136, &xctx->header_text, ptr2); + my_free(1137,&ptr); } dbg(1, "read_xschem_file(): file_version=%s\n", xctx->file_version); break; @@ -2898,7 +2898,7 @@ static void read_xschem_file(FILE *fd) break; case '[': found=0; - my_strdup(_ALLOC_ID_, &xctx->inst[xctx->instances-1].prop_ptr, + my_strdup(1138, &xctx->inst[xctx->instances-1].prop_ptr, subst_token(xctx->inst[xctx->instances-1].prop_ptr, "embed", "true")); if(xctx->inst[xctx->instances-1].name) { my_snprintf(name_embedded, S(name_embedded), "%s/.xschem_embedded_%d_%s", @@ -2914,7 +2914,7 @@ static void read_xschem_file(FILE *fd) /* if loading file coming back from embedded symbol delete temporary file */ /* symbol from this temp file has already been loaded in go_back() */ if(!xctx->x_strcmp(name_embedded, xctx->sym[i].name)) { - my_strdup2(_ALLOC_ID_, &xctx->sym[i].name, xctx->inst[xctx->instances-1].name); + my_strdup2(1139, &xctx->sym[i].name, xctx->inst[xctx->instances-1].name); xunlink(name_embedded); found=1;break; } @@ -2971,13 +2971,13 @@ void load_ascii_string(char **ptr, FILE *fd) for(;;) { - if(i+5>strlength) my_realloc(_ALLOC_ID_, &str,(strlength+=CADCHUNKALLOC)); + if(i+5>strlength) my_realloc(1140, &str,(strlength+=CADCHUNKALLOC)); c=fgetc(fd); if (c=='\r') continue; if(c==EOF) { fprintf(errfp, "EOF reached, malformed {...} string input, missing close brace\n"); - my_free(_ALLOC_ID_, ptr); - my_free(_ALLOC_ID_, &str); + my_free(1141, ptr); + my_free(1142, &str); return; } if(begin) { @@ -2997,9 +2997,9 @@ void load_ascii_string(char **ptr, FILE *fd) } else if(c=='{') begin=1; } dbg(2, "load_ascii_string(): string read=%s\n",str? str:""); - my_strdup(_ALLOC_ID_, ptr, str); + my_strdup(1143, ptr, str); dbg(2, "load_ascii_string(): loaded %s\n",*ptr? *ptr:""); - my_free(_ALLOC_ID_, &str); + my_free(1144, &str); } void make_symbol(void) @@ -3118,7 +3118,7 @@ Sch_pin_record *sort_schematic_pins(int *npins) (*npins)++; } } - pinnumber_list = my_malloc(_ALLOC_ID_, sizeof(Sch_pin_record) * *npins); + pinnumber_list = my_malloc(1145, sizeof(Sch_pin_record) * *npins); *npins = 0; for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; @@ -3163,11 +3163,11 @@ int save_schematic(const char *schname) /* 20171020 added return value */ dbg(1, "save_schematic(): sch[currsch]=%s\n", xctx->sch[xctx->currsch] ? xctx->sch[xctx->currsch] : "NULL"); if(!xctx->sch[xctx->currsch]) { /* no current schematic name -> assign new name */ - my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], schname); + my_strdup2(1146, &xctx->sch[xctx->currsch], schname); set_modify(-1); /* set title to new filename */ } else if(strcmp(schname, xctx->sch[xctx->currsch])) { /* user asks to save to a different filename */ - my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], schname); + my_strdup2(1147, &xctx->sch[xctx->currsch], schname); set_modify(-1); /* set title to new filename */ } else { /* user asks to save to same filename */ @@ -3232,16 +3232,16 @@ void link_symbols_to_instances(int from) dbg(2, "link_symbols_to_instances(): inst=%d\n", i); dbg(2, "link_symbols_to_instances(): matching inst %d name=%s \n",i, xctx->inst[i].name); dbg(2, "link_symbols_to_instances(): -------\n"); - my_strdup2(_ALLOC_ID_, &name, tcl_hook2(translate(i, xctx->inst[i].name))); + my_strdup2(1148, &name, tcl_hook2(translate(i, xctx->inst[i].name))); xctx->inst[i].ptr = match_symbol(name); - my_free(_ALLOC_ID_, &name); + my_free(1149, &name); } for(i = from; i < xctx->instances; ++i) { type=xctx->sym[xctx->inst[i].ptr].type; cond= type && IS_LABEL_SH_OR_PIN(type); if(cond) { xctx->inst[i].flags |= PIN_OR_LABEL; /* label or pin */ - my_strdup2(_ALLOC_ID_, &xctx->inst[i].lab, get_tok_value(xctx->inst[i].prop_ptr,"lab",0)); + my_strdup2(1150, &xctx->inst[i].lab, get_tok_value(xctx->inst[i].prop_ptr,"lab",0)); } else xctx->inst[i].flags &= ~PIN_OR_LABEL; /* ordinary symbol */ } @@ -3285,7 +3285,7 @@ int load_schematic(int load_symbols, const char *fname, int reset_undo, int aler my_snprintf(msg, S(msg), "get_directory {%s}", fname); my_strncpy(xctx->current_dirname, tcleval(msg), S(xctx->current_dirname)); /* local file name */ - my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], name); + my_strdup2(1151, &xctx->sch[xctx->currsch], name); /* local relative reference */ my_strncpy(xctx->current_name, rel_sym_path(name), S(xctx->current_name)); @@ -3302,7 +3302,7 @@ int load_schematic(int load_symbols, const char *fname, int reset_undo, int aler } /* local file name */ - my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], fname); + my_strdup2(1152, &xctx->sch[xctx->currsch], fname); /* local relative reference */ my_strncpy(xctx->current_name, rel_sym_path(fname), S(xctx->current_name)); } else { /* local file specified and not coming from web url */ @@ -3310,7 +3310,7 @@ int load_schematic(int load_symbols, const char *fname, int reset_undo, int aler my_snprintf(msg, S(msg), "get_directory {%s}", fname); my_strncpy(xctx->current_dirname, tcleval(msg), S(xctx->current_dirname)); /* local file name */ - my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], fname); + my_strdup2(1153, &xctx->sch[xctx->currsch], fname); /* local relative reference */ my_strncpy(xctx->current_name, rel_sym_path(fname), S(xctx->current_name)); } @@ -3331,7 +3331,7 @@ int load_schematic(int load_symbols, const char *fname, int reset_undo, int aler cmd = get_generator_command(fname); if(cmd) { fd = popen(cmd, "r"); - my_free(_ALLOC_ID_, &cmd); + my_free(1154, &cmd); } else fd = NULL; } else fd=fopen(name,fopen_read_mode); @@ -3393,7 +3393,7 @@ int load_schematic(int load_symbols, const char *fname, int reset_undo, int aler } else { my_strncpy(xctx->current_dirname, pwd_dir, S(xctx->current_dirname)); } - my_mstrcat(_ALLOC_ID_, &xctx->sch[xctx->currsch], xctx->current_dirname, "/", name, NULL); + my_mstrcat(1155, &xctx->sch[xctx->currsch], xctx->current_dirname, "/", name, NULL); if(reset_undo) set_modify(0); } check_collapsing_objects(); @@ -3430,7 +3430,7 @@ void delete_undo(void) xunlink(diff_name); } rmdir(xctx->undo_dirname); - my_free(_ALLOC_ID_, &xctx->undo_dirname); + my_free(1156, &xctx->undo_dirname); xctx->undo_initialized = 0; } @@ -3439,7 +3439,7 @@ static void init_undo(void) { if(!xctx->undo_initialized) { /* create undo directory */ - if( !my_strdup(_ALLOC_ID_, &xctx->undo_dirname, create_tmpdir("xschem_undo_") )) { + if( !my_strdup(1157, &xctx->undo_dirname, create_tmpdir("xschem_undo_") )) { dbg(0, "xinit(): problems creating tmp undo dir, Undo will be disabled\n"); dbg(0, "init_undo(): Check permissions in %s\n", tclgetvar("XSCHEM_TMP_DIR")); xctx->no_undo = 1; /* disable undo */ @@ -3660,7 +3660,7 @@ static void get_sym_type(const char *symname, char **type, /* first look in already loaded symbols in xctx->sym[] array... */ for(i=0;isymbols; ++i) { if(xctx->x_strcmp(symname, xctx->sym[i].name) == 0) { - my_strdup2(_ALLOC_ID_, type, xctx->sym[i].type); + my_strdup2(1158, type, xctx->sym[i].type); found = 1; break; } @@ -3681,7 +3681,7 @@ static void get_sym_type(const char *symname, char **type, if(fd==NULL) { dbg(1, "get_sym_type(): Symbol not found: %s\n",name); - my_strdup2(_ALLOC_ID_, type, ""); + my_strdup2(1159, type, ""); } else { char *globalprop=NULL; int fscan_ret; @@ -3695,12 +3695,12 @@ static void get_sym_type(const char *symname, char **type, case 'G': load_ascii_string(&globalprop,fd); if(!found) { - my_strdup2(_ALLOC_ID_, type, get_tok_value(globalprop, "type", 0)); + my_strdup2(1160, type, get_tok_value(globalprop, "type", 0)); } break; case 'K': load_ascii_string(&globalprop,fd); - my_strdup2(_ALLOC_ID_, type, get_tok_value(globalprop, "type", 0)); + my_strdup2(1161, type, get_tok_value(globalprop, "type", 0)); if(type[0]) found = 1; break; case 'B': @@ -3729,8 +3729,8 @@ static void get_sym_type(const char *symname, char **type, } read_line(fd, 0); /* discard any remaining characters till (but not including) newline */ } - my_free(_ALLOC_ID_, &globalprop); - my_free(_ALLOC_ID_, &rect.prop_ptr); + my_free(1162, &globalprop); + my_free(1163, &rect.prop_ptr); if(!embed_fd) fclose(fd); } } @@ -3761,7 +3761,7 @@ static void align_sch_pins_with_sym(const char *name, int pos) name, symname); fail = 1; } - rect = (xRect *) my_malloc(_ALLOC_ID_, sizeof(xRect) * sym_n_pins); + rect = (xRect *) my_malloc(1164, sizeof(xRect) * sym_n_pins); dbg(1, "align_sch_pins_with_sym(): symbol: %s\n", symname); for(i=0; i < xctx->sym[pos].rects[PINLAYER]; ++i) { Int_hashentry *entry; @@ -3782,10 +3782,10 @@ static void align_sch_pins_with_sym(const char *name, int pos) xctx->sym[pos].rect[PINLAYER][i] = rect[i]; } } - my_free(_ALLOC_ID_, &rect); + my_free(1165, &rect); } int_hash_free(&pintable); - my_free(_ALLOC_ID_, &symtype); + my_free(1166, &symtype); } } @@ -3799,14 +3799,14 @@ static void add_pinlayer_boxes(int *lastr, xRect **bb, char *pin_label = NULL; i = lastr[PINLAYER]; - my_realloc(_ALLOC_ID_, &bb[PINLAYER], (i + 1) * sizeof(xRect)); + my_realloc(1167, &bb[PINLAYER], (i + 1) * sizeof(xRect)); bb[PINLAYER][i].x1 = i_x0 - 2.5; bb[PINLAYER][i].x2 = i_x0 + 2.5; bb[PINLAYER][i].y1 = i_y0 - 2.5; bb[PINLAYER][i].y2 = i_y0 + 2.5; RECTORDER(bb[PINLAYER][i].x1, bb[PINLAYER][i].y1, bb[PINLAYER][i].x2, bb[PINLAYER][i].y2); bb[PINLAYER][i].prop_ptr = NULL; label = get_tok_value(prop_ptr, "lab", 0); save = strlen(label)+30; - pin_label = my_malloc(_ALLOC_ID_, save); + pin_label = my_malloc(1168, save); pin_label[0] = '\0'; if (!strcmp(symtype, "ipin")) { my_snprintf(pin_label, save, "name=%s dir=in ", label); @@ -3815,16 +3815,16 @@ static void add_pinlayer_boxes(int *lastr, xRect **bb, } else if (!strcmp(symtype, "iopin")) { my_snprintf(pin_label, save, "name=%s dir=inout ", label); } - my_strdup(_ALLOC_ID_, &bb[PINLAYER][i].prop_ptr, pin_label); + my_strdup(1169, &bb[PINLAYER][i].prop_ptr, pin_label); bb[PINLAYER][i].flags = 0; bb[PINLAYER][i].extraptr = 0; bb[PINLAYER][i].dash = 0; bb[PINLAYER][i].ellipse_a = bb[PINLAYER][i].ellipse_b = -1; bb[PINLAYER][i].sel = 0; /* add to symbol pins remaining attributes from schematic pins, except name= and lab= */ - my_strdup(_ALLOC_ID_, &pin_label, get_sym_template(prop_ptr, "lab")); /* remove name=... and lab=... */ - my_strcat(_ALLOC_ID_, &bb[PINLAYER][i].prop_ptr, pin_label); - my_free(_ALLOC_ID_, &pin_label); + my_strdup(1170, &pin_label, get_sym_template(prop_ptr, "lab")); /* remove name=... and lab=... */ + my_strcat(1171, &bb[PINLAYER][i].prop_ptr, pin_label); + my_free(1172, &pin_label); lastr[PINLAYER]++; } @@ -3910,7 +3910,7 @@ static void calc_symbol_bbox(int pos) * estr = my_expand(get_text_floater(i), tclgetintvar("tabstop")); * text_bbox(estr, tt[i].xscale, tt[i].yscale, rot, flip, * tt[i].x0, tt[i].y0, &rx1,&ry1,&rx2,&ry2, &dtmp); -* my_free(_ALLOC_ID_, &estr); +* my_free(1173, &estr); * tmp.x1=rx1;tmp.y1=ry1;tmp.x2=rx2;tmp.y2=ry2; * updatebbox(count,&boundbox,&tmp); * } @@ -3967,15 +3967,15 @@ int load_sym_def(const char *name, FILE *embed_fd) short inst_rot, inst_flip; char *symname = NULL; char tag[1]; - int *lastl = my_malloc(_ALLOC_ID_, cadlayers * sizeof(lastl)); - int *lastr = my_malloc(_ALLOC_ID_, cadlayers * sizeof(int)); - int *lastp = my_malloc(_ALLOC_ID_, cadlayers * sizeof(int)); - int *lasta = my_malloc(_ALLOC_ID_, cadlayers * sizeof(int)); + int *lastl = my_malloc(1174, cadlayers * sizeof(lastl)); + int *lastr = my_malloc(1175, cadlayers * sizeof(int)); + int *lastp = my_malloc(1176, cadlayers * sizeof(int)); + int *lasta = my_malloc(1177, cadlayers * sizeof(int)); int lastt; - xLine tmpline, **ll = my_malloc(_ALLOC_ID_, cadlayers * sizeof(xLine *)); - xRect tmprect, **bb = my_malloc(_ALLOC_ID_, cadlayers * sizeof(xRect *)); - xPoly tmppoly, **pp = my_malloc(_ALLOC_ID_, cadlayers * sizeof(xPoly *)); - xArc tmparc, **aa = my_malloc(_ALLOC_ID_, cadlayers * sizeof(xArc *)); + xLine tmpline, **ll = my_malloc(1178, cadlayers * sizeof(xLine *)); + xRect tmprect, **bb = my_malloc(1179, cadlayers * sizeof(xRect *)); + xPoly tmppoly, **pp = my_malloc(1180, cadlayers * sizeof(xPoly *)); + xArc tmparc, **aa = my_malloc(1181, cadlayers * sizeof(xArc *)); xText tmptext, *tt; int endfile; char *skip_line; @@ -3998,9 +3998,9 @@ int load_sym_def(const char *name, FILE *embed_fd) recursion_counter++; dbg(1, "l_s_d(): loading name=%s\n", name); lcc=NULL; - my_realloc(_ALLOC_ID_, &lcc, (level + 1) * sizeof(Lcc)); + my_realloc(1182, &lcc, (level + 1) * sizeof(Lcc)); max_level = level + 1; - my_strdup2(_ALLOC_ID_, &cmd, tcl_hook2(name)); + my_strdup2(1183, &cmd, tcl_hook2(name)); dbg(1, "l_s_d(): cmd=%s\n", cmd); generator = is_generator(cmd); if(generator) { @@ -4012,7 +4012,7 @@ int load_sym_def(const char *name, FILE *embed_fd) } else { lcc[level].fd = NULL; } - my_free(_ALLOC_ID_, &translated_cmd); + my_free(1184, &translated_cmd); } else if(!embed_fd) { /* regular symbol: open file */ if(!strcmp(xctx->file_version,"1.0")) { my_strncpy(sympath, abs_sym_path(name, ".sym"), S(sympath)); @@ -4035,7 +4035,7 @@ int load_sym_def(const char *name, FILE *embed_fd) dbg(1, "l_s_d(): getting embed_fd, level=%d\n", level); lcc[level].fd = embed_fd; } - my_free(_ALLOC_ID_, &cmd); + my_free(1185, &cmd); if(lcc[level].fd==NULL) { /* issue warning only on top level symbol loading */ if(recursion_counter == 1) dbg(0, "l_s_d(): Symbol not found: %s\n", name); @@ -4062,17 +4062,17 @@ int load_sym_def(const char *name, FILE *embed_fd) symbol[symbols].base_name=NULL; symbol[symbols].name=NULL; - symbol[symbols].line=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *)); - symbol[symbols].poly=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *)); - symbol[symbols].arc=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *)); - symbol[symbols].rect=my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *)); - symbol[symbols].lines=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int)); - symbol[symbols].rects=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int)); - symbol[symbols].arcs=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int)); - symbol[symbols].polygons=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int)); + symbol[symbols].line=my_calloc(1186, cadlayers, sizeof(xLine *)); + symbol[symbols].poly=my_calloc(1187, cadlayers, sizeof(xPoly *)); + symbol[symbols].arc=my_calloc(1188, cadlayers, sizeof(xArc *)); + symbol[symbols].rect=my_calloc(1189, cadlayers, sizeof(xRect *)); + symbol[symbols].lines=my_calloc(1190, cadlayers, sizeof(int)); + symbol[symbols].rects=my_calloc(1191, cadlayers, sizeof(int)); + symbol[symbols].arcs=my_calloc(1192, cadlayers, sizeof(int)); + symbol[symbols].polygons=my_calloc(1193, cadlayers, sizeof(int)); - my_strdup2(_ALLOC_ID_, &symbol[symbols].name,name); + my_strdup2(1194, &symbol[symbols].name,name); /* read symbol from file */ while(1) { @@ -4082,8 +4082,8 @@ int load_sym_def(const char *name, FILE *embed_fd) dbg(1, "l_s_d(): fclose1, level=%d, fd=%p\n", level, lcc[level].fd); if(generator) pclose(lcc[level].fd); else fclose(lcc[level].fd); - my_free(_ALLOC_ID_, &lcc[level].prop_ptr); - my_free(_ALLOC_ID_, &lcc[level].symname); + my_free(1195, &lcc[level].prop_ptr); + my_free(1196, &lcc[level].symname); --level; continue; } else break; @@ -4152,12 +4152,12 @@ int load_sym_def(const char *name, FILE *embed_fd) load_ascii_string(&tmpline.prop_ptr, lcc[level].fd); if( !strboolcmp(get_tok_value(tmpline.prop_ptr, "symbol_ignore", 0), "true")) { - my_free(_ALLOC_ID_, &tmpline.prop_ptr); + my_free(1197, &tmpline.prop_ptr); continue; } i=lastl[c]; - my_realloc(_ALLOC_ID_, &ll[c],(i+1)*sizeof(xLine)); + my_realloc(1198, &ll[c],(i+1)*sizeof(xLine)); ll[c][i].x1 = tmpline.x1; ll[c][i].y1 = tmpline.y1; @@ -4199,9 +4199,9 @@ int load_sym_def(const char *name, FILE *embed_fd) continue; } - tmppoly.x = my_calloc(_ALLOC_ID_, poly_points, sizeof(double)); - tmppoly.y = my_calloc(_ALLOC_ID_, poly_points, sizeof(double)); - tmppoly.selected_point = my_calloc(_ALLOC_ID_, poly_points, sizeof(unsigned short)); + tmppoly.x = my_calloc(1199, poly_points, sizeof(double)); + tmppoly.y = my_calloc(1200, poly_points, sizeof(double)); + tmppoly.selected_point = my_calloc(1201, poly_points, sizeof(unsigned short)); tmppoly.points = poly_points; for(k=0;k0 && c == PINLAYER) c = 7; /* Don't care about pins inside SYM: set on different layer */ i=lastr[c]; - my_realloc(_ALLOC_ID_, &bb[c],(i+1)*sizeof(xRect)); + my_realloc(1210, &bb[c],(i+1)*sizeof(xRect)); bb[c][i].x1 = tmprect.x1; bb[c][i].y1 = tmprect.y1; @@ -4359,7 +4359,7 @@ int load_sym_def(const char *name, FILE *embed_fd) RECTORDER(bb[c][i].x1, bb[c][i].y1, bb[c][i].x2, bb[c][i].y2); /* don't load graphs of LCC schematic instances */ if(strstr(get_tok_value(bb[c][i].prop_ptr, "flags", 0), "graph")) { - my_free(_ALLOC_ID_, &bb[c][i].prop_ptr); + my_free(1211, &bb[c][i].prop_ptr); continue; } dbg(2, "l_s_d(): loaded rect: ptr=%lx\n", (unsigned long)bb[c]); @@ -4415,12 +4415,12 @@ int load_sym_def(const char *name, FILE *embed_fd) if(xctx->tok_size) is_floater = 1; /* get rid of floater texts in LCC symbols */ } if( !strboolcmp(get_tok_value(tmptext.prop_ptr, "symbol_ignore", 0), "true") || is_floater) { - my_free(_ALLOC_ID_, &tmptext.prop_ptr); - my_free(_ALLOC_ID_, &tmptext.txt_ptr); + my_free(1212, &tmptext.prop_ptr); + my_free(1213, &tmptext.txt_ptr); continue; } i=lastt; - my_realloc(_ALLOC_ID_, &tt,(i+1)*sizeof(xText)); + my_realloc(1214, &tt,(i+1)*sizeof(xText)); tt[i].font=NULL; tt[i].txt_ptr = tmptext.txt_ptr; tt[i].x0 = tmptext.x0; @@ -4437,7 +4437,7 @@ int load_sym_def(const char *name, FILE *embed_fd) const char* tmp = translate2(lcc, level, tt[i].txt_ptr); dbg(1, "l_s_d(): txt2: tt[i].txt_ptr=%s, i=%d\n", tt[i].txt_ptr, i); rot = lcc[level].rot; flip = lcc[level].flip; - my_strdup2(_ALLOC_ID_, &tt[i].txt_ptr, tmp); + my_strdup2(1215, &tt[i].txt_ptr, tmp); dbg(1, "l_s_d(): txt3: tt[i].txt_ptr=%s, i=%d\n", tt[i].txt_ptr, i); /* allow annotation inside LCC instances. */ if(!strcmp(tt[i].txt_ptr, "@spice_get_voltage")) { @@ -4449,16 +4449,16 @@ int load_sym_def(const char *name, FILE *embed_fd) int i; for(i = 1; i ) */ - my_realloc(_ALLOC_ID_, &tt[i].txt_ptr, new_size); + my_realloc(1218, &tt[i].txt_ptr, new_size); my_snprintf(tt[i].txt_ptr, new_size, "@spice_get_voltage(%s%s)", path ? path : "", lab); - my_free(_ALLOC_ID_, &path); + my_free(1219, &path); dbg(1, " --> tt[i].txt_ptr=%s\n", tt[i].txt_ptr); } if(!strcmp(tt[i].txt_ptr, "@spice_get_current")) { @@ -4470,16 +4470,16 @@ int load_sym_def(const char *name, FILE *embed_fd) int i; for(i = 1; i ) */ - my_realloc(_ALLOC_ID_, &tt[i].txt_ptr, new_size); + my_realloc(1222, &tt[i].txt_ptr, new_size); my_snprintf(tt[i].txt_ptr, new_size, "@spice_get_current(%s%s)", path ? path : "", dev); - my_free(_ALLOC_ID_, &path); + my_free(1223, &path); dbg(1, " --> tt[i].txt_ptr=%s\n", tt[i].txt_ptr); } ROTATION(rot, flip, 0.0, 0.0, tt[i].x0, tt[i].y0, rx1, ry1); @@ -4491,7 +4491,7 @@ int load_sym_def(const char *name, FILE *embed_fd) if(level > 0 && symtype && !strcmp(symtype, "label")) { char lay[30]; my_snprintf(lay, S(lay), " layer=%d", WIRELAYER); - my_strcat(_ALLOC_ID_, &tt[i].prop_ptr, lay); + my_strcat(1224, &tt[i].prop_ptr, lay); } dbg(1, "l_s_d(): loaded text : t=%s p=%s\n", tt[i].txt_ptr, tt[i].prop_ptr ? tt[i].prop_ptr : "NULL"); set_text_flags(&tt[i]); @@ -4509,12 +4509,12 @@ int load_sym_def(const char *name, FILE *embed_fd) load_ascii_string(&tmpline.prop_ptr, lcc[level].fd); if( !strboolcmp(get_tok_value(tmpline.prop_ptr, "symbol_ignore", 0), "true")) { - my_free(_ALLOC_ID_, &tmpline.prop_ptr); + my_free(1225, &tmpline.prop_ptr); continue; } i = lastl[WIRELAYER]; - my_realloc(_ALLOC_ID_, &ll[WIRELAYER],(i+1)*sizeof(xLine)); + my_realloc(1226, &ll[WIRELAYER],(i+1)*sizeof(xLine)); ll[WIRELAYER][i].x1 = tmpline.x1; ll[WIRELAYER][i].y1 = tmpline.y1; ll[WIRELAYER][i].x2 = tmpline.x2; @@ -4625,7 +4625,7 @@ int load_sym_def(const char *name, FILE *embed_fd) } if(fd_tmp) { if (level+1 >= max_level) { - my_realloc(_ALLOC_ID_, &lcc, (max_level + 1) * sizeof(Lcc)); + my_realloc(1227, &lcc, (max_level + 1) * sizeof(Lcc)); max_level++; } ++level; @@ -4652,8 +4652,8 @@ int load_sym_def(const char *name, FILE *embed_fd) lcc[level].x0 += lcc[(level-1)].x0; lcc[level].y0 += lcc[(level-1)].y0; } - my_strdup(_ALLOC_ID_, &lcc[level].prop_ptr, prop_ptr); - my_strdup(_ALLOC_ID_, &lcc[level].symname, symname); + my_strdup(1228, &lcc[level].prop_ptr, prop_ptr); + my_strdup(1229, &lcc[level].symname, symname); dbg(1, "level incremented: level=%d, symname=%s, prop_ptr=%s sympath=%s\n", level, symname, prop_ptr, sympath); } @@ -4667,8 +4667,8 @@ int load_sym_def(const char *name, FILE *embed_fd) break; case ']': if(level) { - my_free(_ALLOC_ID_, &lcc[level].prop_ptr); - my_free(_ALLOC_ID_, &lcc[level].symname); + my_free(1230, &lcc[level].prop_ptr); + my_free(1231, &lcc[level].symname); --level; } else { endfile=1; @@ -4714,19 +4714,19 @@ int load_sym_def(const char *name, FILE *embed_fd) /* given a .sch file used as instance in LCC schematics, order its pin * as in corresponding .sym file if it exists */ align_sch_pins_with_sym(name, symbols); - my_free(_ALLOC_ID_, &prop_ptr); - my_free(_ALLOC_ID_, &lastl); - my_free(_ALLOC_ID_, &lastr); - my_free(_ALLOC_ID_, &lastp); - my_free(_ALLOC_ID_, &lasta); - my_free(_ALLOC_ID_, &ll); - my_free(_ALLOC_ID_, &bb); - my_free(_ALLOC_ID_, &aa); - my_free(_ALLOC_ID_, &pp); - my_free(_ALLOC_ID_, &lcc); - my_free(_ALLOC_ID_, &aux_ptr); - my_free(_ALLOC_ID_, &symname); - my_free(_ALLOC_ID_, &symtype); + my_free(1232, &prop_ptr); + my_free(1233, &lastl); + my_free(1234, &lastr); + my_free(1235, &lastp); + my_free(1236, &lasta); + my_free(1237, &ll); + my_free(1238, &bb); + my_free(1239, &aa); + my_free(1240, &pp); + my_free(1241, &lcc); + my_free(1242, &aux_ptr); + my_free(1243, &symname); + my_free(1244, &symtype); recursion_counter--; sort_symbol_pins(xctx->sym[xctx->symbols].rect[PINLAYER], xctx->sym[xctx->symbols].rects[PINLAYER], @@ -4791,20 +4791,20 @@ void create_sch_from_sym(void) char *sch = NULL; size_t ln; - my_strdup(_ALLOC_ID_, &pinname[0], tcleval("rel_sym_path [find_file_first ipin.sym]")); - my_strdup(_ALLOC_ID_, &pinname[1], tcleval("rel_sym_path [find_file_first opin.sym]")); - my_strdup(_ALLOC_ID_, &pinname[2], tcleval("rel_sym_path [find_file_first iopin.sym]")); - my_strdup(_ALLOC_ID_, &generic_pin, tcleval("rel_sym_path [find_file_first generic_pin.sym]")); + my_strdup(1245, &pinname[0], tcleval("rel_sym_path [find_file_first ipin.sym]")); + my_strdup(1246, &pinname[1], tcleval("rel_sym_path [find_file_first opin.sym]")); + my_strdup(1247, &pinname[2], tcleval("rel_sym_path [find_file_first iopin.sym]")); + my_strdup(1248, &generic_pin, tcleval("rel_sym_path [find_file_first generic_pin.sym]")); if(pinname[0] && pinname[1] && pinname[2] && generic_pin) { rebuild_selected_array(); if(xctx->lastsel > 1) return; if(xctx->lastsel==1 && xctx->sel_array[0].type==ELEMENT) { - my_strdup2(_ALLOC_ID_, &sch, + my_strdup2(1249, &sch, get_tok_value((xctx->inst[xctx->sel_array[0].n].ptr+ xctx->sym)->prop_ptr, "schematic",0 )); my_strncpy(schname, abs_sym_path(sch, ""), S(schname)); - my_free(_ALLOC_ID_, &sch); + my_free(1250, &sch); if(!schname[0]) { my_strncpy(schname, add_ext(abs_sym_path(tcl_hook2(xctx->inst[xctx->sel_array[0].n].name), ""), ".sch"), S(schname)); @@ -4836,13 +4836,13 @@ void create_sch_from_sym(void) rct = ptr->rect[GENERICLAYER]; ypos=0; for(i=0;ilastsel...) */ - my_free(_ALLOC_ID_, &dir); - my_free(_ALLOC_ID_, &prop); - my_free(_ALLOC_ID_, &sub2_prop); - my_free(_ALLOC_ID_, &str); + my_free(1257, &dir); + my_free(1258, &prop); + my_free(1259, &sub2_prop); + my_free(1260, &str); } else { fprintf(errfp, "create_sch_from_sym(): location of schematic pins not found\n"); tcleval("alert_ {create_sch_from_sym(): location of schematic pins not found} {}"); } - my_free(_ALLOC_ID_, &pinname[0]); - my_free(_ALLOC_ID_, &pinname[1]); - my_free(_ALLOC_ID_, &pinname[2]); - my_free(_ALLOC_ID_, &generic_pin); + my_free(1261, &pinname[0]); + my_free(1262, &pinname[1]); + my_free(1263, &pinname[2]); + my_free(1264, &generic_pin); } void descend_symbol(void) @@ -4922,20 +4922,20 @@ void descend_symbol(void) else return; /* build up current hierarchy path */ - my_strdup(_ALLOC_ID_, &str, xctx->inst[n].instname); - 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], str); - my_strcat(_ALLOC_ID_, &xctx->sch_path[xctx->currsch+1], "."); + my_strdup(1265, &str, xctx->inst[n].instname); + my_strdup(1266, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]); + my_strcat(1267, &xctx->sch_path[xctx->currsch+1], str); + my_strcat(1268, &xctx->sch_path[xctx->currsch+1], "."); if(xctx->portmap[xctx->currsch + 1].table) str_hash_free(&xctx->portmap[xctx->currsch + 1]); str_hash_init(&xctx->portmap[xctx->currsch + 1], HASHSIZE); xctx->sch_path_hash[xctx->currsch+1] = 0; - my_free(_ALLOC_ID_, &str); + my_free(1269, &str); /* store hierarchy of inst attributes and sym templates for hierarchic parameter substitution */ - my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].prop_ptr, + my_strdup(1270, &xctx->hier_attr[xctx->currsch].prop_ptr, xctx->inst[n].prop_ptr); - my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch].templ, + my_strdup(1271, &xctx->hier_attr[xctx->currsch].templ, get_tok_value((xctx->inst[n].ptr+ xctx->sym)->prop_ptr, "template", 0)); if(!xctx->inst[n].embed) @@ -4979,12 +4979,12 @@ void descend_symbol(void) /* ... we are in a schematic downloaded from web ... */ if(web_url) { /* symbols have already been downloaded while loading parent schematic: set local file path */ - my_mstrcat(_ALLOC_ID_, &sympath, xschem_web_dirname, "/", get_cell_w_ext(tcl_hook2(name), 0), NULL); - my_strdup(_ALLOC_ID_, ¤t_dirname_save, xctx->current_dirname); /* save http url */ + my_mstrcat(1272, &sympath, xschem_web_dirname, "/", get_cell_w_ext(tcl_hook2(name), 0), NULL); + my_strdup(1273, ¤t_dirname_save, xctx->current_dirname); /* save http url */ } if(!sympath || stat(sympath, &buf)) { /* not found */ dbg(1, "descend_symbol: not found: %s\n", sympath); - my_strdup2(_ALLOC_ID_, &sympath, abs_sym_path(tcl_hook2(name), "")); + my_strdup2(1274, &sympath, abs_sym_path(tcl_hook2(name), "")); } dbg(1, "descend_symbol(): name=%s, sympath=%s, dirname=%s\n", name, sympath, xctx->current_dirname); ++xctx->currsch; /* increment level counter */ @@ -4992,9 +4992,9 @@ void descend_symbol(void) if(web_url) { /* restore web url current_dirname that is reset by load_schematic with local path */ my_strncpy(xctx->current_dirname, current_dirname_save, S(xctx->current_dirname)); - my_free(_ALLOC_ID_, ¤t_dirname_save); + my_free(1275, ¤t_dirname_save); } - my_free(_ALLOC_ID_, &sympath); + my_free(1276, &sympath); } zoom_full(1, 0, 1 + 2 * tclgetboolvar("zoom_full_center"), 0.97); } diff --git a/src/scheduler.c b/src/scheduler.c index 0ecf6da0..698537b3 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -29,16 +29,16 @@ void statusmsg(char str[],int n) { if(!str) return; if(str[0]== '\0') { - my_free(_ALLOC_ID_, &xctx->infowindow_text); + my_free(1277, &xctx->infowindow_text); return; } else { if(n == 3) { - my_strdup(_ALLOC_ID_, &xctx->infowindow_text, str); + my_strdup(1278, &xctx->infowindow_text, str); } else if(n == 2) { if(xctx->infowindow_text && xctx->infowindow_text[0]) { - my_strcat(_ALLOC_ID_, &xctx->infowindow_text, "\n"); + my_strcat(1279, &xctx->infowindow_text, "\n"); } - my_strcat(_ALLOC_ID_, &xctx->infowindow_text, str); + my_strcat(1280, &xctx->infowindow_text, str); } } if(!has_x) return; @@ -192,7 +192,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg dir = argv[5]; if(!strcmp(dir, "inout") || !strcmp(dir, "out") ) flip = 1; if(!strcmp(dir, "inout")) linecol = 7; - my_mstrcat(_ALLOC_ID_, &prop, "name=", name, " dir=", dir, NULL); + my_mstrcat(1281, &prop, "name=", name, " dir=", dir, NULL); storeobject(-1, x - 2.5, y - 2.5, x + 2.5, y + 2.5, xRECT, PINLAYER, 0, prop); if(flip) { create_text(draw, x - 25, y - 5, 0, 1, name, NULL, 0.2, 0.2); @@ -213,7 +213,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } xctx->draw_window = save; } - my_free(_ALLOC_ID_, &prop); + my_free(1282, &prop); } else { unselect_all(1); storeobject(-1, x - 2.5, y - 2.5, x + 2.5, y + 2.5, xRECT, PINLAYER, SELECTED, "name=XXX\ndir=inout"); @@ -332,7 +332,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg raw_read(f, &xctx->raw, "op", -1.0, -1.0); if(level >= 0) { xctx->raw->level = level; - my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[level]); + my_strdup2(1283, &xctx->raw->schname, xctx->sch[level]); } update_op(); draw(); @@ -465,15 +465,15 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } if(!stat(sympath, &buf)) { /* file exists */ if(xctx->time_last_modify < buf.st_mtime) { - my_mstrcat(_ALLOC_ID_, &res, "Warning: symbol ", sympath, " is newer than schematic\n", NULL); + my_mstrcat(1284, &res, "Warning: symbol ", sympath, " is newer than schematic\n", NULL); } } else { /* not found */ - my_mstrcat(_ALLOC_ID_, &res, "Warning: symbol ", sympath, " not found\n", NULL); + my_mstrcat(1285, &res, "Warning: symbol ", sympath, " not found\n", NULL); } - my_mstrcat(_ALLOC_ID_, &res, "symbol ", my_itoa(i), " : ", sympath, "\n", NULL); + my_mstrcat(1286, &res, "symbol ", my_itoa(i), " : ", sympath, "\n", NULL); } Tcl_SetResult(interp, res, TCL_VOLATILE); - my_free(_ALLOC_ID_, &res); + my_free(1287, &res); } /* check_unique_names [1|0] @@ -814,7 +814,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } display_hilights(what, &str); Tcl_SetResult(interp, str, TCL_VOLATILE); - my_free(_ALLOC_ID_, &str); + my_free(1288, &str); } /* draw_graph [n] [flags] @@ -978,7 +978,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg ": UNSAVED data: want to exit?\""); } if(force || !xctx->modified || !strcmp(tclresult(), "ok")) { - if(closewindow) tclvareval("exit ", exit_status, NULL); + if(closewindow) { + char s[40]; + my_snprintf(s, S(s), "exit %d", exit_status); + tcleval(s); + } else clear_schematic(0, 0); } } @@ -1005,7 +1009,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg ": UNSAVED data: want to exit?\""); } if(!has_x || force || !xctx->modified || !strcmp(tclresult(), "ok")) { - if(closewindow) tclvareval("exit ", exit_status, NULL); + if(closewindow) { + char s[40]; + my_snprintf(s, S(s), "exit %d", exit_status); + tcleval(s); + } else clear_schematic(0, 0); } } @@ -1033,10 +1041,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 : ""); - result = my_malloc(_ALLOC_ID_, llen + 30); + result = my_malloc(1289, llen + 30); my_snprintf(result, llen + 30, "%s %d", l, tmp); Tcl_SetResult(interp, result, TCL_VOLATILE); - my_free(_ALLOC_ID_, &result); + my_free(1290, &result); } } else { cmd_found = 0;} @@ -1770,7 +1778,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(1291,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]) { @@ -1789,7 +1797,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(1292, &subtok); } } /* xschem getprop symbol lm358.sym [type] */ @@ -1877,9 +1885,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(1293, &s, get_tok_value(argv[2], argv[3], t)); Tcl_SetResult(interp, s, TCL_VOLATILE); - my_free(_ALLOC_ID_, &s); + my_free(1294, &s); } /* get_tok_size @@ -2330,11 +2338,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg char *instname = xctx->inst[i].instname ? xctx->inst[i].instname : ""; char *type = (xctx->inst[i].ptr + xctx->sym)->type; type = type ? type : ""; - if(i > 0) my_mstrcat(_ALLOC_ID_, &s, "\n", NULL); - my_mstrcat(_ALLOC_ID_, &s, "{", instname, "} {", name, "} {", type, "}", NULL); + if(i > 0) my_mstrcat(1295, &s, "\n", NULL); + my_mstrcat(1296, &s, "{", instname, "} {", name, "} {", type, "}", NULL); } Tcl_SetResult(interp, (char *)s, TCL_VOLATILE); - my_free(_ALLOC_ID_, &s); + my_free(1297, &s); } /* instance_net inst pin * Return the name of the net attached to pin 'pin' of instance 'inst' @@ -2463,7 +2471,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(1298, sizeof(xctx->inst[i].instname)); if((ss=strchr(xctx->inst[i].instname, ':')) ) { sscanf(ss+1, "%s", tmpstr); if(isonlydigit(tmpstr)) { @@ -2482,7 +2490,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg get_inst_pin_coord(i, p, &pinx0, &piny0); 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(1299, &tmpstr); } /* instance_pins inst @@ -2504,11 +2512,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg const char *pin; pin = get_tok_value((xctx->inst[i].ptr+ xctx->sym)->rect[PINLAYER][p].prop_ptr, "name",0); if(!pin[0]) pin = "--ERROR--"; - my_mstrcat(_ALLOC_ID_, &pins, "{", pin, "}", NULL); - if(p< no_of_pins-1) my_strcat(_ALLOC_ID_, &pins, " "); + my_mstrcat(1300, &pins, "{", pin, "}", NULL); + if(p< no_of_pins-1) my_strcat(1301, &pins, " "); } Tcl_SetResult(interp, pins, TCL_VOLATILE); - my_free(_ALLOC_ID_, &pins); + my_free(1302, &pins); } } @@ -2555,16 +2563,16 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(!pin[0]) pin = "--ERROR--"; if(xctx->inst[i].node[p] && !strcmp(xctx->inst[i].node[p], argv[2]) && !IS_LABEL_SH_OR_PIN( (xctx->inst[i].ptr+xctx->sym)->type )) { - my_mstrcat(_ALLOC_ID_, &pins, "{ {", xctx->inst[i].instname, "} {", pin, NULL); + my_mstrcat(1303, &pins, "{ {", xctx->inst[i].instname, "} {", pin, NULL); get_inst_pin_coord(i, p, &pinx0, &piny0); my_strncpy(xx, dtoa(pinx0), S(xx)); my_strncpy(yy, dtoa(piny0), S(yy)); - my_mstrcat(_ALLOC_ID_, &pins, "} {", xx, "} {", yy, "} } ", NULL); + my_mstrcat(1304, &pins, "} {", xx, "} {", yy, "} } ", NULL); } } } Tcl_SetResult(interp, pins ? pins : "", TCL_VOLATILE); - my_free(_ALLOC_ID_, &pins); + my_free(1305, &pins); } /* is_symgen symbol @@ -2645,7 +2653,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(1306, &res); } /* list_hilights [sep | all | all_nets | all_inst] @@ -2677,7 +2685,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} list_nets(&result); Tcl_SetResult(interp, result, TCL_VOLATILE); - my_free(_ALLOC_ID_, &result); + my_free(1307, &result); } /* list_tokens str with_quotes @@ -2751,7 +2759,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, !force); tclvareval("update_recent_file {", f, "}", NULL); - my_strdup(_ALLOC_ID_, &xctx->sch_path[xctx->currsch], "."); + my_strdup(1308, &xctx->sch_path[xctx->currsch], "."); if(xctx->portmap[xctx->currsch].table) str_hash_free(&xctx->portmap[xctx->currsch]); str_hash_init(&xctx->portmap[xctx->currsch], HASHSIZE); xctx->sch_path_hash[xctx->currsch] = 0; @@ -3044,14 +3052,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(argc > 5) { char *strcopy = NULL, *strptr = NULL, *saveptr = NULL, *tok; - my_strdup(_ALLOC_ID_, &strcopy, argv[2]); + my_strdup(1309, &strcopy, argv[2]); strptr = strcopy; while( (tok = my_strtok_r(strptr, argv[3], argv[4], atoi(argv[5]), &saveptr)) ) { strptr = NULL; Tcl_AppendResult(interp, "{", tok, "}\n", NULL); } - my_free(_ALLOC_ID_, &strptr); + my_free(1310, &strptr); } } @@ -3099,7 +3107,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg int done_netlist = 0; if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} yyparse_error = 0; - my_strdup(_ALLOC_ID_, &saveshow, tclgetvar("show_infowindow_after_netlist")); + my_strdup(1311, &saveshow, tclgetvar("show_infowindow_after_netlist")); if(argc <= 2 || (argc > 2 && strcmp(argv[2], "-erc"))) { /* xschem netlist NOT invoked from GUI */ tclsetvar("show_infowindow_after_netlist", "never"); } @@ -3160,7 +3168,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg Tcl_SetResult(interp, my_itoa(err), TCL_VOLATILE); } } - my_free(_ALLOC_ID_, &saveshow); + my_free(1312, &saveshow); } /* new_process [f] @@ -4189,9 +4197,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg xctx->prep_net_structs=0; xctx->prep_hi_structs=0; } - my_strdup(_ALLOC_ID_, &sym, tcl_hook2(symbol)); + my_strdup(1313, &sym, tcl_hook2(symbol)); sym_number=match_symbol(sym); - my_free(_ALLOC_ID_, &sym); + my_free(1314, &sym); if(sym_number>=0) { prefix=(get_tok_value( (xctx->sym+sym_number)->templ , "name",0))[0]; /* get new symbol prefix */ @@ -4200,23 +4208,23 @@ 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(1315, &xctx->inst[inst].name, rel_sym_path(symbol)); xctx->inst[inst].ptr=sym_number; - my_strdup(_ALLOC_ID_, &name, xctx->inst[inst].instname); + my_strdup(1316, &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(1317, &ptr,subst_token(xctx->inst[inst].prop_ptr, "name", name) ); if(!fast) hash_names(-1, XINSERT); hash_names(inst, XDELETE); new_prop_string(inst, ptr, /* sets also inst[].instname */ tclgetboolvar("disable_unique_names")); /* set new prop_ptr */ hash_names(inst, XINSERT); set_inst_flags(&xctx->inst[inst]); - my_free(_ALLOC_ID_, &ptr); + my_free(1318, &ptr); } - my_free(_ALLOC_ID_, &name); + my_free(1319, &name); set_modify(1); /* draw(); */ Tcl_SetResult(interp, xctx->inst[inst].instname , TCL_VOLATILE); @@ -4260,21 +4268,21 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg hash_names(inst, XDELETE); set_inst_prop(inst); - my_strdup2(_ALLOC_ID_, &translated_sym, translate(inst, xctx->inst[inst].name)); + my_strdup2(1320, &translated_sym, translate(inst, xctx->inst[inst].name)); sym_number=match_symbol(translated_sym); if(sym_number > 0) { delete_inst_node(inst); xctx->inst[inst].ptr=sym_number; } - if(subst) my_free(_ALLOC_ID_, &subst); + if(subst) my_free(1321, &subst); set_inst_flags(&xctx->inst[inst]); hash_names(inst, XINSERT); /* 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); set_modify(-2); /* reset floaters caches */ draw(); - my_free(_ALLOC_ID_, &translated_sym); + my_free(1322, &translated_sym); Tcl_SetResult(interp, xctx->inst[inst].instname , TCL_VOLATILE); } @@ -4294,7 +4302,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg Tcl_SetResult(interp, "xschem reset_symbol: instance not found", TCL_STATIC); return TCL_ERROR; } else { - my_strdup(_ALLOC_ID_, &xctx->inst[inst].name, argv[3]); + my_strdup(1323, &xctx->inst[inst].name, argv[3]); } Tcl_ResetResult(interp); } @@ -4341,7 +4349,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } rn = resolved_net(net); Tcl_AppendResult(interp, rn, NULL); - my_free(_ALLOC_ID_, &rn); + my_free(1324, &rn); } /* rotate [x0 y0] @@ -4765,7 +4773,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(1325, &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; @@ -4773,7 +4781,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(1326, &viewer_name); } Tcl_ResetResult(interp); } @@ -4836,13 +4844,13 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } else if(!strcmp(argv[2], "format")) { /* set name of custom format attribute used for netlisting */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} - my_strdup(_ALLOC_ID_, &xctx->format, argv[3]); + my_strdup(1327, &xctx->format, argv[3]); } else if(!strcmp(argv[2], "header_text")) { /* set header metadata (used for license info) */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} 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(1328, &xctx->header_text, argv[3]); } } else if(!strcmp(argv[2], "hide_symbols")) { /* set to 0,1,2 for various hiding level of symbols */ @@ -4858,7 +4866,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg else if(!strcmp(argv[2], "infowindow_text")) { /* ERC messages */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} - my_strdup(_ALLOC_ID_, &xctx->infowindow_text, argv[3]); + my_strdup(1329, &xctx->infowindow_text, argv[3]); } else if(!strcmp(argv[2], "intuitive_interface")) { /* ERC messages */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} @@ -4908,7 +4916,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} if(n >= 0 && n <= xctx->currsch) { xctx->raw->level = atoi(argv[3]); - my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[xctx->raw->level]); + my_strdup2(1330, &xctx->raw->schname, xctx->sch[xctx->raw->level]); Tcl_SetResult(interp, my_itoa(n), TCL_VOLATILE); } else { Tcl_SetResult(interp, "-1", TCL_VOLATILE); @@ -4930,23 +4938,23 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } else if(!strcmp(argv[2], "schsymbolprop")) { /* set global symbol attribute string */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} - my_strdup(_ALLOC_ID_, &xctx->schsymbolprop, argv[3]); + my_strdup(1331, &xctx->schsymbolprop, argv[3]); } else if(!strcmp(argv[2], "schprop")) { /* set schematic global spice attribute string */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} - my_strdup(_ALLOC_ID_, &xctx->schprop, argv[3]); + my_strdup(1332, &xctx->schprop, argv[3]); } else if(!strcmp(argv[2], "schverilogprop")) { /* set schematic global verilog attribute string */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} - my_strdup(_ALLOC_ID_, &xctx->schverilogprop, argv[3]); + my_strdup(1333, &xctx->schverilogprop, argv[3]); } else if(!strcmp(argv[2], "schvhdlprop")) { /* set schematic global vhdl attribute string */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} - my_strdup(_ALLOC_ID_, &xctx->schvhdlprop, argv[3]); + my_strdup(1334, &xctx->schvhdlprop, argv[3]); } else if(!strcmp(argv[2], "schtedaxprop")) { /* set schematic global tedax attribute string */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} - my_strdup(_ALLOC_ID_, &xctx->schtedaxprop, argv[3]); + my_strdup(1335, &xctx->schtedaxprop, argv[3]); } else if(!strcmp(argv[2], "text_svg")) { /* set to 1 to use svg elements */ text_svg=atoi(argv[3]); @@ -4980,10 +4988,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg char *s = NULL; if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} if(argc < 5) {Tcl_SetResult(interp, "Missing arguments", TCL_STATIC);return TCL_ERROR;} - my_strdup(_ALLOC_ID_, &s, argv[2]); + my_strdup(1336, &s, argv[2]); set_different_token(&s, argv[3], argv[4]); Tcl_SetResult(interp, s, TCL_VOLATILE); - my_free(_ALLOC_ID_, &s); + my_free(1337, &s); } /* set_modify @@ -5068,28 +5076,28 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(argc > 5) { if(!strcmp(argv[4], "allprops")) { hash_names(-1, XINSERT); - my_strdup2(_ALLOC_ID_, &subst, argv[5]); + my_strdup2(1338, &subst, argv[5]); } else { - my_strdup2(_ALLOC_ID_, &subst, subst_token(xctx->inst[inst].prop_ptr, argv[4], argv[5])); + my_strdup2(1339, &subst, subst_token(xctx->inst[inst].prop_ptr, argv[4], argv[5])); } } else if(argc > 4) {/* assume argc == 5 , delete attribute */ - my_strdup2(_ALLOC_ID_, &subst, subst_token(xctx->inst[inst].prop_ptr, argv[4], NULL)); + my_strdup2(1340, &subst, subst_token(xctx->inst[inst].prop_ptr, argv[4], NULL)); } else if(argc > 3) { /* clear all instance prop_str */ - my_free(_ALLOC_ID_, &subst); + my_free(1341, &subst); } hash_names(inst, XDELETE); new_prop_string(inst, subst, tclgetboolvar("disable_unique_names")); - my_strdup2(_ALLOC_ID_, &translated_sym, translate(inst, xctx->inst[inst].name)); + my_strdup2(1342, &translated_sym, translate(inst, xctx->inst[inst].name)); sym_number=match_symbol(translated_sym); if(sym_number > 0) { delete_inst_node(inst); xctx->inst[inst].ptr=sym_number; } - if(subst) my_free(_ALLOC_ID_, &subst); + if(subst) my_free(1343, &subst); set_inst_flags(&xctx->inst[inst]); hash_names(inst, XINSERT); if(!fast) { @@ -5098,7 +5106,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg set_modify(-2); /* reset floaters caches */ draw(); } - my_free(_ALLOC_ID_, &translated_sym); + my_free(1344, &translated_sym); Tcl_SetResult(interp, xctx->inst[inst].instname , TCL_VOLATILE); } } else if(argc > 2 && !strcmp(argv[2], "symbol")) { @@ -5118,9 +5126,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } sym = &xctx->sym[i]; if(argc > 5) - my_strdup2(_ALLOC_ID_, &sym->prop_ptr, subst_token(sym->prop_ptr, argv[4], argv[5])); + my_strdup2(1345, &sym->prop_ptr, subst_token(sym->prop_ptr, argv[4], argv[5])); else - my_strdup2(_ALLOC_ID_, &sym->prop_ptr, subst_token(sym->prop_ptr, argv[4], NULL)); /* delete attr */ + my_strdup2(1346, &sym->prop_ptr, subst_token(sym->prop_ptr, argv[4], NULL)); /* delete attr */ } else if(argc > 5 && !strcmp(argv[2], "rect")) { /* 0 1 2 3 4 5 6 7 @@ -5180,14 +5188,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(1347, &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(1348, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], NULL)); /* delete attr */ } } if(change_done) set_modify(1); @@ -5245,7 +5253,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg t->yscale, t->rot, t->flip, t->hcenter, t->vcenter, t->x0, t->y0, &xx1,&yy1,&xx2,&yy2, &tmp, &dtmp); - my_free(_ALLOC_ID_, &estr); + my_free(1349, &estr); bbox(ADD, xx1, yy1, xx2, yy2); } /* verify if there is some difference */ @@ -5253,19 +5261,19 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(strcmp(argv[5], t->txt_ptr)) { change_done = 1; if(fast == 3 || fast == 0) xctx->push_undo(); - my_strdup2(_ALLOC_ID_, &t->txt_ptr, argv[5]); + my_strdup2(1350, &t->txt_ptr, argv[5]); } } else 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(1351, &t->prop_ptr, subst_token(t->prop_ptr, argv[4], argv[5])); } } else if(argc > 4) { 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(1352, &t->prop_ptr, subst_token(t->prop_ptr, argv[4], NULL)); /* delete attr */ } } if(change_done) { @@ -5277,7 +5285,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg t->yscale, t->rot, t->flip, t->hcenter, t->vcenter, t->x0, t->y0, &xx1,&yy1,&xx2,&yy2, &tmp, &dtmp); - my_free(_ALLOC_ID_, &estr); + my_free(1353, &estr); if(!fast) bbox(ADD, xx1, yy1, xx2, yy2); } if(!fast) { @@ -5338,9 +5346,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg char *s=NULL; if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} 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(1354, &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(1355, &s); } /* symbol_in_new_window [new_process] @@ -5558,7 +5566,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg dbg(0, "%s\n----\n", s); Tcl_SetResult(interp, t, TCL_VOLATILE); - my_free(_ALLOC_ID_, &t); + my_free(1356, &t); } } @@ -5655,10 +5663,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg Tcl_SetResult(interp, "xschem translate: instance not found", TCL_STATIC); return TCL_ERROR; } - my_strdup2(_ALLOC_ID_, &s, translate(i, argv[3])); + my_strdup2(1357, &s, translate(i, argv[3])); Tcl_ResetResult(interp); Tcl_SetResult(interp, s, TCL_VOLATILE); - my_free(_ALLOC_ID_, &s); + my_free(1358, &s); } } @@ -5674,16 +5682,16 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg int eat_escapes = 0; if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} if(argc > 3) eat_escapes = atoi(argv[3]); - if(argc > 6) my_strdup2(_ALLOC_ID_, &s, translate3(argv[2], eat_escapes, argv[4], argv[5], argv[6])); - else if(argc > 5) my_strdup2(_ALLOC_ID_, &s, translate3(argv[2], eat_escapes, argv[4], argv[5], NULL)); - else if(argc > 4) my_strdup2(_ALLOC_ID_, &s, translate3(argv[2], eat_escapes, argv[4], NULL, NULL)); + if(argc > 6) my_strdup2(1359, &s, translate3(argv[2], eat_escapes, argv[4], argv[5], argv[6])); + else if(argc > 5) my_strdup2(1360, &s, translate3(argv[2], eat_escapes, argv[4], argv[5], NULL)); + else if(argc > 4) my_strdup2(1361, &s, translate3(argv[2], eat_escapes, argv[4], NULL, NULL)); else { Tcl_SetResult(interp, "xschem translate3: missing arguments", TCL_STATIC); return TCL_ERROR; } Tcl_ResetResult(interp); Tcl_SetResult(interp, s, TCL_VOLATILE); - my_free(_ALLOC_ID_, &s); + my_free(1362, &s); } /* trim_chars str sep @@ -5798,7 +5806,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} for(i = 0; i < xctx->texts; i++) if(xctx->text[i].flags & TEXT_FLOATER) { - my_free(_ALLOC_ID_, &xctx->text[i].floater_ptr); /* clear floater cached value */ + my_free(1363, &xctx->text[i].floater_ptr); /* clear floater cached value */ } for(i = 0; i < xctx->instances; ++i) { symbol_bbox(i, &xctx->inst[i].x1, &xctx->inst[i].y1, &xctx->inst[i].x2, &xctx->inst[i].y2); @@ -5861,10 +5869,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg int n = atoi(argv[2]); if(n > 0 && n < xctx->wires) { xWire * const wire = xctx->wire; - my_mstrcat(_ALLOC_ID_, &r, dtoa(wire[n].x1), " ", NULL); - my_mstrcat(_ALLOC_ID_, &r, dtoa(wire[n].y1), " ", NULL); - my_mstrcat(_ALLOC_ID_, &r, dtoa(wire[n].x2), " ", NULL); - my_mstrcat(_ALLOC_ID_, &r, dtoa(wire[n].y2), NULL); + my_mstrcat(1364, &r, dtoa(wire[n].x1), " ", NULL); + my_mstrcat(1365, &r, dtoa(wire[n].y1), " ", NULL); + my_mstrcat(1366, &r, dtoa(wire[n].x2), " ", NULL); + my_mstrcat(1367, &r, dtoa(wire[n].y2), NULL); Tcl_SetResult(interp, r, TCL_VOLATILE); } } @@ -6152,9 +6160,9 @@ int tclvareval(const char *script, ...) va_list args; va_start(args, script); - size = my_strcat(_ALLOC_ID_, &str, script); + size = my_strcat(1368, &str, script); while( (p = va_arg(args, const char *)) ) { - size = my_strcat(_ALLOC_ID_, &str, p); + size = my_strcat(1369, &str, p); dbg(2, "tclvareval(): p=%s, str=%s, size=%d\n", p, str, size); } dbg(2, "tclvareval(): script=%s, str=%s, size=%d\n", script, str ? str : "", size); @@ -6164,6 +6172,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(1370, &str); return return_code; } diff --git a/src/select.c b/src/select.c index 1b8df43d..f6bfdcf7 100644 --- a/src/select.c +++ b/src/select.c @@ -175,7 +175,7 @@ int select_dangling_nets(void) char *type; double x0, y0, x1, y1, x2, y2; - table = my_calloc(_ALLOC_ID_, xctx->wires, sizeof(int)); + table = my_calloc(1371, xctx->wires, sizeof(int)); hash_instances(); hash_wires(); @@ -315,7 +315,7 @@ int select_dangling_nets(void) xctx->need_reb_sel_arr = 1; rebuild_selected_array(); draw_selection(xctx->gc[SELLAYER], 0); - my_free(_ALLOC_ID_, &table); + my_free(1372, &table); return ret; } @@ -374,7 +374,7 @@ void symbol_bbox(int i, double *x1,double *y1, double *x2, double *y2) x0+text_x0,y0+text_y0, &xx1,&yy1,&xx2,&yy2, &tmp, &dtmp); dbg(1, "symbol bbox: text bbox: %s, %g %g %g %g\n", tmp_txt, xx1, yy1, xx2, yy2); dbg(1, "symbol bbox: text bbox: zoom=%g, lw=%g\n", xctx->zoom, xctx->lw); - my_free(_ALLOC_ID_, &estr); + my_free(1373, &estr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); @@ -404,7 +404,7 @@ static void del_rect_line_arc_poly() { if(c == GRIDLAYER) xctx->graph_lastsel = -1; /* invalidate last selected graph */ ++j; - my_free(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr); + my_free(1374, &xctx->rect[c][i].prop_ptr); set_rect_extraptr(0, &xctx->rect[c][i]); deleted = 1; continue; @@ -422,7 +422,7 @@ static void del_rect_line_arc_poly() { ++j; deleted = 1; - my_free(_ALLOC_ID_, &xctx->line[c][i].prop_ptr); + my_free(1375, &xctx->line[c][i].prop_ptr); continue; } if(j) @@ -445,7 +445,7 @@ static void del_rect_line_arc_poly() else 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); - my_free(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr); + my_free(1376, &xctx->arc[c][i].prop_ptr); deleted = 1; continue; } @@ -470,10 +470,10 @@ static void del_rect_line_arc_poly() if(k==0 || xctx->poly[c][i].y[k] > y2) y2 = xctx->poly[c][i].y[k]; } ++j; - 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(1377, &xctx->poly[c][i].prop_ptr); + my_free(1378, &xctx->poly[c][i].x); + my_free(1379, &xctx->poly[c][i].y); + my_free(1380, &xctx->poly[c][i].selected_point); /*fprintf(errfp, "bbox: %.16g %.16g %.16g %.16g\n", x1, y1, x2, y2); */ deleted = 1; continue; @@ -499,8 +499,8 @@ int delete_wires(int selected_flag) if(xctx->wire[i].sel == selected_flag) { ++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(1381, &xctx->wire[i].prop_ptr); + my_free(1382, &xctx->wire[i].node); deleted = 1; continue; @@ -546,11 +546,11 @@ void delete(int to_push_undo) cairo_restore(xctx->cairo_ctx); } #endif - my_free(_ALLOC_ID_, &xctx->text[i].prop_ptr); - my_free(_ALLOC_ID_, &xctx->text[i].font); - my_free(_ALLOC_ID_, &xctx->text[i].floater_instname); - my_free(_ALLOC_ID_, &xctx->text[i].floater_ptr); - my_free(_ALLOC_ID_, &xctx->text[i].txt_ptr); + my_free(1383, &xctx->text[i].prop_ptr); + my_free(1384, &xctx->text[i].font); + my_free(1385, &xctx->text[i].floater_instname); + my_free(1386, &xctx->text[i].floater_ptr); + my_free(1387, &xctx->text[i].txt_ptr); deleted = 1; ++j; continue; @@ -572,12 +572,12 @@ void delete(int to_push_undo) deleted = 1; if(xctx->inst[i].prop_ptr != NULL) { - my_free(_ALLOC_ID_, &xctx->inst[i].prop_ptr); + my_free(1388, &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(1389, &xctx->inst[i].name); + my_free(1390, &xctx->inst[i].instname); + my_free(1391, &xctx->inst[i].lab); ++j; continue; } @@ -1346,7 +1346,7 @@ void select_inside(double x1,double y1, double x2, double y2, int sel) /*added u xctx->text[i].hcenter, xctx->text[i].vcenter, xctx->text[i].x0, xctx->text[i].y0, &xx1,&yy1, &xx2,&yy2, &tmpint, &dtmp); - my_free(_ALLOC_ID_, &estr); + my_free(1392, &estr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); @@ -1558,7 +1558,7 @@ void select_touch(double x1,double y1, double x2, double y2, int sel) /*added un xctx->text[i].hcenter, xctx->text[i].vcenter, xctx->text[i].x0, xctx->text[i].y0, &xx1,&yy1, &xx2,&yy2, &tmpint, &dtmp); - my_free(_ALLOC_ID_, &estr); + my_free(1393, &estr); #if HAS_CAIRO==1 if(customfont) { cairo_restore(xctx->cairo_ctx); @@ -1683,7 +1683,7 @@ int floaters_from_selected_inst() set_modify(1); first = 0; } - my_strdup2(_ALLOC_ID_, &xctx->inst[i].prop_ptr, + my_strdup2(1394, &xctx->inst[i].prop_ptr, subst_token(xctx->inst[i].prop_ptr, "hide_texts", "true")); set_inst_flags(&xctx->inst[i]); for(t = 0; t < sym->texts; t++) { diff --git a/src/spice_netlist.c b/src/spice_netlist.c index 1e7863d7..9ddb0466 100644 --- a/src/spice_netlist.c +++ b/src/spice_netlist.c @@ -61,10 +61,10 @@ void hier_psprint(char **res, int what) /* netlister driver */ zoom_full(0, 0, 1 + 2 * tclgetboolvar("zoom_full_center"), 0.97); if(what & 1) ps_draw(2, 1, 0); /* 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(1395, res, hier_psprint_mtime(xctx->sch[xctx->currsch])); + my_strcat(1396, res, " {"); + my_strcat(1397, res, xctx->sch[xctx->currsch]); + my_strcat(1398, res, "}\n"); } dbg(1,"--> %s\n", get_cell(xctx->sch[xctx->currsch], 0) ); unselect_all(1); @@ -72,8 +72,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(1399, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]); + my_strcat(1400, &xctx->sch_path[xctx->currsch+1], "->netlisting"); xctx->sch_path_hash[xctx->currsch+1] = 0; xctx->currsch++; subckt_name=NULL; @@ -83,13 +83,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(tcl_hook2(xctx->sym[i].name), "")); + my_strdup2(1401, &abs_path, abs_sym_path(tcl_hook2(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(flag && (!strcmp(xctx->sym[i].type, "subcircuit") || !strcmp(xctx->sym[i].type, "primitive"))) { /* 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(1402, &subckt_name, get_cell(xctx->sym[i].name, 0)); get_sch_from_sym(filename, xctx->sym + i, -1, 0); if (str_hash_lookup(&subckt_table, filename, "", XLOOKUP)==NULL) { @@ -110,10 +110,10 @@ void hier_psprint(char **res, int what) /* netlister driver */ zoom_full(0, 0, 1 + 2 * tclgetboolvar("zoom_full_center"), 0.97); if(what & 1) ps_draw(2, 1, 0); /* 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(1403, res, hier_psprint_mtime(xctx->sch[xctx->currsch])); + my_strcat(1404, res, " {"); + my_strcat(1405, res, xctx->sch[xctx->currsch]); + my_strcat(1406, res, "}\n"); } dbg(1,"--> %s\n", get_cell(xctx->sch[xctx->currsch], 0) ); } @@ -122,10 +122,10 @@ void hier_psprint(char **res, int what) /* netlister driver */ } /* can not free additional syms since *_block_netlist() may have loaded additional syms */ /* get_additional_symbols(0); */ - my_free(_ALLOC_ID_, &abs_path); + my_free(1407, &abs_path); str_hash_free(&subckt_table); - my_free(_ALLOC_ID_, &subckt_name); - my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]); + my_free(1408, &subckt_name); + my_free(1409, &xctx->sch[xctx->currsch]); xctx->currsch--; unselect_all(1); remove_symbols(); @@ -147,10 +147,10 @@ static char *model_name(const char *m) char *ptr; int n; size_t l = strlen(m) + 1; - my_strdup(_ALLOC_ID_, &m_lower, m); + my_strdup(1410, &m_lower, m); strtolower(m_lower); - my_realloc(_ALLOC_ID_, &modelname, l); - my_realloc(_ALLOC_ID_, &model_name_result, l); + my_realloc(1411, &modelname, l); + my_realloc(1412, &model_name_result, l); if((ptr = strstr(m_lower, ".subckt"))) { n = sscanf(ptr, ".subckt %s %s", model_name_result, modelname); } else if((ptr = strstr(m_lower, ".model"))) { @@ -161,10 +161,10 @@ static char *model_name(const char *m) 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(1413, &model_name_result, modelname); } - my_free(_ALLOC_ID_, &modelname); - my_free(_ALLOC_ID_, &m_lower); + my_free(1414, &modelname); + my_free(1415, &m_lower); return model_name_result; } @@ -224,21 +224,21 @@ static int spice_netlist(FILE *fd, int spice_stop ) fprintf(fd, "**** end_element\n"); } /* hash device_model attribute if any */ - my_strdup2(_ALLOC_ID_, &val, get_tok_value(xctx->inst[i].prop_ptr, "device_model", 2)); + my_strdup2(1416, &val, get_tok_value(xctx->inst[i].prop_ptr, "device_model", 2)); m = val; if(strchr(val, '@')) m = translate(i, val); else m = tcl_hook2(m); if(m[0]) str_hash_lookup(&model_table, model_name(m), m, XINSERT); else { - my_strdup2(_ALLOC_ID_, &val, + my_strdup2(1417, &val, get_tok_value( (xctx->inst[i].ptr+ xctx->sym)->prop_ptr, "device_model", 2)); m = val; if(strchr(val, '@')) m = translate(i, val); else m = tcl_hook2(m); if(m[0]) str_hash_lookup(&model_table, model_name(m), m, XINSERT); } - my_free(_ALLOC_ID_, &model_name_result); - my_free(_ALLOC_ID_, &val); + my_free(1418, &model_name_result); + my_free(1419, &val); } } } @@ -316,10 +316,10 @@ int global_spice_netlist(int global) /* netlister driver */ { if(skip_instance(i, 1, lvs_ignore)) continue; 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(1420, &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(1421, &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"); @@ -344,7 +344,7 @@ int global_spice_netlist(int global) /* netlister driver */ pinnumber_list = sort_schematic_pins(&npins); /* sort pins according to sim_pinnumber attr */ /* print top subckt ipin/opins */ - my_strdup2(_ALLOC_ID_, &top_symbol_name, abs_sym_path(add_ext(xctx->current_name, ".sym"), "")); + my_strdup2(1422, &top_symbol_name, abs_sym_path(add_ext(xctx->current_name, ".sym"), "")); if(!stat(top_symbol_name, &buf)) { /* if top level has a symbol use the symbol for pin ordering */ dbg(1, "found top level symbol %s\n", top_symbol_name); load_sym_def(top_symbol_name, NULL); @@ -360,7 +360,7 @@ int global_spice_netlist(int global) /* netlister driver */ } remove_symbol(xctx->symbols - 1); } - my_free(_ALLOC_ID_, &top_symbol_name); + my_free(1423, &top_symbol_name); if(found_top_symbol != 3) { for(i=0;iinst[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(1425, &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(1426, &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"); @@ -424,7 +424,7 @@ int global_spice_netlist(int global) /* netlister driver */ /* warning if two symbols perfectly overlapped */ err |= 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(1427, xctx->instances, sizeof(unsigned int)); for(i=0;iinstances; ++i) stored_flags[i] = xctx->inst[i].color; if(global) @@ -433,7 +433,7 @@ int global_spice_netlist(int global) /* netlister driver */ int web_url = is_from_web(xctx->current_dirname); char *current_dirname_save = NULL; - my_strdup2(_ALLOC_ID_, ¤t_dirname_save, xctx->current_dirname); + my_strdup2(1428, ¤t_dirname_save, xctx->current_dirname); unselect_all(1); /* ensure all unused symbols purged before descending hierarchy */ if(!tclgetboolvar("keep_symbols")) remove_symbols(); @@ -441,8 +441,8 @@ int 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(1429, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]); + my_strcat(1430, &xctx->sch_path[xctx->currsch+1], "->netlisting"); xctx->sch_path_hash[xctx->currsch+1] = 0; xctx->currsch++; subckt_name=NULL; @@ -457,11 +457,11 @@ int global_spice_netlist(int global) /* netlister driver */ * to resolve subschematic instances with model=@modp in format string, * modp will be first looked up in instance prop_ptr string, and if not found * in parent symbol template string */ - my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch - 1].templ, + my_strdup(1431, &xctx->hier_attr[xctx->currsch - 1].templ, tcl_hook2(xctx->sym[i].templ)); - my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch - 1].prop_ptr, + my_strdup(1432, &xctx->hier_attr[xctx->currsch - 1].prop_ptr, tcl_hook2(xctx->sym[i].parent_prop_ptr)); - my_strdup(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, "")); + my_strdup(1433, &abs_path, abs_sym_path(xctx->sym[i].name, "")); if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path)) { if(!web_url) { @@ -469,7 +469,7 @@ int global_spice_netlist(int global) /* netlister driver */ my_strncpy(xctx->current_dirname, tclresult(), S(xctx->current_dirname)); } /* 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(1434, &subckt_name, get_cell(xctx->sym[i].name, 0)); dbg(1, "global_spice_netlist(): subckt_name=%s\n", subckt_name); if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL) { @@ -488,14 +488,14 @@ int global_spice_netlist(int global) /* netlister driver */ } } if(xctx->hier_attr[xctx->currsch - 1].templ) - my_free(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch - 1].templ); + my_free(1435, &xctx->hier_attr[xctx->currsch - 1].templ); if(xctx->hier_attr[xctx->currsch - 1].prop_ptr) - my_free(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch - 1].prop_ptr); - my_free(_ALLOC_ID_, &abs_path); + my_free(1436, &xctx->hier_attr[xctx->currsch - 1].prop_ptr); + my_free(1437, &abs_path); /* get_additional_symbols(0); */ - my_free(_ALLOC_ID_, &subckt_name); + my_free(1438, &subckt_name); /*clear_drawing(); */ - my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]); + my_free(1439, &xctx->sch[xctx->currsch]); xctx->currsch--; unselect_all(1); dbg(1, "global_spice_netlist(): invoking pop_undo(0, 0)\n"); @@ -514,13 +514,13 @@ int global_spice_netlist(int global) /* netlister driver */ dbg(1, "spice_netlist(): invoke prepare_netlist_structs for %s\n", xctx->current_name); err |= prepare_netlist_structs(1); /* so 'lab=...' attributes for unnamed nets are set */ if(!xctx->hilight_nets) xctx->hilight_nets = saved_hilight_nets; - my_free(_ALLOC_ID_, ¤t_dirname_save); + my_free(1440, ¤t_dirname_save); } /* restore hilight flags from errors found analyzing top level before descending hierarchy */ for(i=0;iinstances; ++i) if(!xctx->inst[i].color) 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(1441, &stored_flags); /* print globals nodes found in netlist 28032003 */ if(!split_f) { @@ -535,14 +535,14 @@ int global_spice_netlist(int global) /* netlister driver */ { if(skip_instance(i, 1, lvs_ignore)) continue; 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(1442, &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(1443, &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; @@ -586,7 +586,7 @@ int global_spice_netlist(int global) /* netlister driver */ } if(!debug_var) xunlink(netl_filename); } - my_free(_ALLOC_ID_, &place); + my_free(1444, &place); xctx->netlist_count = 0; tclvareval("show_infotext ", my_itoa(err), NULL); /* critical error: force ERC window showing */ exit_code = err ? 10 : 0; @@ -623,7 +623,7 @@ int spice_block_netlist(FILE *fd, int i) if(!strcmp(default_schematic, "ignore")) { return err; } - my_strdup(_ALLOC_ID_, &name, tcl_hook2(xctx->sym[i].name)); + my_strdup(1445, &name, tcl_hook2(xctx->sym[i].name)); dbg(1, "spice_block_netlist(): filename=%s\n", filename); if(split_f) { @@ -636,27 +636,27 @@ int spice_block_netlist(FILE *fd, int i) fprintf(fd, "\n* expanding symbol: %s # of pins=%d\n", name,xctx->sym[i].rects[PINLAYER] ); if(xctx->sym[i].base_name) fprintf(fd, "** sym_path: %s\n", abs_sym_path(xctx->sym[i].base_name, "")); else fprintf(fd, "** sym_path: %s\n", sanitized_abs_sym_path(name, "")); - my_strdup(_ALLOC_ID_, &sym_def, get_tok_value(xctx->sym[i].prop_ptr,"spice_sym_def",0)); + my_strdup(1446, &sym_def, get_tok_value(xctx->sym[i].prop_ptr,"spice_sym_def",0)); if(sym_def) { char *symname_attr = NULL; char *templ = NULL; const char *translated_sym_def; - my_strdup2(_ALLOC_ID_, &templ, get_tok_value(xctx->sym[i].prop_ptr, "template", 0)); - my_mstrcat(_ALLOC_ID_, &symname_attr, "symname=", get_cell(name, 0), NULL); + my_strdup2(1447, &templ, get_tok_value(xctx->sym[i].prop_ptr, "template", 0)); + my_mstrcat(1448, &symname_attr, "symname=", get_cell(name, 0), NULL); translated_sym_def = translate3(sym_def, 1, "", templ, symname_attr); - my_free(_ALLOC_ID_, &templ); - my_free(_ALLOC_ID_, &symname_attr); + my_free(1449, &templ); + my_free(1450, &symname_attr); fprintf(fd, "%s\n", translated_sym_def); - my_free(_ALLOC_ID_, &sym_def); + my_free(1451, &sym_def); } else { const char *s = sanitize(get_cell(name, 0)); fprintf(fd, "** sch_path: %s\n", sanitized_abs_sym_path(filename, "")); fprintf(fd, ".subckt %s ", s); print_spice_subckt_nodes(fd, i); - my_strdup(_ALLOC_ID_, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) ); + my_strdup(1452, &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 : "" ); @@ -664,7 +664,7 @@ int 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(1453, &extra); fprintf(fd, "\n"); spice_stop ? load_schematic(0,filename, 0, 1) : load_schematic(1,filename, 0, 1); @@ -691,7 +691,7 @@ int spice_block_netlist(FILE *fd, int i) if(debug_var==0) xunlink(netl_filename); } xctx->netlist_count++; - my_free(_ALLOC_ID_, &name); + my_free(1454, &name); return err; } @@ -729,12 +729,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(1455, s); entry->next=NULL; entry->token=NULL; entry->value=NULL; - my_strdup2(_ALLOC_ID_, &entry->token, token); - my_strdup2(_ALLOC_ID_, &entry->value, value); + my_strdup2(1456, &entry->token, token); + my_strdup2(1457, &entry->value, value); entry->hash=hashcode; *preventry=entry; } @@ -745,13 +745,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(1458, &entry->token); + my_free(1459, &entry->value); + my_free(1460, &entry); *preventry=saveptr; } else if(value && what == XINSERT ) { - my_strdup2(_ALLOC_ID_, &entry->value, value); + my_strdup2(1461, &entry->value, value); } return entry; /* found matching entry, return the address */ } @@ -766,7 +766,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(1462, size, sizeof(Str_hashentry *)); } static void str_hash_free_entry(Str_hashentry *entry) @@ -774,9 +774,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(1463, &(entry->token)); + my_free(1464, &(entry->value)); + my_free(1465, &entry); entry = tmp; } } @@ -792,7 +792,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(1466, &(hashtable->table)); hashtable->size = 0; } } @@ -830,10 +830,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(1467, s); entry->next=NULL; entry->token=NULL; - my_strdup2(_ALLOC_ID_, &entry->token, token); + my_strdup2(1468, &entry->token, token); entry->value = value; entry->hash=hashcode; *preventry=entry; @@ -845,8 +845,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(1469, &entry->token); + my_free(1470, &entry); *preventry=saveptr; } else if(what == XINSERT ) { @@ -865,7 +865,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(1471, size, sizeof(Int_hashentry *)); } static void int_hash_free_entry(Int_hashentry *entry) @@ -873,8 +873,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(1472, &(entry->token)); + my_free(1473, &entry); entry = tmp; } } @@ -890,7 +890,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(1474, &(hashtable->table)); hashtable->size = 0; } } @@ -930,10 +930,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(1475, s); entry->next=NULL; entry->token=NULL; - my_strdup2(_ALLOC_ID_, &entry->token, token); + my_strdup2(1476, &entry->token, token); entry->value = value; entry->hash=hashcode; *preventry=entry; @@ -945,8 +945,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(1477, &entry->token); + my_free(1478, &entry); *preventry=saveptr; } else if(what == XINSERT ) { @@ -965,7 +965,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(1479, size, sizeof(Ptr_hashentry *)); } static void ptr_hash_free_entry(Ptr_hashentry *entry) @@ -973,8 +973,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(1480, &(entry->token)); + my_free(1481, &entry); entry = tmp; } } @@ -990,7 +990,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(1482, &(hashtable->table)); hashtable->size = 0; } } diff --git a/src/store.c b/src/store.c index 4fab716a..5ccbe9f2 100644 --- a/src/store.c +++ b/src/store.c @@ -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(1483, &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(1484, &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(1485, &xctx->text, sizeof(xText)*xctx->maxt); } } @@ -57,7 +57,7 @@ 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(1486, &xctx->sym, sizeof(xSymbol)*xctx->maxs); } } @@ -71,7 +71,7 @@ void check_inst_storage(void) int i, old = xctx->maxi; xctx->maxi=(1 + xctx->instances / ELEMINST) * ELEMINST; - my_realloc(_ALLOC_ID_, &xctx->inst, sizeof(xInstance)*xctx->maxi); + my_realloc(1487, &xctx->inst, sizeof(xInstance)*xctx->maxi); #ifdef ZERO_REALLOC memset(xctx->inst + xctx->instances, 0, sizeof(xInstance) * (xctx->maxi - xctx->instances)); #endif @@ -86,7 +86,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(1488, &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 @@ -98,7 +98,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(1489, &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 @@ -110,7 +110,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(1490, &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 @@ -122,7 +122,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(1491, &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 @@ -150,7 +150,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(1492, &xctx->arc[rectc][n].prop_ptr, prop_ptr); xctx->arc[rectc][n].sel = sel; if(sel == SELECTED) set_first_sel(ARC, n, rectc); @@ -192,10 +192,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(1493, points, sizeof(double)); + xctx->poly[rectc][n].y= my_calloc(1494, points, sizeof(double)); + xctx->poly[rectc][n].selected_point= my_calloc(1495, points, sizeof(unsigned short)); + my_strdup(1496, &xctx->poly[rectc][n].prop_ptr, prop_ptr); for(j=0;jpoly[rectc][n].x[j] = x[j]; xctx->poly[rectc][n].y[j] = y[j]; @@ -247,7 +247,7 @@ int 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(1497, &xctx->line[rectc][n].prop_ptr, prop_ptr); xctx->line[rectc][n].sel=sel; if(sel == SELECTED) set_first_sel(LINE, n, rectc); if( prop_ptr && !strboolcmp(get_tok_value(prop_ptr, "bus", 0), "true") ) @@ -281,7 +281,7 @@ int 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(1498, &xctx->rect[rectc][n].prop_ptr, prop_ptr); xctx->rect[rectc][n].sel=sel; if(sel == SELECTED) set_first_sel(xRECT, n, rectc); @@ -341,7 +341,7 @@ int 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(1499, &xctx->wire[n].prop_ptr, prop_ptr); if(prop_ptr && !strboolcmp(get_tok_value(prop_ptr,"bus",0), "true")) xctx->wire[n].bus=1; else xctx->wire[n].bus=0; xctx->wire[n].sel=sel; diff --git a/src/svgdraw.c b/src/svgdraw.c index b1f1a4a8..0715e4b7 100644 --- a/src/svgdraw.c +++ b/src/svgdraw.c @@ -334,7 +334,7 @@ static void svg_draw_string(int layer, const char *str, short rot, short flip, i text_bbox(estr, xscale, yscale, rot, flip, hcenter, vcenter, x,y, &textx1,&texty1,&textx2,&texty2, &no_of_lines, &longest_line); if(!textclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,textx1,texty1,textx2,texty2)) { - my_free(_ALLOC_ID_, &estr); + my_free(1500, &estr); return; } if(hcenter) { @@ -358,7 +358,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, estr); + my_strdup2(1501, &sss, estr); tt=ss=sss; for(;;) { c=*ss; @@ -376,8 +376,8 @@ static void svg_draw_string(int layer, const char *str, short rot, short flip, i } ++ss; } - my_free(_ALLOC_ID_, &sss); - my_free(_ALLOC_ID_, &estr); + my_free(1502, &sss); + my_free(1503, &estr); } @@ -405,7 +405,7 @@ static void old_svg_draw_string(int layer, const char *str, &rx1,&ry1,&rx2,&ry2, &no_of_lines, &longest_line); #endif if(!textclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,rx1,ry1,rx2,ry2)) { - my_free(_ALLOC_ID_, &estr); + my_free(1504, &estr); return; } x=rx1;y=ry1; @@ -436,7 +436,7 @@ static void old_svg_draw_string(int layer, const char *str, } ++pos; } - my_free(_ALLOC_ID_, &estr); + my_free(1505, &estr); } @@ -573,8 +573,8 @@ 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, bezier; - double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points); - double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points); + double *x = my_malloc(1506, sizeof(double) * polygon->points); + double *y = my_malloc(1507, sizeof(double) * polygon->points); for(k=0;kpoints; ++k) { ROTATION(rot, flip, 0.0,0.0,polygon->x[k],polygon->y[k],x[k],y[k]); x[k]+= x0; @@ -582,8 +582,8 @@ static void svg_draw_symbol(int c, int n,int layer,short tmp_flip, short rot, } bezier = !strboolcmp(get_tok_value(polygon->prop_ptr, "bezier", 0), "true"); svg_drawpolygon(c, NOW, x, y, polygon->points, polygon->fill, polygon->dash, bezier); - my_free(_ALLOC_ID_, &x); - my_free(_ALLOC_ID_, &y); + my_free(1508, &x); + my_free(1509, &y); } } for(j=0;j< symptr->arcs[layer]; ++j) { @@ -744,7 +744,7 @@ void svg_draw(void) else return; } svg_restore_lw(); - svg_colors=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Svg_color)); + svg_colors=my_calloc(1510, cadlayers, sizeof(Svg_color)); if(svg_colors==NULL){ fprintf(errfp, "svg_draw(): calloc error\n"); return; @@ -771,7 +771,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(1511, cadlayers, sizeof(int)); #if 0 * /* Determine used layers. Disabled since we want hilight colors */ * for(c=0;c\n"); fclose(fd); tclsetboolvar("draw_grid", old_grid); - my_free(_ALLOC_ID_, &svg_colors); - my_free(_ALLOC_ID_, &unused_layer); + my_free(1512, &svg_colors); + my_free(1513, &unused_layer); Tcl_SetResult(interp,"",TCL_STATIC); } diff --git a/src/tedax_netlist.c b/src/tedax_netlist.c index 44fd52bc..cbdb857e 100644 --- a/src/tedax_netlist.c +++ b/src/tedax_netlist.c @@ -37,7 +37,7 @@ static int tedax_netlist(FILE *fd, int tedax_stop ) for(i=0;iinstances; ++i) /* print first ipin/opin defs ... */ { if(skip_instance(i, 1, lvs_ignore)) 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 && IS_PIN(type) ) { print_tedax_element(fd, i) ; /* this is the element line */ } @@ -45,7 +45,7 @@ static int tedax_netlist(FILE *fd, int tedax_stop ) for(i=0;iinstances; ++i) /* ... then print other lines */ { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1515, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if(!strcmp(type,"noconn")) continue; if( type && !IS_LABEL_OR_PIN(type) ) { /* already done in global_tedax_netlist */ @@ -63,7 +63,7 @@ static int tedax_netlist(FILE *fd, int tedax_stop ) } } } - my_free(_ALLOC_ID_, &type); + my_free(1516, &type); } if(!tedax_stop && !xctx->netlist_count) redraw_hilights(0); /* draw_hilight_net(1); */ return err; @@ -97,7 +97,7 @@ static int tedax_block_netlist(FILE *fd, int i) fprintf(fd, "begin netlist v1 %s\n",sanitize(get_cell(xctx->sym[i].name, 0))); print_tedax_subckt(fd, i); - my_strdup(_ALLOC_ID_, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) ); + my_strdup(1517, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) ); /* this is now done in print_spice_subckt */ /* * fprintf(fd, "%s ", extra ? extra : "" ); @@ -105,7 +105,7 @@ static int 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(1518, &extra); fprintf(fd, "\n"); load_schematic(1,filename, 0, 1); get_additional_symbols(1); @@ -190,7 +190,7 @@ int global_tedax_netlist(int global) /* netlister driver */ /* warning if two symbols perfectly overlapped */ err |= 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(1519, xctx->instances, sizeof(unsigned int)); for(i=0;iinstances; ++i) stored_flags[i] = xctx->inst[i].color; if(global) /* was if(global) ... 20180901 no hierarchical tEDAx netlist for now */ @@ -205,8 +205,8 @@ int 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(1520, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]); + my_strcat(1521, &xctx->sch_path[xctx->currsch+1], "->netlisting"); xctx->sch_path_hash[xctx->currsch+1] = 0; xctx->currsch++; subckt_name=NULL; @@ -217,7 +217,7 @@ int global_tedax_netlist(int global) /* netlister driver */ if(xctx->sym[i].flags & (TEDAX_IGNORE | TEDAX_SHORT)) continue; if(lvs_ignore && (xctx->sym[i].flags & LVS_IGNORE)) continue; if(!xctx->sym[i].type) continue; - my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[i].name), "")); + my_strdup2(1522, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[i].name), "")); if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path)) { if(!web_url) { @@ -225,7 +225,7 @@ int global_tedax_netlist(int global) /* netlister driver */ my_strncpy(xctx->current_dirname, tclresult(), S(xctx->current_dirname)); } /* 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(1523, &subckt_name, get_cell(xctx->sym[i].name, 0)); if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL) { /* do not insert symbols with default_schematic attribute set to ignore in hash since these symbols @@ -236,13 +236,13 @@ int global_tedax_netlist(int global) /* netlister driver */ } } } - my_free(_ALLOC_ID_, &abs_path); + my_free(1524, &abs_path); /* can not free additional syms since *_block_netlist() may have loaded additional syms */ /* get_additional_symbols(0); */ str_hash_free(&subckt_table); - my_free(_ALLOC_ID_, &subckt_name); + my_free(1525, &subckt_name); /*clear_drawing(); */ - my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]); + my_free(1526, &xctx->sch[xctx->currsch]); xctx->currsch--; unselect_all(1); /* symbol vs schematic pin check, we do it here since now we have ALL symbols loaded */ @@ -260,14 +260,14 @@ int global_tedax_netlist(int global) /* netlister driver */ err |= prepare_netlist_structs(1); /* so 'lab=...' attributes for unnamed nets are set */ if(!xctx->hilight_nets) xctx->hilight_nets = saved_hilight_nets; - my_free(_ALLOC_ID_, ¤t_dirname_save); + my_free(1527, ¤t_dirname_save); } /* restore hilight flags from errors found analyzing top level before descending hierarchy */ for(i=0;iinstances; ++i) if(!xctx->inst[i].color) 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(1528, &stored_flags); /* print globals nodes found in netlist 28032003 */ record_global_node(0,fd,NULL); diff --git a/src/token.c b/src/token.c index ebfcb0d9..2032b949 100644 --- a/src/token.c +++ b/src/token.c @@ -63,17 +63,17 @@ const char *tcl_hook2(const char *cmd) char *unescaped_res; if(cmd == NULL) { - my_free(_ALLOC_ID_, &result); + my_free(1529, &result); return empty; } if(strstr(cmd, "tcleval(") == cmd) { unescaped_res = str_replace(cmd, "\\}", "}", 0); tclvareval("tclpropeval2 {", unescaped_res, "}" , NULL); - my_strdup2(_ALLOC_ID_, &result, tclresult()); + my_strdup2(1530, &result, tclresult()); /* dbg(0, "tcl_hook2: return: %s\n", result);*/ } else { /* dbg(0, "tcl_hook2: return: %s\n", cmd); */ - my_strdup2(_ALLOC_ID_, &result, cmd); + my_strdup2(1531, &result, cmd); } return result; } @@ -87,12 +87,12 @@ int is_generator(const char *name) if(!name) { if(re) { regfree(re); - my_free(_ALLOC_ID_, &re); + my_free(1532, &re); } return 0; } if(!re) { - re = my_malloc(_ALLOC_ID_, sizeof(regex_t)); + re = my_malloc(1533, sizeof(regex_t)); regcomp(re, "^[^ \t()]+\\([^()]*\\)[ \t]*$", REG_NOSUB | REG_EXTENDED); } if(!regexec(re, name, 0 , NULL, 0) ) res = 1; @@ -117,12 +117,12 @@ const char *sanitize(const char *name) static char *s = NULL; static char *empty=""; if(name == NULL) { - my_free(_ALLOC_ID_, &s); + my_free(1534, &s); return empty; } tclvareval("regsub -all { *[(),] *} {", name, "} _", NULL); tclvareval("regsub {_$} {", tclresult(), "} {}", NULL); - my_strdup2(_ALLOC_ID_, &s, tclresult()); + my_strdup2(1535, &s, tclresult()); return s; } @@ -149,18 +149,18 @@ char *get_generator_command(const char *str) goto end; } #ifdef __unix__ - /* my_strdup(_ALLOC_ID_, &gen_cmd, cmd_filename); */ + /* my_strdup(1536, &gen_cmd, cmd_filename); */ /* add quotes to protect spaces in cmd path */ - my_mstrcat(_ALLOC_ID_, &gen_cmd, "\"", cmd_filename, "\"", NULL); + my_mstrcat(1537, &gen_cmd, "\"", cmd_filename, "\"", NULL); *spc_idx = ' '; - my_strcat(_ALLOC_ID_, &gen_cmd, spc_idx); + my_strcat(1538, &gen_cmd, spc_idx); #else /* tclsh "cmd_filename" a b c */ /* command tclsh is needed so new TCL windows will NOT open */ /* quotes are needed for filename if filename has spaces */ *spc_idx = ' '; int len = 8 + strlen(cmd_filename) + strlen(spc_idx) + 1; /*8="tclsh "+ "\""*2*/ - gen_cmd = my_malloc(_ALLOC_ID_, len * sizeof(char)); + gen_cmd = my_malloc(1539, len * sizeof(char)); my_snprintf(gen_cmd, len, "tclsh \"%s\"%s", cmd_filename, spc_idx); #endif dbg(1, "get_generator_command(): cmd_filename=%s\n", cmd_filename); @@ -168,7 +168,7 @@ char *get_generator_command(const char *str) dbg(1, "get_generator_command(): is_symgen=%d\n", is_generator(str)); end: - my_free(_ALLOC_ID_, &cmd); + my_free(1540, &cmd); return gen_cmd; } @@ -213,8 +213,8 @@ int set_different_token(char **s,const char *new, const char *old) if(new==NULL) return 0; sizeval = sizetok = CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &token, sizetok); - my_realloc(_ALLOC_ID_, &value, sizeval); + my_realloc(1541, &token, sizetok); + my_realloc(1542, &value, sizeval); /* parse new string and add / change attributes that are missing / different from old */ while(1) { @@ -242,7 +242,7 @@ int set_different_token(char **s,const char *new, const char *old) value_pos=0; if(strcmp(value, get_tok_value(old,token,1))) { mod=1; - my_strdup(_ALLOC_ID_, s, subst_token(*s, token, value) ); + my_strdup(1543, s, subst_token(*s, token, value) ); } state=TOK_BEGIN; } @@ -277,7 +277,7 @@ int set_different_token(char **s,const char *new, const char *old) get_tok_value(new,token,1); if(xctx->tok_size == 0 ) { mod=1; - my_strdup(_ALLOC_ID_, s, subst_token(*s, token, NULL) ); + my_strdup(1544, s, subst_token(*s, token, NULL) ); } } else if(state==TOK_END) { value[value_pos]='\0'; @@ -287,8 +287,8 @@ int set_different_token(char **s,const char *new, const char *old) escape = (c=='\\' && !escape); if(c=='\0') break; } - my_free(_ALLOC_ID_, &token); - my_free(_ALLOC_ID_, &value); + my_free(1545, &token); + my_free(1546, &value); return mod; } @@ -307,12 +307,12 @@ const char *list_tokens(const char *s, int with_quotes) int escape=0; if(s==NULL) { - my_free(_ALLOC_ID_, &token); + my_free(1547, &token); sizetok = 0; return ""; } sizetok = CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &token, sizetok); + my_realloc(1548, &token, sizetok); token[0] = '\0'; while(1) { c=*s++; @@ -393,10 +393,10 @@ static void get_pin_and_attr(const char *token, char **pin_num_or_name, char **p if(*p == ':' && !bracket) { /* 01234567890123456 * @#A[3:0]:net_name */ - *pin_num_or_name = my_malloc(_ALLOC_ID_, p - token - 1); + *pin_num_or_name = my_malloc(1549, p - token - 1); memcpy(*pin_num_or_name, token + 2, p - token - 2); (*pin_num_or_name)[p - token - 2] = '\0'; - my_strdup2(_ALLOC_ID_, pin_attr, p + 1); + my_strdup2(1550, pin_attr, p + 1); done = 1; break; } @@ -404,8 +404,8 @@ static void get_pin_and_attr(const char *token, char **pin_num_or_name, char **p p++; } if(!done) { - my_strdup2(_ALLOC_ID_, pin_num_or_name, token + 2); - my_strdup2(_ALLOC_ID_, pin_attr, ""); + my_strdup2(1551, pin_num_or_name, token + 2); + my_strdup2(1552, pin_attr, ""); } dbg(1, "get_pin_and_attr(): token=%s, name=%s, attr=%s\n", token, *pin_num_or_name ? *pin_num_or_name : "NULL", @@ -443,9 +443,9 @@ const char *get_tok_value(const char *s,const char *tok, int with_quotes) if(s==NULL) { if(tok == NULL) { - my_free(_ALLOC_ID_, &result); - my_free(_ALLOC_ID_, &token); - my_free(_ALLOC_ID_, &translated_tok); + my_free(1553, &result); + my_free(1554, &token); + my_free(1555, &translated_tok); size = sizetok = 0; dbg(2, "get_tok_value(): clear static data\n"); } @@ -455,8 +455,8 @@ const char *get_tok_value(const char *s,const char *tok, int with_quotes) /* dbg(0, "get_tok_value(): looking for <%s> in <%.30s>\n",tok,s); */ if( size == 0 ) { sizetok = size = CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &result, size); - my_realloc(_ALLOC_ID_, &token, sizetok); + my_realloc(1556, &result, size); + my_realloc(1557, &token, sizetok); } while(1) { c=*s++; @@ -469,11 +469,11 @@ const char *get_tok_value(const char *s,const char *tok, int with_quotes) /* don't use STR_ALLOC() for efficiency reasons */ if(value_pos>=size) { size+=CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &result,size); + my_realloc(1558, &result,size); } if(token_pos>=sizetok) { sizetok+=CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &token,sizetok); + my_realloc(1559, &token,sizetok); } if(c=='"') { if(!escape) quote=!quote; @@ -506,7 +506,7 @@ const char *get_tok_value(const char *s,const char *tok, int with_quotes) if(with_quotes & 2) { return result; } else { - my_strdup2(_ALLOC_ID_, &translated_tok, tcl_hook2(result)); + my_strdup2(1560, &translated_tok, tcl_hook2(result)); return translated_tok; } } @@ -546,15 +546,15 @@ const char *get_sym_template(char *s,char *extra) dbg(1, "get_sym_template(): s=%s, extra=%s\n", s ? s : "NULL", extra ? extra : "NULL"); if(s==NULL) { - my_free(_ALLOC_ID_, &result); + my_free(1561, &result); return ""; } l = strlen(s); STR_ALLOC(&result, l+1, &sizeres); result[0] = '\0'; sizetok = sizeval = CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &value,sizeval); - my_realloc(_ALLOC_ID_, &token,sizetok); + my_realloc(1562, &value,sizeval); + my_realloc(1563, &token,sizetok); while(1) { c=*s++; space=SPACE(c) ; @@ -606,8 +606,8 @@ const char *get_sym_template(char *s,char *extra) break; } } - my_free(_ALLOC_ID_, &value); - my_free(_ALLOC_ID_, &token); + my_free(1564, &value); + my_free(1565, &token); dbg(1, "get_sym_template(): result=|%s|\n", result); return result; } @@ -631,20 +631,20 @@ static char *get_pin_attr_from_inst(int inst, int pin, const char *attr) size_t tok_val_len; tok_val_len = strlen(str); attr_size = strlen(attr); - my_strdup(_ALLOC_ID_, &pinname, str); - pname =my_malloc(_ALLOC_ID_, tok_val_len + attr_size + 30); + my_strdup(1566, &pinname, str); + pname =my_malloc(1567, tok_val_len + attr_size + 30); my_snprintf(pname, tok_val_len + attr_size + 30, "%s(%s)", attr, pinname); - my_free(_ALLOC_ID_, &pinname); + my_free(1568, &pinname); str = get_tok_value(xctx->inst[inst].prop_ptr, pname, 0); - my_free(_ALLOC_ID_, &pname); - if(xctx->tok_size) my_strdup2(_ALLOC_ID_, &pin_attr_value, str); + my_free(1569, &pname); + if(xctx->tok_size) my_strdup2(1570, &pin_attr_value, str); else { - pnumber = my_malloc(_ALLOC_ID_, attr_size + 100); + pnumber = my_malloc(1571, attr_size + 100); my_snprintf(pnumber, attr_size + 100, "%s(%d)", attr, pin); str = get_tok_value(xctx->inst[inst].prop_ptr, pnumber, 0); dbg(1, "get_pin_attr_from_inst(): pnumber=%s\n", pnumber); - my_free(_ALLOC_ID_, &pnumber); - if(xctx->tok_size) my_strdup2(_ALLOC_ID_, &pin_attr_value, str); + my_free(1572, &pnumber); + if(xctx->tok_size) my_strdup2(1573, &pin_attr_value, str); } } return pin_attr_value; @@ -655,11 +655,11 @@ int get_last_used_index(const char *old_basename, const char *brkt) int retval = 1; Int_hashentry *entry; size_t size = strlen(old_basename) + strlen(brkt)+40; - char *refname = my_malloc(_ALLOC_ID_, size); + char *refname = my_malloc(1574, size); my_snprintf(refname, size, "_@%s@%s", old_basename, brkt); entry = int_hash_lookup(&xctx->inst_name_table, refname, 0, XLOOKUP); if(entry) retval = entry->value; - my_free(_ALLOC_ID_, &refname); + my_free(1575, &refname); return retval; } @@ -686,7 +686,7 @@ void hash_names(int inst, int action) start, stop, xctx->inst[inst].instname? xctx->inst[inst].instname : "NULL"); for(i = start; i < stop; ++i) { if(xctx->inst[i].instname && xctx->inst[i].instname[0]) { - my_strdup(_ALLOC_ID_, &upinst, expandlabel(xctx->inst[i].instname, &xmult)); + my_strdup(1576, &upinst, expandlabel(xctx->inst[i].instname, &xmult)); strtoupper(upinst); upinst_ptr = upinst; @@ -698,7 +698,7 @@ void hash_names(int inst, int action) } } } - if(upinst) my_free(_ALLOC_ID_, &upinst); + if(upinst) my_free(1577, &upinst); } /* return -1 if name is not used, else return first instance number with same name found @@ -715,7 +715,7 @@ static int name_is_used(char *name, const char *old_basename, const char *brkt, char *upinst = NULL; char *upinst_ptr, *upinst_state, *single_name; Int_hashentry *entry; - my_strdup(_ALLOC_ID_, &upinst, expandlabel(name, &xmult)); + my_strdup(1578, &upinst, expandlabel(name, &xmult)); strtoupper(upinst); upinst_ptr = upinst; while( (single_name = my_strtok_r(upinst_ptr, ",", "", 0, &upinst_state)) ) { @@ -726,15 +726,15 @@ static int name_is_used(char *name, const char *old_basename, const char *brkt, break; } } - my_free(_ALLOC_ID_, &upinst); + my_free(1579, &upinst); dbg(1, "name_is_used(%s): return inst %d\n", name, used); if(q != -1 && used == -1) { size_t size = strlen(old_basename) + strlen(brkt)+40; - char *refname = my_malloc(_ALLOC_ID_, size); + char *refname = my_malloc(1580, size); my_snprintf(refname, size, "_@%s@%s", old_basename, brkt); int_hash_lookup(&xctx->inst_name_table, refname, q, XINSERT); - my_free(_ALLOC_ID_, &refname); + my_free(1581, &refname); } return used; } @@ -759,31 +759,31 @@ void new_prop_string(int i, const char *old_prop, int dis_uniq_names) dbg(1, "new_prop_string(): i=%d, old_prop=%s\n", i, old_prop); if(old_prop==NULL) { - my_free(_ALLOC_ID_, &xctx->inst[i].prop_ptr); + my_free(1582, &xctx->inst[i].prop_ptr); return; } - old_name_len = my_strdup(_ALLOC_ID_, &old_name,get_tok_value(old_prop,"name",0) ); /* added old_name_len */ + old_name_len = my_strdup(1583, &old_name,get_tok_value(old_prop,"name",0) ); /* added old_name_len */ if(old_name==NULL) { - my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, old_prop); /* changed to copy old props if no name */ - my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, ""); + my_strdup(1584, &xctx->inst[i].prop_ptr, old_prop); /* changed to copy old props if no name */ + my_strdup2(1585, &xctx->inst[i].instname, ""); return; } /* don't change old_prop if name does not conflict. */ /* if no hash_names() is done and inst_table uninitialized --> use old_prop */ is_used = name_is_used(old_name, "", "", -1); if(dis_uniq_names || is_used == -1 || is_used == i) { - my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, old_prop); - my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, old_name); - my_free(_ALLOC_ID_, &old_name); + my_strdup(1586, &xctx->inst[i].prop_ptr, old_prop); + my_strdup2(1587, &xctx->inst[i].instname, old_name); + my_free(1588, &old_name); return; } /* old_name is not unique. Find another unique name */ - old_name_base = my_malloc(_ALLOC_ID_, old_name_len+1); + old_name_base = my_malloc(1589, old_name_len+1); n = sscanf(old_name, "%[^[0-9]",old_name_base); if(!n) old_name_base[0] = '\0'; /* there is no basename (like in "[3:0]" or "12"), set to empty string */ brkt=find_bracket(old_name); /* if no bracket found will point to end of string ('\0') */ - my_realloc(_ALLOC_ID_, &new_name, old_name_len + 40); + my_realloc(1590, &new_name, old_name_len + 40); qq = get_last_used_index(old_name_base, brkt); /* */ @@ -792,18 +792,18 @@ void new_prop_string(int i, const char *old_prop, int dis_uniq_names) is_used = name_is_used(new_name, old_name_base, brkt, q); if(is_used == -1 ) break; } - my_free(_ALLOC_ID_, &old_name_base); + my_free(1591, &old_name_base); dbg(1, "new_prop_string(): new_name=%s\n", new_name); new_prop = subst_token(old_prop, "name", new_name); dbg(1, "new_prop_string(): old_prop=|%s|\n", old_prop); dbg(1, "new_prop_string(): new_prop=|%s|\n", new_prop); if(strcmp(new_prop, old_prop) ) { - my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, new_prop); - my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, new_name); + my_strdup(1592, &xctx->inst[i].prop_ptr, new_prop); + my_strdup2(1593, &xctx->inst[i].instname, new_name); } - my_free(_ALLOC_ID_, &old_name); - my_free(_ALLOC_ID_, &new_name); - my_free(_ALLOC_ID_, &up_new_name); + my_free(1594, &old_name); + my_free(1595, &new_name); + my_free(1596, &up_new_name); } void check_unique_names(int rename) @@ -852,13 +852,13 @@ void check_unique_names(int rename) /* rename duplicates */ if(rename) for(i=0;iinstances; ++i) { if( (xctx->inst[i].color != -10000)) { - my_strdup(_ALLOC_ID_, &tmp, xctx->inst[i].prop_ptr); + my_strdup(1597, &tmp, xctx->inst[i].prop_ptr); newpropcnt++; new_prop_string(i, tmp, 0); hash_names(i, XINSERT); symbol_bbox(i, &xctx->inst[i].x1, &xctx->inst[i].y1, &xctx->inst[i].x2, &xctx->inst[i].y2); bbox(ADD, xctx->inst[i].x1, xctx->inst[i].y1, xctx->inst[i].x2, xctx->inst[i].y2); - my_free(_ALLOC_ID_, &tmp); + my_free(1598, &tmp); } } /* for(i...) */ if(modified) set_modify(1); @@ -918,25 +918,25 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 char *fmt_attr = NULL; char *result = NULL; - my_strdup(_ALLOC_ID_, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); - my_strdup(_ALLOC_ID_, &name, xctx->inst[inst].instname); + my_strdup(1599, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); + my_strdup(1600, &name, xctx->inst[inst].instname); fmt_attr = xctx->format ? xctx->format : "vhdl_format"; - if(!name) my_strdup(_ALLOC_ID_, &name, get_tok_value(template, "name", 0)); + if(!name) my_strdup(1601, &name, get_tok_value(template, "name", 0)); /* allow format string override in instance */ - my_strdup(_ALLOC_ID_, &format, get_tok_value(xctx->inst[inst].prop_ptr, fmt_attr, 2)); + my_strdup(1602, &format, get_tok_value(xctx->inst[inst].prop_ptr, fmt_attr, 2)); /* get netlist format rule from symbol */ if(!xctx->tok_size) - my_strdup(_ALLOC_ID_, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, fmt_attr, 2)); + my_strdup(1603, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, fmt_attr, 2)); /* allow format string override in instance */ if(xctx->tok_size && strcmp(fmt_attr, "vhdl_format")) - my_strdup(_ALLOC_ID_, &format, get_tok_value(xctx->inst[inst].prop_ptr, "vhdl_format", 2)); + my_strdup(1604, &format, get_tok_value(xctx->inst[inst].prop_ptr, "vhdl_format", 2)); /* get netlist format rule from symbol */ if(!xctx->tok_size && strcmp(fmt_attr, "vhdl_format")) - my_strdup(_ALLOC_ID_, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "vhdl_format", 2)); + my_strdup(1605, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "vhdl_format", 2)); if((name==NULL) || (format==NULL) ) { - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &name); - my_free(_ALLOC_ID_, &format); + my_free(1606, &template); + my_free(1607, &name); + my_free(1608, &format); return; /*do no netlist unwanted insts(no format) */ } no_of_pins= (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]; @@ -982,55 +982,55 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 if(!xctx->tok_size) value=get_tok_value(template, token+1, 0); if(!xctx->tok_size && token[0] =='%') { - my_mstrcat(_ALLOC_ID_, &result, token + 1, NULL); + my_mstrcat(1609, &result, token + 1, NULL); } else if(value && value[0]!='\0') { /* instance names (name) and node labels (lab) go thru the expandlabel function. */ /*if something else must be parsed, put an if here! */ if(!(strcmp(token+1,"name"))) { if( (lab=expandlabel(value, &tmp)) != NULL) - my_mstrcat(_ALLOC_ID_, &result, "----name(", lab, ")", NULL); + my_mstrcat(1610, &result, "----name(", lab, ")", NULL); else - my_mstrcat(_ALLOC_ID_, &result, value, NULL); + my_mstrcat(1611, &result, value, NULL); } else if(!(strcmp(token+1,"lab"))) { if( (lab=expandlabel(value, &tmp)) != NULL) - my_mstrcat(_ALLOC_ID_, &result, "----pin(", lab, ")", NULL); + my_mstrcat(1612, &result, "----pin(", lab, ")", NULL); else - my_mstrcat(_ALLOC_ID_, &result, value, NULL); + my_mstrcat(1613, &result, value, NULL); } - else my_mstrcat(_ALLOC_ID_, &result, value, NULL); + else my_mstrcat(1614, &result, value, NULL); } else if(strcmp(token,"@symref")==0) { const char *s = get_sym_name(inst, 9999, 1, 0); - my_mstrcat(_ALLOC_ID_, &result, s, NULL); + my_mstrcat(1615, &result, s, NULL); } else if(strcmp(token,"@symname")==0) /* of course symname must not be present */ /* in hash table */ { const char *s = sanitize(translate(inst, get_sym_name(inst, 0, 0, 0))); - my_mstrcat(_ALLOC_ID_, &result, s, NULL); + my_mstrcat(1616, &result, s, NULL); } else if (strcmp(token,"@symname_ext")==0) { const char *s = sanitize(translate(inst, get_sym_name(inst, 0, 1, 0))); - my_mstrcat(_ALLOC_ID_, &result, s, NULL); + my_mstrcat(1617, &result, s, NULL); } else if(strcmp(token,"@schname_ext")==0) /* of course schname must not be present */ /* in hash table */ { - my_mstrcat(_ALLOC_ID_, &result, xctx->current_name, NULL); + my_mstrcat(1618, &result, xctx->current_name, NULL); } else if(strcmp(token,"@schname")==0) { - my_mstrcat(_ALLOC_ID_, &result, get_cell(xctx->current_name, 0), NULL); + my_mstrcat(1619, &result, get_cell(xctx->current_name, 0), NULL); } else if(strcmp(token,"@topschname")==0) /* of course topschname must not be present in attributes */ { const char *topsch; topsch = get_trailing_path(xctx->sch[0], 0, 1); - my_mstrcat(_ALLOC_ID_, &result, topsch, NULL); + my_mstrcat(1620, &result, topsch, NULL); } else if(strcmp(token,"@pinlist")==0) /* of course pinlist must not be present */ /* in hash table. print multiplicity */ @@ -1044,9 +1044,9 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 if(strboolcmp(get_tok_value(prop,"vhdl_ignore",0), "true")) { const char *name = get_tok_value(prop,"name",0); if(!int_hash_lookup(&table, name, 1, XINSERT_NOREPLACE)) { - if(!first) my_mstrcat(_ALLOC_ID_, &result, " , ", NULL); + if(!first) my_mstrcat(1621, &result, " , ", NULL); str_ptr = net_name(inst,i, &multip, 0, 1); - my_mstrcat(_ALLOC_ID_, &result, "----pin(", str_ptr, ") ", NULL); + my_mstrcat(1622, &result, "----pin(", str_ptr, ") ", NULL); first = 0; } } @@ -1059,7 +1059,7 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 if(!strcmp( get_tok_value(ptr->rect[PINLAYER][i].prop_ptr,"name",0), token+2)) { if(strboolcmp(get_tok_value(ptr->rect[PINLAYER][i].prop_ptr,"vhdl_ignore",0), "true")) { str_ptr = net_name(inst,i, &multip, 0, 1); - my_mstrcat(_ALLOC_ID_, &result, "----pin(", str_ptr, ") ", NULL); + my_mstrcat(1623, &result, "----pin(", str_ptr, ") ", NULL); } break; } @@ -1084,24 +1084,24 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 pin_attr_value = get_pin_attr_from_inst(inst, n, pin_attr); /* get pin_attr from instance pin attribute string */ if(!pin_attr_value) { - my_strdup(_ALLOC_ID_, &pin_attr_value, + my_strdup(1624, &pin_attr_value, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->rect[PINLAYER][n].prop_ptr, pin_attr, 0)); } } /* @#n:net_name attribute (n = pin number or name) will translate to net name attached to pin */ if(!pin_attr_value && is_net_name) { prepare_netlist_structs(0); - my_strdup(_ALLOC_ID_, &pin_attr_value, + my_strdup(1625, &pin_attr_value, xctx->inst[inst].node && xctx->inst[inst].node[n] ? xctx->inst[inst].node[n] : "?"); } - if(!pin_attr_value ) my_strdup(_ALLOC_ID_, &pin_attr_value, "--UNDEF--"); + if(!pin_attr_value ) my_strdup(1626, &pin_attr_value, "--UNDEF--"); value = pin_attr_value; /* recognize slotted devices: instname = "U3:3", value = "a:b:c:d" --> value = "c" */ if(value[0] && !strcmp(pin_attr, "pinnumber") ) { char *ss; int slot; char *tmpstr = NULL; - tmpstr = my_malloc(_ALLOC_ID_, sizeof(xctx->inst[inst].instname)); + tmpstr = my_malloc(1627, sizeof(xctx->inst[inst].instname)); if( (ss=strchr(xctx->inst[inst].instname, ':')) ) { sscanf(ss+1, "%s", tmpstr); if(isonlydigit(tmpstr)) { @@ -1109,10 +1109,10 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 if(strstr(value,":")) value = find_nth(value, ":", "", 0, slot); } } - my_free(_ALLOC_ID_, &tmpstr); + my_free(1628, &tmpstr); } - my_mstrcat(_ALLOC_ID_, &result, value, NULL); - my_free(_ALLOC_ID_, &pin_attr_value); + my_mstrcat(1629, &result, value, NULL); + my_free(1630, &pin_attr_value); } else if(n>=0 && n < (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]) { const char *si; @@ -1120,11 +1120,11 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 si = get_tok_value(prop, "verilog_ignore",0); if(strboolcmp(si, "true")) { str_ptr = net_name(inst,n, &multip, 0, 1); - my_mstrcat(_ALLOC_ID_, &result, "----pin(", str_ptr, ") ", NULL); + my_mstrcat(1631, &result, "----pin(", str_ptr, ") ", NULL); } } - my_free(_ALLOC_ID_, &pin_attr); - my_free(_ALLOC_ID_, &pin_num_or_name); + my_free(1632, &pin_attr); + my_free(1633, &pin_num_or_name); } else if(!strncmp(token,"@tcleval", 8)) { @@ -1132,19 +1132,19 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 size_t s; char *tclcmd=NULL; s = token_pos + strlen(name) + strlen(xctx->inst[inst].name) + 100; - tclcmd = my_malloc(_ALLOC_ID_, s); + tclcmd = my_malloc(1634, s); Tcl_ResetResult(interp); my_snprintf(tclcmd, s, "tclpropeval {%s} {%s} {%s}", token, name, xctx->inst[inst].name); tcleval(tclcmd); - my_mstrcat(_ALLOC_ID_, &result, tclresult(), NULL); - my_free(_ALLOC_ID_, &tclcmd); + my_mstrcat(1635, &result, tclresult(), NULL); + my_free(1636, &tclcmd); } if(c!='%' && c!='@' && c!='\0' ) { char str[2]; str[0] = (unsigned char) c; str[1] = (unsigned char)'\0'; - my_mstrcat(_ALLOC_ID_, &result, str, NULL); + my_mstrcat(1637, &result, str, NULL); } if(c == '@' || c == '%') s--; state=TOK_BEGIN; @@ -1153,14 +1153,14 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 char str[2]; str[0] = (unsigned char) c; str[1] = (unsigned char)'\0'; - my_mstrcat(_ALLOC_ID_, &result, str, NULL); + my_mstrcat(1638, &result, str, NULL); } if(c=='\0') { if(result && strstr(result, "tcleval(")== result) { dbg(1, "print_vhdl_primitive(): before translate() result=%s\n", result); - my_strdup(_ALLOC_ID_, &result, translate(inst, result)); + my_strdup(1639, &result, translate(inst, result)); dbg(1, "print_vhdl_primitive(): after translate() result=%s\n", result); } if(result) fprintf(fd, "%s", result); @@ -1169,11 +1169,11 @@ static void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 200 break ; } } - my_free(_ALLOC_ID_, &result); - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &format); - my_free(_ALLOC_ID_, &name); - my_free(_ALLOC_ID_, &token); + my_free(1640, &result); + my_free(1641, &template); + my_free(1642, &format); + my_free(1643, &name); + my_free(1644, &token); } const char *subst_token(const char *s, const char *tok, const char *new_val) @@ -1197,26 +1197,26 @@ const char *subst_token(const char *s, const char *tok, const char *new_val) size_t new_val_len; if(s==NULL && tok == NULL){ - my_free(_ALLOC_ID_, &result); + my_free(1645, &result); return ""; } if((tok == NULL || tok[0]=='\0') && s ){ - my_strdup2(_ALLOC_ID_, &result, s); + my_strdup2(1646, &result, s); return result; } /* quote new_val if it contains newlines and not "name" token */ if(new_val) { new_val_len = strlen(new_val); if(strcmp(tok, "name") && !is_quoted(new_val) && strpbrk(new_val, ";\n \t")) { - new_val_copy = my_malloc(_ALLOC_ID_, new_val_len+3); + new_val_copy = my_malloc(1647, new_val_len+3); my_snprintf(new_val_copy, new_val_len+3, "\"%s\"", new_val); } - else my_strdup(_ALLOC_ID_, &new_val_copy, new_val); + else my_strdup(1648, &new_val_copy, new_val); } else new_val_copy = NULL; dbg(1, "subst_token(): %s, %s, %s\n", s ? s : "", tok ? tok : "", new_val ? new_val : ""); sizetok = size = CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &result, size); - my_realloc(_ALLOC_ID_, &token, sizetok); + my_realloc(1649, &result, size); + my_realloc(1650, &token, sizetok); result[0] = '\0'; while( s ) { c=*s++; @@ -1341,8 +1341,8 @@ const char *subst_token(const char *s, const char *tok, const char *new_val) } } dbg(2, "subst_token(): returning: %s\n",result); - my_free(_ALLOC_ID_, &token); - my_free(_ALLOC_ID_, &new_val_copy); + my_free(1651, &token); + my_free(1652, &new_val_copy); return result; } @@ -1453,13 +1453,13 @@ void print_vhdl_element(FILE *fd, int inst) print_vhdl_primitive(fd, inst); return; } - my_strdup(_ALLOC_ID_, &name,xctx->inst[inst].instname); - if(!name) my_strdup(_ALLOC_ID_, &name, get_tok_value(template, "name", 0)); + my_strdup(1653, &name,xctx->inst[inst].instname); + if(!name) my_strdup(1654, &name, get_tok_value(template, "name", 0)); if(name==NULL) { - my_free(_ALLOC_ID_, &name); + my_free(1655, &name); return; } - my_strdup(_ALLOC_ID_, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); + my_strdup(1656, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); no_of_pins= (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]; no_of_generics= (xctx->inst[inst].ptr + xctx->sym)->rects[GENERICLAYER]; @@ -1478,7 +1478,7 @@ void print_vhdl_element(FILE *fd, int inst) tmp=0; /* 20080213 use generic_type property to decide if some properties are strings, see later */ - my_strdup(_ALLOC_ID_, &generic_type, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr,"generic_type", 0)); + my_strdup(1657, &generic_type, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr,"generic_type", 0)); while(1) { @@ -1544,10 +1544,10 @@ void print_vhdl_element(FILE *fd, int inst) for(i=0;iinst[inst].node || !xctx->inst[inst].node[no_of_pins+i]) continue; - my_strdup(_ALLOC_ID_, &generic_type,get_tok_value( + my_strdup(1658, &generic_type,get_tok_value( (xctx->inst[inst].ptr + xctx->sym)->rect[GENERICLAYER][i].prop_ptr,"type",0)); - my_strdup(_ALLOC_ID_, &generic_value, xctx->inst[inst].node[no_of_pins+i] ); - /*my_strdup(_ALLOC_ID_, &generic_value, get_tok_value( */ + my_strdup(1659, &generic_value, xctx->inst[inst].node[no_of_pins+i] ); + /*my_strdup(1660, &generic_value, get_tok_value( */ /* (xctx->inst[inst].ptr + xctx->sym)->rect[GENERICLAYER][i].prop_ptr,"value") ); */ str_ptr = get_tok_value( (xctx->inst[inst].ptr + xctx->sym)->rect[GENERICLAYER][i].prop_ptr,"name",0); @@ -1586,12 +1586,12 @@ void print_vhdl_element(FILE *fd, int inst) int_hash_free(&table); fprintf(fd, "\n);\n\n"); dbg(2, "print_vhdl_element(): ------- end ------ \n"); - my_free(_ALLOC_ID_, &name); - my_free(_ALLOC_ID_, &generic_value); - my_free(_ALLOC_ID_, &generic_type); - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &value); - my_free(_ALLOC_ID_, &token); + my_free(1661, &name); + my_free(1662, &generic_value); + my_free(1663, &generic_type); + my_free(1664, &template); + my_free(1665, &value); + my_free(1666, &token); } void print_generic(FILE *fd, char *ent_or_comp, int symbol) @@ -1608,12 +1608,12 @@ void print_generic(FILE *fd, char *ent_or_comp, int symbol) int escape=0; int token_number=0; - my_strdup(_ALLOC_ID_, &template, xctx->sym[symbol].templ); + my_strdup(1667, &template, xctx->sym[symbol].templ); if( !template || !(template[0]) ) { - my_free(_ALLOC_ID_, &template); + my_free(1668, &template); return; } - my_strdup(_ALLOC_ID_, &generic_type, get_tok_value(xctx->sym[symbol].prop_ptr,"generic_type",0)); + my_strdup(1669, &generic_type, get_tok_value(xctx->sym[symbol].prop_ptr,"generic_type",0)); dbg(2, "print_generic(): symbol=%d template=%s \n", symbol, template); fprintf(fd, "%s %s ",ent_or_comp, sanitize(get_cell(xctx->sym[symbol].name, 0))); @@ -1657,7 +1657,7 @@ void print_generic(FILE *fd, char *ent_or_comp, int symbol) token_number++; value[value_pos]='\0'; value_pos=0; - my_strdup(_ALLOC_ID_, &type, get_tok_value(generic_type,token,0)); + my_strdup(1670, &type, get_tok_value(generic_type,token,0)); if(value[0] != '\0') /* token has a value */ { @@ -1684,9 +1684,9 @@ void print_generic(FILE *fd, char *ent_or_comp, int symbol) for(i=0;isym[symbol].rects[GENERICLAYER]; ++i) { - my_strdup(_ALLOC_ID_, &generic_type, + my_strdup(1671, &generic_type, get_tok_value(xctx->sym[symbol].rect[GENERICLAYER][i].prop_ptr,"generic_type",0)); - my_strdup(_ALLOC_ID_, &generic_value, + my_strdup(1672, &generic_value, get_tok_value(xctx->sym[symbol].rect[GENERICLAYER][i].prop_ptr,"value", 0) ); str_tmp = get_tok_value(xctx->sym[symbol].rect[GENERICLAYER][i].prop_ptr,"name",0); if(!tmp) fprintf(fd, "generic (\n"); @@ -1698,12 +1698,12 @@ void print_generic(FILE *fd, char *ent_or_comp, int symbol) tmp=1; } if(tmp) fprintf(fd, "\n);\n"); - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &value); - my_free(_ALLOC_ID_, &token); - my_free(_ALLOC_ID_, &type); - my_free(_ALLOC_ID_, &generic_type); - my_free(_ALLOC_ID_, &generic_value); + my_free(1673, &template); + my_free(1674, &value); + my_free(1675, &token); + my_free(1676, &type); + my_free(1677, &generic_type); + my_free(1678, &generic_value); } @@ -1718,13 +1718,13 @@ void print_verilog_param(FILE *fd, int symbol) int token_number=0; char *extra = NULL; - my_strdup(_ALLOC_ID_, &template, xctx->sym[symbol].templ); /* 20150409 20171103 */ + my_strdup(1679, &template, xctx->sym[symbol].templ); /* 20150409 20171103 */ if( !template || !(template[0]) ) { - my_free(_ALLOC_ID_, &template); + my_free(1680, &template); return; } - my_strdup(_ALLOC_ID_, &generic_type, get_tok_value(xctx->sym[symbol].prop_ptr,"generic_type",0)); - my_strdup(_ALLOC_ID_, &extra, get_tok_value(xctx->sym[symbol].prop_ptr,"extra",0) ); + my_strdup(1681, &generic_type, get_tok_value(xctx->sym[symbol].prop_ptr,"generic_type",0)); + my_strdup(1682, &extra, get_tok_value(xctx->sym[symbol].prop_ptr,"extra",0) ); dbg(2, "print_verilog_param(): symbol=%d template=%s \n", symbol, template); s=template; @@ -1786,11 +1786,11 @@ void print_verilog_param(FILE *fd, int symbol) break ; } } - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &generic_type); - my_free(_ALLOC_ID_, &value); - my_free(_ALLOC_ID_, &token); - my_free(_ALLOC_ID_, &extra); + my_free(1683, &template); + my_free(1684, &generic_type); + my_free(1685, &value); + my_free(1686, &token); + my_free(1687, &extra); } @@ -1826,9 +1826,9 @@ static int has_included_subcircuit(int inst, int symbol, char **result) int ret = 0; - my_strdup2(_ALLOC_ID_, &spice_sym_def, get_tok_value(xctx->inst[inst].prop_ptr, "spice_sym_def", 2)); + my_strdup2(1688, &spice_sym_def, get_tok_value(xctx->inst[inst].prop_ptr, "spice_sym_def", 2)); if(!spice_sym_def[0]) { - my_strdup2(_ALLOC_ID_, &spice_sym_def, get_tok_value(xctx->sym[symbol].prop_ptr, "spice_sym_def", 0)); + my_strdup2(1689, &spice_sym_def, get_tok_value(xctx->sym[symbol].prop_ptr, "spice_sym_def", 0)); } if(xctx->tok_size) { @@ -1836,16 +1836,16 @@ static int has_included_subcircuit(int inst, int symbol, char **result) char *templ = NULL; char *symname_attr = NULL; - my_strdup2(_ALLOC_ID_, &templ, get_tok_value(xctx->sym[symbol].prop_ptr, "template", 0)); - my_strdup2(_ALLOC_ID_, &symname, get_tok_value(xctx->inst[inst].prop_ptr, "schematic", 0)); + my_strdup2(1690, &templ, get_tok_value(xctx->sym[symbol].prop_ptr, "template", 0)); + my_strdup2(1691, &symname, get_tok_value(xctx->inst[inst].prop_ptr, "schematic", 0)); if(!symname[0]) { - my_strdup2(_ALLOC_ID_, &symname, get_tok_value(xctx->sym[symbol].prop_ptr, "schematic", 0)); + my_strdup2(1692, &symname, get_tok_value(xctx->sym[symbol].prop_ptr, "schematic", 0)); } if(!symname[0]) { - my_strdup2(_ALLOC_ID_, &symname, xctx->sym[symbol].name); + my_strdup2(1693, &symname, xctx->sym[symbol].name); } - my_mstrcat(_ALLOC_ID_, &symname_attr, "symname=", get_cell(symname, 0), NULL); - my_mstrcat(_ALLOC_ID_, &symname_attr, " symref=", get_sym_name(inst, 9999, 1, 1), NULL); + my_mstrcat(1694, &symname_attr, "symname=", get_cell(symname, 0), NULL); + my_mstrcat(1695, &symname_attr, " symref=", get_sym_name(inst, 9999, 1, 1), NULL); translated_sym_def = translate3(spice_sym_def, 1, xctx->inst[inst].prop_ptr, templ, symname_attr); @@ -1854,9 +1854,9 @@ static int has_included_subcircuit(int inst, int symbol, char **result) strtolower(symname); tclvareval("has_included_subcircuit {", get_cell(symname, 0), "} {", translated_sym_def, "}", NULL); - my_free(_ALLOC_ID_, &templ); - my_free(_ALLOC_ID_, &symname); - my_free(_ALLOC_ID_, &symname_attr); + my_free(1696, &templ); + my_free(1697, &symname); + my_free(1698, &symname_attr); if(tclresult()[0]) { char *subckt_pin, *pin_save; char *net, *net_save; @@ -1870,7 +1870,7 @@ static int has_included_subcircuit(int inst, int symbol, char **result) Str_hashtable table = {NULL, 0}; str_hash_init(&table, 6247); - my_strdup2(_ALLOC_ID_, &subckt_pinlist, tclresult()); + my_strdup2(1699, &subckt_pinlist, tclresult()); dbg(1, "included subcircuit: pinlist=%s\n", subckt_pinlist); @@ -1884,9 +1884,9 @@ static int has_included_subcircuit(int inst, int symbol, char **result) int pin_mult, net_mult; char *pin_expanded_ptr, *pin_expanded = NULL; char *net_expanded_ptr, *net_expanded = NULL; - my_strdup2(_ALLOC_ID_, &pin_expanded, expandlabel(name, &pin_mult)); + my_strdup2(1700, &pin_expanded, expandlabel(name, &pin_mult)); strtolower(pin_expanded); - my_strdup2(_ALLOC_ID_, &net_expanded, net_name(inst, i, &net_mult, 0, 1)); + my_strdup2(1701, &net_expanded, net_name(inst, i, &net_mult, 0, 1)); net_expanded_ptr = net_expanded; pin_expanded_ptr = pin_expanded; while((pin = my_strtok_r(pin_expanded_ptr, ",", "", 0, &pin_save))) { @@ -1896,8 +1896,8 @@ static int has_included_subcircuit(int inst, int symbol, char **result) pin_expanded_ptr = NULL; net_expanded_ptr = NULL; } - my_free(_ALLOC_ID_, &pin_expanded); - my_free(_ALLOC_ID_, &net_expanded); + my_free(1702, &pin_expanded); + my_free(1703, &net_expanded); } } @@ -1911,7 +1911,7 @@ static int has_included_subcircuit(int inst, int symbol, char **result) net = entry->value; symbol_pins++; dbg(1, "subckt_pin=%s, net=%s\n", subckt_pin, net); - my_mstrcat(_ALLOC_ID_, &tmp_result, "?1", " ", net, " ", NULL); + my_mstrcat(1704, &tmp_result, "?1", " ", net, " ", NULL); } subckt_pinlist_ptr = NULL; } @@ -1920,18 +1920,18 @@ static int has_included_subcircuit(int inst, int symbol, char **result) /* check if they match */ if(instance_pins == symbol_pins) { ret = 1; - my_mstrcat(_ALLOC_ID_, result, tmp_result, NULL); + my_mstrcat(1705, result, tmp_result, NULL); } else { dbg(0, "has_included_subcircuit(): symbol and .subckt pins do not match. Discard .subckt port order\n"); if(has_x) tcleval("alert_ {has_included_subcircuit(): " "symbol and .subckt pins do not match. Discard .subckt port order}"); } - if(tmp_result) my_free(_ALLOC_ID_, &tmp_result); - my_free(_ALLOC_ID_, &subckt_pinlist); + if(tmp_result) my_free(1706, &tmp_result); + my_free(1707, &subckt_pinlist); } } - my_free(_ALLOC_ID_, &spice_sym_def); + my_free(1708, &spice_sym_def); return ret; } @@ -1950,13 +1950,13 @@ void print_spice_subckt_nodes(FILE *fd, int symbol) const char *tclres, *fmt_attr = NULL; fmt_attr = xctx->format ? xctx->format : "format"; - my_strdup(_ALLOC_ID_, &format1, get_tok_value(xctx->sym[symbol].prop_ptr, fmt_attr, 2)); + my_strdup(1709, &format1, get_tok_value(xctx->sym[symbol].prop_ptr, fmt_attr, 2)); if(!xctx->tok_size && strcmp(fmt_attr, "format") ) - my_strdup(_ALLOC_ID_, &format1, get_tok_value(xctx->sym[symbol].prop_ptr, "format", 2)); + my_strdup(1710, &format1, get_tok_value(xctx->sym[symbol].prop_ptr, "format", 2)); dbg(1, "print_spice_subckt(): format1=%s\n", format1); /* can not do this, since @symname is used as a token later in format parser */ - /* my_strdup(_ALLOC_ID_, &format1, + /* my_strdup(1711, &format1, * str_replace(format1, "@symname", get_cell(xctx->sym[symbol].name, 0), '\\')); */ if(format1 && strstr(format1, "tcleval(") == format1) { @@ -1964,12 +1964,12 @@ void print_spice_subckt_nodes(FILE *fd, int symbol) if(!strcmp(tclres, "?\n")) { char *ptr = strrchr(format1 + 8, ')'); *ptr = '\0'; - my_strdup(_ALLOC_ID_, &format, format1 + 8); - } else my_strdup(_ALLOC_ID_, &format, tclres); + my_strdup(1712, &format, format1 + 8); + } else my_strdup(1713, &format, tclres); } else { - my_strdup(_ALLOC_ID_, &format, format1); + my_strdup(1714, &format, format1); } - if(format1) my_free(_ALLOC_ID_, &format1); + if(format1) my_free(1715, &format1); dbg(1, "print_spice_subckt(): format=%s\n", format); if( format==NULL ) { return; /* no format */ @@ -2025,7 +2025,7 @@ void print_spice_subckt_nodes(FILE *fd, int symbol) if(!int_hash_lookup(&table, name, 1, XINSERT_NOREPLACE)) { str_ptr= expandlabel(name, &multip); /* fprintf(fd, "%s ", str_ptr); */ - my_mstrcat(_ALLOC_ID_, &result, str_ptr, " ", NULL); + my_mstrcat(1716, &result, str_ptr, " ", NULL); } } } @@ -2039,7 +2039,7 @@ void print_spice_subckt_nodes(FILE *fd, int symbol) } if(isym[symbol].rect[PINLAYER][pin_number].prop_ptr,"spice_ignore",0), "true")) { str_ptr = get_tok_value(xctx->sym[symbol].rect[PINLAYER][pin_number].prop_ptr,"name",0); /* fprintf(fd, "%s ", expandlabel(str_ptr, &multip)); */ - my_mstrcat(_ALLOC_ID_, &result, expandlabel(str_ptr, &multip), " ", NULL); + my_mstrcat(1718, &result, expandlabel(str_ptr, &multip), " ", NULL); } } - my_free(_ALLOC_ID_, &pin_attr); - my_free(_ALLOC_ID_, &pin_num_or_name); + my_free(1719, &pin_attr); + my_free(1720, &pin_num_or_name); } /* this will print the other @parameters, usually "extra" nodes so they will be in the order @@ -2066,7 +2066,7 @@ void print_spice_subckt_nodes(FILE *fd, int symbol) /* if token not followed by white space it is not an extra node */ if( ( (space || c == '%' || c == '@') && !escape ) ) { /* fprintf(fd, "%s ", token + 1); */ - my_mstrcat(_ALLOC_ID_, &result, token + 1, " ", NULL); + my_mstrcat(1721, &result, token + 1, " ", NULL); } } /* if(c!='%' && c!='@' && c!='\0' ) fputc(c,fd); */ @@ -2079,17 +2079,17 @@ void print_spice_subckt_nodes(FILE *fd, int symbol) } if(c=='\0') { - my_mstrcat(_ALLOC_ID_, &result, "\n", NULL); + my_mstrcat(1722, &result, "\n", NULL); break ; } } if(result) { fprintf(fd, "%s", result); - my_free(_ALLOC_ID_, &result); + my_free(1723, &result); } - my_free(_ALLOC_ID_, &format1); - my_free(_ALLOC_ID_, &format); - my_free(_ALLOC_ID_, &token); + my_free(1724, &format1); + my_free(1725, &format); + my_free(1726, &token); } int print_spice_element(FILE *fd, int inst) @@ -2110,30 +2110,30 @@ int print_spice_element(FILE *fd, int inst) const char *fmt_attr = NULL; size = CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &result, size); + my_realloc(1727, &result, size); result[0] = '\0'; - my_strdup(_ALLOC_ID_, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); - my_strdup(_ALLOC_ID_, &name,xctx->inst[inst].instname); - if (!name) my_strdup(_ALLOC_ID_, &name, get_tok_value(template, "name", 0)); + my_strdup(1728, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); + my_strdup(1729, &name,xctx->inst[inst].instname); + if (!name) my_strdup(1730, &name, get_tok_value(template, "name", 0)); fmt_attr = xctx->format ? xctx->format : "format"; /* allow format string override in instance */ - my_strdup(_ALLOC_ID_, &format, get_tok_value(xctx->inst[inst].prop_ptr, fmt_attr, 2)); + my_strdup(1731, &format, get_tok_value(xctx->inst[inst].prop_ptr, fmt_attr, 2)); /* get netlist format rule from symbol */ if(!xctx->tok_size) - my_strdup(_ALLOC_ID_, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, fmt_attr, 2)); + my_strdup(1732, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, fmt_attr, 2)); /* allow format string override in instance */ if(!xctx->tok_size && strcmp(fmt_attr, "format") ) - my_strdup(_ALLOC_ID_, &format, get_tok_value(xctx->inst[inst].prop_ptr, "format", 2)); + my_strdup(1733, &format, get_tok_value(xctx->inst[inst].prop_ptr, "format", 2)); /* get netlist format rule from symbol */ if(!xctx->tok_size && strcmp(fmt_attr, "format")) - my_strdup(_ALLOC_ID_, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "format", 2)); + my_strdup(1734, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "format", 2)); if ((name==NULL) || (format==NULL)) { - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &format); - my_free(_ALLOC_ID_, &name); - my_free(_ALLOC_ID_, &result); + my_free(1735, &template); + my_free(1736, &format); + my_free(1737, &name); + my_free(1738, &result); return 0; /* do no netlist unwanted insts(no format) */ } no_of_pins= (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]; @@ -2180,7 +2180,7 @@ int print_spice_element(FILE *fd, int inst) size_t tok_val_len; size_t tok_size; dbg(1, "print_spice_element(): token: |%s|\n", token); - my_strdup2(_ALLOC_ID_, &val, get_tok_value(xctx->inst[inst].prop_ptr, token+1, 0)); + my_strdup2(1739, &val, get_tok_value(xctx->inst[inst].prop_ptr, token+1, 0)); tok_size = xctx->tok_size; value = val; if(strchr(value, '@')) { @@ -2200,7 +2200,7 @@ int print_spice_element(FILE *fd, int inst) } tok_val_len = strlen(value); if(!strcmp(token, "@spiceprefix") && value[0]) { - my_realloc(_ALLOC_ID_, &spiceprefixtag, tok_val_len+22); + my_realloc(1740, &spiceprefixtag, tok_val_len+22); my_snprintf(spiceprefixtag, tok_val_len+22, "**** spice_prefix %s\n", value); value = spiceprefixtag; } @@ -2217,7 +2217,7 @@ int print_spice_element(FILE *fd, int inst) } if(!token_exists && token[0] =='%') { /* result_pos += my_snprintf(result + result_pos, tmp, "%s", token + 1); */ - my_mstrcat(_ALLOC_ID_, &result, token + 1, NULL); + my_mstrcat(1741, &result, token + 1, NULL); /* fputs(token + 1, fd); */ } else if (value && value[0]!='\0') { /* instance names (name) and node labels (lab) go thru the expandlabel function. */ @@ -2226,7 +2226,7 @@ int print_spice_element(FILE *fd, int inst) if (!(strcmp(token+1,"name") && strcmp(token+1,"lab")) /* expand name/labels */ && ((lab = expandlabel(value, &itmp)) != NULL)) { /* result_pos += my_snprintf(result + result_pos, tmp, "%s", lab); */ - my_mstrcat(_ALLOC_ID_, &result, lab, NULL); + my_mstrcat(1742, &result, lab, NULL); /* fputs(lab,fd); */ @@ -2234,7 +2234,7 @@ int print_spice_element(FILE *fd, int inst) } else { /* result_pos += my_snprintf(result + result_pos, tmp, "%s", value); */ - my_mstrcat(_ALLOC_ID_, &result, value, NULL); + my_mstrcat(1743, &result, value, NULL); /* fputs(value,fd); */ } } @@ -2242,20 +2242,20 @@ int print_spice_element(FILE *fd, int inst) { const char *s = get_sym_name(inst, 9999, 1, 0); /* result_pos += my_snprintf(result + result_pos, tmp, "%s", s); */ - my_mstrcat(_ALLOC_ID_, &result, s, NULL); + my_mstrcat(1744, &result, s, NULL); } else if (strcmp(token,"@symname")==0) /* of course symname must not be present in attributes */ { const char *s = sanitize(translate(inst, get_sym_name(inst, 0, 0, 0))); /* result_pos += my_snprintf(result + result_pos, tmp, "%s", s); */ - my_mstrcat(_ALLOC_ID_, &result, s, NULL); + my_mstrcat(1745, &result, s, NULL); /* fputs(s,fd); */ } else if (strcmp(token,"@symname_ext")==0) /* of course symname_ext must not be present in attributes */ { const char *s = sanitize(translate(inst, get_sym_name(inst, 0, 1, 0))); /* result_pos += my_snprintf(result + result_pos, tmp, "%s", s); */ - my_mstrcat(_ALLOC_ID_, &result, s, NULL); + my_mstrcat(1746, &result, s, NULL); /* fputs(s,fd); */ } else if(strcmp(token,"@topschname")==0) /* of course topschname must not be present in attributes */ @@ -2263,12 +2263,12 @@ int print_spice_element(FILE *fd, int inst) const char *topsch; topsch = get_trailing_path(xctx->sch[0], 0, 1); /* result_pos += my_snprintf(result + result_pos, tmp, "%s", topsch); */ - my_mstrcat(_ALLOC_ID_, &result, topsch, NULL); + my_mstrcat(1747, &result, topsch, NULL); } else if(strcmp(token,"@schname_ext")==0) /* of course schname must not be present in attributes */ { /* result_pos += my_snprintf(result + result_pos, tmp, "%s", xctx->current_name); */ - my_mstrcat(_ALLOC_ID_, &result, xctx->current_name, NULL); + my_mstrcat(1748, &result, xctx->current_name, NULL); /* fputs(xctx->current_name, fd); */ } else if(strcmp(token,"@savecurrent")==0) @@ -2279,14 +2279,14 @@ int print_spice_element(FILE *fd, int inst) if(!sc[0]) sc = get_tok_value(template, "savecurrent", 0); if(!strboolcmp(sc , "true")) { /* result_pos += my_snprintf(result + result_pos, tmp, "\n.save I( ?1 %s )", instname); */ - my_mstrcat(_ALLOC_ID_, &result, "\n.save I( ?1 ", instname, " )", NULL); + my_mstrcat(1749, &result, "\n.save I( ?1 ", instname, " )", NULL); } } else if(strcmp(token,"@schname")==0) /* of course schname must not be present in attributes */ { const char *schname = get_cell(xctx->current_name, 0); /* result_pos += my_snprintf(result + result_pos, tmp, "%s", schname); */ - my_mstrcat(_ALLOC_ID_, &result, schname, NULL); + my_mstrcat(1750, &result, schname, NULL); } else if(strcmp(token,"@pinlist")==0) /* of course pinlist must not be present in attributes */ /* print multiplicity */ @@ -2304,7 +2304,7 @@ int print_spice_element(FILE *fd, int inst) str_ptr = net_name(inst, i, &multip, 0, 1); /* result_pos += my_snprintf(result + result_pos, tmp, "?%d %s ", multip, str_ptr); */ - my_mstrcat(_ALLOC_ID_, &result, "?", my_itoa(multip), " ", str_ptr, " ", NULL); + my_mstrcat(1751, &result, "?", my_itoa(multip), " ", str_ptr, " ", NULL); } } } @@ -2319,7 +2319,7 @@ int print_spice_element(FILE *fd, int inst) str_ptr = net_name(inst,i, &multip, 0, 1); /* result_pos += my_snprintf(result + result_pos, tmp, "?%d %s ", multip, str_ptr); */ - my_mstrcat(_ALLOC_ID_, &result, "?", my_itoa(multip), " ", str_ptr, " ", NULL); + my_mstrcat(1752, &result, "?", my_itoa(multip), " ", str_ptr, " ", NULL); } break; } @@ -2343,24 +2343,24 @@ int print_spice_element(FILE *fd, int inst) pin_attr_value = get_pin_attr_from_inst(inst, n, pin_attr); /* get pin_attr from instance pin attribute string */ if(!pin_attr_value) { - my_strdup(_ALLOC_ID_, &pin_attr_value, + my_strdup(1753, &pin_attr_value, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->rect[PINLAYER][n].prop_ptr, pin_attr, 0)); } } /* @#n:net_name attribute (n = pin number or name) will translate to net name attached to pin */ if(!pin_attr_value && is_net_name) { prepare_netlist_structs(0); - my_strdup(_ALLOC_ID_, &pin_attr_value, + my_strdup(1754, &pin_attr_value, xctx->inst[inst].node && xctx->inst[inst].node[n] ? xctx->inst[inst].node[n] : "?"); } - if(!pin_attr_value ) my_strdup(_ALLOC_ID_, &pin_attr_value, "--UNDEF--"); + if(!pin_attr_value ) my_strdup(1755, &pin_attr_value, "--UNDEF--"); value = pin_attr_value; /* recognize slotted devices: instname = "U3:3", value = "a:b:c:d" --> value = "c" */ if(value[0] && !strcmp(pin_attr, "pinnumber") ) { char *ss; int slot; char *tmpstr = NULL; - tmpstr = my_malloc(_ALLOC_ID_, sizeof(xctx->inst[inst].instname)); + tmpstr = my_malloc(1756, sizeof(xctx->inst[inst].instname)); if( (ss=strchr(xctx->inst[inst].instname, ':')) ) { sscanf(ss+1, "%s", tmpstr); if(isonlydigit(tmpstr)) { @@ -2368,11 +2368,11 @@ int print_spice_element(FILE *fd, int inst) if(strstr(value,":")) value = find_nth(value, ":", "", 0, slot); } } - my_free(_ALLOC_ID_, &tmpstr); + my_free(1757, &tmpstr); } /* result_pos += my_snprintf(result + result_pos, tmp, "%s", value); */ - my_mstrcat(_ALLOC_ID_, &result, value, NULL); - my_free(_ALLOC_ID_, &pin_attr_value); + my_mstrcat(1758, &result, value, NULL); + my_free(1759, &pin_attr_value); } else if(n>=0 && n < (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]) { const char *si; @@ -2382,27 +2382,27 @@ int print_spice_element(FILE *fd, int inst) str_ptr = net_name(inst,n, &multip, 0, 1); /* result_pos += my_snprintf(result + result_pos, tmp, "?%d %s ", multip, str_ptr); */ - my_mstrcat(_ALLOC_ID_, &result, "?", my_itoa(multip), " ", str_ptr, " ", NULL); + my_mstrcat(1760, &result, "?", my_itoa(multip), " ", str_ptr, " ", NULL); } } - my_free(_ALLOC_ID_, &pin_attr); - my_free(_ALLOC_ID_, &pin_num_or_name); + my_free(1761, &pin_attr); + my_free(1762, &pin_num_or_name); } else if (!strncmp(token,"@tcleval", 8)) { size_t s; char *tclcmd=NULL; const char *res; s = token_pos + strlen(name) + strlen(xctx->inst[inst].name) + 100; - tclcmd = my_malloc(_ALLOC_ID_, s); + tclcmd = my_malloc(1763, s); Tcl_ResetResult(interp); my_snprintf(tclcmd, s, "tclpropeval {%s} {%s} {%s}", token, name, xctx->inst[inst].name); dbg(1, "print_spice_element(): tclpropeval {%s} {%s} {%s}", token, name, xctx->inst[inst].name); res = tcleval(tclcmd); /* result_pos += my_snprintf(result + result_pos, tmp, "%s", res); */ - my_mstrcat(_ALLOC_ID_, &result, res, NULL); + my_mstrcat(1764, &result, res, NULL); /* fprintf(fd, "%s", tclresult()); */ - my_free(_ALLOC_ID_, &tclcmd); + my_free(1765, &tclcmd); } /* /20171029 */ @@ -2412,19 +2412,19 @@ int print_spice_element(FILE *fd, int inst) str[1] = '\0'; /* result_pos += my_snprintf(result + result_pos, 2, "%c", c); */ /* no realloc needed */ - my_mstrcat(_ALLOC_ID_, &result, str, NULL); + my_mstrcat(1766, &result, str, NULL); /* fputc(c,fd); */ } if(c == '@' || c == '%' ) s--; state=TOK_BEGIN; - my_free(_ALLOC_ID_, &val); + my_free(1767, &val); } else if(state==TOK_BEGIN && c!='\0') { char str[2]; str[0] = (unsigned char) c; str[1] = '\0'; /* result_pos += my_snprintf(result + result_pos, 2, "%c", c); */ /* no realloc needed */ - my_mstrcat(_ALLOC_ID_, &result, str, NULL); + my_mstrcat(1768, &result, str, NULL); /* fputc(c,fd); */ } if(c=='\0') @@ -2433,7 +2433,7 @@ int print_spice_element(FILE *fd, int inst) str[0] = '\n'; str[1] = '\0'; /* result_pos += my_snprintf(result + result_pos, 2, "%c", '\n'); */ /* no realloc needed */ - my_mstrcat(_ALLOC_ID_, &result, str, NULL); + my_mstrcat(1769, &result, str, NULL); /* fputc('\n',fd); */ break; } @@ -2446,7 +2446,7 @@ int print_spice_element(FILE *fd, int inst) /* do one level of substitutions to resolve @params and equations*/ if(result && strstr(result, "tcleval(")== result) { dbg(1, "print_spice_element(): before translate() result=%s\n", result); - my_strdup(_ALLOC_ID_, &result, translate(inst, result)); + my_strdup(1770, &result, translate(inst, result)); dbg(1, "print_spice_element(): after translate() result=%s\n", result); } @@ -2464,19 +2464,19 @@ int print_spice_element(FILE *fd, int inst) * c++; * if(!*c) break; * } - * my_strdup2(_ALLOC_ID_, &result, translate(inst, result+5)); + * my_strdup2(1771, &result, translate(inst, result+5)); * } #endif if(result) fprintf(fd, "%s", result); - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &format); - my_free(_ALLOC_ID_, &name); - my_free(_ALLOC_ID_, &token); - my_free(_ALLOC_ID_, &result); - my_free(_ALLOC_ID_, &spiceprefixtag); - /* my_free(_ALLOC_ID_, &translatedvalue); */ + my_free(1772, &template); + my_free(1773, &format); + my_free(1774, &name); + my_free(1775, &token); + my_free(1776, &result); + my_free(1777, &spiceprefixtag); + /* my_free(1778, &translatedvalue); */ return 1; } @@ -2501,24 +2501,24 @@ void print_tedax_element(FILE *fd, int inst) int no_of_pins=0; int subcircuit = 0; - my_strdup(_ALLOC_ID_, &extra, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr,"extra",0)); - my_strdup(_ALLOC_ID_, &extra_pinnumber, get_tok_value(xctx->inst[inst].prop_ptr,"extra_pinnumber",0)); - if(!extra_pinnumber) my_strdup(_ALLOC_ID_, &extra_pinnumber, + my_strdup(1779, &extra, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr,"extra",0)); + my_strdup(1780, &extra_pinnumber, get_tok_value(xctx->inst[inst].prop_ptr,"extra_pinnumber",0)); + if(!extra_pinnumber) my_strdup(1781, &extra_pinnumber, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr,"extra_pinnumber",0)); - my_strdup(_ALLOC_ID_, &template, + my_strdup(1782, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); - my_strdup(_ALLOC_ID_, &numslots, get_tok_value(xctx->inst[inst].prop_ptr,"numslots",0)); - if(!numslots) my_strdup(_ALLOC_ID_, &numslots, get_tok_value(template,"numslots",0)); - if(!numslots) my_strdup(_ALLOC_ID_, &numslots, "1"); + my_strdup(1783, &numslots, get_tok_value(xctx->inst[inst].prop_ptr,"numslots",0)); + if(!numslots) my_strdup(1784, &numslots, get_tok_value(template,"numslots",0)); + if(!numslots) my_strdup(1785, &numslots, "1"); - my_strdup(_ALLOC_ID_, &name,xctx->inst[inst].instname); + my_strdup(1786, &name,xctx->inst[inst].instname); /* my_strdup(xxx, &name,get_tok_value(xctx->inst[inst].prop_ptr,"name",0)); */ - if(!name) my_strdup(_ALLOC_ID_, &name, get_tok_value(template, "name", 0)); + if(!name) my_strdup(1787, &name, get_tok_value(template, "name", 0)); /* allow format string override in instance */ - my_strdup(_ALLOC_ID_, &format, get_tok_value(xctx->inst[inst].prop_ptr,"tedax_format",2)); + my_strdup(1788, &format, get_tok_value(xctx->inst[inst].prop_ptr,"tedax_format",2)); if(!format || !format[0]) - my_strdup(_ALLOC_ID_, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr,"tedax_format",2)); + my_strdup(1789, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr,"tedax_format",2)); no_of_pins= (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]; if( !format && !strcmp((xctx->inst[inst].ptr + xctx->sym)->type, "subcircuit") ) { @@ -2536,15 +2536,15 @@ void print_tedax_element(FILE *fd, int inst) sanitize(translate(inst, get_sym_name(inst, 0, 0, 0))), xctx->inst[inst].instname); int_hash_init(&table, 37); for(i=0;iinst[inst].ptr + xctx->sym)->rect[PINLAYER][i].prop_ptr,"name",0)); - my_strdup2(_ALLOC_ID_, &pin, expandlabel(pinname, &pin_mult)); + my_strdup2(1792, &pin, expandlabel(pinname, &pin_mult)); if(!int_hash_lookup(&table, pinname, 1, XINSERT_NOREPLACE)) { dbg(1, "#net=%s pinname=%s pin=%s net_mult=%d pin_mult=%d\n", net, pinname, pin, net_mult, pin_mult); for(n = 0; n < net_mult; ++n) { - my_strdup(_ALLOC_ID_, &netbit, find_nth(net, ",", "", 0, n+1)); - my_strdup(_ALLOC_ID_, &pinbit, find_nth(pin, ",", "", 0, n+1)); + my_strdup(1793, &netbit, find_nth(net, ",", "", 0, n+1)); + my_strdup(1794, &pinbit, find_nth(pin, ",", "", 0, n+1)); fprintf(fd, "__map__ %s -> %s\n", pinbit ? pinbit : "__UNCONNECTED_PIN__", netbit ? netbit : "__UNCONNECTED_PIN__"); @@ -2552,21 +2552,21 @@ void print_tedax_element(FILE *fd, int inst) } } int_hash_free(&table); - my_free(_ALLOC_ID_, &net); - my_free(_ALLOC_ID_, &pin); - my_free(_ALLOC_ID_, &pinname); - my_free(_ALLOC_ID_, &pinbit); - my_free(_ALLOC_ID_, &netbit); + my_free(1795, &net); + my_free(1796, &pin); + my_free(1797, &pinname); + my_free(1798, &pinbit); + my_free(1799, &netbit); fprintf(fd, "\n"); } if(name==NULL || !format || !format[0]) { - my_free(_ALLOC_ID_, &extra); - my_free(_ALLOC_ID_, &extra_pinnumber); - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &numslots); - my_free(_ALLOC_ID_, &format); - my_free(_ALLOC_ID_, &name); + my_free(1800, &extra); + my_free(1801, &extra_pinnumber); + my_free(1802, &template); + my_free(1803, &numslots); + my_free(1804, &format); + my_free(1805, &name); return; } @@ -2576,10 +2576,10 @@ void print_tedax_element(FILE *fd, int inst) char *pinnumber; pinnumber = get_pin_attr_from_inst(inst, i, "pinnumber"); if(!pinnumber) { - my_strdup2(_ALLOC_ID_, &pinnumber, + my_strdup2(1806, &pinnumber, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->rect[PINLAYER][i].prop_ptr,"pinnumber",0)); } - if(!xctx->tok_size) my_strdup(_ALLOC_ID_, &pinnumber, "--UNDEF--"); + if(!xctx->tok_size) my_strdup(1807, &pinnumber, "--UNDEF--"); tmp = net_name(inst,i, &multip, 0, 1); if(tmp && !strstr(tmp, "__UNCONNECTED_PIN__")) { fprintf(fd, "conn %s %s %s %s %d\n", @@ -2589,7 +2589,7 @@ void print_tedax_element(FILE *fd, int inst) pinnumber, i+1); } - my_free(_ALLOC_ID_, &pinnumber); + my_free(1808, &pinnumber); } if(extra){ @@ -2744,24 +2744,24 @@ void print_tedax_element(FILE *fd, int inst) pin_attr_value = get_pin_attr_from_inst(inst, n, pin_attr); /* get pin_attr from instance pin attribute string */ if(!pin_attr_value) { - my_strdup(_ALLOC_ID_, &pin_attr_value, + my_strdup(1809, &pin_attr_value, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->rect[PINLAYER][n].prop_ptr, pin_attr, 0)); } } /* @#n:net_name attribute (n = pin number or name) will translate to net name attached to pin */ if(!pin_attr_value && is_net_name) { prepare_netlist_structs(0); - my_strdup(_ALLOC_ID_, &pin_attr_value, + my_strdup(1810, &pin_attr_value, xctx->inst[inst].node && xctx->inst[inst].node[n] ? xctx->inst[inst].node[n] : "?"); } - if(!pin_attr_value ) my_strdup(_ALLOC_ID_, &pin_attr_value, "--UNDEF--"); + if(!pin_attr_value ) my_strdup(1811, &pin_attr_value, "--UNDEF--"); value = pin_attr_value; /* recognize slotted devices: instname = "U3:3", value = "a:b:c:d" --> value = "c" */ if(value[0] && !strcmp(pin_attr, "pinnumber")) { char *ss; int slot; char *tmpstr = NULL; - tmpstr = my_malloc(_ALLOC_ID_, sizeof(xctx->inst[inst].instname)); + tmpstr = my_malloc(1812, sizeof(xctx->inst[inst].instname)); if( (ss=strchr(xctx->inst[inst].instname, ':')) ) { sscanf(ss+1, "%s", tmpstr); if(isonlydigit(tmpstr)) { @@ -2769,10 +2769,10 @@ void print_tedax_element(FILE *fd, int inst) if(strstr(value,":")) value = find_nth(value, ":", "", 0, slot); } } - my_free(_ALLOC_ID_, &tmpstr); + my_free(1813, &tmpstr); } fprintf(fd, "%s", value); - my_free(_ALLOC_ID_, &pin_attr_value); + my_free(1814, &pin_attr_value); } else if(n>=0 && n < (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]) { const char *si; @@ -2783,20 +2783,20 @@ void print_tedax_element(FILE *fd, int inst) fprintf(fd, "%s", str_ptr); } } - my_free(_ALLOC_ID_, &pin_attr); - my_free(_ALLOC_ID_, &pin_num_or_name); + my_free(1815, &pin_attr); + my_free(1816, &pin_num_or_name); } else if(!strncmp(token,"@tcleval", 8)) { /* char tclcmd[strlen(token)+100] ; */ size_t s; char *tclcmd=NULL; s = token_pos + strlen(name) + strlen(xctx->inst[inst].name) + 100; - tclcmd = my_malloc(_ALLOC_ID_, s); + tclcmd = my_malloc(1817, s); Tcl_ResetResult(interp); my_snprintf(tclcmd, s, "tclpropeval {%s} {%s} {%s}", token, name, xctx->inst[inst].name); tcleval(tclcmd); fprintf(fd, "%s", tclresult()); - my_free(_ALLOC_ID_, &tclcmd); + my_free(1818, &tclcmd); /* fprintf(errfp, "%s\n", tclcmd); */ } /* /20171029 */ @@ -2814,13 +2814,13 @@ void print_tedax_element(FILE *fd, int inst) } } /* if(format) */ if(!subcircuit) fprintf(fd,"end_inst\n"); - my_free(_ALLOC_ID_, &extra); - my_free(_ALLOC_ID_, &extra_pinnumber); - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &numslots); - my_free(_ALLOC_ID_, &format); - my_free(_ALLOC_ID_, &name); - my_free(_ALLOC_ID_, &token); + my_free(1819, &extra); + my_free(1820, &extra_pinnumber); + my_free(1821, &template); + my_free(1822, &numslots); + my_free(1823, &format); + my_free(1824, &name); + my_free(1825, &token); } /* print verilog element if verilog_format is specified */ @@ -2840,28 +2840,28 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level const char *fmt_attr = NULL; char *result = NULL; - my_strdup(_ALLOC_ID_, &template, + my_strdup(1826, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); - my_strdup(_ALLOC_ID_, &name,xctx->inst[inst].instname); - if(!name) my_strdup(_ALLOC_ID_, &name, get_tok_value(template, "name", 0)); + my_strdup(1827, &name,xctx->inst[inst].instname); + if(!name) my_strdup(1828, &name, get_tok_value(template, "name", 0)); fmt_attr = xctx->format ? xctx->format : "verilog_format"; /* allow format string override in instance */ - my_strdup(_ALLOC_ID_, &format, get_tok_value(xctx->inst[inst].prop_ptr, fmt_attr, 2)); + my_strdup(1829, &format, get_tok_value(xctx->inst[inst].prop_ptr, fmt_attr, 2)); /* get netlist format rule from symbol */ if(!xctx->tok_size) - my_strdup(_ALLOC_ID_, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, fmt_attr, 2)); + my_strdup(1830, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, fmt_attr, 2)); /* allow format string override in instance */ if(!xctx->tok_size && strcmp(fmt_attr, "verilog_format") ) - my_strdup(_ALLOC_ID_, &format, get_tok_value(xctx->inst[inst].prop_ptr, "verilog_format", 2)); + my_strdup(1831, &format, get_tok_value(xctx->inst[inst].prop_ptr, "verilog_format", 2)); /* get netlist format rule from symbol */ if(!xctx->tok_size && strcmp(fmt_attr, "verilog_format")) - my_strdup(_ALLOC_ID_, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "verilog_format", 2)); + my_strdup(1832, &format, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "verilog_format", 2)); if((name==NULL) || (format==NULL) ) { - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &name); - my_free(_ALLOC_ID_, &format); + my_free(1833, &template); + my_free(1834, &name); + my_free(1835, &format); return; /*do no netlist unwanted insts(no format) */ } no_of_pins= (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]; @@ -2906,56 +2906,56 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level if(!xctx->tok_size) value=get_tok_value(template, token+1, 0); if(!xctx->tok_size && token[0] =='%') { - my_mstrcat(_ALLOC_ID_, &result, token + 1, NULL); + my_mstrcat(1836, &result, token + 1, NULL); } else if(value && value[0]!='\0') { /* instance names (name) and node labels (lab) go thru the expandlabel function. */ /*if something else must be parsed, put an if here! */ if(!(strcmp(token+1,"name"))) { if( (lab=expandlabel(value, &tmp)) != NULL) - my_mstrcat(_ALLOC_ID_, &result, "----name(", lab, ")", NULL); + my_mstrcat(1837, &result, "----name(", lab, ")", NULL); else - my_mstrcat(_ALLOC_ID_, &result, value, NULL); + my_mstrcat(1838, &result, value, NULL); } else if(!(strcmp(token+1,"lab"))) { if( (lab=expandlabel(value, &tmp)) != NULL) - my_mstrcat(_ALLOC_ID_, &result, "----pin(", lab, ")", NULL); + my_mstrcat(1839, &result, "----pin(", lab, ")", NULL); else - my_mstrcat(_ALLOC_ID_, &result, value, NULL); + my_mstrcat(1840, &result, value, NULL); } - else my_mstrcat(_ALLOC_ID_, &result, value, NULL); + else my_mstrcat(1841, &result, value, NULL); } else if(strcmp(token,"@symref")==0) { const char *s = get_sym_name(inst, 9999, 1, 0); - my_mstrcat(_ALLOC_ID_, &result, s, NULL); + my_mstrcat(1842, &result, s, NULL); } else if(strcmp(token,"@symname")==0) /* of course symname must not be present */ /* in hash table */ { const char *s = sanitize(translate(inst, get_sym_name(inst, 0, 0, 0))); - my_mstrcat(_ALLOC_ID_, &result, s, NULL); + my_mstrcat(1843, &result, s, NULL); } else if (strcmp(token,"@symname_ext")==0) { const char *s = sanitize(translate(inst, get_sym_name(inst, 0, 1, 0))); - my_mstrcat(_ALLOC_ID_, &result, s, NULL); + my_mstrcat(1844, &result, s, NULL); } else if(strcmp(token,"@schname_ext")==0) /* of course schname must not be present */ /* in hash table */ { - my_mstrcat(_ALLOC_ID_, &result, xctx->current_name, NULL); + my_mstrcat(1845, &result, xctx->current_name, NULL); } else if(strcmp(token,"@schname")==0) /* of course schname must not be present */ /* in hash table */ { - my_mstrcat(_ALLOC_ID_, &result, get_cell(xctx->current_name, 0), NULL); + my_mstrcat(1846, &result, get_cell(xctx->current_name, 0), NULL); } else if(strcmp(token,"@topschname")==0) /* of course topschname must not be present in attributes */ { const char *topsch; topsch = get_trailing_path(xctx->sch[0], 0, 1); - my_mstrcat(_ALLOC_ID_, &result, topsch, NULL); + my_mstrcat(1847, &result, topsch, NULL); } else if(strcmp(token,"@pinlist")==0) /* of course pinlist must not be present */ /* in hash table. print multiplicity */ @@ -2967,9 +2967,9 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level if(strboolcmp(get_tok_value(xctx->sym[symbol].rect[PINLAYER][i].prop_ptr,"verilog_ignore",0), "true")) { const char *name = get_tok_value(xctx->sym[symbol].rect[PINLAYER][i].prop_ptr,"name",0); if(!int_hash_lookup(&table, name, 1, XINSERT_NOREPLACE)) { - if(!first) my_mstrcat(_ALLOC_ID_, &result, " , ", NULL); + if(!first) my_mstrcat(1848, &result, " , ", NULL); str_ptr = net_name(inst,i, &multip, 0, 1); - my_mstrcat(_ALLOC_ID_, &result, "----pin(", str_ptr, ") ", NULL); + my_mstrcat(1849, &result, "----pin(", str_ptr, ") ", NULL); first = 0; } } @@ -2981,7 +2981,7 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level char *prop = (xctx->inst[inst].ptr + xctx->sym)->rect[PINLAYER][i].prop_ptr; if(!strcmp( get_tok_value(prop,"name",0), token+2)) { str_ptr = net_name(inst,i, &multip, 0, 1); - my_mstrcat(_ALLOC_ID_, &result, "----pin(", str_ptr, ") ", NULL); + my_mstrcat(1850, &result, "----pin(", str_ptr, ") ", NULL); break; } } @@ -3005,24 +3005,24 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level pin_attr_value = get_pin_attr_from_inst(inst, n, pin_attr); /* get pin_attr from instance pin attribute string */ if(!pin_attr_value) { - my_strdup(_ALLOC_ID_, &pin_attr_value, + my_strdup(1851, &pin_attr_value, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->rect[PINLAYER][n].prop_ptr, pin_attr, 0)); } } /* @#n:net_name attribute (n = pin number or name) will translate to net name attached to pin */ if(!pin_attr_value && is_net_name) { prepare_netlist_structs(0); - my_strdup(_ALLOC_ID_, &pin_attr_value, + my_strdup(1852, &pin_attr_value, xctx->inst[inst].node && xctx->inst[inst].node[n] ? xctx->inst[inst].node[n] : "?"); } - if(!pin_attr_value ) my_strdup(_ALLOC_ID_, &pin_attr_value, "--UNDEF--"); + if(!pin_attr_value ) my_strdup(1853, &pin_attr_value, "--UNDEF--"); value = pin_attr_value; /* recognize slotted devices: instname = "U3:3", value = "a:b:c:d" --> value = "c" */ if(value[0] && !strcmp(pin_attr, "pinnumber") ) { char *ss; int slot; char *tmpstr = NULL; - tmpstr = my_malloc(_ALLOC_ID_, sizeof(xctx->inst[inst].instname)); + tmpstr = my_malloc(1854, sizeof(xctx->inst[inst].instname)); if( (ss=strchr(xctx->inst[inst].instname, ':')) ) { sscanf(ss+1, "%s", tmpstr); if(isonlydigit(tmpstr)) { @@ -3030,10 +3030,10 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level if(strstr(value,":")) value = find_nth(value, ":", "", 0, slot); } } - my_free(_ALLOC_ID_, &tmpstr); + my_free(1855, &tmpstr); } - my_mstrcat(_ALLOC_ID_, &result, value, NULL); - my_free(_ALLOC_ID_, &pin_attr_value); + my_mstrcat(1856, &result, value, NULL); + my_free(1857, &pin_attr_value); } else if(n>=0 && n < (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]) { const char *si; @@ -3041,11 +3041,11 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level si = get_tok_value(prop, "verilog_ignore",0); if(strboolcmp(si, "true")) { str_ptr = net_name(inst,n, &multip, 0, 1); - my_mstrcat(_ALLOC_ID_, &result, "----pin(", str_ptr, ") ", NULL); + my_mstrcat(1858, &result, "----pin(", str_ptr, ") ", NULL); } } - my_free(_ALLOC_ID_, &pin_attr); - my_free(_ALLOC_ID_, &pin_num_or_name); + my_free(1859, &pin_attr); + my_free(1860, &pin_num_or_name); } else if(!strncmp(token,"@tcleval", 8)) { @@ -3053,18 +3053,18 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level size_t s; char *tclcmd=NULL; s = token_pos + strlen(name) + strlen(xctx->inst[inst].name) + 100; - tclcmd = my_malloc(_ALLOC_ID_, s); + tclcmd = my_malloc(1861, s); Tcl_ResetResult(interp); my_snprintf(tclcmd, s, "tclpropeval {%s} {%s} {%s}", token, name, xctx->inst[inst].name); tcleval(tclcmd); - my_mstrcat(_ALLOC_ID_, &result, tclresult(), NULL); - my_free(_ALLOC_ID_, &tclcmd); + my_mstrcat(1862, &result, tclresult(), NULL); + my_free(1863, &tclcmd); } if(c!='%' && c!='@' && c!='\0') { char str[2]; str[0] = (unsigned char) c; str[1] = '\0'; - my_mstrcat(_ALLOC_ID_, &result, str, NULL); + my_mstrcat(1864, &result, str, NULL); } if(c == '@' || c == '%') s--; state=TOK_BEGIN; @@ -3073,14 +3073,14 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level char str[2]; str[0] = (unsigned char) c; str[1] = '\0'; - my_mstrcat(_ALLOC_ID_, &result, str, NULL); + my_mstrcat(1865, &result, str, NULL); } if(c=='\0') { /* do one level of substitutions to resolve @params and equations*/ if(result && strstr(result, "tcleval(")== result) { dbg(1, "print_verilog_primitive(): before translate() result=%s\n", result); - my_strdup(_ALLOC_ID_, &result, translate(inst, result)); + my_strdup(1866, &result, translate(inst, result)); dbg(1, "print_verilog_primitive(): after translate() result=%s\n", result); } if(result) fprintf(fd, "%s", result); @@ -3089,11 +3089,11 @@ static void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level break ; } } - my_free(_ALLOC_ID_, &result); - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &format); - my_free(_ALLOC_ID_, &name); - my_free(_ALLOC_ID_, &token); + my_free(1867, &result); + my_free(1868, &template); + my_free(1869, &format); + my_free(1870, &name); + my_free(1871, &token); } /* verilog module instantiation: @@ -3148,35 +3148,35 @@ void print_verilog_element(FILE *fd, int inst) return; } - my_strdup(_ALLOC_ID_, &name,xctx->inst[inst].instname); - if(!name) my_strdup(_ALLOC_ID_, &name, get_tok_value(template, "name", 0)); + my_strdup(1872, &name,xctx->inst[inst].instname); + if(!name) my_strdup(1873, &name, get_tok_value(template, "name", 0)); if(name==NULL) { - my_free(_ALLOC_ID_, &name); + my_free(1874, &name); return; } /* verilog_extra is the list of additional nodes passed as attributes */ - my_strdup(_ALLOC_ID_, &v_extra, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "verilog_extra", 0)); + my_strdup(1875, &v_extra, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "verilog_extra", 0)); /* extra is the list of attributes NOT to consider as instance parameters */ - my_strdup(_ALLOC_ID_, &extra, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "extra", 0)); - my_strdup(_ALLOC_ID_, &verilogprefix, + my_strdup(1876, &extra, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "extra", 0)); + my_strdup(1877, &verilogprefix, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "verilogprefix", 0)); if(verilogprefix) { - my_strdup(_ALLOC_ID_, &symname, verilogprefix); - my_strcat(_ALLOC_ID_, &symname, get_sym_name(inst, 0, 0, 0)); + my_strdup(1878, &symname, verilogprefix); + my_strcat(1879, &symname, get_sym_name(inst, 0, 0, 0)); } else { - my_strdup(_ALLOC_ID_, &symname, get_sym_name(inst, 0, 0, 0)); + my_strdup(1880, &symname, get_sym_name(inst, 0, 0, 0)); } - my_free(_ALLOC_ID_, &verilogprefix); - my_strdup(_ALLOC_ID_, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); + my_free(1881, &verilogprefix); + my_strdup(1882, &template, (xctx->inst[inst].ptr + xctx->sym)->templ); no_of_pins= (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]; /* 20080915 use generic_type property to decide if some properties are strings, see later */ - my_strdup(_ALLOC_ID_, &generic_type, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr,"generic_type",0)); + my_strdup(1883, &generic_type, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr,"generic_type",0)); s=xctx->inst[inst].prop_ptr; /* print instance subckt */ dbg(2, "print_verilog_element(): printing inst name & subcircuit name\n"); fprintf(fd, "%s\n", sanitize(symname)); - my_free(_ALLOC_ID_, &symname); + my_free(1884, &symname); /* -------- print generics passed as properties */ tmp=0; while(1) @@ -3288,13 +3288,13 @@ void print_verilog_element(FILE *fd, int inst) fprintf(fd, "\n);\n\n"); dbg(2, "print_verilog_element(): ------- end ------ \n"); - my_free(_ALLOC_ID_, &name); - my_free(_ALLOC_ID_, &generic_type); - my_free(_ALLOC_ID_, &template); - my_free(_ALLOC_ID_, &value); - my_free(_ALLOC_ID_, &token); - my_free(_ALLOC_ID_, &extra); - my_free(_ALLOC_ID_, &v_extra); + my_free(1885, &name); + my_free(1886, &generic_type); + my_free(1887, &template); + my_free(1888, &value); + my_free(1889, &token); + my_free(1890, &extra); + my_free(1891, &v_extra); } @@ -3318,14 +3318,14 @@ const char *net_name(int i, int j, int *multip, int hash_prefix_unnamed_net, int } if(xctx->inst[i].node && xctx->inst[i].node[j] == NULL) { - my_strdup(_ALLOC_ID_, &pinname, get_tok_value( sym->rect[PINLAYER][j].prop_ptr,"name",0)); + my_strdup(1892, &pinname, get_tok_value( sym->rect[PINLAYER][j].prop_ptr,"name",0)); /* before reporting unconnected pin try to locate duplicated pin and use it if found */ for(k = 0; k < no_of_pins; ++k) { const char *duplicated_pinname; if(k == j) continue; duplicated_pinname = get_tok_value( sym->rect[PINLAYER][k].prop_ptr,"name",0); if(!strcmp(duplicated_pinname , pinname)) { - my_strdup(_ALLOC_ID_, &pinname, duplicated_pinname); + my_strdup(1893, &pinname, duplicated_pinname); j = k; break; } @@ -3335,7 +3335,7 @@ const char *net_name(int i, int j, int *multip, int hash_prefix_unnamed_net, int if(xctx->inst[i].node && xctx->inst[i].node[j] == NULL) { expandlabel(pinname, multip); - if(pinname) my_free(_ALLOC_ID_, &pinname); + if(pinname) my_free(1894, &pinname); if(erc) { my_snprintf(errstr, S(errstr), "Warning: unconnected pin, Inst idx: %d, Pin idx: %d Inst:%s\n", i, j, xctx->inst[i].instname ) ; @@ -3352,7 +3352,7 @@ const char *net_name(int i, int j, int *multip, int hash_prefix_unnamed_net, int return expandlabel(unconn, &tmp); } else { /* xctx->inst[i].node[j] not NULL */ - if(pinname) my_free(_ALLOC_ID_, &pinname); + if(pinname) my_free(1895, &pinname); if((xctx->inst[i].node[j])[0] == '#') /* unnamed net */ { /* get unnamed node multiplicity ( minimum multip found in circuit) */ @@ -3415,7 +3415,7 @@ char *trim_chars(const char *str, const char *sep) char *last; if(str == NULL) { - my_free(_ALLOC_ID_, &result); + my_free(1896, &result); result_size = 0; return NULL; } @@ -3423,7 +3423,7 @@ char *trim_chars(const char *str, const char *sep) /* allocate storage for result */ if(len > result_size) { result_size = len + CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &result, result_size); + my_realloc(1897, &result, result_size); } memcpy(result, str, len); if(*str == '\0')return result; @@ -3461,7 +3461,7 @@ char *find_nth(const char *str, const char *sep, const char *quote, int keep_quo /* clean up static data */ if(!str) { - my_free(_ALLOC_ID_, &result); + my_free(1898, &result); result_size = 0; return NULL; } @@ -3469,7 +3469,7 @@ char *find_nth(const char *str, const char *sep, const char *quote, int keep_quo len = strlen(str) + 1; if(len > result_size) { result_size = len + CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &result, result_size); + my_realloc(1899, &result, result_size); } result_pos = 0; @@ -3525,7 +3525,7 @@ static char *get_pin_attr(const char *token, int inst, int engineering) pin_attr_value = get_pin_attr_from_inst(inst, n, pin_attr); /* get pin_attr from instance pin attribute string */ if(!pin_attr_value) { - my_strdup(_ALLOC_ID_, &pin_attr_value, + my_strdup(1900, &pin_attr_value, get_tok_value((xctx->inst[inst].ptr + xctx->sym)->rect[PINLAYER][n].prop_ptr, pin_attr, 0)); } } @@ -3533,7 +3533,7 @@ static char *get_pin_attr(const char *token, int inst, int engineering) * if 'net_name=true' attribute is set in instance or symbol */ if(!pin_attr_value && is_net_name) { prepare_netlist_structs(0); - my_strdup2(_ALLOC_ID_, &pin_attr_value, + my_strdup2(1901, &pin_attr_value, xctx->inst[inst].node && xctx->inst[inst].node[n] ? xctx->inst[inst].node[n] : ""); } else if(!pin_attr_value && !is_net_name && !strcmp(pin_attr, "spice_get_voltage")) @@ -3550,15 +3550,15 @@ static char *get_pin_attr(const char *token, int inst, int engineering) const char *valstr; if(path) { prepare_netlist_structs(0); - my_strdup2(_ALLOC_ID_, &net, net_name(inst, n, &multip, 0, 0)); + my_strdup2(1902, &net, net_name(inst, n, &multip, 0, 0)); if(multip == 1 && net && net[0]) { char *rn; dbg(1, "get_pin_attr() spice_get_voltage: inst=%d\n", inst); dbg(1, " net=%s\n", net); rn = resolved_net(net); if(rn) { - my_strdup2(_ALLOC_ID_, &fqnet, rn); - if(rn) my_free(_ALLOC_ID_, &rn); + my_strdup2(1903, &fqnet, rn); + if(rn) my_free(1904, &rn); strtolower(fqnet); dbg(1, "get_pin_attr() @spice_get_voltage: fqnet=%s start_level=%d\n", fqnet, start_level); idx = get_raw_index(fqnet, NULL); @@ -3571,12 +3571,12 @@ static char *get_pin_attr(const char *token, int inst, int engineering) } else { valstr = engineering? dtoa_eng(val) : dtoa(val); } - my_strdup2(_ALLOC_ID_, &pin_attr_value, valstr); + my_strdup2(1905, &pin_attr_value, valstr); dbg(1, "inst %d, net=%s, fqnet=%s idx=%d valstr=%s\n", inst, net, fqnet, idx, valstr); - if(fqnet) my_free(_ALLOC_ID_, &fqnet); + if(fqnet) my_free(1906, &fqnet); } } - if(net) my_free(_ALLOC_ID_, &net); + if(net) my_free(1907, &net); } } } @@ -3589,28 +3589,28 @@ static char *get_pin_attr(const char *token, int inst, int engineering) if(xctx->inst[inst].node && xctx->inst[inst].node[n]) { rn = resolved_net(xctx->inst[inst].node[n]); } - my_strdup2(_ALLOC_ID_, &pin_attr_value, rn ? rn : ""); - if(rn) my_free(_ALLOC_ID_, &rn); + my_strdup2(1908, &pin_attr_value, rn ? rn : ""); + if(rn) my_free(1909, &rn); } - if(!pin_attr_value ) my_strdup2(_ALLOC_ID_, &pin_attr_value, ""); - my_strdup2(_ALLOC_ID_, &value, pin_attr_value); + if(!pin_attr_value ) my_strdup2(1910, &pin_attr_value, ""); + my_strdup2(1911, &value, pin_attr_value); /* recognize slotted devices: instname = "U3:3", value = "a:b:c:d" --> value = "c" */ if(pin_attr_value[0] && !strcmp(pin_attr, "pinnumber") ) { char *ss; int slot; char *tmpstr = NULL; if( xctx->inst[inst].instname && (ss=strchr(xctx->inst[inst].instname, ':')) ) { - tmpstr = my_malloc(_ALLOC_ID_, sizeof(xctx->inst[inst].instname)); + tmpstr = my_malloc(1912, sizeof(xctx->inst[inst].instname)); sscanf(ss+1, "%s", tmpstr); if(isonlydigit(tmpstr)) { slot = atoi(tmpstr); - if(strstr(value,":")) my_strdup2(_ALLOC_ID_, &value, find_nth(value, ":", "", 0, slot)); + if(strstr(value,":")) my_strdup2(1913, &value, find_nth(value, ":", "", 0, slot)); } - my_free(_ALLOC_ID_, &tmpstr); + my_free(1914, &tmpstr); } } - my_free(_ALLOC_ID_, &pin_attr_value); + my_free(1915, &pin_attr_value); } /* just @#pin was given */ else if(n>=0 && n < (xctx->inst[inst].ptr + xctx->sym)->rects[PINLAYER]) { @@ -3621,11 +3621,11 @@ static char *get_pin_attr(const char *token, int inst, int engineering) tmp = strlen(str_ptr) +100 ; /* always make room for some extra chars * so 1-char writes to result do not need reallocs */ - value = my_malloc(_ALLOC_ID_, tmp); + value = my_malloc(1916, tmp); my_snprintf(value, tmp, "?%d %s ", multip, str_ptr); } - my_free(_ALLOC_ID_, &pin_attr); - my_free(_ALLOC_ID_, &pin_num_or_name); + my_free(1917, &pin_attr); + my_free(1918, &pin_num_or_name); dbg(1, "get_pin_attr(): returning value=%s\n", value); return value; } @@ -3660,8 +3660,8 @@ const char *translate(int inst, const char* s) sp_prefix = tclgetboolvar("spiceprefix"); if(!s || !xctx || !xctx->inst) { - my_free(_ALLOC_ID_, &result); - my_free(_ALLOC_ID_, &translated_tok); + my_free(1919, &result); + my_free(1920, &translated_tok); return empty; } if(inst >= xctx->instances) { @@ -3675,7 +3675,7 @@ const char *translate(int inst, const char* s) level = xctx->currsch; lcc = xctx->hier_attr; size=CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &result,size); + my_realloc(1921, &result,size); result[0]='\0'; dbg(1, "translate(): substituting props in <%s>, instance <%s>\n", s ? s : "NULL" , instname); @@ -3759,7 +3759,7 @@ const char *translate(int inst, const char* s) STR_ALLOC(&result, tmp + result_pos, &size); memcpy(result+result_pos, value, tmp+1); result_pos+=tmp; - my_free(_ALLOC_ID_, &value); + my_free(1922, &value); } } else if(inst >= 0 && strcmp(token,"@sch_last_modified")==0 && xctx->inst[inst].ptr >= 0) { @@ -3833,10 +3833,10 @@ const char *translate(int inst, const char* s) if(path) { prepare_netlist_structs(0); if(xctx->inst[inst].lab) { - my_strdup2(_ALLOC_ID_, &net, expandlabel(xctx->inst[inst].lab, &multip)); + my_strdup2(1923, &net, expandlabel(xctx->inst[inst].lab, &multip)); } if(net == NULL || net[0] == '\0') { - my_strdup2(_ALLOC_ID_, &net, net_name(inst, 0, &multip, 0, 0)); + my_strdup2(1924, &net, net_name(inst, 0, &multip, 0, 0)); } if(multip == 1 && net && net[0]) { char *rn; @@ -3844,8 +3844,8 @@ const char *translate(int inst, const char* s) dbg(1, " net=%s\n", net); rn = resolved_net(net); if(rn) { - my_strdup2(_ALLOC_ID_, &fqnet, rn); - if(rn) my_free(_ALLOC_ID_, &rn); + my_strdup2(1925, &fqnet, rn); + if(rn) my_free(1926, &rn); strtolower(fqnet); dbg(1, "translate() @spice_get_voltage: fqnet=%s start_level=%d\n", fqnet, start_level); idx = get_raw_index(fqnet, NULL); @@ -3870,10 +3870,10 @@ const char *translate(int inst, const char* s) result_pos += len; } dbg(1, "inst %d, net=%s, fqnet=%s idx=%d valstr=%s\n", inst, net, fqnet, idx, valstr); - if(fqnet) my_free(_ALLOC_ID_, &fqnet); + if(fqnet) my_free(1927, &fqnet); } } - if(net) my_free(_ALLOC_ID_, &net); + if(net) my_free(1928, &net); } } } @@ -3900,13 +3900,13 @@ const char *translate(int inst, const char* s) if(*path == '.') skip++; ++path; } - net = my_malloc(_ALLOC_ID_, tmp); + net = my_malloc(1929, tmp); n = sscanf(token + 19, "%[^)]", net); expandlabel(net, &multip); if(n == 1 && multip == 1) { len = strlen(path) + strlen(instname) + strlen(net) + 2; dbg(1, "net=%s\n", net); - fqnet = my_malloc(_ALLOC_ID_, len); + fqnet = my_malloc(1930, len); global_net = strrchr(net, '.'); @@ -3946,9 +3946,9 @@ const char *translate(int inst, const char* s) result_pos += len; } dbg(1, "instname %s, net=%s, fqnet=%s idx=%d valstr=%s\n", instname, net, fqnet, idx, valstr); - my_free(_ALLOC_ID_, &fqnet); + my_free(1931, &fqnet); } - my_free(_ALLOC_ID_, &net); + my_free(1932, &net); } } } @@ -3972,14 +3972,14 @@ const char *translate(int inst, const char* s) if(*path == '.') skip++; ++path; } - dev = my_malloc(_ALLOC_ID_, tmp); + dev = my_malloc(1933, tmp); n = sscanf(token + 19, "%[^)]", dev); if(n == 1) { strtolower(dev); len = strlen(path) + strlen(instname) + strlen(dev) + 21; /* some extra chars for i(..) wrapper */ dbg(1, "dev=%s\n", dev); - fqdev = my_malloc(_ALLOC_ID_, len); + fqdev = my_malloc(1934, len); if(!sim_is_xyce) { int prefix, vsource; char *prefix_ptr = strrchr(dev, '.'); /* last '.' in dev */ @@ -4018,9 +4018,9 @@ const char *translate(int inst, const char* s) result_pos += len; } dbg(1, "instname %s, dev=%s, fqdev=%s idx=%d valstr=%s\n", instname, dev, fqdev, idx, valstr); - my_free(_ALLOC_ID_, &fqdev); + my_free(1935, &fqdev); } /* if(n == 1) */ - my_free(_ALLOC_ID_, &dev); + my_free(1936, &dev); } /* if(path) */ } /* if((start_level = sch_waves_loaded()) >= 0 && xctx->raw->annot_p>=0) */ } @@ -4051,13 +4051,13 @@ const char *translate(int inst, const char* s) net1 = net_name(inst, 0, &multip, 0, 0); len = strlen(path) + strlen(net1) + 1; dbg(1, "net1=%s\n", net1); - fqnet1 = my_malloc(_ALLOC_ID_, len); + fqnet1 = my_malloc(1937, len); my_snprintf(fqnet1, len, "%s%s", path, net1); strtolower(fqnet1); net2 = net_name(inst, 1, &multip, 0, 0); len = strlen(path) + strlen(net2) + 1; dbg(1, "net2=%s\n", net2); - fqnet2 = my_malloc(_ALLOC_ID_, len); + fqnet2 = my_malloc(1938, len); my_snprintf(fqnet2, len, "%s%s", path, net2); strtolower(fqnet2); dbg(1, "translate(): fqnet1=%s start_level=%d\n", fqnet1, start_level); @@ -4084,8 +4084,8 @@ const char *translate(int inst, const char* s) } dbg(1, "inst %d, fqnet1=%s fqnet2=%s idx1=%d idx2=%d, val1=%g val2=%g valstr=%s\n", inst, fqnet1, fqnet2, idx1, idx2, val1, val2, valstr); - my_free(_ALLOC_ID_, &fqnet1); - my_free(_ALLOC_ID_, &fqnet2); + my_free(1939, &fqnet1); + my_free(1940, &fqnet2); } } } @@ -4109,11 +4109,11 @@ const char *translate(int inst, const char* s) if(*path == '.') skip++; ++path; } - my_strdup2(_ALLOC_ID_, &dev, instname); + my_strdup2(1941, &dev, instname); strtolower(dev); len = strlen(path) + strlen(dev) + 21; /* some extra chars for i(..) wrapper */ dbg(1, "dev=%s\n", dev); - fqdev = my_malloc(_ALLOC_ID_, len); + fqdev = my_malloc(1942, len); if(!sim_is_xyce) { int prefix=dev[0]; int vsource = (prefix == 'v') || (prefix == 'e'); @@ -4151,8 +4151,8 @@ const char *translate(int inst, const char* s) result_pos += len; } dbg(1, "instname %s, dev=%s, fqdev=%s idx=%d valstr=%s\n", instname, dev, fqdev, idx, valstr); - my_free(_ALLOC_ID_, &fqdev); - my_free(_ALLOC_ID_, &dev); + my_free(1943, &fqdev); + my_free(1944, &dev); } } } @@ -4214,18 +4214,18 @@ const char *translate(int inst, const char* s) } } else { int i = level; - my_strdup2(_ALLOC_ID_, &value1, value); + my_strdup2(1945, &value1, value); /* recursive substitution of value using parent level prop_str attributes */ while(i > 0) { const char *tok = get_tok_value(lcc[i-1].prop_ptr, value1, 0); if(xctx->tok_size && tok[0]) { dbg(1, "tok=%s\n", tok); - my_strdup2(_ALLOC_ID_, &value1, tok); + my_strdup2(1946, &value1, tok); } else { tok = get_tok_value(lcc[i-1].templ, value1, 0); if(xctx->tok_size && tok[0]) { dbg(1, "from parent template: tok=%s\n", tok); - my_strdup2(_ALLOC_ID_, &value1, tok); + my_strdup2(1947, &value1, tok); } } dbg(1, "2 translate(): lcc[%d].prop_ptr=%s, value1=%s\n", i-1, lcc[i-1].prop_ptr, value1); @@ -4235,7 +4235,7 @@ const char *translate(int inst, const char* s) STR_ALLOC(&result, tmp + result_pos, &size); memcpy(result+result_pos, value1, tmp+1); result_pos+=tmp; - my_free(_ALLOC_ID_, &value1); + my_free(1948, &value1); } } token_pos = 0; @@ -4251,11 +4251,11 @@ const char *translate(int inst, const char* s) } } /* while(1) */ dbg(2, "translate(): returning %s\n", result); - my_free(_ALLOC_ID_, &token); + my_free(1949, &token); /* if result is like: 'tcleval(some_string)' pass it thru tcl evaluation so expressions * can be calculated */ - my_strdup2(_ALLOC_ID_, &translated_tok, tcl_hook2(result)); + my_strdup2(1950, &translated_tok, tcl_hook2(result)); return translated_tok; } @@ -4270,11 +4270,11 @@ const char *translate2(Lcc *lcc, int level, char* s) char *token = NULL, *value = NULL; if(!s) { - my_free(_ALLOC_ID_, &result); + my_free(1951, &result); return empty; } size = CADCHUNKALLOC; - my_realloc(_ALLOC_ID_, &result, size); + my_realloc(1952, &result, size); result[0] = '\0'; dbg(1, "translate2(): s=%s, level=%d\n", s, level); while (1) { @@ -4304,16 +4304,16 @@ const char *translate2(Lcc *lcc, int level, char* s) dbg(1, "translate2(): lcc[%d].prop_ptr=%s token=%s\n", level, lcc[level].prop_ptr, token); /* if spiceprefix==0 and token == @spiceprefix then set empty value */ if(!tclgetboolvar("spiceprefix") && !strcmp(token, "@spiceprefix")) { - if(value) my_free(_ALLOC_ID_, &value); + if(value) my_free(1953, &value); xctx->tok_size = 0; } else if(token[0] == '@' && (token[1] == '@' || token[1] == '#')) { /* get rid of pin attribute info */ - if(value) my_free(_ALLOC_ID_, &value); + if(value) my_free(1954, &value); xctx->tok_size = 0; } else { - my_strdup2(_ALLOC_ID_, &value, get_tok_value(lcc[level].prop_ptr, token + 1, 0)); + my_strdup2(1955, &value, get_tok_value(lcc[level].prop_ptr, token + 1, 0)); /* propagate %xxx tokens to upper levels if no value found */ if(!value[0] && token[0] == '%') { - my_strdup2(_ALLOC_ID_, &value, token + 1); + my_strdup2(1956, &value, token + 1); xctx->tok_size = 1; /* just to tell %xxx token was found */ } dbg(1, "translate2(): lcc[%d].prop_ptr=%s value=%s\n", level, lcc[level].prop_ptr, value); @@ -4325,7 +4325,7 @@ const char *translate2(Lcc *lcc, int level, char* s) const char *upperval = get_tok_value(lcc[i-1].prop_ptr, value, 0); dbg(1, "translate2(): lcc[%d].prop_ptr=%s upperval=%s\n", i-1, lcc[i-1].prop_ptr, upperval); if(xctx->tok_size && upperval[0]) { - my_strdup2(_ALLOC_ID_, &value, upperval); + my_strdup2(1957, &value, upperval); } else { break; } @@ -4349,20 +4349,20 @@ const char *translate2(Lcc *lcc, int level, char* s) } else if(strcmp(token,"@path")==0) { char *path = NULL; - my_strdup2(_ALLOC_ID_, &path, "@path@name\\."); + my_strdup2(1958, &path, "@path@name\\."); if(level > 1) { /* add parent LCC instance names (X1, Xinv etc) */ int i; for(i = 1; i tok_size) { /* above lines did not find a value for token */ /* no definition found -> keep token */ - my_strcat(_ALLOC_ID_, &result, token); + my_strcat(1967, &result, token); } else { - my_strdup2(_ALLOC_ID_, &value1, value); - my_strcat(_ALLOC_ID_, &result, value1); - my_free(_ALLOC_ID_, &value1); + my_strdup2(1968, &value1, value); + my_strcat(1969, &result, value1); + my_free(1970, &value1); } token_pos = 0; if(c == '@' || c == '%') s--; /* these token separators are also identifiers for next token: push them back */ @@ -4474,7 +4474,7 @@ const char *translate3(const char *s, int eat_escapes, const char *s1, const cha char ch[2]; ch[0] = (char)c; ch[1] = '\0'; - my_strcat(_ALLOC_ID_, &result, ch); + my_strcat(1971, &result, ch); } state=TOK_BEGIN; } /* else if(state==TOK_SEP) */ @@ -4482,20 +4482,20 @@ const char *translate3(const char *s, int eat_escapes, const char *s1, const cha char ch[2]; ch[0] = (char)c; ch[1] = '\0'; - my_strcat(_ALLOC_ID_, &result, ch); + my_strcat(1972, &result, ch); } if(c=='\0') { - /* my_strcat(_ALLOC_ID_, &result, ""); */ + /* my_strcat(1973, &result, ""); */ break; } } /* while(1) */ dbg(2, "translate3(): returning %s\n", result); - my_free(_ALLOC_ID_, &token); + my_free(1974, &token); /* if result is like: 'tcleval(some_string)' pass it thru tcl evaluation so expressions * can be calculated */ dbg(1, "translate3(): result=|%s|\n", result); - my_strdup2(_ALLOC_ID_, &translated_tok, tcl_hook2(result)); + my_strdup2(1975, &translated_tok, tcl_hook2(result)); return translated_tok; } diff --git a/src/verilog_netlist.c b/src/verilog_netlist.c index 0a8ec9bf..a4e9144b 100644 --- a/src/verilog_netlist.c +++ b/src/verilog_netlist.c @@ -47,7 +47,7 @@ static int verilog_netlist(FILE *fd , int verilog_stop) { if(skip_instance(i, 1, lvs_ignore)) continue; dbg(2, "verilog_netlist(): into the netlisting loop\n"); - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1976, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if( type && ( !IS_LABEL_SH_OR_PIN(type) && strcmp(type,"netlist_commands")&& @@ -68,7 +68,7 @@ static int verilog_netlist(FILE *fd , int verilog_stop) } } } - my_free(_ALLOC_ID_, &type); + my_free(1977, &type); } dbg(1, "verilog_netlist(): end\n"); if(!verilog_stop && !xctx->netlist_count) redraw_hilights(0); /*draw_hilight_net(1); */ @@ -132,14 +132,14 @@ int global_verilog_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1978, &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(!xctx->tok_size && 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(1979, &tmp_string, str_tmp); fprintf(fd, "%s\n", str_tmp ? translate(i, tmp_string) : "(NULL)"); } } @@ -162,7 +162,7 @@ int global_verilog_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1980, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if( type && (strcmp(type,"opin"))==0) { if(tmp) fprintf(fd, " ,\n"); @@ -176,7 +176,7 @@ int global_verilog_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1981, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if( type && (strcmp(type,"iopin"))==0) { if(tmp) fprintf(fd, " ,\n"); @@ -190,7 +190,7 @@ int global_verilog_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1982, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if( type && (strcmp(type,"ipin"))==0) { if(tmp) fprintf(fd, " ,\n"); @@ -218,12 +218,12 @@ int global_verilog_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1983, &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(1984, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0)); + my_strdup(1985, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0)); + if(!sig_type || sig_type[0]=='\0') my_strdup(1986, &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)"); @@ -237,12 +237,12 @@ int global_verilog_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1987, &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(1988, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0)); + my_strdup(1989, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0)); + if(!sig_type || sig_type[0]=='\0') my_strdup(1990, &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)"); @@ -256,12 +256,12 @@ int global_verilog_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1991, &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(1992, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0)); + my_strdup(1993, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0)); + if(!sig_type || sig_type[0]=='\0') my_strdup(1994, &sig_type,"wire"); str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : ""; fprintf(fd, " input %s ;\n", str_tmp ? str_tmp : ""); fprintf(fd, " %s %s ", sig_type, str_tmp ? str_tmp : ""); @@ -278,7 +278,7 @@ int global_verilog_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(1995, &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)); } @@ -307,7 +307,7 @@ int global_verilog_netlist(int global) /* netlister driver */ /* warning if two symbols perfectly overlapped */ err |= 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(1996, xctx->instances, sizeof(unsigned int)); for(i=0;iinstances; ++i) stored_flags[i] = xctx->inst[i].color; if(global) @@ -322,8 +322,8 @@ int 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(1997, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]); + my_strcat(1998, &xctx->sch_path[xctx->currsch+1], "->netlisting"); xctx->sch_path_hash[xctx->currsch+1] = 0; xctx->currsch++; @@ -335,14 +335,14 @@ int global_verilog_netlist(int global) /* netlister driver */ if(xctx->sym[i].flags & (VERILOG_IGNORE | VERILOG_SHORT)) continue; if(lvs_ignore && (xctx->sym[i].flags & LVS_IGNORE)) continue; if(!xctx->sym[i].type) continue; - my_strdup2(_ALLOC_ID_, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[i].name), "")); + my_strdup2(1999, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[i].name), "")); if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path)) { if(!web_url) { tclvareval("get_directory [list ", xctx->sch[xctx->currsch - 1], "]", NULL); my_strncpy(xctx->current_dirname, tclresult(), S(xctx->current_dirname)); } /* 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(2000, &subckt_name, get_cell(xctx->sym[i].name, 0)); if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL) { /* do not insert symbols with default_schematic attribute set to ignore in hash since these symbols @@ -358,12 +358,12 @@ int global_verilog_netlist(int global) /* netlister driver */ } } } - my_free(_ALLOC_ID_, &abs_path); + my_free(2001, &abs_path); /* can not free additional syms since *_block_netlist() may have loaded additional syms */ /* get_additional_symbols(0); */ str_hash_free(&subckt_table); - my_free(_ALLOC_ID_, &subckt_name); - my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]); + my_free(2002, &subckt_name); + my_free(2003, &xctx->sch[xctx->currsch]); xctx->currsch--; unselect_all(1); /* symbol vs schematic pin check, we do it here since now we have ALL symbols loaded */ @@ -380,14 +380,14 @@ int global_verilog_netlist(int global) /* netlister driver */ my_strncpy(xctx->current_name, rel_sym_path(xctx->sch[xctx->currsch]), S(xctx->current_name)); err |= prepare_netlist_structs(1); /* so 'lab=...' attributes for unnamed nets are set */ if(!xctx->hilight_nets) xctx->hilight_nets = saved_hilight_nets; - my_free(_ALLOC_ID_, ¤t_dirname_save); + my_free(2004, ¤t_dirname_save); } /* restore hilight flags from errors found analyzing top level before descending hierarchy */ for(i=0;iinstances; ++i) if(!xctx->inst[i].color) 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(2005, &stored_flags); dbg(1, "global_verilog_netlist(): starting awk on netlist!\n"); if(!split_f) { @@ -402,10 +402,10 @@ int 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(2006, &sig_type); + my_free(2007, &port_value); + my_free(2008, &tmp_string); + my_free(2009, &type); xctx->netlist_count = 0; tclvareval("show_infotext ", my_itoa(err), NULL); /* critical error: force ERC window showing */ exit_code = err ? 10 : 0; @@ -446,7 +446,7 @@ int verilog_block_netlist(FILE *fd, int i) if(!strcmp(default_schematic, "ignore")) { return err; } - my_strdup(_ALLOC_ID_, &name, tcl_hook2(xctx->sym[i].name)); + my_strdup(2010, &name, tcl_hook2(xctx->sym[i].name)); if(split_f) { my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", @@ -466,8 +466,8 @@ int 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(2011, &extra, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0)); + my_strdup(2012, &extra2, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0)); fprintf(fd, "// sch_path: %s\n", sanitized_abs_sym_path(filename, "")); verilog_stop? load_schematic(0,filename, 0, 1) : load_schematic(1,filename, 0, 1); get_additional_symbols(1); @@ -476,32 +476,32 @@ int verilog_block_netlist(FILE *fd, int i) for(j=0;jinstances; ++j) { if(skip_instance(j, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[j].ptr+ xctx->sym)->type); + my_strdup(2013, &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(!xctx->tok_size && 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(2014, &tmp_string, str_tmp); fprintf(fd, "%s\n", str_tmp ? translate(j, tmp_string) : "(NULL)"); } } - my_strdup(_ALLOC_ID_, &verilogprefix, + my_strdup(2015, &verilogprefix, get_tok_value(xctx->sym[i].prop_ptr, "verilogprefix", 0)); if(verilogprefix) { - my_strdup(_ALLOC_ID_, &symname, verilogprefix); - my_strcat(_ALLOC_ID_, &symname, get_cell(xctx->sym[i].name, 0)); + my_strdup(2016, &symname, verilogprefix); + my_strcat(2017, &symname, get_cell(xctx->sym[i].name, 0)); } else { - my_strdup(_ALLOC_ID_, &symname, get_cell(xctx->sym[i].name, 0)); + my_strdup(2018, &symname, get_cell(xctx->sym[i].name, 0)); } - my_free(_ALLOC_ID_, &verilogprefix); + my_free(2019, &verilogprefix); fprintf(fd, "module %s (\n", sanitize(symname)); - my_free(_ALLOC_ID_, &symname); + my_free(2020, &symname); /*print_generic(fd, "entity", i); */ dbg(1, "verilog_block_netlist(): entity ports\n"); @@ -540,15 +540,15 @@ int verilog_block_netlist(FILE *fd, int i) for(j=0;jsym[i].rects[PINLAYER]; ++j) { if(strboolcmp(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(2021, &sig_type,get_tok_value( xctx->sym[i].rect[PINLAYER][j].prop_ptr,"verilog_type",0)); - my_strdup(_ALLOC_ID_, &port_value, + my_strdup(2022, &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(2023, &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(2024, &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(2025, &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)) { @@ -565,7 +565,7 @@ int verilog_block_netlist(FILE *fd, int i) if(extra2) { char *verilog_extra_dir = NULL; const char *dir; - my_strdup2(_ALLOC_ID_, &verilog_extra_dir, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra_dir", 0)); + my_strdup2(2026, &verilog_extra_dir, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra_dir", 0)); saveptr1 = NULL; for(extra_ptr = extra2; ; extra_ptr=NULL) { extra_token=my_strtok_r(extra_ptr, " ", "", 0, &saveptr1); @@ -578,7 +578,7 @@ int verilog_block_netlist(FILE *fd, int i) } fprintf(fd, " wire %s ;\n", extra_token); } - my_free(_ALLOC_ID_, &verilog_extra_dir); + my_free(2027, &verilog_extra_dir); } dbg(1, "verilog_block_netlist(): netlisting %s\n", get_cell( xctx->sch[xctx->currsch], 0)); err |= verilog_netlist(fd, verilog_stop); @@ -588,7 +588,7 @@ int verilog_block_netlist(FILE *fd, int i) if(xctx->netlist_count && !strboolcmp(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(2028, &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)); } @@ -599,13 +599,13 @@ int 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(2029, &dir_tmp); + my_free(2030, &sig_type); + my_free(2031, &port_value); + my_free(2032, &type); + my_free(2033, &tmp_string); + my_free(2034, &extra); + my_free(2035, &extra2); } /* if(!sym_def[0]) */ if(split_f) { int save; @@ -620,7 +620,7 @@ int verilog_block_netlist(FILE *fd, int i) if(debug_var==0) xunlink(netl_filename); } xctx->netlist_count++; - my_free(_ALLOC_ID_, &name); + my_free(2036, &name); return err; } diff --git a/src/vhdl_netlist.c b/src/vhdl_netlist.c index 5e395635..e3bc6f88 100644 --- a/src/vhdl_netlist.c +++ b/src/vhdl_netlist.c @@ -56,7 +56,7 @@ static int vhdl_netlist(FILE *fd , int vhdl_stop) for(l=0;linstances; ++l) { if(skip_instance(l, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type); + my_strdup(2037, &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); @@ -72,7 +72,7 @@ static int vhdl_netlist(FILE *fd , int vhdl_stop) { /* dont print elements with vhdl_ignore=true set in symbol */ if(skip_instance(i, 1, lvs_ignore)) continue; dbg(2, "vhdl_netlist(): into the netlisting loop\n"); - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(2038, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if( type && ( !IS_LABEL_SH_OR_PIN(type) && strcmp(type,"generic")&& @@ -95,7 +95,7 @@ static int vhdl_netlist(FILE *fd , int vhdl_stop) } } } - if(type) my_free(_ALLOC_ID_, &type); + if(type) my_free(2039, &type); dbg(1, "vhdl_netlist(): end\n"); if(!vhdl_stop && !xctx->netlist_count) redraw_hilights(0); /* draw_hilight_net(1); */ return err; @@ -155,7 +155,7 @@ int global_vhdl_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(2040, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if( type && (strcmp(type,"package"))==0) { if(xctx->inst[i].prop_ptr) { /* */ @@ -170,7 +170,7 @@ int global_vhdl_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(2041, &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); @@ -235,9 +235,9 @@ int global_vhdl_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) 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(2042, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0)); + if(!sig_type || sig_type[0]=='\0') my_strdup(2043, &sig_type,"std_logic"); + my_strdup(2044, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if( type && (strcmp(type,"opin"))==0) { str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : ""; @@ -252,9 +252,9 @@ int global_vhdl_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) 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(2045, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0)); + if(!sig_type || sig_type[0]=='\0') my_strdup(2046, &sig_type,"std_logic"); + my_strdup(2047, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if( type && (strcmp(type,"iopin"))==0) { str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : ""; @@ -269,9 +269,9 @@ int global_vhdl_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) 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(2048, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0)); + if(!sig_type || sig_type[0]=='\0') my_strdup(2049, &sig_type,"std_logic"); + my_strdup(2050, &type,(xctx->inst[i].ptr+ xctx->sym)->type); if( type && (strcmp(type,"ipin"))==0) { str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : ""; @@ -287,7 +287,7 @@ int global_vhdl_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(2051, &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); @@ -310,7 +310,7 @@ int global_vhdl_netlist(int global) /* netlister driver */ if(lvs_ignore && (xctx->sym[j].flags & LVS_IGNORE)) 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(tcl_hook2(xctx->sym[j].name), "")); + my_strdup(2052, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[j].name), "")); if(( strcmp(xctx->sym[j].type,"subcircuit")==0 || strcmp(xctx->sym[j].type,"primitive")==0 @@ -318,7 +318,7 @@ int 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(2053, &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); @@ -331,12 +331,12 @@ int global_vhdl_netlist(int global) /* netlister driver */ for(i=0;isym[j].rects[PINLAYER]; ++i) { if(strboolcmp(get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"vhdl_ignore",0), "true")) { - my_strdup(_ALLOC_ID_, &sig_type, + my_strdup(2054, &sig_type, get_tok_value( xctx->sym[j].rect[PINLAYER][i].prop_ptr,"sig_type",0)); - my_strdup(_ALLOC_ID_, &port_value, + my_strdup(2055, &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(2056, &sig_type,"std_logic"); + my_strdup(2057, &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"); @@ -346,7 +346,7 @@ int global_vhdl_netlist(int global) /* netlister driver */ fprintf(fd," := %s", port_value); tmp=1; } - my_free(_ALLOC_ID_, &dir_tmp); + my_free(2058, &dir_tmp); } } int_hash_free(&table); @@ -354,11 +354,11 @@ int global_vhdl_netlist(int global) /* netlister driver */ fprintf(fd, "end component ;\n\n"); } } - my_free(_ALLOC_ID_, &abs_path); + my_free(2059, &abs_path); } get_additional_symbols(0); str_hash_free(&subckt_table); - my_free(_ALLOC_ID_, &subckt_name); + my_free(2060, &subckt_name); dbg(1, "global_vhdl_netlist(): netlisting top level\n"); err |= vhdl_netlist(fd, 0); @@ -366,7 +366,7 @@ int global_vhdl_netlist(int global) /* netlister driver */ for(i=0;iinstances; ++i) { if(skip_instance(i, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type); + my_strdup(2061, &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)); } @@ -394,7 +394,7 @@ int global_vhdl_netlist(int global) /* netlister driver */ /* warning if two symbols perfectly overlapped */ err |= 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(2062, xctx->instances, sizeof(unsigned int)); for(i=0;iinstances; ++i) stored_flags[i] = xctx->inst[i].color; if(global) @@ -410,8 +410,8 @@ int 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(2063, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]); + my_strcat(2064, &xctx->sch_path[xctx->currsch+1], "->netlisting"); xctx->sch_path_hash[xctx->currsch+1] = 0; xctx->currsch++; @@ -423,7 +423,7 @@ int global_vhdl_netlist(int global) /* netlister driver */ if(xctx->sym[i].flags & (VHDL_IGNORE | VHDL_SHORT)) continue; if(lvs_ignore && (xctx->sym[i].flags & LVS_IGNORE)) continue; if(!xctx->sym[i].type) continue; - my_strdup(_ALLOC_ID_, &abs_path, abs_sym_path(xctx->sym[i].name, "")); + my_strdup(2065, &abs_path, abs_sym_path(xctx->sym[i].name, "")); if(strcmp(xctx->sym[i].type,"subcircuit")==0 && check_lib(1, abs_path)) { if(!web_url) { @@ -431,7 +431,7 @@ int global_vhdl_netlist(int global) /* netlister driver */ my_strncpy(xctx->current_dirname, tclresult(), S(xctx->current_dirname)); } /* 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(2066, &subckt_name, get_cell(xctx->sym[i].name, 0)); if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL) { /* do not insert symbols with default_schematic attribute set to ignore in hash since these symbols @@ -447,12 +447,12 @@ int global_vhdl_netlist(int global) /* netlister driver */ } } } - my_free(_ALLOC_ID_, &abs_path); + my_free(2067, &abs_path); /* can not free additional syms since *_block_netlist() may have loaded additional syms */ /* get_additional_symbols(0); */ str_hash_free(&subckt_table); - my_free(_ALLOC_ID_, &subckt_name); - my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]); + my_free(2068, &subckt_name); + my_free(2069, &xctx->sch[xctx->currsch]); xctx->currsch--; unselect_all(1); /* symbol vs schematic pin check, we do it here since now we have ALL symbols loaded */ @@ -469,14 +469,14 @@ int global_vhdl_netlist(int global) /* netlister driver */ my_strncpy(xctx->current_name, rel_sym_path(xctx->sch[xctx->currsch]), S(xctx->current_name)); err |= prepare_netlist_structs(1); /* so 'lab=...' attributes for unnamed nets are set */ if(!xctx->hilight_nets) xctx->hilight_nets = saved_hilight_nets; - my_free(_ALLOC_ID_, ¤t_dirname_save); + my_free(2070, ¤t_dirname_save); } /* restore hilight flags from errors found analyzing top level before descending hierarchy */ for(i=0;iinstances; ++i) if(!xctx->inst[i].color) 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(2071, &stored_flags); dbg(1, "global_vhdl_netlist(): starting awk on netlist!\n"); if(!split_f) { fclose(fd); @@ -490,9 +490,9 @@ int 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(2072, &sig_type); + my_free(2073, &type); + my_free(2074, &port_value); xctx->netlist_count = 0; tclvareval("show_infotext ", my_itoa(err), NULL); /* critical error: force ERC window showing */ exit_code = err ? 10 : 0; @@ -581,12 +581,12 @@ int vhdl_block_netlist(FILE *fd, int i) for(j=0;jsym[i].rects[PINLAYER]; ++j) { if(strboolcmp(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"vhdl_ignore",0), "true")) { - my_strdup(_ALLOC_ID_, &sig_type, + my_strdup(2075, &sig_type, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"sig_type",0)); - my_strdup(_ALLOC_ID_, &port_value, + my_strdup(2076, &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(2077, &sig_type,"std_logic"); + my_strdup(2078, &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"); @@ -597,7 +597,7 @@ int vhdl_block_netlist(FILE *fd, int i) fprintf(fd," := %s", port_value); tmp=1; } - my_free(_ALLOC_ID_, &dir_tmp); + my_free(2079, &dir_tmp); } } int_hash_free(&table); @@ -607,7 +607,7 @@ int vhdl_block_netlist(FILE *fd, int i) for(l=0;linstances; ++l) { if(skip_instance(l, 1, lvs_ignore)) continue; - my_strdup(_ALLOC_ID_, &type,(xctx->inst[l].ptr+ xctx->sym)->type); + my_strdup(2080, &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); @@ -636,7 +636,7 @@ int 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(2081, &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) ) { @@ -660,19 +660,19 @@ int vhdl_block_netlist(FILE *fd, int i) for(k=0;ksym[j].rects[PINLAYER]; ++k) { if(strboolcmp(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(2082, &sig_type,get_tok_value( xctx->sym[j].rect[PINLAYER][k].prop_ptr,"sig_type",0)); - my_strdup(_ALLOC_ID_, &port_value, + my_strdup(2083, &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(2084, &sig_type,"std_logic"); + my_strdup(2085, &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 : "", sig_type); - my_free(_ALLOC_ID_, &dir_tmp); + my_free(2086, &dir_tmp); if(port_value &&port_value[0]) fprintf(fd," := %s", port_value); tmp=1; } @@ -685,7 +685,7 @@ int vhdl_block_netlist(FILE *fd, int i) } /* for(j...) */ get_additional_symbols(0); } /* if(!vhdl_stop) */ - my_free(_ALLOC_ID_, &abs_path); + my_free(2087, &abs_path); dbg(1, "vhdl_block_netlist(): netlisting %s\n", get_cell( xctx->sch[xctx->currsch], 0)); err |= vhdl_netlist(fd, vhdl_stop); fprintf(fd,"//// begin user architecture code\n"); @@ -695,7 +695,7 @@ int vhdl_block_netlist(FILE *fd, int i) if(xctx->netlist_count && !strboolcmp(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(2088, &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)); } @@ -703,9 +703,9 @@ int 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", sanitize(get_cell(xctx->sym[i].name, 0)) ); - my_free(_ALLOC_ID_, &sig_type); - my_free(_ALLOC_ID_, &port_value); - my_free(_ALLOC_ID_, &type); + my_free(2089, &sig_type); + my_free(2090, &port_value); + my_free(2091, &type); } /* if(!sym_def[0]) */ if(split_f) { int save; diff --git a/src/xinit.c b/src/xinit.c index da0a7e71..f070c507 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -321,7 +321,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(2092, &xctx->color_array[i], s); } } @@ -375,54 +375,54 @@ static void free_xschem_data() xctx->delete_undo(); free_simdata(); - my_free(_ALLOC_ID_, &xctx->node_table); - my_free(_ALLOC_ID_, &xctx->hilight_table); + my_free(2093, &xctx->node_table); + my_free(2094, &xctx->hilight_table); - my_free(_ALLOC_ID_, &xctx->wire); - my_free(_ALLOC_ID_, &xctx->text); - my_free(_ALLOC_ID_, &xctx->inst); + my_free(2095, &xctx->wire); + my_free(2096, &xctx->text); + my_free(2097, &xctx->inst); for(i=0;irect[i]); - my_free(_ALLOC_ID_, &xctx->line[i]); - my_free(_ALLOC_ID_, &xctx->poly[i]); - my_free(_ALLOC_ID_, &xctx->arc[i]); + my_free(2098, &xctx->rect[i]); + my_free(2099, &xctx->line[i]); + my_free(2100, &xctx->poly[i]); + my_free(2101, &xctx->arc[i]); } - 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(2102, &xctx->sym); + my_free(2103, &xctx->rect); + my_free(2104, &xctx->line); + my_free(2105, &xctx->poly); + my_free(2106, &xctx->arc); + my_free(2107, &xctx->rects); + my_free(2108, &xctx->polygons); + my_free(2109, &xctx->arcs); + my_free(2110, &xctx->lines); + my_free(2111, &xctx->maxr); + my_free(2112, &xctx->maxp); + my_free(2113, &xctx->maxa); + my_free(2114, &xctx->maxl); + my_free(2115, &xctx->sel_array); for(i=0;iportmap[i].table) str_hash_free(&xctx->portmap[i]); - if(xctx->sch[i]) my_free(_ALLOC_ID_, &xctx->sch[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[i]) my_free(2116, &xctx->sch[i]); + if(xctx->sch_path[i]) my_free(2117, &xctx->sch_path[i]); + if(xctx->hier_attr[i].templ) my_free(2118, &xctx->hier_attr[i].templ); + if(xctx->hier_attr[i].prop_ptr) my_free(2119, &xctx->hier_attr[i].prop_ptr); + if(xctx->hier_attr[i].symname) my_free(2120, &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;icolor_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); - my_free(_ALLOC_ID_, &xctx); + my_free(2121, &xctx->gridpoint); + my_free(2122, &xctx->biggridpoint); + my_free(2123, &xctx->gc); + my_free(2124, &xctx->gcstipple); + for(i=0;icolor_array[i]); + my_free(2126, &xctx->color_array); + my_free(2127, &xctx->enable_layer); + my_free(2128, &xctx->active_layer); + my_free(2129, &xctx->top_path); + my_free(2130, &xctx->current_win_path); + my_free(2131, &xctx->fill_type); + my_free(2132, &xctx->format); + my_free(2133, &xctx); } void create_gc(void) @@ -452,7 +452,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(2134, 1, sizeof(Xschem_ctx)); xctx->cur_undo_ptr = 0; xctx->head_undo_ptr = 0; xctx->tail_undo_ptr = 0; @@ -539,12 +539,12 @@ static void alloc_xschem_data(const char *top_path, const char *win_path) } } xctx->n_hash_objects = 0; - xctx->node_table = my_calloc(_ALLOC_ID_, HASHSIZE, sizeof(Node_hashentry *)); + xctx->node_table = my_calloc(2135, HASHSIZE, sizeof(Node_hashentry *)); xctx->inst_name_table.table = NULL; xctx->inst_name_table.size = 0; xctx->floater_inst_table.table = NULL; xctx->floater_inst_table.size = 0; - xctx->hilight_table = my_calloc(_ALLOC_ID_, HASHSIZE, sizeof(Hilight_hashentry *)); + xctx->hilight_table = my_calloc(2136, HASHSIZE, sizeof(Hilight_hashentry *)); xctx->window = xctx->save_pixmap = 0; xctx->xrect[0].width = xctx->xrect[0].height = xctx->xrect[0].x = xctx->xrect[0].y = 0; @@ -598,21 +598,21 @@ static void alloc_xschem_data(const char *top_path, const char *win_path) xctx->portmap[i].table = NULL; xctx->portmap[i].size = 0; } - my_strdup(_ALLOC_ID_, &xctx->sch_path[0],"."); + my_strdup(2137, &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->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->text=my_calloc(2138, xctx->maxt,sizeof(xText)); + xctx->wire=my_calloc(2139, xctx->maxw,sizeof(xWire)); + xctx->inst=my_calloc(2140, xctx->maxi , sizeof(xInstance) ); + xctx->sym=my_calloc(2141, xctx->maxs , sizeof(xSymbol) ); + xctx->maxr=my_calloc(2142, cadlayers, sizeof(int)); + xctx->maxa=my_calloc(2143, cadlayers, sizeof(int)); + xctx->maxp=my_calloc(2144, cadlayers, sizeof(int)); + xctx->maxl=my_calloc(2145, cadlayers, sizeof(int)); for(i=0;imaxr[i]=CADMAXOBJECTS; @@ -620,28 +620,28 @@ 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(2146, cadlayers, sizeof(xRect *)); + xctx->line=my_calloc(2147, cadlayers, sizeof(xLine *)); + xctx->poly=my_calloc(2148, cadlayers, sizeof(xPoly *)); + xctx->arc=my_calloc(2149, cadlayers, sizeof(xArc *)); for(i=0;irect[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(2150, xctx->maxr[i],sizeof(xRect)); + xctx->arc[i]=my_calloc(2151, xctx->maxa[i],sizeof(xArc)); + xctx->poly[i]=my_calloc(2152, xctx->maxp[i],sizeof(xPoly)); + xctx->line[i]=my_calloc(2153, 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(2154, cadlayers, sizeof(int)); + xctx->polygons=my_calloc(2155, cadlayers, sizeof(int)); + xctx->arcs=my_calloc(2156, cadlayers, sizeof(int)); + xctx->lines=my_calloc(2157, cadlayers, sizeof(int)); xctx->maxsel=MAXGROUP; - xctx->sel_array=my_calloc(_ALLOC_ID_, xctx->maxsel, sizeof(Selected)); + xctx->sel_array=my_calloc(2158, xctx->maxsel, sizeof(Selected)); xctx->first_sel.n = -1; xctx->first_sel.type = 0; xctx->first_sel.col = 0; - xctx->biggridpoint=(XSegment*)my_calloc(_ALLOC_ID_, CADMAXGRIDPOINTS,sizeof(XSegment)); - xctx->gridpoint=(XPoint*)my_calloc(_ALLOC_ID_, CADMAXGRIDPOINTS,sizeof(XPoint)); + xctx->biggridpoint=(XSegment*)my_calloc(2159, CADMAXGRIDPOINTS,sizeof(XSegment)); + xctx->gridpoint=(XPoint*)my_calloc(2160, CADMAXGRIDPOINTS,sizeof(XPoint)); xctx->enable_drill = 0; xctx->prev_set_modify = -1; xctx->prev_crossx = xctx->prev_crossy = 0.0; @@ -669,22 +669,22 @@ 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(2161, cadlayers, sizeof(GC)); + xctx->gcstipple=my_calloc(2162, cadlayers, sizeof(GC)); + xctx->color_array=my_calloc(2163, cadlayers, sizeof(char*)); + xctx->enable_layer=my_calloc(2164, cadlayers, sizeof(int)); xctx->crosshair_layer = TEXTLAYER; xctx->n_active_layers = 0; - xctx->active_layer=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int)); + xctx->active_layer=my_calloc(2165, 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(2166, &xctx->top_path, top_path); + my_strdup2(2167, &xctx->current_win_path, win_path); + xctx->fill_type=my_calloc(2168, cadlayers, sizeof(int)); xctx->case_insensitive = 0; xctx->show_hidden_texts = 0; xctx->x_strcmp = strcmp; @@ -755,7 +755,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(2169, &s, l); my_snprintf(s, l, "C %s %g %g %d %d %s", tcl_hook2(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 : ""); @@ -764,7 +764,7 @@ int compare_schematics(const char *f) for(i=0;iwires; ++i) { l =1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : ""); - my_realloc(_ALLOC_ID_, &s, l); + my_realloc(2170, &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); @@ -817,7 +817,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(2171, &s, l); my_snprintf(s, l, "C %s %g %g %d %d %s", tcl_hook2(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 : ""); @@ -835,7 +835,7 @@ int compare_schematics(const char *f) for(i=0;iwires; ++i) { l =1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : ""); - my_realloc(_ALLOC_ID_, &s, l); + my_realloc(2172, &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); @@ -865,7 +865,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(2173,&s, l); my_snprintf(s, l, "C %s %g %g %d %d %s", tcl_hook2(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 : ""); @@ -880,7 +880,7 @@ int compare_schematics(const char *f) for(i=0;iwires; ++i) { l = 1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : ""); - my_realloc(_ALLOC_ID_, &s, l); + my_realloc(2174, &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); @@ -894,7 +894,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(2175, &s); return ret; } @@ -907,7 +907,7 @@ static void xwin_exit(void) dbg(0, "xwin_exit() double call, doing nothing...\n"); return; } - if(xctx->infowindow_text) my_free(_ALLOC_ID_, &xctx->infowindow_text); + if(xctx->infowindow_text) my_free(2176, &xctx->infowindow_text); if(has_x) new_schematic("destroy_all", "1", NULL, 1); drawbezier(xctx->window, xctx->gc[0], 0, NULL, NULL, 0, 0); delete_schematic_data(1); @@ -926,18 +926,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(2177, &pixmap); } dbg(1, "xwin_exit(): clearing drawing data structures\n"); /* global context - graphic preferences/settings */ for(i=0;itop_path, save_xctx->current_win_path); /* alloc data into xctx */ init_pixdata(); /* populate xctx->fill_type array that is used in create_gc() to set fill styles */ @@ -1267,7 +1267,7 @@ int preview_window(const char *what, const char *win_path, const char *fname) delete_schematic_data(1); preview_xctx[i] = NULL; } - my_free(_ALLOC_ID_, ¤t_file[i]); + my_free(2188, ¤t_file[i]); xctx = save_xctx; /* restore schematic */ save_xctx = NULL; set_modify(-1); @@ -1804,14 +1804,14 @@ static void destroy_window(int *window_count, const char *win_path) if(savectx == xctx) savectx = save_xctx[0]; if(has_x) { tclvareval("winfo toplevel ", win_path, NULL); - my_strdup2(_ALLOC_ID_, &toplevel, tclresult()); + my_strdup2(2189, &toplevel, tclresult()); } delete_schematic_data(1); save_xctx[n] = NULL; if(has_x) { Tk_DestroyWindow(Tk_NameToWindow(interp, window_path[n], mainwindow)); tclvareval("destroy ", toplevel, NULL); - my_free(_ALLOC_ID_, &toplevel); + my_free(2190, &toplevel); } my_strncpy(window_path[n], "", S(window_path[n])); (*window_count)--; @@ -1920,7 +1920,7 @@ static void destroy_all_windows(int *window_count, int force) char *toplevel = NULL; if(has_x) { tclvareval("winfo toplevel ", window_path[i], NULL); - my_strdup2(_ALLOC_ID_, &toplevel, tclresult()); + my_strdup2(2191, &toplevel, tclresult()); } delete_schematic_data(1); /* set saved ctx to main window if previous is about to be destroyed */ @@ -1929,7 +1929,7 @@ static void destroy_all_windows(int *window_count, int force) if(has_x) { Tk_DestroyWindow(Tk_NameToWindow(interp, window_path[i], mainwindow)); tclvareval("destroy ", toplevel, NULL); - my_free(_ALLOC_ID_, &toplevel); + my_free(2192, &toplevel); } /* delete Tcl context of deleted schematic window */ tclvareval("delete_ctx ", window_path[i], NULL); @@ -2402,22 +2402,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(2193, &up_hier, "../../.."); } - else my_strdup(_ALLOC_ID_, &up_hier, ".."); - /* my_strcat(_ALLOC_ID_, &win_xschem_library_path, "."); */ + else my_strdup(2194, &up_hier, ".."); + /* my_strcat(2195, &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(2196, &win_xschem_library_path, "\;"); + my_strcat(2197, &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(2198, &win_xschem_library_path); + my_free(2199, &up_hier); char *xschem_sharedir=NULL; if ((xschem_sharedir=getenv("XSCHEM_SHAREDIR")) != NULL) { if (!stat(xschem_sharedir, &buf)) { @@ -2616,7 +2616,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(2200, &xschem_executable, get_file_path(xschem_executable)); dbg(1, "Tcl_AppInit(): resolved xschem_executable=%s\n", xschem_executable); /* get xschem globals from tcl variables set in xschemrc/xschem.tcl */ @@ -2654,19 +2654,19 @@ int Tcl_AppInit(Tcl_Interp *inter) } /* initialize current schematic name to empty string to avoid gazillion checks in the code for NULL */ - my_strdup2(_ALLOC_ID_, &xctx->sch[xctx->currsch], ""); + my_strdup2(2201, &xctx->sch[xctx->currsch], ""); xctx->crosshair_layer = tclgetintvar("crosshair_layer"); if(xctx->crosshair_layer < 0 ) xctx->crosshair_layer = 2; if(xctx->crosshair_layer >= cadlayers ) xctx->crosshair_layer = 2; /* global context / graphic preferences/settings */ - pixdata=my_calloc(_ALLOC_ID_, cadlayers, sizeof(char*)); + pixdata=my_calloc(2202, cadlayers, sizeof(char*)); for(i=0;iplotfile, cli_opt_plotfile, S(xctx->plotfile)); xctx->draw_window = tclgetintvar("draw_window"); @@ -3017,7 +3017,9 @@ int Tcl_AppInit(Tcl_Interp *inter) tcleval("eval_postinit_commands"); if(cli_opt_quit) { - tclvareval("exit ", my_itoa(exit_code), NULL); + char s[40]; + my_snprintf(s, S(s), "exit %d", exit_code); + tcleval(s); } diff --git a/src/xschem.h b/src/xschem.h index 5eb3cc41..d98b616d 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -415,7 +415,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(2205, dest_string, *size); \ } \ } while(0)