reset alloc IDs

This commit is contained in:
stefan schippers 2025-04-18 02:02:15 +02:00
parent dbac25433c
commit 6af59cb3fb
32 changed files with 2338 additions and 2338 deletions

File diff suppressed because it is too large Load Diff

View File

@ -492,7 +492,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
c = G_Y(xctx->mousey);
if(gr->logy) c = pow(10, c);
my_strdup(223, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor1_y", dtoa(c)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor1_y", dtoa(c)));
need_redraw_master = 1;
}
@ -502,7 +502,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
c = G_Y(xctx->mousey);
if(gr->logy) c = pow(10, c);
my_strdup(224, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor2_y", dtoa(c)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor2_y", dtoa(c)));
need_redraw_master = 1;
}
@ -514,7 +514,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(225, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(c)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(c)));
} else {
xctx->graph_cursor1_x = c;
}
@ -529,7 +529,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(226, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(c)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(c)));
} else {
xctx->graph_cursor2_x = c;
}
@ -642,7 +642,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
tclvareval("input_line {Pos:} {} ", dtoa_eng(cursor), NULL);
cursor = atof_eng(tclresult());
if(r->flags & 4) {
my_strdup(227, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(cursor)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(cursor)));
} else {
xctx->graph_cursor1_x = cursor;
}
@ -672,7 +672,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
tclvareval("input_line {Pos:} {} ", dtoa_eng(cursor), NULL);
cursor = atof_eng(tclresult());
if(r->flags & 4) {
my_strdup(228, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(cursor)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(cursor)));
} else {
xctx->graph_cursor2_x = cursor;
}
@ -696,7 +696,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(fabs(xctx->mousey - W_Y(logcursor)) < 10) {
tclvareval("input_line {Pos:} {} ", dtoa_eng(cursor), NULL);
cursor = atof_eng(tclresult());
my_strdup(229, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor1_y", dtoa(cursor)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor1_y", dtoa(cursor)));
event = 0; button = 0; /* avoid further processing ButtonPress that might set GRAPHPAN */
}
need_redraw_master = 1;
@ -711,7 +711,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(fabs(xctx->mousey - W_Y(logcursor)) < 10) {
tclvareval("input_line {Pos:} {} ", dtoa_eng(cursor), NULL);
cursor = atof_eng(tclresult());
my_strdup(230, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor2_y", dtoa(cursor)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor2_y", dtoa(cursor)));
event = 0; button = 0; /* avoid further processing ButtonPress that might set GRAPHPAN */
}
need_redraw_master = 1;
@ -732,7 +732,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(231, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(c)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(c)));
}
} else {
xctx->graph_cursor1_x = c;
@ -750,7 +750,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(232, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(c)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(c)));
}
} else {
xctx->graph_cursor2_x = c;
@ -801,12 +801,12 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
cursor1 = tmp;
if(r->flags & 4) {
my_strdup(233, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(cursor1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor1_x", dtoa(cursor1)));
} else {
xctx->graph_cursor1_x = cursor1;
}
if(r->flags & 4) {
my_strdup(234, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(cursor2)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "cursor2_x", dtoa(cursor2)));
} else {
xctx->graph_cursor2_x = cursor2;
}
@ -865,11 +865,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(235, &rawfile, get_tok_value(r->prop_ptr, "rawfile", 0));
my_strdup2(236, &sim_type, get_tok_value(r->prop_ptr, "sim_type", 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));
if(rawfile[0] && sim_type[0]) switched = extra_rawfile(2, rawfile, sim_type, -1.0, -1.0);
my_free(237, &rawfile);
my_free(238, &sim_type);
my_free(_ALLOC_ID_, &rawfile);
my_free(_ALLOC_ID_, &sim_type);
idx = get_raw_index(find_nth(get_tok_value(r->prop_ptr, "sweep", 0), ", ", "\"", 0, 1), NULL);
dset = dataset == -1 ? 0 : dataset;
@ -909,7 +909,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
r = &xctx->rect[GRIDLAYER][i];
need_redraw = 0;
if( !(r->flags & 1) ) continue; /* 1: graph; 3: graph_unlocked */
my_strdup2(239, &curr_sim_type, get_tok_value(r->prop_ptr, "sim_type", 0));
my_strdup2(_ALLOC_ID_, &curr_sim_type, get_tok_value(r->prop_ptr, "sim_type", 0));
gr->gx1 = gr->master_gx1;
gr->gx2 = gr->master_gx2;
gr->gw = gr->master_gw;
@ -923,7 +923,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
get_tok_value(xctx->rect[GRIDLAYER][xctx->graph_master].prop_ptr, "sim_type", 0))) {
same_sim_type = 1;
}
my_free(240, &curr_sim_type);
my_free(_ALLOC_ID_, &curr_sim_type);
if(event == MotionNotify && (state & Button1Mask) && !xctx->graph_bottom &&
!(xctx->graph_flags & (16 | 32 | 512 | 1024))) {
@ -937,8 +937,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(241, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(242, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
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)));
xctx->my_double_save = xctx->mousey_snap;
need_redraw = 1;
}
@ -948,8 +948,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(243, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(244, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
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)));
xctx->my_double_save = xctx->mousey_snap;
need_redraw = 1;
}
@ -967,8 +967,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(245, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(246, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
}
}
@ -984,16 +984,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(247, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(248, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
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)));
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(249, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(250, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
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)));
need_redraw = 1;
}
}
@ -1006,8 +1006,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(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)));
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)));
need_redraw = 1;
}
}
@ -1021,16 +1021,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(253, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(254, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
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)));
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(255, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(256, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
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)));
need_redraw = 1;
}
}
@ -1043,8 +1043,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(257, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(258, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
}
}
@ -1060,8 +1060,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(259, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(260, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
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)));
need_redraw = 1;
} else {
@ -1072,8 +1072,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(261, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(262, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
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)));
need_redraw = 1;
}
}
@ -1083,8 +1083,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(263, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(264, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
}
}
@ -1100,8 +1100,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(265, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(266, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
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)));
need_redraw = 1;
} else {
double m = G_Y(xctx->mousey);
@ -1111,8 +1111,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(267, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(268, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
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)));
need_redraw = 1;
}
}
@ -1122,8 +1122,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(269, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(270, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
}
}
@ -1135,9 +1135,9 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(xctx->graph_flags & 128) {
double c = G_Y(xctx->mousey);
if(gr->logy) c = pow(10, c);
my_strdup(271, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor1_y", dtoa(c)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor1_y", dtoa(c)));
} else {
my_strdup(272, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor1_y", NULL));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor1_y", NULL));
}
}
/* y hcursor2 toggle */
@ -1147,9 +1147,9 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(xctx->graph_flags & 256) {
double c = G_Y(xctx->mousey);
if(gr->logy) c = pow(10, c);
my_strdup(273, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor2_y", dtoa(c)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor2_y", dtoa(c)));
} else {
my_strdup(274, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor2_y", NULL));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hcursor2_y", NULL));
}
}
else if(event == KeyPress && key == 't' && access_cond ) {
@ -1161,7 +1161,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(275, &r->prop_ptr, subst_token(r->prop_ptr, "dataset", my_itoa(track_dset)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "dataset", my_itoa(track_dset)));
}
/* do this here to update texts printing current dataset in graph
@ -1192,8 +1192,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(276, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(277, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
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)));
need_redraw = 1;
}
} else {
@ -1202,8 +1202,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(278, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(279, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
}
}
@ -1219,8 +1219,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(280, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(281, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
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)));
need_redraw = 1;
}
} else {
@ -1229,8 +1229,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(282, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(283, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
}
}
@ -1242,8 +1242,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(284, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(285, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
}
}
@ -1255,8 +1255,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(286, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(287, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
}
}
@ -1282,8 +1282,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
if(r->sel || (same_sim_type && !(r->flags & 2)) || i == xctx->graph_master) {
/* xx1 and xx2 calculated for master graph above */
my_strdup(288, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(289, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
}
}
@ -1304,8 +1304,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
clear_graphpan_at_end = 1;
/* xx1 and xx2 calculated for master graph above */
my_strdup(290, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(291, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
need_redraw = 1;
} else if(i == xctx->graph_master) {
clear_graphpan_at_end = 1;
@ -1328,8 +1328,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
} else {
if(yy2 < yy1) { double tmp; tmp = yy1; yy1 = yy2; yy2 = tmp; }
}
my_strdup(292, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(yy1)));
my_strdup(293, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(yy2)));
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)));
} else {
yy1 = DG_Y(xctx->my_double_save);
yy2 = DG_Y(xctx->mousey_snap);
@ -1338,8 +1338,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
} else {
if(yy2 < yy1) { double tmp; tmp = yy1; yy1 = yy2; yy2 = tmp; }
}
my_strdup(294, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1", dtoa(yy1)));
my_strdup(295, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2", dtoa(yy2)));
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)));
}
need_redraw = 1;
} else if(i == xctx->graph_master) {
@ -1982,9 +1982,9 @@ static int edit_polygon_point(int state)
if(state & ShiftMask) {
xctx->push_undo();
points++;
my_realloc(296, &p->x, sizeof(double) * points);
my_realloc(297, &p->y, sizeof(double) * points);
my_realloc(298, &p->selected_point, sizeof(unsigned short) * 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);
p->selected_point[i] = 0;
for(j = points - 2; j > i; j--) {
p->x[j + 1] = p->x[j];
@ -2008,9 +2008,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(299, &p->x, sizeof(double) * points);
my_realloc(300, &p->y, sizeof(double) * points);
my_realloc(301, &p->selected_point, sizeof(unsigned short) * 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);
p->points = points;
p->sel = SELECTED;
return 1;
@ -2368,12 +2368,12 @@ static int grabscreen(const char *win_path, int event, int mx, int my, KeySym ke
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(302, &closure.buffer);
my_mstrcat(303, &prop, "flags=image,unscaled\nalpha=0.8\nimage_data=", encoded_data, NULL);
my_free(304, &encoded_data);
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);
storeobject(-1, xctx->mousex_snap, xctx->mousey_snap, xctx->mousex_snap + grab_w, xctx->mousey_snap + grab_h,
xRECT, GRIDLAYER, SELECTED, prop);
my_free(305, &prop);
my_free(_ALLOC_ID_, &prop);
xctx->need_reb_sel_arr=1;
rebuild_selected_array();
move_objects(START,0,0,0);
@ -2972,11 +2972,11 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
if(!tool) {
tool = tclgetintvar("sim(spicewave,default)");
my_snprintf(str, PATH_MAX + 100, "sim(spicewave,%d,name)", tool);
my_strdup(306, &tool_name, tclgetvar(str));
my_strdup(_ALLOC_ID_, &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(307, &tool_name);
my_free(_ALLOC_ID_, &tool_name);
}
}
if(tool) {

View File

@ -217,12 +217,12 @@ void trim_wires(void)
xctx->wire[j].sel = 0;
}
xctx->wire[xctx->wires].prop_ptr=NULL;
my_strdup(308, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[j].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[j].prop_ptr);
xctx->wire[xctx->wires].bus =
get_attr_val(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0));
xctx->wire[xctx->wires].node=NULL;
my_strdup(309, &xctx->wire[xctx->wires].node, xctx->wire[j].node);
my_strdup(_ALLOC_ID_, &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);
@ -238,7 +238,7 @@ void trim_wires(void)
}
/* dbg(1, "trim_wires(): break: %g\n", timer(1)); */
/* reduce included wires */
my_realloc(310, &wireflag, xctx->wires*sizeof(unsigned short));
my_realloc(_ALLOC_ID_, &wireflag, xctx->wires*sizeof(unsigned short));
memset(wireflag, 0, xctx->wires*sizeof(unsigned short));
for(i=0;i<xctx->wires; ++i) {
if(wireflag[i]) continue;
@ -281,8 +281,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(311, &xctx->wire[i].prop_ptr);
my_free(312, &xctx->wire[i].node);
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->wire[i].node);
continue;
}
if(j) {
@ -299,7 +299,7 @@ void trim_wires(void)
/* after wire deletions full rehash is needed */
hash_wires();
my_realloc(313, &wireflag, xctx->wires*sizeof(unsigned short));
my_realloc(_ALLOC_ID_, &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)); */
@ -378,8 +378,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(314, &xctx->wire[i].prop_ptr);
my_free(315, &xctx->wire[i].node);
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->wire[i].node);
continue;
}
if(j) {
@ -401,7 +401,7 @@ void trim_wires(void)
}
} while(changed);
dbg(1, "trim_wires(): doloops=%d changed=%d\n", doloops, changed);
my_free(316, &wireflag);
my_free(_ALLOC_ID_, &wireflag);
update_conn_cues(WIRELAYER, 0, 0);
}
@ -497,7 +497,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(317, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
xctx->wire[xctx->wires].bus =
get_attr_val(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0));
xctx->wire[xctx->wires].node=NULL;
@ -505,7 +505,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(318, &xctx->wire[xctx->wires].node, xctx->wire[i].node);
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].node, xctx->wire[i].node);
xctx->need_reb_sel_arr=1;
xctx->wires++;
xctx->wire[i].x1 = x0;
@ -572,7 +572,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(319, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
xctx->wire[xctx->wires].bus =
get_attr_val(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus", 0));
xctx->wire[xctx->wires].node=NULL;
@ -580,7 +580,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(320, &xctx->wire[xctx->wires].node, xctx->wire[i].node);
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].node, xctx->wire[i].node);
xctx->need_reb_sel_arr=1;
xctx->wires++;
} else {
@ -666,7 +666,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(321, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->wire[xctx->wires].prop_ptr, xctx->wire[i].prop_ptr);
xctx->wire[xctx->wires].bus =
get_attr_val(get_tok_value(xctx->wire[xctx->wires].prop_ptr,"bus",0));
xctx->wire[xctx->wires].node=NULL;

View File

@ -270,7 +270,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(322, &estr);
my_free(_ALLOC_ID_, &estr);
return;
}
@ -302,7 +302,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(323, &sss, estr);
my_strdup2(_ALLOC_ID_, &sss, estr);
tt=ss=sss;
for(;;) {
c=*ss;
@ -323,8 +323,8 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in
}
++ss;
}
my_free(324, &sss);
my_free(325, &estr);
my_free(_ALLOC_ID_, &sss);
my_free(_ALLOC_ID_, &estr);
}
#else /* !HAS_CAIRO */
@ -356,7 +356,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(326, &estr);
my_free(_ALLOC_ID_, &estr);
return;
}
xscale*=tclgetdoublevar("nocairo_font_xscale") * cairo_font_scale;
@ -394,7 +394,7 @@ void draw_string(int layer, int what, const char *str, short rot, short flip, in
++pos;
a += FONTWIDTH+FONTWHITESPACE;
}
my_free(327, &estr);
my_free(_ALLOC_ID_, &estr);
}
}
@ -413,11 +413,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(328, &estr);
my_free(_ALLOC_ID_, &estr);
return;
}
drawtemprect(gctext,what, textx1,texty1,textx2,texty2);
my_free(329, &estr);
my_free(_ALLOC_ID_, &estr);
}
void get_sym_text_layer(int inst, int text_n, int *layer)
@ -602,16 +602,16 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot,
bus = get_attr_val(get_tok_value(polygon->prop_ptr, "bus", 0)) ? THICK : NOW;
bezier = !strboolcmp(get_tok_value(polygon->prop_ptr, "bezier", 0), "true");
dash = (disabled == 1) ? 3 : polygon->dash;
x = my_malloc(330, sizeof(double) * polygon->points);
y = my_malloc(331, sizeof(double) * polygon->points);
x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
for(k=0;k<polygon->points; ++k) {
ROTATION(rot, flip, 0.0, 0.0,polygon->x[k],polygon->y[k],x[k],y[k]);
x[k]+= x0;
y[k] += y0;
}
drawpolygon(c, bus, x, y, polygon->points, polygon->fill, dash, bezier); /* added fill */
my_free(332, &x);
my_free(333, &y);
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
}
for(j=0;j< symptr->arcs[layer]; ++j)
{
@ -731,18 +731,18 @@ 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(334, &txtptr, translate(n, text.txt_ptr));
my_strdup2(_ALLOC_ID_, &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(335, &txtptr, translate3(txtptr, 1, xctx->inst[n].prop_ptr,
my_strdup2(_ALLOC_ID_, &txtptr, translate3(txtptr, 1, xctx->inst[n].prop_ptr,
xctx->sym[xctx->inst[n].ptr].templ, NULL, 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(336, &txtptr);
my_free(_ALLOC_ID_, &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);
@ -852,16 +852,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(337, sizeof(double) * polygon->points);
double *y = my_malloc(338, sizeof(double) * polygon->points);
double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
for(k=0;k<polygon->points; ++k) {
ROTATION(rot, flip, 0.0, 0.0,polygon->x[k],polygon->y[k],x[k],y[k]);
x[k] += x0;
y[k] += y0;
}
drawtemppolygon(gc, NOW, x, y, polygon->points, bezier);
my_free(339, &x);
my_free(340, &y);
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
}
}
@ -903,15 +903,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(341, &txtptr, translate(n, text.txt_ptr));
my_strdup2(_ALLOC_ID_, &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(342, &txtptr, translate3(txtptr, 1, xctx->inst[n].prop_ptr,
my_strdup2(_ALLOC_ID_, &txtptr, translate3(txtptr, 1, xctx->inst[n].prop_ptr,
xctx->sym[xctx->inst[n].ptr].templ, NULL, 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(343, &txtptr);
my_free(_ALLOC_ID_, &txtptr);
#if HAS_CAIRO==1
if(customfont) {
cairo_restore(xctx->cairo_ctx);
@ -1847,10 +1847,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(344, &p);
my_free(_ALLOC_ID_, &p);
return;
}
if(!p) p = my_malloc(345, psize * sizeof(XPoint));
if(!p) p = my_malloc(_ALLOC_ID_, psize * sizeof(XPoint));
i = 0;
for(b = 0; b < points - 2; b++) {
if(points == 3) { /* 3 points: only one bezier */
@ -1887,7 +1887,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(346, &p, psize * sizeof(XPoint));
my_realloc(_ALLOC_ID_, &p, psize * sizeof(XPoint));
}
p[i].x = (short)X_TO_SCREEN(xp);
p[i].y = (short)Y_TO_SCREEN(yp);
@ -1922,7 +1922,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(347, sizeof(XPoint) * points);
p = my_malloc(_ALLOC_ID_, sizeof(XPoint) * points);
if(what) {
for(i=0;i<points; ++i) {
clip_xy_to_short(X_TO_SCREEN(x[i]), Y_TO_SCREEN(y[i]), &sx, &sy);
@ -1981,7 +1981,7 @@ void drawpolygon(int c, int what, double *x, double *y, int points, int poly_fil
if(dash || what == THICK) {
XSetLineAttributes (display, xctx->gc[c], XLINEWIDTH(xctx->lw) ,LineSolid, LINECAP , LINEJOIN);
}
my_free(348, &p);
my_free(_ALLOC_ID_, &p);
}
/* flags: bit 0: bezier
@ -2019,14 +2019,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(349, sizeof(XPoint) * points);
p = my_malloc(_ALLOC_ID_, sizeof(XPoint) * points);
for(i=0;i<points; ++i) {
clip_xy_to_short(X_TO_SCREEN(x[i]), Y_TO_SCREEN(y[i]), &sx, &sy);
p[i].x = sx;
p[i].y = sy;
}
XDrawLines(display, xctx->window, gc, p, points, CoordModeOrigin);
my_free(350, &p);
my_free(_ALLOC_ID_, &p);
}
}
}
@ -2333,9 +2333,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(351, (*n_bits) * sizeof(SPICE_DATA *));
idx_arr = my_malloc(_ALLOC_ID_, (*n_bits) * sizeof(SPICE_DATA *));
p = 0;
my_strdup2(352, &ntok_copy, ntok);
my_strdup2(_ALLOC_ID_, &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)) ) {
@ -2349,7 +2349,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(353, &ntok_copy);
my_free(_ALLOC_ID_, &ntok_copy);
return idx_arr;
}
@ -2394,12 +2394,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(354, &custom_rawfile, raw->rawfile);
else my_strdup2(355, &custom_rawfile, "");
if(raw && raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, raw->rawfile);
else my_strdup2(_ALLOC_ID_, &custom_rawfile, "");
} else {
my_strdup2(356, &custom_rawfile, ptr);
my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr);
}
my_strdup2(357, &sim_type, get_tok_value(r->prop_ptr,"sim_type", 0));
my_strdup2(_ALLOC_ID_, &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);
}
@ -2410,13 +2410,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(358, &custom_rawfile, raw->rawfile);
else my_strdup2(359, &custom_rawfile, "");
if(raw && raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, raw->rawfile);
else my_strdup2(_ALLOC_ID_, &custom_rawfile, "");
} else {
my_strdup2(360, &custom_rawfile, ptr);
my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr);
}
my_strdup2(361, &sim_type,
my_strdup2(_ALLOC_ID_, &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);
@ -2447,12 +2447,12 @@ int graph_fullxzoom(int i, Graph_ctx *gr, int dataset)
xx2 = mylog10(xx2);
}
dbg(1, "graph_fullxzoom(): xx1=%g, xx2=%g\n");
my_strdup(362, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(363, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(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)));
if(sch_waves_loaded()!= -1 && custom_rawfile[0]) extra_rawfile(5, NULL, NULL, -1.0, -1.0);
my_free(364, &custom_rawfile);
my_free(365, &sim_type);
my_free(_ALLOC_ID_, &custom_rawfile);
my_free(_ALLOC_ID_, &sim_type);
need_redraw = 1;
if(save_npoints != -1) { /* restore multiple OP points from artificial dc sweep */
@ -2491,18 +2491,18 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset)
autoload = !strboolcmp(get_tok_value(r->prop_ptr,"autoload", 0), "true");
if(autoload == 0) autoload = 2;
dbg(1, "graph_fullyzoom(): graph_dataset=%d\n", graph_dataset);
my_strdup2(366, &node, get_tok_value(r->prop_ptr,"node", 0));
my_strdup2(367, &sweep, get_tok_value(r->prop_ptr,"sweep", 0));
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));
ptr = get_tok_value(r->prop_ptr,"rawfile", 0);
if(!ptr[0]) {
if(xctx->raw && xctx->raw->rawfile) my_strdup2(368, &custom_rawfile, xctx->raw->rawfile);
else my_strdup2(369, &custom_rawfile, "");
if(xctx->raw && xctx->raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, xctx->raw->rawfile);
else my_strdup2(_ALLOC_ID_, &custom_rawfile, "");
} else {
my_strdup2(370, &custom_rawfile, ptr);
my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr);
}
my_strdup2(371, &sim_type, get_tok_value(r->prop_ptr,"sim_type", 0));
my_strdup2(_ALLOC_ID_, &sim_type, get_tok_value(r->prop_ptr,"sim_type", 0));
save_extra_idx = xctx->extra_idx;
nptr = node;
@ -2518,7 +2518,7 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset)
extra_rawfile(autoload, custom_rawfile, sim_type[0] ? sim_type : xctx->raw->sim_type, -1.0, -1.0);
}
raw = xctx->raw;
my_strdup2(372, &nd, find_nth(ntok, "%", "\"", 0, 2));
my_strdup2(_ALLOC_ID_, &nd, find_nth(ntok, "%", "\"", 0, 2));
/* if %<n> is specified after node name, <n> is the dataset number to plot in graph */
if(nd[0]) {
int pos = 1;
@ -2527,25 +2527,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(373, &node_rawfile, tclresult());
my_strdup2(_ALLOC_ID_, &node_rawfile, tclresult());
tclvareval("subst {", find_nth(nd, "\n ", "\"", 0, pos + 1), "}", NULL);
my_strdup2(374, &node_sim_type, tclresult()[0] ? tclresult() :
my_strdup2(_ALLOC_ID_, &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(375, &node_rawfile);
my_free(376, &node_sim_type);
my_free(_ALLOC_ID_, &node_rawfile);
my_free(_ALLOC_ID_, &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(377, &ntok_copy, find_nth(ntok, "%", "\"", 4, 1));
my_strdup(_ALLOC_ID_, &ntok_copy, find_nth(ntok, "%", "\"", 4, 1));
} else {
node_dataset = -1;
my_strdup(378, &ntok_copy, ntok);
my_strdup(_ALLOC_ID_, &ntok_copy, ntok);
}
/* transform multiple OP points into a dc sweep */
@ -2556,14 +2556,14 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset)
raw->npoints[0] = raw->allpoints;
}
my_free(379, &nd);
my_free(_ALLOC_ID_, &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(380, &bus_msb, trim_chars(tmp_ptr, "\n "));
my_strdup2(_ALLOC_ID_, &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);
@ -2577,9 +2577,9 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset)
if(!bus_msb) {
char *express = NULL;
if(strstr(ntok_copy, ";")) {
my_strdup2(381, &express, find_nth(ntok_copy, ";", "\"", 0, 2));
my_strdup2(_ALLOC_ID_, &express, find_nth(ntok_copy, ";", "\"", 0, 2));
} else {
my_strdup2(382, &express, ntok_copy);
my_strdup2(_ALLOC_ID_, &express, ntok_copy);
}
if(strpbrk(express, " \n\t")) {
/* we *need* to recalculate the expression column for any new expression
@ -2588,7 +2588,7 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset)
} else {
v = get_raw_index(express, NULL);
}
my_free(383, &express);
my_free(_ALLOC_ID_, &express);
dbg(1, "graph_fullyzoom(): v=%d\n", v);
}
if(xctx->raw && v >= 0) {
@ -2637,7 +2637,7 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int graph_dataset)
sweepvar_wrap++;
} /* for(dset...) */
}
if(bus_msb) my_free(384, &bus_msb);
if(bus_msb) my_free(_ALLOC_ID_, &bus_msb);
if(save_npoints != -1) { /* restore multiple OP points from artificial dc sweep */
raw->datasets = save_datasets;
raw->npoints[0] = save_npoints;
@ -2652,18 +2652,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(385, &node);
my_free(386, &sweep);
my_free(387, &custom_rawfile);
my_free(388, &sim_type);
if(ntok_copy) my_free(389, &ntok_copy);
my_strdup(390, &r->prop_ptr, subst_token(r->prop_ptr, "y1", dtoa(min)));
my_strdup(391, &r->prop_ptr, subst_token(r->prop_ptr, "y2", dtoa(max)));
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)));
need_redraw = 1;
} else { /* digital plot */
my_strdup(392, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1",
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos1",
get_tok_value(r->prop_ptr, "y1", 0) ));
my_strdup(393, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2",
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "ypos2",
get_tok_value(r->prop_ptr, "y2", 0) ));
need_redraw = 1;
}
@ -3337,18 +3337,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(394, &alias_ptr, find_nth(ntok, ";", "\"", 0, 1));
my_strdup2(395, &ntok_ptr, find_nth(ntok, ";", "\"", 0, 2));
my_strdup2(_ALLOC_ID_, &alias_ptr, find_nth(ntok, ";", "\"", 0, 1));
my_strdup2(_ALLOC_ID_, &ntok_ptr, find_nth(ntok, ";", "\"", 0, 2));
}
else {
my_strdup2(396, &alias_ptr, ntok);
my_strdup2(397, &ntok_ptr, ntok);
my_strdup2(_ALLOC_ID_, &alias_ptr, ntok);
my_strdup2(_ALLOC_ID_, &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(398, &alias_ptr);
my_free(399, &ntok_ptr);
my_free(_ALLOC_ID_, &alias_ptr);
my_free(_ALLOC_ID_, &ntok_ptr);
}
if(gr->digital) {
double xt = gr->x1 - 15 * gr->txtsizelab;
@ -3486,8 +3486,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(400, &i->prop_ptr, subst_token(i->prop_ptr, "spice_data", ptr));
my_free(401, &ptr);
my_strdup2(_ALLOC_ID_, &i->prop_ptr, subst_token(i->prop_ptr, "spice_data", ptr));
my_free(_ALLOC_ID_, &ptr);
set_modify(1);
}
return res;
@ -3512,9 +3512,9 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
xRect *r = &xctx->rect[GRIDLAYER][i];
/* get plot data */
my_strdup2(402, &node, get_tok_value(r->prop_ptr,"node", 0));
my_strdup2(403, &color, get_tok_value(r->prop_ptr,"color", 0));
my_strdup2(404, &sweep, get_tok_value(r->prop_ptr,"sweep", 0));
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));
nptr = node;
cptr = color;
sptr = sweep;
@ -3552,11 +3552,11 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
} else {
if(gr->hilight_wave == wcnt) {
gr->hilight_wave = -1;
my_strdup2(405, &r->prop_ptr,
my_strdup2(_ALLOC_ID_, &r->prop_ptr,
subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
} else {
gr->hilight_wave = wcnt;
my_strdup2(406, &r->prop_ptr,
my_strdup2(_ALLOC_ID_, &r->prop_ptr,
subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
}
}
@ -3579,11 +3579,11 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
} else {
if(gr->hilight_wave == wcnt) {
gr->hilight_wave = -1;
my_strdup2(407, &r->prop_ptr,
my_strdup2(_ALLOC_ID_, &r->prop_ptr,
subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
} else {
gr->hilight_wave = wcnt;
my_strdup2(408, &r->prop_ptr,
my_strdup2(_ALLOC_ID_, &r->prop_ptr,
subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
}
}
@ -3591,9 +3591,9 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
}
++wcnt;
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", 0, &saven)) ) */
my_free(409, &node);
my_free(410, &color);
my_free(411, &sweep);
my_free(_ALLOC_ID_, &node);
my_free(_ALLOC_ID_, &color);
my_free(_ALLOC_ID_, &sweep);
return ret;
}
@ -3700,18 +3700,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(412, &node, get_tok_value(r->prop_ptr,"node", 0));
my_strdup2(413, &sweep, get_tok_value(r->prop_ptr,"sweep", 0));
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));
ptr = get_tok_value(r->prop_ptr,"rawfile", 0);
if(!ptr[0]) {
if(raw && raw->rawfile) my_strdup2(414, &custom_rawfile, raw->rawfile);
else my_strdup2(415, &custom_rawfile, "");
if(raw && raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, raw->rawfile);
else my_strdup2(_ALLOC_ID_, &custom_rawfile, "");
} else {
my_strdup2(416, &custom_rawfile, ptr);
my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr);
}
my_strdup2(417, &sim_type, get_tok_value(r->prop_ptr,"sim_type", 0));
my_strdup2(_ALLOC_ID_, &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);
}
@ -3738,9 +3738,9 @@ int find_closest_wave(int i, Graph_ctx *gr)
expression = 0;
if(raw->values) {
if(strstr(ntok, ";")) {
my_strdup2(418, &express, find_nth(ntok, ";", "\"", 0, 2));
my_strdup2(_ALLOC_ID_, &express, find_nth(ntok, ";", "\"", 0, 2));
} else {
my_strdup2(419, &express, ntok);
my_strdup2(_ALLOC_ID_, &express, ntok);
}
if(strpbrk(express, " \n\t")) {
expression = 1;
@ -3824,14 +3824,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(420, &express);
if(express) my_free(_ALLOC_ID_, &express);
if(sch_waves_loaded()!= -1 && custom_rawfile[0]) extra_rawfile(5, NULL, NULL, -1.0, -1.0);
my_free(421, &custom_rawfile);
my_free(422, &sim_type);
my_free(_ALLOC_ID_, &custom_rawfile);
my_free(_ALLOC_ID_, &sim_type);
my_free(423, &node);
my_free(424, &sweep);
my_free(_ALLOC_ID_, &node);
my_free(_ALLOC_ID_, &sweep);
return closest_dataset;
}
@ -3919,18 +3919,18 @@ void draw_graph(int i, int flags, Graph_ctx *gr, void *ct)
/* graph box, gridlines and axes */
draw_graph_grid(gr, ct);
/* get data to plot */
my_strdup2(425, &node, get_tok_value(r->prop_ptr,"node", 0));
my_strdup2(426, &color, get_tok_value(r->prop_ptr,"color", 0));
my_strdup2(427, &sweep, get_tok_value(r->prop_ptr,"sweep", 0));
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));
ptr = get_tok_value(r->prop_ptr,"rawfile", 0);
if(!ptr[0]) {
if(xctx->raw && xctx->raw->rawfile) my_strdup2(428, &custom_rawfile, xctx->raw->rawfile);
else my_strdup2(429, &custom_rawfile, "");
if(xctx->raw && xctx->raw->rawfile) my_strdup2(_ALLOC_ID_, &custom_rawfile, xctx->raw->rawfile);
else my_strdup2(_ALLOC_ID_, &custom_rawfile, "");
} else {
my_strdup2(430, &custom_rawfile, ptr);
my_strdup2(_ALLOC_ID_, &custom_rawfile, ptr);
}
my_strdup2(431, &sim_type, get_tok_value(r->prop_ptr,"sim_type", 0));
my_strdup2(_ALLOC_ID_, &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;
@ -3956,7 +3956,7 @@ void draw_graph(int i, int flags, Graph_ctx *gr, void *ct)
valid_rawfile = 0;
}
}
my_strdup2(432, &nd, find_nth(ntok, "%", "\"", 0, 2));
my_strdup2(_ALLOC_ID_, &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);
@ -3972,30 +3972,30 @@ void draw_graph(int i, 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(433, &node_rawfile, tclresult());
my_strdup2(_ALLOC_ID_, &node_rawfile, tclresult());
tclvareval("subst {", find_nth(nd, "\n ", "\"", 0, pos + 1), "}", NULL);
my_strdup2(434, &node_sim_type, tclresult()[0] ? tclresult() :
my_strdup2(_ALLOC_ID_, &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(435, &node_rawfile);
my_free(436, &node_sim_type);
my_free(_ALLOC_ID_, &node_rawfile);
my_free(_ALLOC_ID_, &node_sim_type);
valid_rawfile = 0;
}
}
my_free(437, &node_rawfile);
my_free(438, &node_sim_type);
my_free(_ALLOC_ID_, &node_rawfile);
my_free(_ALLOC_ID_, &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(439, &ntok_copy, find_nth(ntok, "%", "\"", 4, 1));
my_strdup(_ALLOC_ID_, &ntok_copy, find_nth(ntok, "%", "\"", 4, 1));
} else {
node_dataset = -1;
my_strdup(440, &ntok_copy, ntok);
my_strdup(_ALLOC_ID_, &ntok_copy, ntok);
}
if(nd) my_free(441, &nd);
if(nd) my_free(_ALLOC_ID_, &nd);
/* transform multiple OP points into a dc sweep */
if(xctx->raw && xctx->raw->sim_type && !strcmp(xctx->raw->sim_type, "op")
&& xctx->raw->datasets > 1 && xctx->raw->npoints[0] == 1) {
@ -4005,14 +4005,14 @@ void draw_graph(int i, int flags, Graph_ctx *gr, void *ct)
xctx->raw->npoints[0] = xctx->raw->allpoints;
}
my_free(442, &nd);
my_free(_ALLOC_ID_, &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(443, &bus_msb, trim_chars(tmp_ptr, "\n "));
my_strdup2(_ALLOC_ID_, &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);
@ -4034,9 +4034,9 @@ void draw_graph(int i, int flags, Graph_ctx *gr, void *ct)
expression = 0;
if(!bus_msb) {
if(strstr(ntok_copy, ";")) {
my_strdup2(444, &express, find_nth(ntok_copy, ";", "\"", 0, 2));
my_strdup2(_ALLOC_ID_, &express, find_nth(ntok_copy, ";", "\"", 0, 2));
} else {
my_strdup2(445, &express, ntok_copy);
my_strdup2(_ALLOC_ID_, &express, ntok_copy);
}
dbg(1, "express=|%s|\n", express);
if(strpbrk(express, " \n\t")) {
@ -4086,7 +4086,7 @@ void draw_graph(int i, int flags, Graph_ctx *gr, void *ct)
ofs_end = ofs + xctx->raw->npoints[dset];
first = -1;
poly_npoints = 0;
my_realloc(446, &point, xctx->raw->npoints[dset] * sizeof(XPoint));
my_realloc(_ALLOC_ID_, &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;
@ -4204,11 +4204,11 @@ void draw_graph(int i, 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(447, &point);
if(idx_arr) my_free(448, &idx_arr);
my_free(_ALLOC_ID_, &point);
if(idx_arr) my_free(_ALLOC_ID_, &idx_arr);
} /* if( expression || (idx = get_raw_index(bus_msb ? bus_msb : express, NULL)) != -1 ) */
++wcnt;
if(bus_msb) my_free(449, &bus_msb);
if(bus_msb) my_free(_ALLOC_ID_, &bus_msb);
if(sch_waves_loaded()!= -1 && save_npoints != -1) { /* restore multiple OP points from artificial dc sweep */
xctx->raw->datasets = save_datasets;
xctx->raw->npoints[0] = save_npoints;
@ -4219,14 +4219,14 @@ void draw_graph(int i, int flags, Graph_ctx *gr, void *ct)
}
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", 0, &saven)) ) */
if(ntok_copy) my_free(450, &ntok_copy);
if(express) my_free(451, &express);
if(ntok_copy) my_free(_ALLOC_ID_, &ntok_copy);
if(express) my_free(_ALLOC_ID_, &express);
/* if(sch_waves_loaded()!= -1 && custom_rawfile[0]) extra_rawfile(5, NULL, NULL, -1.0, -1.0); */
my_free(452, &custom_rawfile);
my_free(453, &sim_type);
my_free(454, &node);
my_free(455, &color);
my_free(456, &sweep);
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);
} /* if(flags & 8) */
/*
* bbox(START, 0.0, 0.0, 0.0, 0.0);
@ -4334,7 +4334,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(457, &closure->buffer, closure->pos + length + 65536);
my_realloc(_ALLOC_ID_, &closure->buffer, closure->pos + length + 65536);
closure->size = closure->pos + length + 65536;
}
memcpy(closure->buffer + closure->pos, in_data, length);
@ -4506,9 +4506,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(458, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", encoded_data));
my_free(459, &closure.buffer);
my_free(460, &encoded_data);
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);
}
dbg(1, "size_x = %d, size_y = %d, stride = %d\n", size_x, size_y, stride);
return 1;
@ -4543,7 +4543,7 @@ static cairo_surface_t *get_surface_from_file(const char *filename, const char *
fd = my_fopen(filename, fopen_read_mode);
if(fd) {
size_t bytes_read;
filedata = my_malloc(461, filesize);
filedata = my_malloc(_ALLOC_ID_, 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",
@ -4562,7 +4562,7 @@ static cairo_surface_t *get_surface_from_file(const char *filename, const char *
dbg(0, "get_surface_from_file():\n");
dbg(0, " A SVG file is specified but no 'filter' attribute to convert to png was given\n");
dbg(0, " May be no 'svg_to_png' variable was specified in xschemrc\n");
my_free(462, &filedata);
my_free(_ALLOC_ID_, &filedata);
return NULL;
}
}
@ -4571,7 +4571,7 @@ 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);
if(!svg) my_free(463, &filedata);
if(!svg) my_free(_ALLOC_ID_, &filedata);
closure.buffer = (unsigned char *)filtered_img_data;
closure.size = filtered_img_size;
closure.pos = 0;
@ -4600,7 +4600,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, "get_surface_from_file(): failure creating image surface from %s\n", filename);
if(surface) cairo_surface_destroy(surface);
my_free(464, &closure.buffer);
my_free(_ALLOC_ID_, &closure.buffer);
*buffer = NULL;
*size = 0;
return NULL;
@ -4610,7 +4610,7 @@ static cairo_surface_t *get_surface_from_file(const char *filename, const char *
* not the filtered content, This way we don't lose resolution */
*buffer = (unsigned char *)filedata;
*size = filesize;
my_free(465, &closure.buffer);
my_free(_ALLOC_ID_, &closure.buffer);
} else {
*buffer = closure.buffer;
*size = closure.size;
@ -4643,7 +4643,7 @@ static cairo_surface_t *get_surface_from_b64data(const char *attr, size_t attr_l
else jpg = -1; /* some invalid data */
if(jpg == -1) {
my_free(466, &closure.buffer);
my_free(_ALLOC_ID_, &closure.buffer);
return NULL;
}
@ -4663,7 +4663,7 @@ static cairo_surface_t *get_surface_from_b64data(const char *attr, size_t attr_l
char *filtered_img_data = NULL;
int ret =
filter_data((char *)closure.buffer, closure.size, &filtered_img_data, &filtered_img_size, filter);
my_free(467, &closure.buffer);
my_free(_ALLOC_ID_, &closure.buffer);
closure.buffer = (unsigned char *)filtered_img_data;
closure.size = filtered_img_size;
closure.pos = 0;
@ -4671,7 +4671,7 @@ static cairo_surface_t *get_surface_from_b64data(const char *attr, size_t attr_l
surface = cairo_image_surface_create_from_png_stream(png_reader, &closure);
} else {
surface = NULL;
if(closure.buffer) my_free(468, &closure.buffer);
if(closure.buffer) my_free(_ALLOC_ID_, &closure.buffer);
return NULL;;
}
}
@ -4680,7 +4680,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(469, &closure.buffer);
my_free(_ALLOC_ID_, &closure.buffer);
return surface;
}
#endif /* HAS_CAIRO==1 */
@ -4717,7 +4717,7 @@ int draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2,
set_rect_extraptr(1, r); /* create r->extraptr pointing to a xEmb_image struct */
emb_ptr = r->extraptr;
my_strncpy(filename, get_tok_value(r->prop_ptr, "image", 0), S(filename));
my_strdup(470, &filter, get_tok_value(r->prop_ptr, "filter", 0));
my_strdup(_ALLOC_ID_, &filter, get_tok_value(r->prop_ptr, "filter", 0));
/******* read image from in-memory buffer ... *******/
if(emb_ptr && emb_ptr->image) {
/* nothing to do, image is already created */
@ -4725,7 +4725,7 @@ int draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2,
} else if( (attr = get_tok_value(r->prop_ptr, "image_data", 0))[0] && (attr_len = strlen(attr)) > 5) {
emb_ptr->image = get_surface_from_b64data(attr, attr_len, filter);
if(!emb_ptr->image) {
my_free(471, &filter);
my_free(_ALLOC_ID_, &filter);
return 0;
}
/******* ... or read PNG from file (image attribute) *******/
@ -4738,14 +4738,14 @@ int draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2,
/* if filename is a SVG file buffer will be the plain svg file content, not the filtered data */
emb_ptr->image = get_surface_from_file(filename, filter, &buffer, &size);
if(!emb_ptr->image) {
my_free(472, &filter);
my_free(_ALLOC_ID_, &filter);
return 0;
}
/* put base64 encoded data to rect image_data attribute */
encoded_data = base64_encode((unsigned char *)buffer, size, &olength, 0);
my_strdup2(473, &r->prop_ptr, subst_token(r->prop_ptr, "image_data", encoded_data));
my_free(474, &encoded_data);
my_free(475, &buffer);
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);
} else { /* no emb_ptr->image and no "image_data" attribute */
return 0;
}
@ -4814,7 +4814,7 @@ int draw_image(int dr, xRect *r, double *x1, double *y1, double *x2, double *y2,
cairo_restore(xctx->cairo_ctx);
cairo_restore(xctx->cairo_save_ctx);
}
my_free(476, &filter);
my_free(_ALLOC_ID_, &filter);
#endif
return 1;
}
@ -4913,7 +4913,7 @@ void svg_embedded_graph(FILE *fd, int i, double rx1, double ry1, double rx2, dou
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(477, &closure.buffer);
my_free(_ALLOC_ID_, &closure.buffer);
cairo_surface_destroy(png_sfc);
xctx->draw_pixmap=1;
xctx->draw_window=save_draw_window;
@ -4931,7 +4931,7 @@ void svg_embedded_graph(FILE *fd, int i, double rx1, double ry1, double rx2, dou
"xlink:href=\"data:image/png;base64,%s\"/>\n",
0.0, 0.0, w, h, transform, ptr);
}
my_free(478, &ptr);
my_free(_ALLOC_ID_, &ptr);
#endif
}

View File

@ -154,7 +154,7 @@ char *my_fgets(FILE *fd, size_t *line_len)
if(line_len) *line_len = 0;
while(fgets(buf, SIZE, fd)) {
my_strcat(479, &s, buf);
my_strcat(_ALLOC_ID_, &s, buf);
len = strlen(buf);
if(line_len) *line_len += len;
if(buf[len - 1] == '\n') break;
@ -242,7 +242,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(480, dest);
my_free(_ALLOC_ID_, dest);
dbg(3,"my_strdup(%d,): freed destination ptr\n", id);
}
@ -255,7 +255,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(481, dest);
my_free(_ALLOC_ID_, dest);
}
if(src!=NULL && src[0]!='\0')
{
@ -285,7 +285,7 @@ char *my_expand(const char *s, int tabstop)
if(!s) {
return NULL;
}
my_strcat2(482, &t, "");
my_strcat2(_ALLOC_ID_, &t, "");
while(*sptr) {
if(*sptr == '\t') {
int i;
@ -298,7 +298,7 @@ char *my_expand(const char *s, int tabstop)
pad[1] = '\0';
spos++;
}
my_strcat2(483, &t, pad);
my_strcat2(_ALLOC_ID_, &t, pad);
if(*sptr == '\n') spos = 0;
sptr++;
}
@ -476,7 +476,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(484, dest);
my_free(_ALLOC_ID_, dest);
dbg(3,"my_strdup2(%d,): freed destination ptr\n", id);
}
return 0;
@ -849,11 +849,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(485, &xctx->inst[i].prop_ptr, ptr);
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, ptr);
if(get_tok_value(ptr, "name",0)[0]) {
my_strdup(486, &tmp, xctx->inst[i].prop_ptr);
my_strdup(_ALLOC_ID_, &tmp, xctx->inst[i].prop_ptr);
new_prop_string(i, tmp, tclgetboolvar("disable_unique_names")); /* sets also inst[].instname */
my_free(487, &tmp);
my_free(_ALLOC_ID_, &tmp);
}
}
@ -1014,7 +1014,7 @@ static int edit_rect_property(int x)
fprintf(errfp, "edit_rect_property() : unknown parameter x=%d\n",x);
return 0;
}
my_strdup(488, &oldprop, xctx->rect[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
my_strdup(_ALLOC_ID_, &oldprop, xctx->rect[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval",oldprop);
} else {
@ -1038,7 +1038,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(489, &xctx->rect[c][n].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->rect[c][n].prop_ptr,
(char *) tclgetvar("retval"));
}
set_rect_flags(&xctx->rect[c][n]); /* set cached .flags bitmask from attributes */
@ -1092,7 +1092,7 @@ static int edit_rect_property(int x)
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
}
}
my_free(490, &oldprop);
my_free(_ALLOC_ID_, &oldprop);
return modified;
}
@ -1102,7 +1102,7 @@ static int edit_line_property(void)
const char *dash;
int preserve, modified = 0;
char *oldprop=NULL;
my_strdup(491, &oldprop, xctx->line[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
my_strdup(_ALLOC_ID_, &oldprop, xctx->line[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval", oldprop);
} else {
@ -1124,7 +1124,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(492, &xctx->line[c][n].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->line[c][n].prop_ptr,
(char *) tclgetvar("retval"));
}
xctx->line[c][n].bus = get_attr_val(get_tok_value(xctx->line[c][n].prop_ptr,"bus",0));
@ -1146,7 +1146,7 @@ static int edit_line_property(void)
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
modified = 1;
}
my_free(493, &oldprop);
my_free(_ALLOC_ID_, &oldprop);
return modified;
}
@ -1158,7 +1158,7 @@ static int edit_wire_property(void)
char *oldprop=NULL;
int bus;
my_strdup(494, &oldprop, xctx->wire[xctx->sel_array[0].n].prop_ptr);
my_strdup(_ALLOC_ID_, &oldprop, xctx->wire[xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval", oldprop);
} else {
@ -1184,7 +1184,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(495, &xctx->wire[k].prop_ptr,(char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &xctx->wire[k].prop_ptr,(char *) tclgetvar("retval"));
}
bus = get_attr_val(get_tok_value(xctx->wire[k].prop_ptr,"bus",0));
if(bus) {
@ -1210,7 +1210,7 @@ static int edit_wire_property(void)
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
modified = 1;
}
my_free(496, &oldprop);
my_free(_ALLOC_ID_, &oldprop);
return modified;
}
@ -1223,7 +1223,7 @@ static int edit_arc_property(void)
const char *dash, *fill_ptr;
int preserve, modified = 0;
my_strdup(497, &oldprop, xctx->arc[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
my_strdup(_ALLOC_ID_, &oldprop, xctx->arc[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval", oldprop);
} else {
@ -1246,7 +1246,7 @@ static int edit_arc_property(void)
set_different_token(&xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"), oldprop);
} else {
my_strdup(498, &xctx->arc[c][i].prop_ptr, (char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &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);
@ -1298,7 +1298,7 @@ static int edit_polygon_property(void)
int preserve, modified = 0;
dbg(1, "edit_property(): input property:\n");
my_strdup(499, &oldprop, xctx->poly[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
my_strdup(_ALLOC_ID_, &oldprop, xctx->poly[xctx->sel_array[0].col][xctx->sel_array[0].n].prop_ptr);
if(oldprop && oldprop[0]) {
tclsetvar("retval", oldprop);
} else {
@ -1322,7 +1322,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(500, &xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr, (char *) tclgetvar("retval"));
}
old_fill = xctx->poly[c][i].fill;
old_dash = xctx->poly[c][i].dash;
@ -1391,7 +1391,7 @@ static int edit_text_property(int x)
}
dbg(1, "edit_text_property(): entering\n");
sel = xctx->sel_array[0].n;
my_strdup(501, &oldprop, xctx->text[sel].prop_ptr);
my_strdup(_ALLOC_ID_, &oldprop, xctx->text[sel].prop_ptr);
if(oldprop && oldprop[0])
tclsetvar("props", oldprop);
else
@ -1446,7 +1446,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(502, &estr);
my_free(_ALLOC_ID_, &estr);
#if HAS_CAIRO==1
if(customfont) {
cairo_restore(xctx->cairo_ctx);
@ -1455,7 +1455,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(503, &xctx->text[sel].floater_ptr);
my_free(_ALLOC_ID_, &xctx->text[sel].floater_ptr);
cg = tclgetdoublevar("cadgrid");
c = xctx->rects[PINLAYER];
for(l=0;l<c; ++l) {
@ -1472,25 +1472,25 @@ static int edit_text_property(int x)
(fabs(yy1 - pcy) < cg*3 || fabs(yy2 - pcy) < cg*3) )
) {
if(x==0)
my_strdup(504, &xctx->rect[PINLAYER][l].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->rect[PINLAYER][l].prop_ptr,
subst_token(xctx->rect[PINLAYER][l].prop_ptr, "name",
(char *) tclgetvar("retval")) );
else
my_strdup(505, &xctx->rect[PINLAYER][l].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->rect[PINLAYER][l].prop_ptr,
subst_token(xctx->rect[PINLAYER][l].prop_ptr, "name",
(char *) tclgetvar("retval")) );
}
}
}
my_strdup2(506, &xctx->text[sel].txt_ptr, (char *) tclgetvar("retval"));
my_strdup2(_ALLOC_ID_, &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(507, &xctx->text[sel].prop_ptr,(char *) tclgetvar("props"));
my_strdup(_ALLOC_ID_, &xctx->text[sel].prop_ptr,(char *) tclgetvar("props"));
my_free(508, &xctx->text[sel].floater_ptr);
my_free(_ALLOC_ID_, &xctx->text[sel].floater_ptr);
set_text_flags(&xctx->text[sel]);
}
if(text_changed || props_changed) {
@ -1503,7 +1503,7 @@ static int edit_text_property(int x)
} /* for(k=0;k<xctx->lastsel; ++k) */
draw();
}
my_free(509, &oldprop);
my_free(_ALLOC_ID_, &oldprop);
return modified;
}
@ -1523,9 +1523,9 @@ int drc_check(int i)
end = i + 1;
}
for(j = start; j < end; j++) {
my_strdup(510, &drc, get_tok_value(xctx->sym[xctx->inst[j].ptr].prop_ptr, "drc", 2));
my_strdup(_ALLOC_ID_, &drc, get_tok_value(xctx->sym[xctx->inst[j].ptr].prop_ptr, "drc", 2));
if(drc) {
my_strdup(511, &res, translate3(drc, 1,
my_strdup(_ALLOC_ID_, &res, translate3(drc, 1,
xctx->inst[j].prop_ptr, xctx->sym[xctx->inst[j].ptr].templ, NULL, NULL));
dbg(1, "drc_check(): res = |%s|, drc=|%s|\n", res, drc);
if(res) {
@ -1536,13 +1536,13 @@ int drc_check(int i)
result = tcleval(replace_res);
if(result && result[0]) {
ret = 1;
my_mstrcat(512, &check_result, result, NULL);
my_mstrcat(_ALLOC_ID_, &check_result, result, NULL);
}
}
}
}
if(drc) my_free(513, &drc);
if(res) my_free(514, &res);
if(drc) my_free(_ALLOC_ID_, &drc);
if(res) my_free(_ALLOC_ID_, &res);
if(check_result) {
if(has_x) {
/* tclvareval("alert_ {", check_result, "} {}", NULL); */
@ -1551,7 +1551,7 @@ int drc_check(int i)
} else {
dbg(0, "%s\n", check_result);
}
my_free(515, &check_result);
my_free(_ALLOC_ID_, &check_result);
}
return ret;
}
@ -1576,19 +1576,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(516, &xctx->old_prop);
my_free(_ALLOC_ID_, &xctx->old_prop);
return 0;
}
/* create new_prop updated attribute string */
if(*netl_com && x==1) {
my_strdup(517, &new_prop,
my_strdup(_ALLOC_ID_, &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(518, &new_prop, (char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &new_prop, (char *) tclgetvar("retval"));
dbg(1, "update_symbol(): new_prop=%s\n", new_prop);
}
my_strncpy(symbol, (char *) tclgetvar("symbol") , S(symbol));
@ -1616,18 +1616,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(519, &old_translated_sym, translate(*ii, xctx->inst[*ii].name));
my_strdup2(_ALLOC_ID_, &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(520, &ss, xctx->inst[*ii].prop_ptr);
my_strdup(_ALLOC_ID_, &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(521, &xctx->inst[*ii].prop_ptr, ss);
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, ss);
}
my_free(522, &ss);
my_free(_ALLOC_ID_, &ss);
}
else {
if(new_prop) {
@ -1636,11 +1636,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(523, &xctx->inst[*ii].prop_ptr, new_prop);
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, new_prop);
}
} else {
if(!pushed) { xctx->push_undo(); pushed=1;}
my_strdup(524, &xctx->inst[*ii].prop_ptr, "");
my_strdup(_ALLOC_ID_, &xctx->inst[*ii].prop_ptr, "");
}
}
}
@ -1649,7 +1649,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(525, &translated_sym, translate(*ii, symbol));
my_strdup2(_ALLOC_ID_, &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) ) ) {
@ -1665,37 +1665,37 @@ 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(526, &xctx->inst[*ii].name, rel_sym_path(symbol));
my_strdup2(_ALLOC_ID_, &xctx->inst[*ii].name, rel_sym_path(symbol));
xctx->inst[*ii].ptr=sym_number; /* update instance to point to new symbol */
}
my_free(527, &translated_sym);
my_free(528, &old_translated_sym);
my_free(_ALLOC_ID_, &translated_sym);
my_free(_ALLOC_ID_, &old_translated_sym);
/* if symbol changed ensure instance name (with new prefix char) is unique */
/* preserve backslashes in name ---------0---------------------------------->. */
my_strdup(529, &name, get_tok_value(xctx->inst[*ii].prop_ptr, "name", 1));
my_strdup(_ALLOC_ID_, &name, get_tok_value(xctx->inst[*ii].prop_ptr, "name", 1));
if(name && name[0] ) {
char *old_name = NULL;
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(530, &ptr, subst_token(xctx->inst[*ii].prop_ptr, "name", name) );
my_strdup(_ALLOC_ID_, &ptr, subst_token(xctx->inst[*ii].prop_ptr, "name", name) );
} else {
my_strdup(531, &ptr, xctx->inst[*ii].prop_ptr);
my_strdup(_ALLOC_ID_, &ptr, xctx->inst[*ii].prop_ptr);
}
/* set unique name of current inst */
if(!pushed) { xctx->push_undo(); pushed=1;}
if(!k) hash_names(-1, XINSERT);
hash_names(*ii, XDELETE);
dbg(1, "update_symbol(): delete %s\n", xctx->inst[*ii].instname);
my_strdup2(532, &old_name, xctx->inst[*ii].instname);
my_strdup2(_ALLOC_ID_, &old_name, xctx->inst[*ii].instname);
new_prop_string(*ii, ptr, /* sets also inst[].instname */
tclgetboolvar("disable_unique_names")); /* set new prop_ptr */
hash_names(*ii, XINSERT);
update_attached_floaters(old_name, *ii, 1);
dbg(1, "update_symbol(): insert %s\n", xctx->inst[*ii].instname);
my_free(533, &old_name);
my_free(_ALLOC_ID_, &old_name);
}
set_inst_flags(&xctx->inst[*ii]);
} /* end for(k=0;k<xctx->lastsel; ++k) */
@ -1716,10 +1716,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(534, &name);
my_free(535, &ptr);
my_free(536, &new_prop);
my_free(537, &xctx->old_prop);
my_free(_ALLOC_ID_, &name);
my_free(_ALLOC_ID_, &ptr);
my_free(_ALLOC_ID_, &new_prop);
my_free(_ALLOC_ID_, &xctx->old_prop);
return modified;
}
@ -1746,12 +1746,12 @@ static int edit_symbol_property(int x, int first_sel)
else {
tclsetvar("retval","");
}
my_strdup(538, &xctx->old_prop, xctx->inst[*ii].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->old_prop, xctx->inst[*ii].prop_ptr);
tclsetvar("symbol",xctx->inst[*ii].name);
if(x==0) {
tcleval("edit_prop {Input property:}");
my_strdup(539, &result, tclresult());
my_strdup(_ALLOC_ID_, &result, tclresult());
}
else {
/* edit_vi_netlist_prop will replace \" with " before editing,
@ -1760,11 +1760,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(540, &result, tclresult());
my_strdup(_ALLOC_ID_, &result, tclresult());
}
dbg(1, "edit_symbol_property(): before update_symbol, modified=%d\n", xctx->modified);
modified = update_symbol(result, x, *ii);
my_free(541, &result);
my_free(_ALLOC_ID_, &result);
dbg(1, "edit_symbol_property(): done update_symbol, modified=%d\n", modified);
*ii=-1;
return modified;
@ -1869,7 +1869,7 @@ char *str_replace(const char *str, const char *rep, const char *with, int escape
int replacements = 0;
if(s==NULL || rep == NULL || with == NULL || rep[0] == '\0') {
my_free(542, &result);
my_free(_ALLOC_ID_, &result);
size = 0;
return NULL;
}
@ -1878,7 +1878,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(543, &result, size);
my_realloc(_ALLOC_ID_, &result, size);
}
while(*s) {
STR_ALLOC(&result, result_pos + with_len + 1, &size);
@ -1906,7 +1906,7 @@ char *str_chars_replace(const char *str, const char *replace_set, const char wit
{
char *res = NULL;
char *s;
my_strdup(544, &res, str);
my_strdup(_ALLOC_ID_, &res, str);
s = res;
dbg(1, "*str_chars_replace(): %s\n", res);
while( *s) {
@ -1973,9 +1973,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(545, &new_prop, (char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &new_prop, (char *) tclgetvar("retval"));
tclsetvar("retval", new_prop);
my_free(546, &new_prop);
my_free(_ALLOC_ID_, &new_prop);
if(strcmp(tclgetvar("tctx::rcode"),"") )
@ -1984,31 +1984,31 @@ void edit_property(int x)
(!xctx->schsymbolprop || strcmp(xctx->schsymbolprop, tclgetvar("retval") ) ) ) {
xctx->push_undo();
modified = 1;
my_strdup(547, &xctx->schsymbolprop, (char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &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(548, &xctx->schverilogprop, (char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &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(549, &xctx->schprop, (char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &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(550, &xctx->schtedaxprop, (char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &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(551, &xctx->schvhdlprop, (char *) tclgetvar("retval"));
my_strdup(_ALLOC_ID_, &xctx->schvhdlprop, (char *) tclgetvar("retval"));
}
}

View File

@ -120,7 +120,7 @@ static void get_char(int c)
dbg(dbglev, "get_char: %c |%s|\n", c, str);
s[0] = (char)c;
s[1] = '\0';
my_mstrcat(562, &ret, s, NULL);
my_mstrcat(_ALLOC_ID_, &ret, s, NULL);
strptr = str;
}
@ -129,7 +129,7 @@ static void get_expr(double x)
char xx[100];
dbg(dbglev,"get_expr(): x=%g\n", x);
my_snprintf(xx, S(xx), "%.15g", x);
my_mstrcat(563, &ret, xx, NULL);
my_mstrcat(_ALLOC_ID_, &ret, xx, NULL);
strptr = str;
}
@ -167,10 +167,10 @@ static void kkerror(char *s) /* Called by kkparse on error */
{
char *ss = NULL;
dbg(dbglev, "error: |%s|\n\n |%s|\n", s, str ? str : "<NULL>");
my_strdup2(564, &ss, strptr);
my_strdup2(_ALLOC_ID_, &ss, strptr);
remove_expr(ss);
my_mstrcat(565, &ret, ss, NULL);
my_free(566, &ss);
my_mstrcat(_ALLOC_ID_, &ret, ss, NULL);
my_free(_ALLOC_ID_, &ss);
lex_state = 0;
}
@ -185,8 +185,8 @@ static symrec *getsym(char *sym_name)
symrec * putsym (char *sym_name)
{
symrec *ptr;
ptr = (symrec *) my_malloc(567, sizeof (symrec));
ptr->name = (char *) my_malloc(568, strlen (sym_name) + 1);
ptr = (symrec *) my_malloc(_ALLOC_ID_, sizeof (symrec));
ptr->name = (char *) my_malloc(_ALLOC_ID_, strlen (sym_name) + 1);
strcpy (ptr->name,sym_name);
ptr->next = (struct symrec *)sym_table;
sym_table = ptr;
@ -211,8 +211,8 @@ void eval_expr_clear_table(void)
while(ptr) {
symrec *tmp = ptr;
ptr = ptr->next;
my_free(569, &(tmp->name));
my_free(570, &tmp);
my_free(_ALLOC_ID_, &(tmp->name));
my_free(_ALLOC_ID_, &tmp);
}
}
@ -287,7 +287,7 @@ static int kklex()
char *eval_expr(const char *s)
{
lex_state = 0;
if(ret) my_free(571, &ret);
if(ret) my_free(_ALLOC_ID_, &ret);
strptr = str = s;
kkparse();
return ret;

View File

@ -70,13 +70,13 @@ static char *expandlabel_strdup(char *src)
char *ptr;
if(src==NULL || src[0]=='\0') {
ptr=NULL;
my_strdup(572, &ptr,"");
my_strdup(_ALLOC_ID_, &ptr,"");
return ptr;
}
else
{
ptr=NULL;
my_strdup(573, &ptr,src);
my_strdup(_ALLOC_ID_, &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(574, l1+l2+1); /* 2 strings plus '\0' */
res=my_malloc(_ALLOC_ID_, 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(575, l1+l2+2); /* 2 strings plus 'c' and '\0' */
res=my_malloc(_ALLOC_ID_, 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(576, (len+1)*n);
ss = str=my_malloc(_ALLOC_ID_, (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(577, (len+1)*n);
str=pos=my_malloc(_ALLOC_ID_, (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(578, &res, n[0] * (strlen(s) + strlen(suffix) + 30));
my_realloc(579, &tmp, strlen(s) + strlen(suffix) + 30);
my_realloc(_ALLOC_ID_, &res, n[0] * (strlen(s) + strlen(suffix) + 30));
my_realloc(_ALLOC_ID_, &tmp, strlen(s) + strlen(suffix) + 30);
l=0;
for(i=1;i<n[0];i++)
{
@ -191,7 +191,7 @@ static char *expandlabel_strbus_suffix(char *s, int *n, char *suffix)
memcpy(res+l,tmp, tmplen+1); /* 20180923 */
l+=tmplen;
}
my_free(580, &tmp);
my_free(_ALLOC_ID_, &tmp);
sprintf(res+l, "%s[%d]%s", s, n[i], suffix);
return res;
}
@ -202,8 +202,8 @@ static char *expandlabel_strbus(char *s, int *n)
int tmplen;
char *res=NULL;
char *tmp=NULL;
my_realloc(581, &res, n[0]*(strlen(s)+20));
my_realloc(582, &tmp, strlen(s)+30);
my_realloc(_ALLOC_ID_, &res, n[0]*(strlen(s)+20));
my_realloc(_ALLOC_ID_, &tmp, strlen(s)+30);
l=0;
for(i=1;i<n[0];i++)
{
@ -212,7 +212,7 @@ static char *expandlabel_strbus(char *s, int *n)
memcpy(res+l,tmp, tmplen+1); /* 20180923 */
l+=tmplen;
}
my_free(583, &tmp);
my_free(_ALLOC_ID_, &tmp);
sprintf(res+l, "%s[%d]", s, n[i]);
return res;
}
@ -223,7 +223,7 @@ static void check_idx(int **ptr,int n)
{
idxsize*=2;
dbg(3, "check_idx(): reallocating idx array: size=%d\n",idxsize);
my_realloc(584, ptr, idxsize*sizeof(int));
my_realloc(_ALLOC_ID_, ptr, idxsize*sizeof(int));
}
}
@ -233,8 +233,8 @@ static char *expandlabel_strbus_nobracket(char *s, int *n)
int tmplen;
char *res=NULL;
char *tmp=NULL;
my_realloc(585, &res, n[0]*(strlen(s)+20));
my_realloc(586, &tmp, strlen(s)+30);
my_realloc(_ALLOC_ID_, &res, n[0]*(strlen(s)+20));
my_realloc(_ALLOC_ID_, &tmp, strlen(s)+30);
l=0;
for(i=1;i<n[0];i++)
{
@ -243,7 +243,7 @@ static char *expandlabel_strbus_nobracket(char *s, int *n)
memcpy(res+l,tmp, tmplen+1);
l+=tmplen;
}
my_free(587, &tmp);
my_free(_ALLOC_ID_, &tmp);
sprintf(res+l, "%s%d", s, n[i]);
return res;
}
@ -254,8 +254,8 @@ static char *expandlabel_strbus_nobracket_suffix(char *s, int *n, char *suffix)
int tmplen;
char *res=NULL;
char *tmp=NULL;
my_realloc(588, &res, n[0] * (strlen(s) + strlen(suffix) + 30));
my_realloc(589, &tmp, strlen(s) + strlen(suffix) + 30);
my_realloc(_ALLOC_ID_, &res, n[0] * (strlen(s) + strlen(suffix) + 30));
my_realloc(_ALLOC_ID_, &tmp, strlen(s) + strlen(suffix) + 30);
l=0;
for(i=1;i<n[0];i++)
{
@ -264,7 +264,7 @@ static char *expandlabel_strbus_nobracket_suffix(char *s, int *n, char *suffix)
memcpy(res+l,tmp, tmplen+1);
l+=tmplen;
}
my_free(590, &tmp);
my_free(_ALLOC_ID_, &tmp);
sprintf(res+l, "%s%d%s", s, n[i], suffix);
return res;
}
@ -308,28 +308,28 @@ int *idx; /* for bus index & bus index ranges */
line: /* empty */
| list {
dbg(dbg_var, "yyparse(): list, dest_string.str=%s\n", $1.str);
my_strdup(591, &(dest_string.str),$1.str);
my_free(592, &$1.str);
my_strdup(_ALLOC_ID_, &(dest_string.str),$1.str);
my_free(_ALLOC_ID_, &$1.str);
dest_string.m=$1.m;
}
;
list: B_NAME {
dbg(dbg_var, "yyparse(): B_NAME, $1=%s\n", $1);
$$.str = expandlabel_strdup($1);
my_free(593, &$1);
my_free(_ALLOC_ID_, &$1);
$$.m = 1;
}
| B_LINE {
dbg(dbg_var, "yyparse(): B_LINE\n");
$$.str = expandlabel_strdup($1); /* prima era =$1 */
my_free(594, &$1);
my_free(_ALLOC_ID_, &$1);
$$.m = 1;
}
| list B_NAME {
dbg(dbg_var, "yyparse(): list B_NAME, $2=%s\n", $2);
$$.str = expandlabel_strcat($1.str, $2);
my_free(595, &$1.str);
my_free(596, &$2);
my_free(_ALLOC_ID_, &$1.str);
my_free(_ALLOC_ID_, &$2);
$$.m = $1.m;
}
| list '*' B_NUM
@ -339,29 +339,29 @@ list: B_NAME {
$$.str=expandlabel_strmult2($3,$1.str);
dbg(dbg_var, "yyparse(): |%s|\n",$$.str);
$$.m = $3 * $1.m;
my_free(597, &$1.str);
my_free(_ALLOC_ID_, &$1.str);
}
| B_NUM '*' list
{
dbg(dbg_var, "yyparse(): B_NUM * list\n");
$$.str=expandlabel_strmult($1,$3.str);
$$.m = $1 * $3.m;
my_free(598, &$3.str);
my_free(_ALLOC_ID_, &$3.str);
}
| list ',' list {
dbg(dbg_var, "yyparse(): list , list\n");
$$.str=expandlabel_strcat_char($1.str, ',', $3.str);
$$.m = $1.m + $3.m;
my_free(599, &$1.str);
my_free(600, &$3.str);
my_free(_ALLOC_ID_, &$1.str);
my_free(_ALLOC_ID_, &$3.str);
}
| list B_CAR list
{
dbg(dbg_var, "yyparse(): list B_CAR list\n");
$$.str=expandlabel_strcat_char($1.str, (char)$2, $3.str);
$$.m = $1.m + $3.m;
my_free(601, &$1.str);
my_free(602, &$3.str);
my_free(_ALLOC_ID_, &$1.str);
my_free(_ALLOC_ID_, &$3.str);
}
| '(' list ')' {
dbg(dbg_var, "yyparse(): ( list )\n");
@ -371,29 +371,29 @@ list: B_NAME {
{
size_t size = strlen($1) + strlen($3) + 3;
dbg(dbg_var, "yyparse(): B_NAME [ B_NAME ] , $1=%s $3=%s\n", $1, $3);
$$.str = my_malloc(603, size);
$$.str = my_malloc(_ALLOC_ID_, size);
$$.m=-1;
my_snprintf($$.str, size, "%s[%s]", $1, $3);
my_free(604, &$1);
my_free(605, &$3);
my_free(_ALLOC_ID_, &$1);
my_free(_ALLOC_ID_, &$3);
}
| B_NAME '[' index ']'
{
dbg(dbg_var, "yyparse(): B_NAME [ index ] , $1=%s $3=%d\n", $1, $3[0]);
$$.str=expandlabel_strbus($1,$3);
my_free(606, &$1);
my_free(_ALLOC_ID_, &$1);
$$.m=$3[0];
my_free(607, &$3);
my_free(_ALLOC_ID_, &$3);
idxsize=INITIALIDXSIZE;
}
| B_NAME '[' index ']' B_TRAILER
{
dbg(dbg_var, "yyparse(): B_NAME [ index ] B_NAME, $1=%s $3=%d, $5=%s\n", $1, $3[0], $5);
$$.str=expandlabel_strbus_suffix($1, $3, $5);
my_free(608, &$1);
my_free(609, &$5);
my_free(_ALLOC_ID_, &$1);
my_free(_ALLOC_ID_, &$5);
$$.m=$3[0];
my_free(610, &$3);
my_free(_ALLOC_ID_, &$3);
idxsize=INITIALIDXSIZE;
}
@ -401,19 +401,19 @@ list: B_NAME {
{
dbg(dbg_var, "yyparse(): B_NAME [ index_nobracket ] $1=%s $3=%d\n",$1, $3[0]);
$$.str=expandlabel_strbus_nobracket($1,$3);
my_free(611, &$1);
my_free(_ALLOC_ID_, &$1);
$$.m=$3[0];
my_free(612, &$3);
my_free(_ALLOC_ID_, &$3);
idxsize=INITIALIDXSIZE;
}
| B_NAME '[' index_nobracket ']' B_TRAILER
{
dbg(dbg_var, "yyparse(): B_NAME [ index_nobracket ] $1=%s $3=%d, $5=%s\n",$1, $3[0], $5);
$$.str=expandlabel_strbus_nobracket_suffix($1, $3, $5);
my_free(613, &$1);
my_free(614, &$5);
my_free(_ALLOC_ID_, &$1);
my_free(_ALLOC_ID_, &$5);
$$.m=$3[0];
my_free(615, &$3);
my_free(_ALLOC_ID_, &$3);
idxsize=INITIALIDXSIZE;
}
@ -423,7 +423,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
/* start : end : extend : repetitions */
int r, i, sign, offset;
sign = XSIGN($3-$1);
$$=my_malloc(616, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
offset = 0;
for(r=0; r < $7; r++) {
@ -441,7 +441,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
int sign;
sign = XSIGN($3-$1);
$$=my_malloc(617, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
for(i=$1;;i+=sign*$5)
{
@ -455,7 +455,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
| B_IDXNUM ':' B_IDXNUM
{
int i;
$$=my_malloc(618, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
for(i=$1;;i+=XSIGN($3-$1))
{
@ -465,7 +465,7 @@ index: B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM ':' B_IDXNUM
}
}
| B_IDXNUM {
$$=my_malloc(619, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
check_idx(&$$, ++$$[0]);
$$[$$[0]]=$1;
@ -520,7 +520,7 @@ index_nobracket: B_IDXNUM B_DOUBLEDOT B_IDXNUM B_DOUBLEDOT B_IDXNUM B_DOUBLEDOT
/* start .. end .. offset .. repetitions */
int r, i, sign, offset;
sign = XSIGN($3-$1);
$$=my_malloc(620, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
offset = 0;
for(r=0; r < $7; r++) {
@ -538,7 +538,7 @@ index_nobracket: B_IDXNUM B_DOUBLEDOT B_IDXNUM B_DOUBLEDOT B_IDXNUM B_DOUBLEDOT
int sign;
sign = XSIGN($3-$1);
$$=my_malloc(621, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
for(i=$1;;i+=sign*$5)
{
@ -552,7 +552,7 @@ index_nobracket: B_IDXNUM B_DOUBLEDOT B_IDXNUM B_DOUBLEDOT B_IDXNUM B_DOUBLEDOT
| B_IDXNUM B_DOUBLEDOT B_IDXNUM
{
int i;
$$=my_malloc(622, INITIALIDXSIZE*sizeof(int));
$$=my_malloc(_ALLOC_ID_, INITIALIDXSIZE*sizeof(int));
$$[0]=0;
for(i=$1;;i+=XSIGN($3-$1))
{

View File

@ -275,7 +275,7 @@ void xfind_closest_net_or_symbol_pin(double mx, double my, double *x, double *y)
y0=xctx->inst[i].y0;
rot = xctx->inst[i].rot;
flip = xctx->inst[i].flip;
my_strdup(623, &type, (xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &type, (xctx->inst[i].ptr+ xctx->sym)->type);
if(!type) continue;
no_of_pin_rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER];
@ -318,7 +318,7 @@ void xfind_closest_net_or_symbol_pin(double mx, double my, double *x, double *y)
}
*x = min_dist_x;
*y = min_dist_y;
my_free(624, &type);
my_free(_ALLOC_ID_, &type);
}
#endif
@ -461,7 +461,7 @@ static void find_closest_text(double mx, double my, int override_lock)
xctx->text[i].hcenter, xctx->text[i].vcenter,
xctx->text[i].x0, xctx->text[i].y0,
&xx1, &yy1, &xx2, &yy2, &tmp, &dtmp);
my_free(625, &estr);
my_free(_ALLOC_ID_, &estr);
#if HAS_CAIRO==1
if(customfont) {
cairo_restore(xctx->cairo_ctx);

View File

@ -38,7 +38,7 @@ void compile_font(void)
select_inside(0, code*FONTOFFSET-1,-FONTHEIGHT-1,
code*FONTOFFSET+FONTWIDTH+1,FONTWHITESPACE + FONTDESCENT+1, 1);
rebuild_selected_array();
character[code] = my_calloc(626, xctx->lastsel*4+1, sizeof(double));
character[code] = my_calloc(_ALLOC_ID_, xctx->lastsel*4+1, sizeof(double));
character[code][0] = (double)xctx->lastsel;
dbg(2, "compile_font(): character[%d][]={%.16g",code,character[code][0]);
for(i=0;i<xctx->lastsel; ++i)
@ -60,6 +60,6 @@ void compile_font(void)
clear_drawing();
unselect_all(1);
xctx->currsch = 0;
my_free(627, &xctx->sch[xctx->currsch]);
my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]);
}

View File

@ -28,7 +28,7 @@ void init_inst_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, doub
dbg(3, "init_inst_iterator(): instances=%d\n", xctx->instances);
if(xctx->instances) {
my_realloc(628, &ctx->instflag, xctx->instances*sizeof(unsigned short));
my_realloc(_ALLOC_ID_, &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(629, &ctx->instflag);
my_free(_ALLOC_ID_, &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(630, &ctx->wireflag, xctx->wires*sizeof(unsigned short));
my_realloc(_ALLOC_ID_, &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(631, &ctx->wireflag);
my_free(_ALLOC_ID_, &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(632, &ctx->objectflag, xctx->n_hash_objects * sizeof(unsigned short));
my_realloc(_ALLOC_ID_, &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(633, &ctx->objectflag);
my_free(_ALLOC_ID_, &ctx->objectflag);
return NULL;
}
}

View File

@ -48,9 +48,9 @@ static void hilight_hash_free_entry(Hilight_hashentry *entry)
Hilight_hashentry *tmp;
while(entry) {
tmp = entry->next;
my_free(634, &entry->token);
my_free(635, &entry->path);
my_free(636, &entry);
my_free(_ALLOC_ID_, &entry->token);
my_free(_ALLOC_ID_, &entry->path);
my_free(_ALLOC_ID_, &entry);
entry = tmp;
}
}
@ -89,11 +89,11 @@ static Hilight_hashentry *hilight_hash_lookup(const char *token, int value, int
size_t lent = strlen(token) + 1;
size_t lenp = strlen(xctx->sch_path[xctx->currsch]) + 1;
if( what==XINSERT || what == XINSERT_NOREPLACE) { /* insert data */
Hilight_hashentry *entry = (Hilight_hashentry *)my_malloc(637, sizeof( Hilight_hashentry ));
Hilight_hashentry *entry = (Hilight_hashentry *)my_malloc(_ALLOC_ID_, sizeof( Hilight_hashentry ));
entry->next = NULL;
entry->token = my_malloc(638, lent);
entry->token = my_malloc(_ALLOC_ID_, lent);
memcpy(entry->token, token, lent);
entry->path = my_malloc(639, lenp);
entry->path = my_malloc(_ALLOC_ID_, lenp);
memcpy(entry->path, xctx->sch_path[xctx->currsch], lenp);
entry->oldvalue = value-1000; /* no old value, set different value anyway*/
entry->value = value;
@ -109,9 +109,9 @@ static Hilight_hashentry *hilight_hash_lookup(const char *token, int value, int
if(what==XDELETE) { /* remove token from the hash table ... */
Hilight_hashentry *saveptr;
saveptr=(*preventry)->next;
my_free(640, &(*preventry)->token);
my_free(641, &(*preventry)->path);
my_free(642, &(*preventry));
my_free(_ALLOC_ID_, &(*preventry)->token);
my_free(_ALLOC_ID_, &(*preventry)->path);
my_free(_ALLOC_ID_, &(*preventry));
*preventry=saveptr;
} else if(what == XINSERT ) {
(*preventry)->oldvalue =(*preventry)->value;
@ -134,13 +134,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(643, len);
inst_tok = my_malloc(_ALLOC_ID_, 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(644, &inst_tok);
my_free(_ALLOC_ID_, &inst_tok);
return entry;
}
@ -163,7 +163,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(645, &string, expandlabel(token,&mult));
my_strdup(_ALLOC_ID_, &string, expandlabel(token,&mult));
if(string==NULL) {
return NULL;
}
@ -187,7 +187,7 @@ Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int wha
string_ptr++;
}
/* if something found return first pointer */
my_free(646, &string);
my_free(_ALLOC_ID_, &string);
return ptr2;
}
@ -198,9 +198,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(647, &xctx->sch_path[xctx->currsch], path);
my_strdup2(_ALLOC_ID_, &xctx->sch_path[xctx->currsch], path);
entry = bus_hilight_hash_lookup(token, value, what);
my_free(648, &xctx->sch_path[xctx->currsch]);
my_free(_ALLOC_ID_, &xctx->sch_path[xctx->currsch]);
xctx->sch_path[xctx->currsch] = oldpath;
xctx->sch_path_hash[xctx->currsch] = 0;
return entry;
@ -228,11 +228,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(649, str, " ");
my_strcat(650, str,"{");
my_strcat(651, str, entry->path+1);
my_strcat(652, str, ptr);
my_strcat(653, str,"}");
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,"}");
first = 0;
}
skip:
@ -276,7 +276,7 @@ int hilight_graph_node(const char *node, int col)
++path_skip;
}
my_strdup2(654, &n, node);
my_strdup2(_ALLOC_ID_, &n, node);
nptr = n;
dbg(1, "hilight_graph_node(): path_skip=%s, %s: %d\n", path_skip, node, col);
@ -293,12 +293,12 @@ int hilight_graph_node(const char *node, int col)
path3 = nptr;
nptr = ptr2 + 1;
if(!strstr(path_skip, path3))
my_mstrcat(655, &path2, path, path3, ".", NULL);
my_mstrcat(_ALLOC_ID_, &path2, path, path3, ".", NULL);
else
my_strdup2(656, &path2, path);
my_strdup2(_ALLOC_ID_, &path2, path);
}
else {
my_strdup2(657, &path2, path);
my_strdup2(_ALLOC_ID_, &path2, path);
}
if(current) {
nptr--;
@ -310,8 +310,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(658, &n);
my_free(659, &path2);
my_free(_ALLOC_ID_, &n);
my_free(_ALLOC_ID_, &path2);
return 1;
}
@ -395,12 +395,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(660, &viewer_name, tclgetvar(tcl_str));
my_strdup(_ALLOC_ID_, &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(661, &viewer_name);
my_free(_ALLOC_ID_, &viewer_name);
}
if(!exists || !viewer) return;
my_snprintf(plotfile, S(plotfile), "%s/xplot", tclgetvar("netlist_dir"));
@ -435,24 +435,24 @@ void create_plot_cmd(void)
fprintf(fd, "%s", str);
fprintf(fd, "\n");
first = 1;
my_free(662, &str);
my_free(_ALLOC_ID_, &str);
}
fprintf(fd, "set color%d=rgb:%s\n", idx, color_str);
if(first) {
my_strcat(663, &str, "plot ");
my_strcat(_ALLOC_ID_, &str, "plot ");
first = 0;
}
my_strcat(664, &str, "\"");
my_strcat(665, &str, (entry->path)+1);
my_strcat(666, &str, tok);
my_strcat(667, &str, "\" ");
my_strcat(_ALLOC_ID_, &str, "\"");
my_strcat(_ALLOC_ID_, &str, (entry->path)+1);
my_strcat(_ALLOC_ID_, &str, tok);
my_strcat(_ALLOC_ID_, &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(668, &t, tok);
my_strdup2(669, &p, (entry->path)+1);
my_strdup(_ALLOC_ID_, &t, tok);
my_strdup2(_ALLOC_ID_, &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);
@ -465,15 +465,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(670, &p);
my_free(671, &t);
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &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(672, &t, tok);
my_strdup2(673, &p, (entry->path)+1);
my_strdup(_ALLOC_ID_, &t, tok);
my_strdup2(_ALLOC_ID_, &p, (entry->path)+1);
/* bespice command syntax :
add_voltage_on_spice_node_to_plot <plot name> <section name> <hierarchical spice node name> <flag clear> [<color>]
@ -485,8 +485,8 @@ void create_plot_cmd(void)
"{add_voltage_on_spice_node_to_plot * \"\" \"",
p, t, "\" 0 ", color_str, "}",
NULL);
my_free(674, &p);
my_free(675, &t);
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
}
}
entry = entry->next;
@ -495,7 +495,7 @@ void create_plot_cmd(void)
if(viewer == NGSPICE) {
fprintf(fd, "%s", str);
fprintf(fd, "\nremcirc\n.endc\n");
my_free(676, &str);
my_free(_ALLOC_ID_, &str);
fclose(fd);
}
if(viewer == GAW) {
@ -535,16 +535,16 @@ void hilight_net_pin_mismatches(void)
for(k=0; k<xctx->lastsel; ++k) {
if(xctx->sel_array[k].type!=ELEMENT) continue;
j = xctx->sel_array[k].n ;
my_strdup(677, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
if( type && IS_LABEL_SH_OR_PIN(type)) break;
symbol = xctx->sym + xctx->inst[j].ptr;
npin = symbol->rects[PINLAYER];
rct=symbol->rect[PINLAYER];
dbg(1, "hilight_net_pin_mismatches(): \n");
for(i=0;i<npin; ++i) {
my_strdup(678, &labname,get_tok_value(rct[i].prop_ptr,"name",0));
my_strdup(679, &lab, expandlabel(labname, &mult));
my_strdup(680, &netname, net_name(j,i, &mult, 0, 0));
my_strdup(_ALLOC_ID_, &labname,get_tok_value(rct[i].prop_ptr,"name",0));
my_strdup(_ALLOC_ID_, &lab, expandlabel(labname, &mult));
my_strdup(_ALLOC_ID_, &netname, net_name(j,i, &mult, 0, 0));
dbg(1, "hilight_net_pin_mismatches(): i=%d labname=%s explabname = %s net = %s\n", i, labname, lab, netname);
if(netname && strcmp(lab, netname)) {
dbg(1, "hilight_net_pin_mismatches(): hilight: %s\n", netname);
@ -553,10 +553,10 @@ void hilight_net_pin_mismatches(void)
}
}
}
my_free(681, &type);
my_free(682, &labname);
my_free(683, &lab);
my_free(684, &netname);
my_free(_ALLOC_ID_, &type);
my_free(_ALLOC_ID_, &labname);
my_free(_ALLOC_ID_, &lab);
my_free(_ALLOC_ID_, &netname);
if(xctx->hilight_nets) propagate_hilights(1, 0, XINSERT_NOREPLACE);
redraw_hilights(0);
}
@ -589,12 +589,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(685, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
my_strdup(_ALLOC_ID_, &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->sym[xctx->inst[i].ptr].rect[PINLAYER][j].prop_ptr,"name",0);
dbg(1, "pin_name=%s\n", pin_name);
if(!pin_name[0]) continue;
my_strdup(686, &pin_node, expandlabel(pin_name, &mult));
my_strdup(_ALLOC_ID_, &pin_node, expandlabel(pin_name, &mult));
dbg(1, "hilight_parent_pins(): pin_node=%s\n", pin_node);
p_n_s1 = pin_node;
@ -625,8 +625,8 @@ void hilight_parent_pins(void)
}
}
}
my_free(687, &pin_node);
my_free(688, &net_node);
my_free(_ALLOC_ID_, &pin_node);
my_free(_ALLOC_ID_, &net_node);
}
void hilight_child_pins(void)
@ -657,11 +657,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(689, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult));
my_strdup(_ALLOC_ID_, &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->sym[xctx->inst[i].ptr].rect[PINLAYER][j].prop_ptr,"name",0);
if(!pin_name[0]) continue;
my_strdup(690, &pin_node, expandlabel(pin_name, &mult));
my_strdup(_ALLOC_ID_, &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) {
@ -680,8 +680,8 @@ void hilight_child_pins(void)
p_n_s1 = NULL;
} /* for(k..) */
}
my_free(691, &pin_node);
my_free(692, &net_node);
my_free(_ALLOC_ID_, &pin_node);
my_free(_ALLOC_ID_, &net_node);
}
@ -754,7 +754,7 @@ int search(const char *tok, const char *val, int sub, int sel, int match_case)
if(regcomp(&re, val , cflags)) return TCL_ERROR;
#else
if(!match_case) {
my_strdup(693, &regexp_options, "-nocase");
my_strdup(_ALLOC_ID_, &regexp_options, "-nocase");
}
#endif
dbg(1, "search():val=%s\n", val);
@ -771,7 +771,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(694, &tmpname,get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr,tok+6,0));
my_strdup(_ALLOC_ID_, &tmpname,get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr,tok+6,0));
has_token = xctx->tok_size;
if(tmpname) {
str = tmpname;
@ -1015,10 +1015,10 @@ int search(const char *tok, const char *val, int sub, int sel, int match_case)
#ifdef __unix__
regfree(&re);
#else
my_free(695, &regexp_options);
my_free(_ALLOC_ID_, &regexp_options);
#endif
xctx->draw_window = save_draw;
my_free(696, &tmpname);
my_free(_ALLOC_ID_, &tmpname);
return found;
}
@ -1049,10 +1049,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(697, &netname,xctx->inst[i].node[j]);
my_strdup2(_ALLOC_ID_, &netname,xctx->inst[i].node[j]);
} else {
/* mult here will be set to pin multiplicity */
my_strdup2(698, &netname, net_name(i, j, &mult, 1, 0));
my_strdup2(_ALLOC_ID_, &netname, net_name(i, j, &mult, 1, 0));
}
/* mult here will be set to net multiplicity */
expandlabel(netname, &mult);
@ -1065,7 +1065,7 @@ static void drill_hilight(int mode)
xctx->inst[i].color = entry->value;
inst_hilight_hash_lookup(i, entry->value, XINSERT_NOREPLACE);
}
my_strdup(699, &propagate_str, get_tok_value(rct[j].prop_ptr, "propag", 0));
my_strdup(_ALLOC_ID_, &propagate_str, get_tok_value(rct[j].prop_ptr, "propag", 0));
if(propagate_str) {
int n = 1;
const char *propag;
@ -1083,9 +1083,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(700, &propagated_net,xctx->inst[i].node[propagate]);
my_strdup2(_ALLOC_ID_, &propagated_net,xctx->inst[i].node[propagate]);
} else {
my_strdup2(701, &propagated_net, net_name(i, propagate, &mult2, 1, 0));
my_strdup2(_ALLOC_ID_, &propagated_net, net_name(i, propagate, &mult2, 1, 0));
}
netbitname = find_nth(propagated_net, ",", "", 0, k);
dbg(1, "netbitname=%s\n", netbitname);
@ -1101,9 +1101,9 @@ static void drill_hilight(int mode)
} /* for(i...) */
if(!found) break;
} /* while(1) */
my_free(702, &netname);
if(propagated_net) my_free(703, &propagated_net);
if(propagate_str) my_free(704, &propagate_str);
my_free(_ALLOC_ID_, &netname);
if(propagated_net) my_free(_ALLOC_ID_, &propagated_net);
if(propagate_str) my_free(_ALLOC_ID_, &propagate_str);
}
/* if fast is set you need to do a propagate_hilights() at the end to finalize the operation */
@ -1145,9 +1145,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(705, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
for(k=1; k<=tok_mult; ++k) {
my_strdup(706, &t, find_nth(expanded_tok, ",", "", 0, k));
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", "", 0, k));
/* bespice command syntax :
add_voltage_on_spice_node_to_plot <plot name> <section name> <hierarchical spice node name> <flag clear> [<color>]
plot name is "*" => automatic
@ -1159,8 +1159,8 @@ static void send_net_to_bespice(int simtype, const char *node)
p, t, "\" 0 ", color_str, "}",
NULL);
}
my_free(707, &p);
my_free(708, &t);
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
}
}
@ -1184,7 +1184,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(709, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
path = p;
start_level = sch_waves_loaded();
if(path) {
@ -1197,20 +1197,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(710, &t, find_nth(expanded_tok, ",", "", 0, k));
my_strdup(_ALLOC_ID_, &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(711, s, ss);
my_strcat(_ALLOC_ID_, s, ss);
} else { /* Xyce */
my_snprintf(ss, S(ss), "%s%s %d", path, t, c);
my_strcat(712, s, ss);
my_strcat(_ALLOC_ID_, s, ss);
}
}
my_free(713, &p);
my_free(714, &t);
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
}
}
@ -1235,11 +1235,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(715, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
path = p;
strtolower(path);
for(k=1; k<=tok_mult; ++k) {
my_strdup(716, &t, find_nth(expanded_tok, ",", "", 0, k));
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", "", 0, k));
strtolower(t);
if(simtype == 0 ) { /* ngspice */
tclvareval("puts $gaw_fd {copyvar v(", path, t,
@ -1249,8 +1249,8 @@ static void send_net_to_gaw(int simtype, const char *node)
") sel #", color_str, "}\nvwait gaw_fd\n", NULL);
}
}
my_free(717, &p);
my_free(718, &t);
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
}
}
@ -1271,9 +1271,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(719, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
for(k=1; k<=tok_mult; ++k) {
my_strdup(720, &t, find_nth(expanded_tok, ",", "", 0, k));
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", "", 0, k));
/* bespice command syntax :
add_current_through_spice_device_to_plot <plot name> <section name> <hierarchical spice device name> <flag clear> [<color>]
plot name is "*" => automatic
@ -1285,8 +1285,8 @@ static void send_current_to_bespice(int simtype, const char *node)
p, t, "\" 0 ", color_str, "}",
NULL);
}
my_free(721, &p);
my_free(722, &t);
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
}
static void send_current_to_graph(char **s, int simtype, const char *node)
@ -1301,7 +1301,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(723, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(_ALLOC_ID_, &p, xctx->sch_path[xctx->currsch]+1);
path = p;
start_level = sch_waves_loaded();
if(path) {
@ -1315,22 +1315,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(724, &t, find_nth(expanded_tok, ",", "", 0, k));
my_strdup(_ALLOC_ID_, &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(725, s, ss);
my_strcat(_ALLOC_ID_, 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(726, s, ss);
my_strcat(_ALLOC_ID_, s, ss);
}
}
my_free(727, &p);
my_free(728, &t);
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
}
static void send_current_to_gaw(int simtype, const char *node)
@ -1350,12 +1350,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(729, &p, xctx->sch_path[xctx->currsch]+1);
my_strdup2(_ALLOC_ID_, &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(730, &t, find_nth(expanded_tok, ",", "", 0, k));
my_strdup(_ALLOC_ID_, &t, find_nth(expanded_tok, ",", "", 0, k));
strtolower(t);
if(!simtype) { /* spice */
tclvareval("puts $gaw_fd {copyvar i(", there_is_hierarchy ? "v." : "", path, t,
@ -1375,8 +1375,8 @@ static void send_current_to_gaw(int simtype, const char *node)
" sel #", color_str, "}\nvwait gaw_fd\n", NULL);
}
}
my_free(731, &p);
my_free(732, &t);
my_free(_ALLOC_ID_, &p);
my_free(_ALLOC_ID_, &t);
}
/* hilight/clear pin/label instances attached to hilight nets, or instances with "highlight=true"
@ -1651,21 +1651,21 @@ static void create_simdata(void)
int i, j;
const char *str;
free_simdata();
my_realloc(733, &xctx->simdata, xctx->instances * sizeof(Simdata));
my_realloc(_ALLOC_ID_, &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(734, &xctx->simdata[i].pin, npin * sizeof(Simdata_pin));
if(npin) my_realloc(_ALLOC_ID_, &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(735, &xctx->simdata[i].pin[j].function, get_tok_value(symbol->prop_ptr, function, 0));
my_strdup(736, &xctx->simdata[i].pin[j].go_to,
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,
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;
@ -1681,12 +1681,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(737, &xctx->simdata[i].pin[j].function);
my_free(738, &xctx->simdata[i].pin[j].go_to);
my_free(_ALLOC_ID_, &xctx->simdata[i].pin[j].function);
my_free(_ALLOC_ID_, &xctx->simdata[i].pin[j].go_to);
}
if(npin) my_free(739, &xctx->simdata[i].pin);
if(npin) my_free(_ALLOC_ID_, &xctx->simdata[i].pin);
}
my_free(740, &xctx->simdata);
my_free(_ALLOC_ID_, &xctx->simdata);
}
xctx->simdata_ninst = 0;
}
@ -1811,7 +1811,7 @@ static void propagate_logic()
if( tclresult()[0] == '1') break;
++iter;
} /* while(1) */
/* my_free(741, &propagated_net); */
/* my_free(_ALLOC_ID_, &propagated_net); */
}
void logic_set(int value, int num, const char *net_name)
@ -1951,7 +1951,7 @@ void hilight_net(int viewer)
}
if( viewer == XSCHEM_GRAPH && s) {
tclvareval("graph_add_nodes_from_list {", s, "}", NULL);
my_free(742, &s);
my_free(_ALLOC_ID_, &s);
}
if(!incr_hi) incr_hilight_color();
if(xctx->hilight_nets) propagate_hilights(1, 0, XINSERT_NOREPLACE);
@ -2069,7 +2069,7 @@ char *resolved_net(const char *net)
/* global node ? return as is */
if(net && record_global_node(3, NULL, net)) {
my_strdup(743, &rnet, net);
my_strdup(_ALLOC_ID_, &rnet, net);
return rnet;
}
if(net) {
@ -2093,18 +2093,18 @@ char *resolved_net(const char *net)
}
}
dbg(1, "path=%s\n", path);
my_strdup2(744, &exp_net, expandlabel(net, &mult));
my_strdup2(_ALLOC_ID_, &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(745, &resolved_net, net_name);
my_strdup2(_ALLOC_ID_, &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(746, &resolved_net, ptr);
my_strdup2(_ALLOC_ID_, &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);
@ -2113,13 +2113,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(747, &resolved_net, entry->value);
my_strdup2(_ALLOC_ID_, &resolved_net, entry->value);
dbg(1, "resolved_net(): while loop: resolved_net=%s\n", resolved_net);
}
else break;
level--;
}
my_strdup2(748, &path2, path);
my_strdup2(_ALLOC_ID_, &path2, path);
skip = start_level;
path2_ptr = path2;
if(level == start_level) path2_ptr[0] = '\0';
@ -2134,15 +2134,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(749, &rnet, resolved_net);
my_strdup2(_ALLOC_ID_, &rnet, resolved_net);
} else {
my_mstrcat(750, &rnet, path2, resolved_net, NULL);
my_mstrcat(_ALLOC_ID_, &rnet, path2, resolved_net, NULL);
}
if(k < mult - 1) my_strcat(751, &rnet, ",");
if(k < mult - 1) my_strcat(_ALLOC_ID_, &rnet, ",");
}
if(resolved_net) my_free(752, &resolved_net);
my_free(753, &path2);
my_free(754, &exp_net);
if(resolved_net) my_free(_ALLOC_ID_, &resolved_net);
my_free(_ALLOC_ID_, &path2);
my_free(_ALLOC_ID_, &exp_net);
}
dbg(1, "resolved_net(): got %s, return %s\n", net, rnet);
return rnet;
@ -2263,14 +2263,14 @@ void print_hilight_net(int show)
fprintf(errfp, "print_hilight_net(): can not create tmpfile %s\n", filename_ptr);
return;
}
my_strdup(755, &filetmp2, filename_ptr);
my_strdup(_ALLOC_ID_, &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(756, &filetmp2);
my_free(_ALLOC_ID_, &filetmp2);
return;
}
my_strdup(757, &filetmp1, filename_ptr);
my_strdup(_ALLOC_ID_, &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);
@ -2343,8 +2343,8 @@ void print_hilight_net(int show)
xctx->prep_hi_structs=0;
xctx->prep_net_structs=0;
my_free(758, &filetmp1);
my_free(759, &filetmp2);
my_free(_ALLOC_ID_, &filetmp1);
my_free(_ALLOC_ID_, &filetmp2);
}
void list_hilights(int all)

View File

@ -28,9 +28,9 @@ static void free_undo_lines(int slot)
for(c = 0;c<cadlayers; ++c) {
for(i = 0;i<xctx->uslot[slot].lines[c]; ++i) {
my_free(760, &xctx->uslot[slot].lptr[c][i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr[c][i].prop_ptr);
}
my_free(761, &xctx->uslot[slot].lptr[c]);
my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr[c]);
xctx->uslot[slot].lines[c] = 0;
}
}
@ -41,9 +41,9 @@ static void free_undo_rects(int slot)
for(c = 0;c<cadlayers; ++c) {
for(i = 0;i<xctx->uslot[slot].rects[c]; ++i) {
my_free(762, &xctx->uslot[slot].bptr[c][i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr[c][i].prop_ptr);
}
my_free(763, &xctx->uslot[slot].bptr[c]);
my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr[c]);
xctx->uslot[slot].rects[c] = 0;
}
}
@ -54,12 +54,12 @@ static void free_undo_polygons(int slot)
for(c = 0;c<cadlayers; ++c) {
for(i = 0;i<xctx->uslot[slot].polygons[c]; ++i) {
my_free(764, &xctx->uslot[slot].pptr[c][i].prop_ptr);
my_free(765, &xctx->uslot[slot].pptr[c][i].x);
my_free(766, &xctx->uslot[slot].pptr[c][i].y);
my_free(767, &xctx->uslot[slot].pptr[c][i].selected_point);
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(768, &xctx->uslot[slot].pptr[c]);
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr[c]);
xctx->uslot[slot].polygons[c] = 0;
}
}
@ -70,9 +70,9 @@ static void free_undo_arcs(int slot)
for(c = 0;c<cadlayers; ++c) {
for(i = 0;i<xctx->uslot[slot].arcs[c]; ++i) {
my_free(769, &xctx->uslot[slot].aptr[c][i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr[c][i].prop_ptr);
}
my_free(770, &xctx->uslot[slot].aptr[c]);
my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr[c]);
xctx->uslot[slot].arcs[c] = 0;
}
}
@ -82,9 +82,9 @@ static void free_undo_wires(int slot)
int i;
for(i = 0;i<xctx->uslot[slot].wires; ++i) {
my_free(771, &xctx->uslot[slot].wptr[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].wptr[i].prop_ptr);
}
my_free(772, &xctx->uslot[slot].wptr);
my_free(_ALLOC_ID_, &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;i<xctx->uslot[slot].texts; ++i) {
my_free(773, &xctx->uslot[slot].tptr[i].prop_ptr);
my_free(774, &xctx->uslot[slot].tptr[i].txt_ptr);
my_free(775, &xctx->uslot[slot].tptr[i].font);
my_free(776, &xctx->uslot[slot].tptr[i].floater_instname);
my_free(777, &xctx->uslot[slot].tptr[i].floater_ptr);
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(778, &xctx->uslot[slot].tptr);
my_free(_ALLOC_ID_, &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;i<xctx->uslot[slot].instances; ++i) {
my_free(779, &xctx->uslot[slot].iptr[i].name);
my_free(780, &xctx->uslot[slot].iptr[i].prop_ptr);
my_free(781, &xctx->uslot[slot].iptr[i].instname);
my_free(782, &xctx->uslot[slot].iptr[i].lab);
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(783, &xctx->uslot[slot].iptr);
my_free(_ALLOC_ID_, &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(784, &sym->name);
my_free(785, &sym->prop_ptr);
my_free(786, &sym->type);
my_free(787, &sym->templ);
my_free(788, &sym->parent_prop_ptr);
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);
for(c = 0;c<cadlayers; ++c) {
for(j = 0;j<sym->polygons[c]; ++j) {
if(sym->poly[c][j].prop_ptr != NULL) {
my_free(789, &sym->poly[c][j].prop_ptr);
my_free(_ALLOC_ID_, &sym->poly[c][j].prop_ptr);
}
my_free(790, &sym->poly[c][j].x);
my_free(791, &sym->poly[c][j].y);
my_free(792, &sym->poly[c][j].selected_point);
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(793, &sym->poly[c]);
my_free(_ALLOC_ID_, &sym->poly[c]);
sym->polygons[c] = 0;
for(j = 0;j<sym->lines[c]; ++j) {
if(sym->line[c][j].prop_ptr != NULL) {
my_free(794, &sym->line[c][j].prop_ptr);
my_free(_ALLOC_ID_, &sym->line[c][j].prop_ptr);
}
}
my_free(795, &sym->line[c]);
my_free(_ALLOC_ID_, &sym->line[c]);
sym->lines[c] = 0;
for(j = 0;j<sym->arcs[c]; ++j) {
if(sym->arc[c][j].prop_ptr != NULL) {
my_free(796, &sym->arc[c][j].prop_ptr);
my_free(_ALLOC_ID_, &sym->arc[c][j].prop_ptr);
}
}
my_free(797, &sym->arc[c]);
my_free(_ALLOC_ID_, &sym->arc[c]);
sym->arcs[c] = 0;
for(j = 0;j<sym->rects[c]; ++j) {
if(sym->rect[c][j].prop_ptr != NULL) {
my_free(798, &sym->rect[c][j].prop_ptr);
my_free(_ALLOC_ID_, &sym->rect[c][j].prop_ptr);
}
}
my_free(799, &sym->rect[c]);
my_free(_ALLOC_ID_, &sym->rect[c]);
sym->rects[c] = 0;
}
for(j = 0;j<sym->texts; ++j) {
if(sym->text[j].prop_ptr != NULL) {
my_free(800, &sym->text[j].prop_ptr);
my_free(_ALLOC_ID_, &sym->text[j].prop_ptr);
}
if(sym->text[j].txt_ptr != NULL) {
my_free(801, &sym->text[j].txt_ptr);
my_free(_ALLOC_ID_, &sym->text[j].txt_ptr);
}
if(sym->text[j].font != NULL) {
my_free(802, &sym->text[j].font);
my_free(_ALLOC_ID_, &sym->text[j].font);
}
if(sym->text[j].floater_instname != NULL) {
my_free(803, &sym->text[j].floater_instname);
my_free(_ALLOC_ID_, &sym->text[j].floater_instname);
}
if(sym->text[j].floater_ptr != NULL) {
my_free(804, &sym->text[j].floater_ptr);
my_free(_ALLOC_ID_, &sym->text[j].floater_ptr);
}
}
my_free(805, &sym->text);
my_free(_ALLOC_ID_, &sym->text);
sym->texts = 0;
my_free(806, &sym->line);
my_free(807, &sym->rect);
my_free(808, &sym->poly);
my_free(809, &sym->arc);
my_free(810, &sym->lines);
my_free(811, &sym->rects);
my_free(812, &sym->polygons);
my_free(813, &sym->arcs);
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(814, &xctx->uslot[slot].symptr);
my_free(_ALLOC_ID_, &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->mem_undo_initialized);
if(!xctx->mem_undo_initialized) {
for(slot = 0;slot<MAX_UNDO; slot++) {
xctx->uslot[slot].lines = my_calloc(815, cadlayers, sizeof(int));
xctx->uslot[slot].rects = my_calloc(816, cadlayers, sizeof(int));
xctx->uslot[slot].arcs = my_calloc(817, cadlayers, sizeof(int));
xctx->uslot[slot].polygons = my_calloc(818, cadlayers, sizeof(int));
xctx->uslot[slot].lptr = my_calloc(819, cadlayers, sizeof(xLine *));
xctx->uslot[slot].bptr = my_calloc(820, cadlayers, sizeof(xRect *));
xctx->uslot[slot].aptr = my_calloc(821, cadlayers, sizeof(xArc *));
xctx->uslot[slot].pptr = my_calloc(822, cadlayers, sizeof(xPoly *));
xctx->uslot[slot].lines = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->uslot[slot].rects = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->uslot[slot].arcs = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->uslot[slot].polygons = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->uslot[slot].lptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xLine *));
xctx->uslot[slot].bptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xRect *));
xctx->uslot[slot].aptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xArc *));
xctx->uslot[slot].pptr = my_calloc(_ALLOC_ID_, cadlayers, sizeof(xPoly *));
}
xctx->mem_undo_initialized = 1;
}
@ -248,14 +248,14 @@ void mem_delete_undo(void)
if(!xctx->mem_undo_initialized) return;
mem_clear_undo();
for(slot = 0;slot<MAX_UNDO; slot++) {
my_free(823, &xctx->uslot[slot].lines);
my_free(824, &xctx->uslot[slot].rects);
my_free(825, &xctx->uslot[slot].arcs);
my_free(826, &xctx->uslot[slot].polygons);
my_free(827, &xctx->uslot[slot].lptr);
my_free(828, &xctx->uslot[slot].bptr);
my_free(829, &xctx->uslot[slot].aptr);
my_free(830, &xctx->uslot[slot].pptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].lines);
my_free(_ALLOC_ID_, &xctx->uslot[slot].rects);
my_free(_ALLOC_ID_, &xctx->uslot[slot].arcs);
my_free(_ALLOC_ID_, &xctx->uslot[slot].polygons);
my_free(_ALLOC_ID_, &xctx->uslot[slot].lptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].bptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].aptr);
my_free(_ALLOC_ID_, &xctx->uslot[slot].pptr);
}
xctx->mem_undo_initialized = 0;
}
@ -268,11 +268,11 @@ void mem_push_undo(void)
mem_init_undo();
slot = xctx->cur_undo_ptr%MAX_UNDO;
my_strdup(831, &xctx->uslot[slot].gptr, xctx->schvhdlprop);
my_strdup(832, &xctx->uslot[slot].vptr, xctx->schverilogprop);
my_strdup(833, &xctx->uslot[slot].sptr, xctx->schprop);
my_strdup(834, &xctx->uslot[slot].kptr, xctx->schsymbolprop);
my_strdup(835, &xctx->uslot[slot].eptr, xctx->schtedaxprop);
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);
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;c<cadlayers; ++c) {
xctx->uslot[slot].lptr[c] = my_calloc(836, xctx->lines[c], sizeof(xLine));
xctx->uslot[slot].bptr[c] = my_calloc(837, xctx->rects[c], sizeof(xRect));
xctx->uslot[slot].pptr[c] = my_calloc(838, xctx->polygons[c], sizeof(xPoly));
xctx->uslot[slot].aptr[c] = my_calloc(839, xctx->arcs[c], sizeof(xArc));
xctx->uslot[slot].lptr[c] = my_calloc(_ALLOC_ID_, xctx->lines[c], sizeof(xLine));
xctx->uslot[slot].bptr[c] = my_calloc(_ALLOC_ID_, xctx->rects[c], sizeof(xRect));
xctx->uslot[slot].pptr[c] = my_calloc(_ALLOC_ID_, xctx->polygons[c], sizeof(xPoly));
xctx->uslot[slot].aptr[c] = my_calloc(_ALLOC_ID_, xctx->arcs[c], sizeof(xArc));
}
xctx->uslot[slot].wptr = my_calloc(840, xctx->wires, sizeof(xWire));
xctx->uslot[slot].tptr = my_calloc(841, xctx->texts, sizeof(xText));
xctx->uslot[slot].iptr = my_calloc(842, xctx->instances, sizeof(xInstance));
xctx->uslot[slot].symptr = my_calloc(843, xctx->symbols, sizeof(xSymbol));
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].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;i<xctx->lines[c]; ++i) {
xctx->uslot[slot].lptr[c][i] = xctx->line[c][i];
xctx->uslot[slot].lptr[c][i].prop_ptr = NULL;
my_strdup(844, &xctx->uslot[slot].lptr[c][i].prop_ptr, xctx->line[c][i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].lptr[c][i].prop_ptr, xctx->line[c][i].prop_ptr);
}
/* rects */
for(i = 0;i<xctx->rects[c]; ++i) {
xctx->uslot[slot].bptr[c][i] = xctx->rect[c][i];
xctx->uslot[slot].bptr[c][i].prop_ptr = NULL;
xctx->uslot[slot].bptr[c][i].extraptr = NULL;
my_strdup(845, &xctx->uslot[slot].bptr[c][i].prop_ptr, xctx->rect[c][i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].bptr[c][i].prop_ptr, xctx->rect[c][i].prop_ptr);
}
/* arcs */
for(i = 0;i<xctx->arcs[c]; ++i) {
xctx->uslot[slot].aptr[c][i] = xctx->arc[c][i];
xctx->uslot[slot].aptr[c][i].prop_ptr = NULL;
my_strdup(846, &xctx->uslot[slot].aptr[c][i].prop_ptr, xctx->arc[c][i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].aptr[c][i].prop_ptr, xctx->arc[c][i].prop_ptr);
}
/*polygons */
for(i = 0;i<xctx->polygons[c]; ++i) {
int points = xctx->poly[c][i].points;
xctx->uslot[slot].pptr[c][i] = xctx->poly[c][i];
xctx->uslot[slot].pptr[c][i].prop_ptr = NULL;
xctx->uslot[slot].pptr[c][i].x = my_malloc(847, points * sizeof(double));
xctx->uslot[slot].pptr[c][i].y = my_malloc(848, points * sizeof(double));
xctx->uslot[slot].pptr[c][i].selected_point = my_malloc(849, points * sizeof(unsigned short));
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));
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(850, &xctx->uslot[slot].pptr[c][i].prop_ptr, xctx->poly[c][i].prop_ptr);
my_strdup(_ALLOC_ID_, &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(851, &xctx->uslot[slot].iptr[i].lab, xctx->inst[i].lab);
my_strdup2(852, &xctx->uslot[slot].iptr[i].instname, xctx->inst[i].instname);
my_strdup2(853, &xctx->uslot[slot].iptr[i].prop_ptr, xctx->inst[i].prop_ptr);
my_strdup2(854, &xctx->uslot[slot].iptr[i].name, xctx->inst[i].name);
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);
}
/* 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(855, &xctx->uslot[slot].tptr[i].prop_ptr, xctx->text[i].prop_ptr);
my_strdup2(856, &xctx->uslot[slot].tptr[i].txt_ptr, xctx->text[i].txt_ptr);
my_strdup2(857, &xctx->uslot[slot].tptr[i].font, xctx->text[i].font);
my_strdup2(858, &xctx->uslot[slot].tptr[i].floater_instname, xctx->text[i].floater_instname);
my_strdup2(859, &xctx->uslot[slot].tptr[i].floater_ptr, xctx->text[i].floater_ptr);
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);
}
/* 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(860, &xctx->uslot[slot].wptr[i].prop_ptr, xctx->wire[i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->uslot[slot].wptr[i].prop_ptr, xctx->wire[i].prop_ptr);
}
@ -419,63 +419,63 @@ void mem_pop_undo(int redo, int set_modify_status)
slot = xctx->cur_undo_ptr%MAX_UNDO;
clear_drawing();
unselect_all(1);
my_free(861, &xctx->wire);
my_free(862, &xctx->text);
my_free(863, &xctx->inst);
my_free(_ALLOC_ID_, &xctx->wire);
my_free(_ALLOC_ID_, &xctx->text);
my_free(_ALLOC_ID_, &xctx->inst);
for(i = 0;i<cadlayers; ++i) {
my_free(864, &xctx->rect[i]);
my_free(865, &xctx->line[i]);
my_free(866, &xctx->poly[i]);
my_free(867, &xctx->arc[i]);
my_free(_ALLOC_ID_, &xctx->rect[i]);
my_free(_ALLOC_ID_, &xctx->line[i]);
my_free(_ALLOC_ID_, &xctx->poly[i]);
my_free(_ALLOC_ID_, &xctx->arc[i]);
}
remove_symbols();
my_free(868, &xctx->sym);
my_free(_ALLOC_ID_, &xctx->sym);
my_strdup(869, &xctx->schvhdlprop, xctx->uslot[slot].gptr);
my_strdup(870, &xctx->schverilogprop, xctx->uslot[slot].vptr);
my_strdup(871, &xctx->schprop, xctx->uslot[slot].sptr);
my_strdup(872, &xctx->schsymbolprop, xctx->uslot[slot].kptr);
my_strdup(873, &xctx->schtedaxprop, xctx->uslot[slot].eptr);
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);
for(c = 0;c<cadlayers; ++c) {
/* lines */
xctx->maxl[c] = xctx->lines[c] = xctx->uslot[slot].lines[c];
xctx->line[c] = my_calloc(874, xctx->lines[c], sizeof(xLine));
xctx->line[c] = my_calloc(_ALLOC_ID_, xctx->lines[c], sizeof(xLine));
for(i = 0;i<xctx->lines[c]; ++i) {
xctx->line[c][i] = xctx->uslot[slot].lptr[c][i];
xctx->line[c][i].prop_ptr = NULL;
my_strdup(875, &xctx->line[c][i].prop_ptr, xctx->uslot[slot].lptr[c][i].prop_ptr);
my_strdup(_ALLOC_ID_, &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(876, xctx->rects[c], sizeof(xRect));
xctx->rect[c] = my_calloc(_ALLOC_ID_, xctx->rects[c], sizeof(xRect));
for(i = 0;i<xctx->rects[c]; ++i) {
xctx->rect[c][i] = xctx->uslot[slot].bptr[c][i];
xctx->rect[c][i].prop_ptr = NULL;
xctx->rect[c][i].extraptr = NULL;
my_strdup(877, &xctx->rect[c][i].prop_ptr, xctx->uslot[slot].bptr[c][i].prop_ptr);
my_strdup(_ALLOC_ID_, &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(878, xctx->arcs[c], sizeof(xArc));
xctx->arc[c] = my_calloc(_ALLOC_ID_, xctx->arcs[c], sizeof(xArc));
for(i = 0;i<xctx->arcs[c]; ++i) {
xctx->arc[c][i] = xctx->uslot[slot].aptr[c][i];
xctx->arc[c][i].prop_ptr = NULL;
my_strdup(879, &xctx->arc[c][i].prop_ptr, xctx->uslot[slot].aptr[c][i].prop_ptr);
my_strdup(_ALLOC_ID_, &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(880, xctx->polygons[c], sizeof(xPoly));
xctx->poly[c] = my_calloc(_ALLOC_ID_, xctx->polygons[c], sizeof(xPoly));
for(i = 0;i<xctx->polygons[c]; ++i) {
int points = xctx->uslot[slot].pptr[c][i].points;
xctx->poly[c][i] = xctx->uslot[slot].pptr[c][i];
xctx->poly[c][i].prop_ptr = NULL;
my_strdup(881, &xctx->poly[c][i].prop_ptr, xctx->uslot[slot].pptr[c][i].prop_ptr);
xctx->poly[c][i].x = my_malloc(882, points * sizeof(double));
xctx->poly[c][i].y = my_malloc(883, points * sizeof(double));
xctx->poly[c][i].selected_point = my_malloc(884, points * sizeof(unsigned short));
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));
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,
@ -485,22 +485,22 @@ void mem_pop_undo(int redo, int set_modify_status)
/* instances */
xctx->maxi = xctx->instances = xctx->uslot[slot].instances;
xctx->inst = my_calloc(885, xctx->instances, sizeof(xInstance));
xctx->inst = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(xInstance));
for(i = 0;i<xctx->instances; ++i) {
xctx->inst[i] = xctx->uslot[slot].iptr[i];
xctx->inst[i].prop_ptr = NULL;
xctx->inst[i].name = NULL;
xctx->inst[i].instname = NULL;
xctx->inst[i].lab = NULL;
my_strdup2(886, &xctx->inst[i].prop_ptr, xctx->uslot[slot].iptr[i].prop_ptr);
my_strdup2(887, &xctx->inst[i].name, xctx->uslot[slot].iptr[i].name);
my_strdup2(888, &xctx->inst[i].instname, xctx->uslot[slot].iptr[i].instname);
my_strdup2(889, &xctx->inst[i].lab, xctx->uslot[slot].iptr[i].lab);
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);
}
/* symbols */
xctx->maxs = xctx->symbols = xctx->uslot[slot].symbols;
xctx->sym = my_calloc(890, xctx->symbols, sizeof(xSymbol));
xctx->sym = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(xSymbol));
for(i = 0;i<xctx->symbols; ++i) {
copy_symbol(&xctx->sym[i], &xctx->uslot[slot].symptr[i]);
@ -508,7 +508,7 @@ void mem_pop_undo(int redo, int set_modify_status)
/* texts */
xctx->maxt = xctx->texts = xctx->uslot[slot].texts;
xctx->text = my_calloc(891, xctx->texts, sizeof(xText));
xctx->text = my_calloc(_ALLOC_ID_, xctx->texts, sizeof(xText));
for(i = 0;i<xctx->texts; ++i) {
xctx->text[i] = xctx->uslot[slot].tptr[i];
xctx->text[i].txt_ptr = NULL;
@ -516,21 +516,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(892, &xctx->text[i].prop_ptr, xctx->uslot[slot].tptr[i].prop_ptr);
my_strdup2(893, &xctx->text[i].txt_ptr, xctx->uslot[slot].tptr[i].txt_ptr);
my_strdup2(894, &xctx->text[i].font, xctx->uslot[slot].tptr[i].font);
my_strdup2(895, &xctx->text[i].floater_instname, xctx->uslot[slot].tptr[i].floater_instname);
my_strdup2(896, &xctx->text[i].floater_ptr, xctx->uslot[slot].tptr[i].floater_ptr);
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);
}
/* wires */
xctx->maxw = xctx->wires = xctx->uslot[slot].wires;
xctx->wire = my_calloc(897, xctx->wires, sizeof(xWire));
xctx->wire = my_calloc(_ALLOC_ID_, xctx->wires, sizeof(xWire));
for(i = 0;i<xctx->wires; ++i) {
xctx->wire[i] = xctx->uslot[slot].wptr[i];
xctx->wire[i].prop_ptr = NULL;
xctx->wire[i].node = NULL;
my_strdup(898, &xctx->wire[i].prop_ptr, xctx->uslot[slot].wptr[i].prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->wire[i].prop_ptr, xctx->uslot[slot].wptr[i].prop_ptr);
}
/* unnecessary since in_memory_undo saves all symbols */
/* link_symbols_to_instances(-1); */

View File

@ -118,17 +118,17 @@ int main(int argc, char **argv)
}
#endif
my_strdup(899, &xschem_executable, argv[0]);
my_strdup(_ALLOC_ID_, &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(900, cli_opt_argc * sizeof(char *));
cli_opt_argv = my_malloc(_ALLOC_ID_, cli_opt_argc * sizeof(char *));
for(i = 0; i < cli_opt_argc; ++i) {
cli_opt_argv[i] = NULL;
my_strdup(901, &cli_opt_argv[i], argv[i]);
my_strdup(_ALLOC_ID_, &cli_opt_argv[i], argv[i]);
}

View File

@ -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(902, &r->prop_ptr, subst_token(r->prop_ptr, "ellipse", str));
my_strdup2(_ALLOC_ID_, &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(903, &r->prop_ptr, subst_token(r->prop_ptr, "ellipse", str));
my_strdup2(_ALLOC_ID_, &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(904, &xctx->wire[i].prop_ptr);
my_free(905, &xctx->wire[i].node);
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
my_free(_ALLOC_ID_, &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(906, &xctx->line[c][i].prop_ptr);
my_free(_ALLOC_ID_, &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(907, &xctx->rect[c][i].prop_ptr);
my_free(_ALLOC_ID_, &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(908, sizeof(double) *xctx->poly[c][n].points);
double *y = my_malloc(909, sizeof(double) *xctx->poly[c][n].points);
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);
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;k<xctx->poly[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(910, &x);
my_free(911, &y);
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
}
break;
@ -543,21 +543,21 @@ void update_attached_floaters(const char *from_name, int inst, int sel)
if(!attach[0]) return;
new_attach = str_replace(attach, from_name, to_name, 1, 1);
my_strdup(912, &xctx->inst[inst].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->inst[inst].prop_ptr,
subst_token(xctx->inst[inst].prop_ptr, "attach", new_attach) );
for(c = 0; c < cadlayers; c++) {
for(i = 0; i < xctx->rects[c]; i++) {
if(!sel || xctx->rect[c][i].sel == SELECTED) {
if( !strcmp(from_name, get_tok_value(xctx->rect[c][i].prop_ptr, "name", 0))) {
my_strdup(913, &xctx->rect[c][i].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr,
subst_token(xctx->rect[c][i].prop_ptr, "name", to_name) );
}
if(c == GRIDLAYER) {
const char *node = get_tok_value(xctx->rect[c][i].prop_ptr, "node", 2);
if(node && node[0]) {
const char *new_node = str_replace(node, from_name, to_name, 1, -1);
my_strdup(914, &xctx->rect[c][i].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr,
subst_token(xctx->rect[c][i].prop_ptr, "node", new_node));
}
}
@ -566,7 +566,7 @@ void update_attached_floaters(const char *from_name, int inst, int sel)
for(i = 0; i < xctx->lines[c]; i++) {
if((!sel || xctx->line[c][i].sel == SELECTED) &&
!strcmp(from_name, get_tok_value(xctx->line[c][i].prop_ptr, "name", 0))) {
my_strdup(915, &xctx->line[c][i].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->line[c][i].prop_ptr,
subst_token(xctx->line[c][i].prop_ptr, "name", to_name) );
}
}
@ -574,7 +574,7 @@ void update_attached_floaters(const char *from_name, int inst, int sel)
for(i = 0; i < xctx->polygons[c]; i++) {
if((!sel || xctx->poly[c][i].sel == SELECTED) &&
!strcmp(from_name, get_tok_value(xctx->poly[c][i].prop_ptr, "name", 0))) {
my_strdup(916, &xctx->poly[c][i].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr,
subst_token(xctx->poly[c][i].prop_ptr, "name", to_name) );
}
@ -582,7 +582,7 @@ void update_attached_floaters(const char *from_name, int inst, int sel)
for(i = 0; i < xctx->arcs[c]; i++) {
if((!sel || xctx->arc[c][i].sel == SELECTED) &&
!strcmp(from_name, get_tok_value(xctx->arc[c][i].prop_ptr, "name", 0))) {
my_strdup(917, &xctx->arc[c][i].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr,
subst_token(xctx->arc[c][i].prop_ptr, "name", to_name) );
}
}
@ -590,14 +590,14 @@ void update_attached_floaters(const char *from_name, int inst, int sel)
for(i = 0; i < xctx->wires; i++) {
if((!sel || xctx->wire[i].sel == SELECTED) &&
!strcmp(from_name, get_tok_value(xctx->wire[i].prop_ptr, "name", 0))) {
my_strdup(918, &xctx->wire[i].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->wire[i].prop_ptr,
subst_token(xctx->wire[i].prop_ptr, "name", to_name) );
}
}
for(i = 0; i < xctx->texts; i++) {
if((!sel || xctx->text[i].sel == SELECTED) &&
!strcmp(from_name, get_tok_value(xctx->text[i].prop_ptr, "name", 0))) {
my_strdup(919, &xctx->text[i].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->text[i].prop_ptr,
subst_token(xctx->text[i].prop_ptr, "name", to_name) );
set_text_flags(&xctx->text[i]);
}
@ -792,8 +792,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(920, sizeof(double) *p->points);
double *y = my_malloc(921, sizeof(double) *p->points);
double *x = my_malloc(_ALLOC_ID_, sizeof(double) *p->points);
double *y = my_malloc(_ALLOC_ID_, sizeof(double) *p->points);
int j;
for(j=0; j<p->points; ++j) {
if( p->sel==SELECTED || p->selected_point[j]) {
@ -816,8 +816,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(922, &x);
my_free(923, &y);
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
}
break;
case ARC:
@ -881,7 +881,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(924, &xctx->text[xctx->texts].txt_ptr,xctx->text[n].txt_ptr);
my_strdup2(_ALLOC_ID_, &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);
@ -896,9 +896,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(925, &xctx->text[xctx->texts].prop_ptr, xctx->text[n].prop_ptr);
my_strdup2(926, &xctx->text[xctx->texts].floater_ptr, xctx->text[n].floater_ptr);
my_strdup2(927, &xctx->text[xctx->texts].floater_instname, xctx->text[n].floater_instname);
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);
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;
@ -914,7 +914,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(928, &estr);
my_free(_ALLOC_ID_, &estr);
#if HAS_CAIRO==1
if(customfont) {
cairo_restore(xctx->cairo_ctx);
@ -952,9 +952,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(929, &xctx->inst[xctx->instances].name, xctx->inst[n].name);
my_strdup2(930, &xctx->inst[xctx->instances].prop_ptr, xctx->inst[n].prop_ptr);
my_strdup2(931, &xctx->inst[xctx->instances].lab, xctx->inst[n].lab);
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);
xctx->inst[n].sel=0;
xctx->inst[xctx->instances].embed = xctx->inst[n].embed;
xctx->inst[xctx->instances].flags = xctx->inst[n].flags;
@ -966,7 +966,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(932, &xctx->inst[xctx->instances].instname, xctx->inst[n].instname);
my_strdup2(_ALLOC_ID_, &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);
@ -1500,7 +1500,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(933, &estr);
my_free(_ALLOC_ID_, &estr);
#if HAS_CAIRO==1
if(customfont) {
cairo_restore(xctx->cairo_ctx);
@ -1527,7 +1527,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(934, &estr);
my_free(_ALLOC_ID_, &estr);
#if HAS_CAIRO==1
if(customfont) {
cairo_restore(xctx->cairo_ctx);

View File

@ -33,7 +33,7 @@ static void instdelete(int n, int x, int y)
while(ptr) {
if(ptr->n == n) {
saveptr = ptr->next;
my_free(935, &ptr);
my_free(_ALLOC_ID_, &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(936, sizeof(Instentry));
newptr=my_malloc(_ALLOC_ID_, 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(937, &t);
my_free(_ALLOC_ID_, &t);
t = tmp;
}
return NULL;
@ -140,7 +140,7 @@ static Objectentry *delobjectentry(Objectentry *t)
Objectentry *tmp;
while( t ) {
tmp = t->next;
my_free(938, &t);
my_free(_ALLOC_ID_, &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(939, &ptr);
my_free(_ALLOC_ID_, &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(940, sizeof(Instentry));
newptr=my_malloc(_ALLOC_ID_, 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(941, &estr);
my_free(_ALLOC_ID_, &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(942, &ptr);
my_free(_ALLOC_ID_, &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(943, sizeof(Instpinentry));
newptr=my_malloc(_ALLOC_ID_, 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(944, &t);
my_free(_ALLOC_ID_, &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(945, &ptr);
my_free(_ALLOC_ID_, &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(946, sizeof(Wireentry));
newptr=my_malloc(_ALLOC_ID_, 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(947, &t);
my_free(_ALLOC_ID_, &t);
t = tmp;
}
return NULL;
@ -617,11 +617,11 @@ void netlist_options(int i)
/* fprintf(errfp, "netlist_options(): prop_ptr=%s\n", xctx->inst[i].prop_ptr); */
if(!strboolcmp(str, "true")) {
tclsetintvar("lvs_netlist", 1);
my_strdup(948, &xctx->format, "lvs_format");
my_strdup(_ALLOC_ID_, &xctx->format, "lvs_format");
}
else {
tclsetintvar("lvs_netlist", 0);
my_strdup(949, &xctx->format, xctx->custom_format);
my_strdup(_ALLOC_ID_, &xctx->format, xctx->custom_format);
}
}
@ -711,10 +711,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(950, &xctx->globals, xctx->size_globals*sizeof(char *) );
my_realloc(_ALLOC_ID_, &xctx->globals, xctx->size_globals*sizeof(char *) );
}
xctx->globals[xctx->max_globals]=NULL;
my_strdup(951, &xctx->globals[xctx->max_globals], node);
my_strdup(_ALLOC_ID_, &xctx->globals[xctx->max_globals], node);
xctx->max_globals++;
} else if(what == 0) {
for(i = 0;i < xctx->max_globals; ++i) {
@ -723,9 +723,9 @@ int record_global_node(int what, FILE *fp, const char *node)
}
} else if(what == 2) {
for(i=0;i<xctx->max_globals; ++i) {
my_free(952, &xctx->globals[i]);
my_free(_ALLOC_ID_, &xctx->globals[i]);
}
my_free(953, &xctx->globals);
my_free(_ALLOC_ID_, &xctx->globals);
xctx->size_globals = xctx->max_globals=0;
}
@ -763,7 +763,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(954, &xctx->node_mult);
my_free(_ALLOC_ID_, &xctx->node_mult);
xctx->node_mult_size=0;
return 0;
}
@ -777,7 +777,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(955, &xctx->node_mult, sizeof(xctx->node_mult[0]) * xctx->node_mult_size );
my_realloc(_ALLOC_ID_, &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;
@ -813,7 +813,7 @@ static void name_generics()
dbg(2, "name_generics(): naming generics from attached labels\n");
if(for_netlist) for (i=0;i<instances; ++i) { /* ... assign node fields on all (non label) instances */
if(skip_instance(i, 0, netlist_lvs_ignore)) continue;
my_strdup(956, &type,(inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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];
@ -839,12 +839,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(957, &inst[i].node[j], get_tok_value(inst[n].prop_ptr,"value",0) );
my_strdup(_ALLOC_ID_, &inst[i].node[j], get_tok_value(inst[n].prop_ptr,"value",0) );
if(!for_netlist) {
my_strdup(958, &sig_type,"");
my_strdup(_ALLOC_ID_, &sig_type,"");
bus_node_hash_lookup(inst[n].node[p],"", XINSERT, 1, sig_type,"", "","");
} else {
my_strdup(959, &sig_type,
my_strdup(_ALLOC_ID_, &sig_type,
get_tok_value(xctx->sym[inst[i].ptr].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 */
@ -860,7 +860,7 @@ static void name_generics()
} /* end if( rects=...>0) */
} /* end if(type not a label nor pin)... */
} /* end for(i...) */
if(type) my_free(960, &type);
if(type) my_free(_ALLOC_ID_, &type);
}
static int signal_short( const char *tag, const char *n1, const char *n2)
@ -893,7 +893,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(961, &inst[i].node[j], node);
my_strdup(_ALLOC_ID_, &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,"","","","");
@ -979,8 +979,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(962, &wire[n].node, wire[k].node);
my_strdup(963, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", 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));
err |= name_attached_inst_to_net(n, tmpi, tmpj);
err |= wirecheck(n); /* recursive check */
} else {
@ -1002,8 +1002,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(964, &wire[n].node, node);
my_strdup(965, &wire[n].prop_ptr, subst_token(wire[n].prop_ptr, "lab", 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));
err |= wirecheck(n);
} else {
if(for_netlist>0) err |= signal_short("Net", wire[n].node, node);
@ -1104,8 +1104,8 @@ static int find_pass_through_symbols(int what, int ninst)
int *symtable = NULL;
if(what == 0 ) { /* initialize */
pt_symbol = my_calloc(966, xctx->symbols, sizeof(int));
symtable = my_calloc(967, xctx->symbols, sizeof(int));
pt_symbol = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(int));
symtable = my_calloc(_ALLOC_ID_, xctx->symbols, sizeof(int));
for(i = 0; i < instances; ++i) {
k = inst[i].ptr;
if( k < 0 || symtable[k] ) continue;
@ -1121,13 +1121,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(968, &symtable);
my_free(_ALLOC_ID_, &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(969, &pt_symbol);
my_free(_ALLOC_ID_, &pt_symbol);
}
return -1;
}
@ -1176,7 +1176,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(970, &inst[n].node[0]); /* bus tap forces net name on pin 0 (the tap) */
my_free(_ALLOC_ID_, &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); */
@ -1196,12 +1196,12 @@ static int instcheck(int n, int p)
} else {
nptr = inst[n].node[p];
}
node_base_name = my_malloc(971, strlen(inst[n].node[p]) + 1);
node_base_name = my_malloc(_ALLOC_ID_, strlen(inst[n].node[p]) + 1);
sscanf(nptr, "%[^[]", node_base_name);
my_strcat(972, &node_base_name, tap);
my_strcat(_ALLOC_ID_, &node_base_name, tap);
}
else {
my_strdup2(973, &node_base_name, tap);
my_strdup2(_ALLOC_ID_, &node_base_name, tap);
}
set_inst_node(n, 0, node_base_name);
get_inst_pin_coord(n, 0, &x0, &y0);
@ -1212,7 +1212,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(974, &node_base_name);
my_free(_ALLOC_ID_, &node_base_name);
}
@ -1220,7 +1220,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(975, &pin_name, get_tok_value(xctx->sym[k].rect[PINLAYER][p].prop_ptr, "name", 0));
my_strdup(_ALLOC_ID_, &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;
@ -1244,7 +1244,7 @@ static int instcheck(int n, int p)
}
}
}
my_free(976, &pin_name);
my_free(_ALLOC_ID_, &pin_name);
}
return err;
}
@ -1281,7 +1281,7 @@ static int name_nodes_of_pins_labels_and_propagate()
for (i=0;i<instances; ++i) {
/* name ipin opin label node fields from prop_ptr attributes */
if(skip_instance(i, 0, netlist_lvs_ignore)) continue;
my_strdup(977, &type,(inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &type,(inst[i].ptr+ xctx->sym)->type);
if(print_erc && (!inst[i].instname || !inst[i].instname[0]) &&
!get_tok_value(xctx->sym[inst[i].ptr].templ, "name", 0)[0]
) {
@ -1320,32 +1320,32 @@ static int name_nodes_of_pins_labels_and_propagate()
}
#endif
port=0;
my_strdup2(978, &dir, "");
my_strdup2(_ALLOC_ID_, &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(979, &dir,
my_strdup2(_ALLOC_ID_, &dir,
get_tok_value(xctx->sym[inst[i].ptr].rect[PINLAYER][0].prop_ptr, "dir",0));
}
else {
/* handle global nodes (global=1 set as symbol property) 28032003 */
my_strdup(980, &global_node,get_tok_value(inst[i].prop_ptr,"global",0));
my_strdup(_ALLOC_ID_, &global_node,get_tok_value(inst[i].prop_ptr,"global",0));
if(!xctx->tok_size) {
my_strdup(981, &global_node,get_tok_value(xctx->sym[inst[i].ptr].prop_ptr,"global",0));
my_strdup(_ALLOC_ID_, &global_node,get_tok_value(xctx->sym[inst[i].ptr].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(982, &sig_type,get_tok_value(inst[i].prop_ptr,"sig_type",0));
my_strdup(983, &verilog_type,get_tok_value(inst[i].prop_ptr,"verilog_type",0));
my_strdup(984, &value,get_tok_value(inst[i].prop_ptr,"value",0));
my_strdup(985, &class,get_tok_value(inst[i].prop_ptr,"class",0));
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(986, &inst[i].node[0], inst[i].lab);
my_strdup(_ALLOC_ID_, &inst[i].node[0], inst[i].lab);
if(!(inst[i].node[0])) {
my_strdup(987, &inst[i].node[0], get_tok_value(xctx->sym[inst[i].ptr].templ, "lab",0));
my_strdup(_ALLOC_ID_, &inst[i].node[0], get_tok_value(xctx->sym[inst[i].ptr].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]);
}
@ -1367,14 +1367,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;i<instances... */
if(dir) my_free(988, &dir);
if(type) my_free(989, &type);
if(global_node) my_free(990, &global_node);
if(dir) my_free(_ALLOC_ID_, &dir);
if(type) my_free(_ALLOC_ID_, &type);
if(global_node) my_free(_ALLOC_ID_, &global_node);
if(for_netlist) {
if(sig_type) my_free(991, &sig_type);
if(verilog_type) my_free(992, &verilog_type);
if(value) my_free(993, &value);
if(class) my_free(994, &class);
if(sig_type) my_free(_ALLOC_ID_, &sig_type);
if(verilog_type) my_free(_ALLOC_ID_, &verilog_type);
if(value) my_free(_ALLOC_ID_, &value);
if(class) my_free(_ALLOC_ID_, &class);
}
return err;
}
@ -1384,8 +1384,8 @@ static int set_unnamed_net(int i)
int err = 0;
char tmp_str[30];
my_snprintf(tmp_str, S(tmp_str), "#net%d", get_unnamed_node(1,0,0));
my_strdup(995, &xctx->wire[i].node, tmp_str);
my_strdup(996, &xctx->wire[i].prop_ptr, subst_token(xctx->wire[i].prop_ptr, "lab", tmp_str));
my_strdup(_ALLOC_ID_, &xctx->wire[i].node, tmp_str);
my_strdup(_ALLOC_ID_, &xctx->wire[i].prop_ptr, subst_token(xctx->wire[i].prop_ptr, "lab", tmp_str));
/* insert unnamed wire name in hash table */
bus_node_hash_lookup(tmp_str, "", XINSERT, 0,"","","","");
err |= wirecheck(i);
@ -1495,7 +1495,7 @@ static int reset_node_data_and_rehash()
(inst[i].ptr+ xctx->sym)->rects[GENERICLAYER];
if(rects > 0)
{
inst[i].node = my_malloc(997, sizeof(char *) * rects);
inst[i].node = my_malloc(_ALLOC_ID_, sizeof(char *) * rects);
for (j=0;j<rects; ++j)
{
inst[i].node[j]=NULL;
@ -1557,8 +1557,8 @@ void delete_inst_node(int i)
if( rects > 0 )
{
for(j=0;j< rects ; ++j)
my_free(998, &xctx->inst[i].node[j]);
my_free(999, &xctx->inst[i].node );
my_free(_ALLOC_ID_, &xctx->inst[i].node[j]);
my_free(_ALLOC_ID_, &xctx->inst[i].node );
}
}
@ -1573,7 +1573,7 @@ void delete_netlist_structs(void)
}
for(i=0;i<xctx->wires; ++i)
{
my_free(1000, &xctx->wire[i].node);
my_free(_ALLOC_ID_, &xctx->wire[i].node);
}
/* erase inst and wire topological hash tables */
del_inst_pin_table();
@ -1776,21 +1776,21 @@ int sym_vs_sch_pins(int all)
}
symbol = match_symbol(name);
my_strdup(1001, &type, xctx->sym[symbol].type);
my_strdup(_ALLOC_ID_, &type, xctx->sym[symbol].type);
if(type && IS_PIN(type)) {
my_strdup(1002, &lab, expandlabel(get_tok_value(tmp, "lab", 0), &mult));
my_strdup(_ALLOC_ID_, &lab, expandlabel(get_tok_value(tmp, "lab", 0), &mult));
if(pin_cnt >= lab_array_size) {
lab_array_size += CADCHUNKALLOC;
my_realloc(1003, &lab_array, lab_array_size * sizeof(char *));
my_realloc(_ALLOC_ID_, &lab_array, lab_array_size * sizeof(char *));
}
lab_array[pin_cnt] = NULL;
my_strdup(1004, &(lab_array[pin_cnt]), lab);
my_strdup(_ALLOC_ID_, &(lab_array[pin_cnt]), lab);
pin_cnt++;
pin_match = 0;
for(j=0; j < rects; ++j) {
my_strdup(1005, &pin_name,
my_strdup(_ALLOC_ID_, &pin_name,
expandlabel(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "name", 0), &mult));
my_strdup(1006, &pin_dir, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "dir", 0));
my_strdup(_ALLOC_ID_, &pin_dir, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "dir", 0));
if( pin_name && !strcmp(pin_name, lab)) {
@ -1877,7 +1877,7 @@ int sym_vs_sch_pins(int all)
}
}
for(j=0; j < rects; ++j) {
my_strdup(1007, &pin_name,
my_strdup(_ALLOC_ID_, &pin_name,
expandlabel(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "name", 0), &mult));
pin_match = 0;
for(k=0; k<pin_cnt; ++k) {
@ -1904,18 +1904,18 @@ int sym_vs_sch_pins(int all)
}
if(lab_array_size) {
for(k=0;k<pin_cnt; ++k) {
my_free(1008, &(lab_array[k]));
my_free(_ALLOC_ID_, &(lab_array[k]));
}
my_free(1009, &lab_array);
my_free(_ALLOC_ID_, &lab_array);
lab_array_size = 0;
pin_cnt=0;
}
} /* if( ... "subcircuit"... ) */
my_free(1010, &type);
my_free(1011, &tmp);
my_free(1012, &lab);
my_free(1013, &pin_name);
my_free(1014, &pin_dir);
my_free(_ALLOC_ID_, &type);
my_free(_ALLOC_ID_, &tmp);
my_free(_ALLOC_ID_, &lab);
my_free(_ALLOC_ID_, &pin_name);
my_free(_ALLOC_ID_, &pin_dir);
} /* for(i=0;i<n_syms; ++i) */
if(all == -1) while(xctx->symbols > n_syms) remove_symbol(xctx->symbols - 1);

View File

@ -56,16 +56,16 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
{
if( what==XINSERT ) /* insert data */
{
Node_hashentry *entry = (Node_hashentry *)my_malloc(1015, sizeof( Node_hashentry ));
Node_hashentry *entry = (Node_hashentry *)my_malloc(_ALLOC_ID_, sizeof( Node_hashentry ));
entry->next = NULL;
entry->token = entry->sig_type = entry->verilog_type =
entry->value = entry->class = entry->orig_tok = NULL;
my_strdup(1016, &(entry->token),token);
if(sig_type &&sig_type[0]) my_strdup(1017, &(entry->sig_type), sig_type);
if(verilog_type &&verilog_type[0]) my_strdup(1018, &(entry->verilog_type), verilog_type);
if(class && class[0]) my_strdup(1019, &(entry->class), class);
if(orig_tok && orig_tok[0]) my_strdup(1020, &(entry->orig_tok), orig_tok);
if(value && value[0]) my_strdup(1021, &(entry->value), value);
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);
entry->d.port=d.port;
entry->d.in=d.in;
entry->d.out=d.out;
@ -84,13 +84,13 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
if(what==XDELETE) /* remove token from the hash table ... */
{
Node_hashentry *saveptr=(*preventry)->next, *entry = *preventry;
my_free(1022, &entry->token);
my_free(1023, &entry->verilog_type);
my_free(1024, &entry->sig_type);
my_free(1025, &entry->class);
my_free(1026, &entry->orig_tok);
my_free(1027, &entry->value);
my_free(1028, &entry);
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);
*preventry=saveptr;
return NULL;
}
@ -102,11 +102,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(1029, &(entry->sig_type), sig_type);
my_strdup(_ALLOC_ID_, &(entry->sig_type), sig_type);
if(verilog_type && verilog_type[0] !='\0')
my_strdup(1030, &(entry->verilog_type), verilog_type);
my_strdup(_ALLOC_ID_, &(entry->verilog_type), verilog_type);
if(value && value[0] !='\0')
my_strdup(1031, &(entry->value), value);
my_strdup(_ALLOC_ID_, &(entry->value), value);
dbg(3, "node_hash_lookup(): hashing %s : value=%s\n\n",
entry->token, entry->value? entry->value:"<NULL>");
return entry;
@ -129,12 +129,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(1032, &string, token);
my_strdup(_ALLOC_ID_, &string, token);
}
else
{
dbg(3, "bus_node_hash_lookup(): expanding node: %s\n", token);
my_strdup(1033, &string, expandlabel(token,&mult));
my_strdup(_ALLOC_ID_, &string, expandlabel(token,&mult));
dbg(3, "bus_node_hash_lookup(): done expanding node: %s\n", token);
}
if(string==NULL) return NULL;
@ -156,7 +156,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(1034, &string);
my_free(_ALLOC_ID_, &string);
return ptr2;
}
@ -166,13 +166,13 @@ static void node_hash_free_entry(Node_hashentry *entry)
while(entry) {
tmp = entry->next;
my_free(1035, &entry->token);
my_free(1036, &entry->verilog_type);
my_free(1037, &entry->sig_type);
my_free(1038, &entry->class);
my_free(1039, &entry->orig_tok);
my_free(1040, &entry->value);
my_free(1041, &entry);
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);
entry = tmp;
}
}
@ -277,9 +277,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(1042, &class, ptr->class);
my_strdup(_ALLOC_ID_, &class, ptr->class);
else
my_strdup(1043, &class, "signal");
my_strdup(_ALLOC_ID_, &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);
@ -309,7 +309,7 @@ void print_vhdl_signals(FILE *fd)
}
}
if(found) fprintf(fd, "\n" );
my_free(1044, &class);
my_free(_ALLOC_ID_, &class);
}
@ -378,25 +378,25 @@ 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(1045, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if(type && xctx->inst[i].node && IS_PIN(type)) {
my_strdup2(1046, &pin_node, expandlabel(xctx->inst[i].lab, &mult));
my_strdup2(_ALLOC_ID_, &pin_node, expandlabel(xctx->inst[i].lab, &mult));
p_n_s1 = pin_node;
for(k = 1; k <= mult; ++k) {
lab = my_strtok_r(p_n_s1, ",", "", 0, &p_n_s2);
p_n_s1 = NULL;
my_mstrcat(1047, result, "{", lab, " ", type, "}\n", NULL);
my_mstrcat(_ALLOC_ID_, result, "{", lab, " ", type, "}\n", NULL);
}
}
if(pin_node) my_free(1048, &pin_node);
if(pin_node) my_free(_ALLOC_ID_, &pin_node);
}
if(type) my_free(1049, &type);
if(type) my_free(_ALLOC_ID_, &type);
for(i=0;i<HASHSIZE; ++i) {
ptr = xctx->node_table[i];
while(ptr) {
if(!ptr->d.port) {
my_mstrcat(1050, result,
my_mstrcat(_ALLOC_ID_, result,
"{", ptr->token, " ", "net", "}\n", NULL);
}
ptr = ptr->next;

View File

@ -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(1051, &cli_opt_preinit_command, optval);
if(optval) my_strdup(_ALLOC_ID_, &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(1052, &cli_opt_tcl_command, optval);
if(optval) my_strdup(_ALLOC_ID_, &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(1053, &cli_opt_tcl_post_command, optval);
if(optval) my_strdup(_ALLOC_ID_, &cli_opt_tcl_post_command, optval);
} else if( (type == LONG && !strcmp("diff", opt)) ) {
dbg(1, "process_options(): diff with: %s\n", optval);

View File

@ -66,7 +66,7 @@ extern int yylex();
void clear_expandlabel_data(void)
{
my_free(1054, &dest_string.str);
my_free(_ALLOC_ID_, &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(1055, &dest_string.str); /* 30102004 delete 'memory' of previous execution */
my_free(_ALLOC_ID_, &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(1056, &dest_string.str, s);
my_strdup2(_ALLOC_ID_, &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(1057, l);
cmd = my_malloc(_ALLOC_ID_, 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(1058, &cmd);
my_free(_ALLOC_ID_, &cmd);
}
if(parselabel_debug >= 3)
@ -138,7 +138,7 @@ const char *expandlabel(const char *s, int *m)
}
} else {
*m=-1;
my_strdup2(1059, &dest_string.str, s);
my_strdup2(_ALLOC_ID_, &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(1060, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
my_strdup(_ALLOC_ID_, &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(1061, &yylval.ptr.str, yytext);
my_strdup(_ALLOC_ID_, &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(1062, &yylval.ptr.str, yytext);
my_strdup(_ALLOC_ID_, &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(1063, &yylval.ptr.str, yytext);
my_strdup(_ALLOC_ID_, &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(1064, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
my_strdup(_ALLOC_ID_, &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(1065, &yylval.ptr.str, yytext);
my_strdup(_ALLOC_ID_, &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(1066, &yylval.ptr.str, yytext); /* freed after use in expandlabel.y */
my_strdup(_ALLOC_ID_, &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;

View File

@ -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(1067, &ptr);
my_free(_ALLOC_ID_, &ptr);
select_wire(i, SELECTED, 1, 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(1068, points, sizeof(double));
ptr[i].y = my_calloc(1069, points, sizeof(double));
ptr[i].selected_point= my_calloc(1070, points, sizeof(unsigned short));
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].points=points;
ptr[i].sel=0;
for(j=0;j<points; ++j) {
if(fscanf(fd, "%lf %lf ",&(ptr[i].x[j]), &(ptr[i].y[j]))<2) {
fprintf(errfp,"merge_polygon(): WARNING: missing fields for POLYGON points, ignoring.\n");
my_free(1071, &ptr[i].x);
my_free(1072, &ptr[i].y);
my_free(1073, &ptr[i].selected_point);
my_free(_ALLOC_ID_, &ptr[i].x);
my_free(_ALLOC_ID_, &ptr[i].y);
my_free(_ALLOC_ID_, &ptr[i].selected_point);
read_line(fd, 0);
return;
}
@ -283,12 +283,12 @@ static void merge_inst(int k,FILE *fd)
load_ascii_string(&tmp, fd);
/* avoid as much as possible calls to rel_sym_path (slow) */
#ifdef __unix__
if(tmp[0] == '/') my_strdup(1074, &xctx->inst[i].name, rel_sym_path(tmp));
else my_strdup(1075, &xctx->inst[i].name,tmp);
if(tmp[0] == '/') my_strdup(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(tmp));
else my_strdup(_ALLOC_ID_, &xctx->inst[i].name,tmp);
#else
my_strdup(1076, &xctx->inst[i].name, rel_sym_path(tmp));
my_strdup(_ALLOC_ID_, &xctx->inst[i].name, rel_sym_path(tmp));
#endif
my_free(1077, &tmp);
my_free(_ALLOC_ID_, &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);
@ -302,14 +302,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(1078, &xctx->inst[i].prop_ptr, prop_ptr);
my_strdup(_ALLOC_ID_, &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(1079, &prop_ptr);
my_free(_ALLOC_ID_, &prop_ptr);
xctx->instances++;
}
@ -373,7 +373,7 @@ void merge_file(int selection_load, const char ext[])
cmd = get_generator_command(name);
if(cmd) {
fd = popen(cmd, "r");
my_free(1080, &cmd);
my_free(_ALLOC_ID_, &cmd);
} else fd = NULL;
} else {
fd=my_fopen(name, fopen_read_mode);
@ -457,7 +457,7 @@ void merge_file(int selection_load, const char ext[])
xctx->mousex_snap = 0.;
xctx->mousey_snap = 0.;
}
my_free(1081, &aux_ptr);
my_free(_ALLOC_ID_, &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);

View File

@ -114,7 +114,7 @@ static int ps_embedded_image(xRect* r, double x1, double y1, double x2, double y
quality_attr = get_tok_value(r->prop_ptr, "jpg_quality", 0);
if(quality_attr[0]) quality = atoi(quality_attr);
}
attr_len = my_strdup2(1082, &attr, get_tok_value(r->prop_ptr, "image_data", 0));
attr_len = my_strdup2(_ALLOC_ID_, &attr, get_tok_value(r->prop_ptr, "image_data", 0));
filter = get_tok_value(r->prop_ptr, "filter", 0);
buffer = base64_decode(attr, attr_len, &buffer_size);
if(attr_len > 5) {
@ -132,8 +132,8 @@ static int ps_embedded_image(xRect* r, double x1, double y1, double x2, double y
}
emb_ptr = r->extraptr;
if(jpg == -1 || !(emb_ptr && emb_ptr->image)) {
my_free(1083, &buffer);
my_free(1084, &attr);
my_free(_ALLOC_ID_, &buffer);
my_free(_ALLOC_ID_, &attr);
return 0;
}
orig_sfc = emb_ptr->image;
@ -242,10 +242,10 @@ static int ps_embedded_image(xRect* r, double x1, double y1, double x2, double y
fprintf(fd, "~>\n");
fprintf(fd, "grestore\n");
my_free(1085, &ascii85EncodedJpeg);
my_free(_ALLOC_ID_, &ascii85EncodedJpeg);
free(jpgData);
my_free(1086, &buffer);
my_free(1087, &attr);
my_free(_ALLOC_ID_, &buffer);
my_free(_ALLOC_ID_, &attr);
#endif
return 1;
}
@ -397,7 +397,7 @@ static int ps_embedded_graph(int i, double rx1, double ry1, double rx2, double r
fprintf(fd, "grestore\n");
my_free(1088, &ascii85EncodedJpeg);
my_free(_ALLOC_ID_, &ascii85EncodedJpeg);
#endif
return 1;
@ -565,7 +565,7 @@ static void ps_drawpolygon(int c, int what, double *x, double *y, int points,
static void ps_filledrect(int gc, double rectx1,double recty1,double rectx2,double recty2,
int dash, int fill, int e_a, int e_b)
{
double x1,y1,x2,y2, tmp;
double x1,y1,x2,y2;
double psdash;
x1=X_TO_PS(rectx1);
@ -748,7 +748,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(1089, &estr);
my_free(_ALLOC_ID_, &estr);
return;
}
if(hcenter) {
@ -772,7 +772,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(1090, &sss, estr);
my_strdup2(_ALLOC_ID_, &sss, estr);
tt=ss=sss;
for(;;) {
c=*ss;
@ -790,8 +790,8 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in
}
++ss;
}
my_free(1091, &sss);
my_free(1092, &estr);
my_free(_ALLOC_ID_, &sss);
my_free(_ALLOC_ID_, &estr);
}
static void old_ps_draw_string(int gctext, const char *str,
@ -817,7 +817,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(1093, &estr);
my_free(_ALLOC_ID_, &estr);
return;
}
xscale*=tclgetdoublevar("nocairo_font_xscale") * cairo_font_scale;
@ -852,7 +852,7 @@ static void old_ps_draw_string(int gctext, const char *str,
}
++pos;
}
my_free(1094, &estr);
my_free(_ALLOC_ID_, &estr);
}
static void ps_drawgrid()
@ -1034,16 +1034,16 @@ static void ps_draw_symbol(int c, int n,int layer, int what, short tmp_flip, sho
dash = (disabled == 1) ? 3 : polygon->dash;
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
int k;
double *x = my_malloc(1095, sizeof(double) * polygon->points);
double *y = my_malloc(1096, sizeof(double) * polygon->points);
double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
for(k=0;k<polygon->points; ++k) {
ROTATION(rot, flip, 0.0,0.0,polygon->x[k],polygon->y[k],x[k],y[k]);
x[k]+= x0;
y[k] += y0;
}
ps_drawpolygon(c, NOW, x, y, polygon->points, polygon->fill, dash, bezier, bus);
my_free(1097, &x);
my_free(1098, &y);
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
}
}
if(symptr->arcs[layer]) fprintf(fd, "NP\n"); /* newpath */
@ -1235,7 +1235,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(1099, cadlayers, sizeof(Ps_color));
ps_colors=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Ps_color));
if(ps_colors==NULL){
fprintf(errfp, "create_ps(): calloc error\n");
return;
@ -1582,7 +1582,7 @@ void create_ps(char **psfile, int what, int fullzoom, int eps)
fclose(fd);
}
tclsetboolvar("draw_grid", old_grid);
my_free(1100, &ps_colors);
my_free(_ALLOC_ID_, &ps_colors);
/* restore original size and zoom factor */

File diff suppressed because it is too large Load Diff

View File

@ -29,16 +29,16 @@ void statusmsg(char str[],int n)
{
if(!str) return;
if(str[0]== '\0') {
my_free(1367, &xctx->infowindow_text);
my_free(_ALLOC_ID_, &xctx->infowindow_text);
return;
} else {
if(n == 3) {
my_strdup(1368, &xctx->infowindow_text, str);
my_strdup(_ALLOC_ID_, &xctx->infowindow_text, str);
} else if(n == 2) {
if(xctx->infowindow_text && xctx->infowindow_text[0]) {
my_strcat(1369, &xctx->infowindow_text, "\n");
my_strcat(_ALLOC_ID_, &xctx->infowindow_text, "\n");
}
my_strcat(1370, &xctx->infowindow_text, str);
my_strcat(_ALLOC_ID_, &xctx->infowindow_text, str);
}
}
if(!has_x) return;
@ -200,7 +200,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(1371, &prop, "name=", name, " dir=", dir, NULL);
my_mstrcat(_ALLOC_ID_, &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);
@ -221,7 +221,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
xctx->draw_window = save;
}
my_free(1372, &prop);
my_free(_ALLOC_ID_, &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");
@ -281,24 +281,24 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(tclresult()[0]) {
char *str = NULL;
my_strdup2(1373, &f, tclresult());
my_mstrcat(1374, &str, "flags=image,unscaled\nalpha=0.8\nimage=", f, "\n", NULL);
my_strdup2(_ALLOC_ID_, &f, tclresult());
my_mstrcat(_ALLOC_ID_, &str, "flags=image,unscaled\nalpha=0.8\nimage=", f, "\n", NULL);
if(strstr(f, ".svg") == f + strlen(f) - 4 ) {
if(tcleval("info exists svg_to_png")[0] == '1') {
my_mstrcat(1375, &str, "filter=\"", tclgetvar("svg_to_png"), "\"\n", NULL);
my_mstrcat(_ALLOC_ID_, &str, "filter=\"", tclgetvar("svg_to_png"), "\"\n", NULL);
}
}
storeobject(-1, xctx->mousex_snap-100, xctx->mousey_snap-100, xctx->mousex_snap+100, xctx->mousey_snap+100,
xRECT, GRIDLAYER, SELECTED, str);
my_free(1376, &str);
my_free(_ALLOC_ID_, &str);
xctx->need_reb_sel_arr=1;
rebuild_selected_array();
move_objects(START,0,0,0);
xctx->ui_state |= START_SYMPIN;
}
if(f) my_free(1377, &f);
if(f) my_free(_ALLOC_ID_, &f);
Tcl_ResetResult(interp);
}
@ -360,7 +360,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(res == 1) {
if(level >= 0) {
xctx->raw->level = level;
my_strdup2(1378, &xctx->raw->schname, xctx->sch[level]);
my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[level]);
}
update_op();
draw();
@ -507,15 +507,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(1379, &res, "Warning: symbol ", sympath, " is newer than schematic\n", NULL);
my_mstrcat(_ALLOC_ID_, &res, "Warning: symbol ", sympath, " is newer than schematic\n", NULL);
}
} else { /* not found */
my_mstrcat(1380, &res, "Warning: symbol ", sympath, " not found\n", NULL);
my_mstrcat(_ALLOC_ID_, &res, "Warning: symbol ", sympath, " not found\n", NULL);
}
my_mstrcat(1381, &res, "symbol ", my_itoa(i), " : ", sympath, "\n", NULL);
my_mstrcat(_ALLOC_ID_, &res, "symbol ", my_itoa(i), " : ", sympath, "\n", NULL);
}
Tcl_SetResult(interp, res, TCL_VOLATILE);
my_free(1382, &res);
my_free(_ALLOC_ID_, &res);
}
/* check_unique_names [1|0]
@ -872,7 +872,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(1383, &str);
my_free(_ALLOC_ID_, &str);
}
/* draw_graph [n] [flags]
@ -1125,10 +1125,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
l = expandlabel(argv[2], &tmp);
llen = strlen(l);
dbg(1, "l=%s\n", l ? l : "<NULL>");
result = my_malloc(1384, llen + 30);
result = my_malloc(_ALLOC_ID_, llen + 30);
my_snprintf(result, llen + 30, "%s %d", l, tmp);
Tcl_SetResult(interp, result, TCL_VOLATILE);
my_free(1385, &result);
my_free(_ALLOC_ID_, &result);
}
}
else { cmd_found = 0;}
@ -1824,11 +1824,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(argc > 4) {
fqdev = get_fqdevice(argv[3], atoi(argv[4]), argv[2]);
Tcl_SetResult(interp, fqdev, TCL_VOLATILE);
my_free(1386, &fqdev);
my_free(_ALLOC_ID_, &fqdev);
} else if(argc > 2) {
fqdev = get_fqdevice("", 0, argv[2]);
Tcl_SetResult(interp, fqdev, TCL_VOLATILE);
my_free(1387, &fqdev);
my_free(_ALLOC_ID_, &fqdev);
}
}
@ -1934,7 +1934,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(1388,tmp);
subtok = my_malloc(_ALLOC_ID_,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]) {
@ -1953,7 +1953,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
Tcl_SetResult(interp, (char *)value, TCL_VOLATILE);
}
my_free(1389, &subtok);
my_free(_ALLOC_ID_, &subtok);
}
}
/* xschem getprop symbol lm358.sym [type] */
@ -2054,9 +2054,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(1390, &s, get_tok_value(argv[2], argv[3], t));
my_strdup(_ALLOC_ID_, &s, get_tok_value(argv[2], argv[3], t));
Tcl_SetResult(interp, s, TCL_VOLATILE);
my_free(1391, &s);
my_free(_ALLOC_ID_, &s);
}
/* get_tok_size
@ -2542,11 +2542,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(1392, &s, "\n", NULL);
my_mstrcat(1393, &s, "{", instname, "} {", name, "} {", type, "}", NULL);
if(i > 0) my_mstrcat(_ALLOC_ID_, &s, "\n", NULL);
my_mstrcat(_ALLOC_ID_, &s, "{", instname, "} {", name, "} {", type, "}", NULL);
}
Tcl_SetResult(interp, (char *)s, TCL_VOLATILE);
my_free(1394, &s);
my_free(_ALLOC_ID_, &s);
}
/* instance_net inst pin
* Return the name of the net attached to pin 'pin' of instance 'inst'
@ -2675,7 +2675,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(1395, sizeof(xctx->inst[i].instname));
tmpstr = my_malloc(_ALLOC_ID_, sizeof(xctx->inst[i].instname));
if((ss=strchr(xctx->inst[i].instname, ':')) ) {
sscanf(ss+1, "%s", tmpstr);
if(isonlydigit(tmpstr)) {
@ -2694,7 +2694,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(1396, &tmpstr);
my_free(_ALLOC_ID_, &tmpstr);
}
/* instance_pins inst
@ -2716,11 +2716,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
const char *pin;
pin = get_tok_value(xctx->sym[xctx->inst[i].ptr].rect[PINLAYER][p].prop_ptr, "name",0);
if(!pin[0]) pin = "--ERROR--";
my_mstrcat(1397, &pins, "{", pin, "}", NULL);
if(p< no_of_pins-1) my_strcat(1398, &pins, " ");
my_mstrcat(_ALLOC_ID_, &pins, "{", pin, "}", NULL);
if(p< no_of_pins-1) my_strcat(_ALLOC_ID_, &pins, " ");
}
Tcl_SetResult(interp, pins, TCL_VOLATILE);
my_free(1399, &pins);
my_free(_ALLOC_ID_, &pins);
}
}
@ -2767,16 +2767,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(1400, &pins, "{ {", xctx->inst[i].instname, "} {", pin, NULL);
my_mstrcat(_ALLOC_ID_, &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(1401, &pins, "} {", xx, "} {", yy, "} } ", NULL);
my_mstrcat(_ALLOC_ID_, &pins, "} {", xx, "} {", yy, "} } ", NULL);
}
}
}
Tcl_SetResult(interp, pins ? pins : "", TCL_VOLATILE);
my_free(1402, &pins);
my_free(_ALLOC_ID_, &pins);
}
/* is_generator symbol
@ -2877,7 +2877,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(1403, &res);
my_free(_ALLOC_ID_, &res);
}
/* list_hilights [sep | all | all_nets | all_inst]
@ -2909,7 +2909,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(1404, &result);
my_free(_ALLOC_ID_, &result);
}
/* list_tokens str with_quotes
@ -3023,7 +3023,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
dbg(1, "xschem load: f=%s, ret=%d\n", f, ret);
if(undo_reset) {
tclvareval("update_recent_file {", f, "}", NULL);
my_strdup(1405, &xctx->sch_path[xctx->currsch], ".");
my_strdup(_ALLOC_ID_, &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;
@ -3362,14 +3362,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(1406, &strcopy, argv[2]);
my_strdup(_ALLOC_ID_, &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(1407, &strptr);
my_free(_ALLOC_ID_, &strptr);
}
}
@ -3426,7 +3426,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(1408, &saveshow, tclgetvar("show_infowindow_after_netlist"));
my_strdup(_ALLOC_ID_, &saveshow, tclgetvar("show_infowindow_after_netlist"));
my_strncpy(savedir, tclgetvar("netlist_dir"), S(savedir));
for(i = 2; i < argc; i++) {
@ -3504,7 +3504,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
Tcl_SetResult(interp, my_itoa(err), TCL_VOLATILE);
}
}
my_free(1409, &saveshow);
my_free(_ALLOC_ID_, &saveshow);
}
/* new_process [f]
@ -4671,9 +4671,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(1410, &sym, tcl_hook2(symbol));
my_strdup(_ALLOC_ID_, &sym, tcl_hook2(symbol));
sym_number=match_symbol(sym);
my_free(1411, &sym);
my_free(_ALLOC_ID_, &sym);
if(sym_number>=0)
{
prefix=(get_tok_value(xctx->sym[sym_number].templ , "name",0))[0]; /* get new symbol prefix */
@ -4682,23 +4682,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(1412, &xctx->inst[inst].name, rel_sym_path(symbol));
my_strdup2(_ALLOC_ID_, &xctx->inst[inst].name, rel_sym_path(symbol));
xctx->inst[inst].ptr=sym_number;
my_strdup(1413, &name, xctx->inst[inst].instname);
my_strdup(_ALLOC_ID_, &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(1414, &ptr,subst_token(xctx->inst[inst].prop_ptr, "name", name) );
my_strdup(_ALLOC_ID_, &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(1415, &ptr);
my_free(_ALLOC_ID_, &ptr);
}
my_free(1416, &name);
my_free(_ALLOC_ID_, &name);
set_modify(1);
/* draw(); */
Tcl_SetResult(interp, xctx->inst[inst].instname , TCL_VOLATILE);
@ -4742,21 +4742,21 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
hash_names(inst, XDELETE);
set_inst_prop(inst);
my_strdup2(1417, &translated_sym, translate(inst, xctx->inst[inst].name));
my_strdup2(_ALLOC_ID_, &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(1418, &subst);
if(subst) my_free(_ALLOC_ID_, &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(1419, &translated_sym);
my_free(_ALLOC_ID_, &translated_sym);
Tcl_SetResult(interp, xctx->inst[inst].instname , TCL_VOLATILE);
}
@ -4776,7 +4776,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(1420, &xctx->inst[inst].name, argv[3]);
my_strdup(_ALLOC_ID_, &xctx->inst[inst].name, argv[3]);
}
Tcl_ResetResult(interp);
}
@ -4823,7 +4823,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
rn = resolved_net(net);
Tcl_AppendResult(interp, rn, NULL);
my_free(1421, &rn);
my_free(_ALLOC_ID_, &rn);
}
/* rotate [x0 y0]
@ -5267,7 +5267,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(1422, &viewer_name, tclgetvar(tcl_str));
my_strdup(_ALLOC_ID_, &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;
@ -5275,7 +5275,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
hilight_net(viewer);
redraw_hilights(0);
}
my_free(1423, &viewer_name);
my_free(_ALLOC_ID_, &viewer_name);
}
Tcl_ResetResult(interp);
}
@ -5346,13 +5346,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(1424, &xctx->custom_format, argv[3]);
my_strdup(_ALLOC_ID_, &xctx->custom_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(1425, &xctx->header_text, argv[3]);
my_strdup2(_ALLOC_ID_, &xctx->header_text, argv[3]);
}
}
else if(!strcmp(argv[2], "hide_symbols")) { /* set to 0,1,2 for various hiding level of symbols */
@ -5368,7 +5368,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(1426, &xctx->infowindow_text, argv[3]);
my_strdup(_ALLOC_ID_, &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;}
@ -5418,7 +5418,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(1427, &xctx->raw->schname, xctx->sch[xctx->raw->level]);
my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[xctx->raw->level]);
Tcl_SetResult(interp, my_itoa(n), TCL_VOLATILE);
} else {
Tcl_SetResult(interp, "-1", TCL_VOLATILE);
@ -5440,23 +5440,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(1428, &xctx->schsymbolprop, argv[3]);
my_strdup(_ALLOC_ID_, &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(1429, &xctx->schprop, argv[3]);
my_strdup(_ALLOC_ID_, &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(1430, &xctx->schverilogprop, argv[3]);
my_strdup(_ALLOC_ID_, &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(1431, &xctx->schvhdlprop, argv[3]);
my_strdup(_ALLOC_ID_, &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(1432, &xctx->schtedaxprop, argv[3]);
my_strdup(_ALLOC_ID_, &xctx->schtedaxprop, argv[3]);
}
else if(!strcmp(argv[2], "text_svg")) { /* set to 1 to use svg <text> elements */
text_svg=atoi(argv[3]);
@ -5490,10 +5490,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(1433, &s, argv[2]);
my_strdup(_ALLOC_ID_, &s, argv[2]);
set_different_token(&s, argv[3], argv[4]);
Tcl_SetResult(interp, s, TCL_VOLATILE);
my_free(1434, &s);
my_free(_ALLOC_ID_, &s);
}
/* set_modify [n]
@ -5598,20 +5598,20 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(fast == 0) {
hash_names(-1, XINSERT);
}
my_strdup2(1435, &old_name, xctx->inst[inst].instname);
my_strdup2(_ALLOC_ID_, &old_name, xctx->inst[inst].instname);
}
if(argc > 5) {
if(!strcmp(argv[4], "allprops")) {
hash_names(-1, XINSERT);
my_strdup2(1436, &subst, argv[5]);
my_strdup2(_ALLOC_ID_, &subst, argv[5]);
} else {
my_strdup2(1437, &subst, subst_token(xctx->inst[inst].prop_ptr, argv[4], argv[5]));
my_strdup2(_ALLOC_ID_, &subst, subst_token(xctx->inst[inst].prop_ptr, argv[4], argv[5]));
}
} else if(argc > 4) {/* assume argc == 5 , delete attribute */
my_strdup2(1438, &subst, subst_token(xctx->inst[inst].prop_ptr, argv[4], NULL));
my_strdup2(_ALLOC_ID_, &subst, subst_token(xctx->inst[inst].prop_ptr, argv[4], NULL));
} else if(argc > 3) {
/* clear all instance prop_str */
my_free(1439, &subst);
my_free(_ALLOC_ID_, &subst);
}
hash_names(inst, XDELETE);
@ -5619,15 +5619,15 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(old_name) {
update_attached_floaters(old_name, inst, 0);
}
my_strdup2(1440, &translated_sym, translate(inst, xctx->inst[inst].name));
my_strdup2(_ALLOC_ID_, &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(1441, &subst);
if(old_name) my_free(1442, &old_name);
if(subst) my_free(_ALLOC_ID_, &subst);
if(old_name) my_free(_ALLOC_ID_, &old_name);
set_inst_flags(&xctx->inst[inst]);
hash_names(inst, XINSERT);
if(!fast) {
@ -5636,7 +5636,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
set_modify(-2); /* reset floaters caches */
draw();
}
my_free(1443, &translated_sym);
my_free(_ALLOC_ID_, &translated_sym);
Tcl_SetResult(interp, xctx->inst[inst].instname , TCL_VOLATILE);
}
} else if(argc > 2 && !strcmp(argv[2], "symbol")) {
@ -5656,9 +5656,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
sym = &xctx->sym[i];
if(argc > 5)
my_strdup2(1444, &sym->prop_ptr, subst_token(sym->prop_ptr, argv[4], argv[5]));
my_strdup2(_ALLOC_ID_, &sym->prop_ptr, subst_token(sym->prop_ptr, argv[4], argv[5]));
else
my_strdup2(1445, &sym->prop_ptr, subst_token(sym->prop_ptr, argv[4], NULL)); /* delete attr */
my_strdup2(_ALLOC_ID_, &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
@ -5697,14 +5697,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(1446, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], argv[6]));
my_strdup2(_ALLOC_ID_, &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(1447, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], NULL)); /* delete attr */
my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, argv[5], NULL)); /* delete attr */
}
}
if(change_done) set_modify(1);
@ -5751,7 +5751,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(1448, &estr);
my_free(_ALLOC_ID_, &estr);
bbox(ADD, xx1, yy1, xx2, yy2);
}
/* verify if there is some difference */
@ -5759,19 +5759,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(1449, &t->txt_ptr, argv[5]);
my_strdup2(_ALLOC_ID_, &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(1450, &t->prop_ptr, subst_token(t->prop_ptr, argv[4], argv[5]));
my_strdup2(_ALLOC_ID_, &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(1451, &t->prop_ptr, subst_token(t->prop_ptr, argv[4], NULL)); /* delete attr */
my_strdup2(_ALLOC_ID_, &t->prop_ptr, subst_token(t->prop_ptr, argv[4], NULL)); /* delete attr */
}
}
if(change_done) {
@ -5783,7 +5783,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(1452, &estr);
my_free(_ALLOC_ID_, &estr);
if(!fast) bbox(ADD, xx1, yy1, xx2, yy2);
}
if(!fast) {
@ -5845,9 +5845,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(1453, &s, subst_token(argv[2], argv[3], strcmp(argv[4], "<NULL>") ? argv[4] : NULL));
my_strdup(_ALLOC_ID_, &s, subst_token(argv[2], argv[3], strcmp(argv[4], "<NULL>") ? argv[4] : NULL));
Tcl_SetResult(interp, s, TCL_VOLATILE);
my_free(1454, &s);
my_free(_ALLOC_ID_, &s);
}
/* symbol_base_name n
* Return the base_name field of a symbol with name or number `n`
@ -6113,7 +6113,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(1455, &t);
my_free(_ALLOC_ID_, &t);
}
}
@ -6213,10 +6213,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(1456, &s, translate(i, argv[3]));
my_strdup2(_ALLOC_ID_, &s, translate(i, argv[3]));
Tcl_ResetResult(interp);
Tcl_SetResult(interp, s, TCL_VOLATILE);
my_free(1457, &s);
my_free(_ALLOC_ID_, &s);
}
}
@ -6232,16 +6232,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(1458, &s, translate3(argv[2], eat_escapes, argv[4], argv[5], argv[6], NULL));
else if(argc > 5) my_strdup2(1459, &s, translate3(argv[2], eat_escapes, argv[4], argv[5], NULL, NULL));
else if(argc > 4) my_strdup2(1460, &s, translate3(argv[2], eat_escapes, argv[4], NULL, NULL, NULL));
if(argc > 6) my_strdup2(_ALLOC_ID_, &s, translate3(argv[2], eat_escapes, argv[4], argv[5], argv[6], NULL));
else if(argc > 5) my_strdup2(_ALLOC_ID_, &s, translate3(argv[2], eat_escapes, argv[4], argv[5], NULL, NULL));
else if(argc > 4) my_strdup2(_ALLOC_ID_, &s, translate3(argv[2], eat_escapes, argv[4], NULL, 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(1461, &s);
my_free(_ALLOC_ID_, &s);
}
/* trim_chars str sep
@ -6364,7 +6364,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(1462, &xctx->text[i].floater_ptr); /* clear floater cached value */
my_free(_ALLOC_ID_, &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);
@ -6427,10 +6427,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(1463, &r, dtoa(wire[n].x1), " ", NULL);
my_mstrcat(1464, &r, dtoa(wire[n].y1), " ", NULL);
my_mstrcat(1465, &r, dtoa(wire[n].x2), " ", NULL);
my_mstrcat(1466, &r, dtoa(wire[n].y2), NULL);
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);
Tcl_SetResult(interp, r, TCL_VOLATILE);
}
}
@ -6737,9 +6737,9 @@ int tclvareval(const char *script, ...)
va_list args;
va_start(args, script);
size = my_strcat(1467, &str, script);
size = my_strcat(_ALLOC_ID_, &str, script);
while( (p = va_arg(args, const char *)) ) {
size = my_strcat(1468, &str, p);
size = my_strcat(_ALLOC_ID_, &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 : "<NULL>", size);
@ -6749,6 +6749,6 @@ int tclvareval(const char *script, ...)
dbg(0, "tclvareval(): error executing %s: %s\n", str, tclresult());
Tcl_ResetResult(interp);
}
my_free(1469, &str);
my_free(_ALLOC_ID_, &str);
return return_code;
}

View File

@ -175,7 +175,7 @@ int select_dangling_nets(void)
char *type;
double x0, y0, x1, y1, x2, y2;
table = my_calloc(1470, xctx->wires, sizeof(int));
table = my_calloc(_ALLOC_ID_, 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(1471, &table);
my_free(_ALLOC_ID_, &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(1472, &estr);
my_free(_ALLOC_ID_, &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(1473, &xctx->rect[c][i].prop_ptr);
my_free(_ALLOC_ID_, &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(1474, &xctx->line[c][i].prop_ptr);
my_free(_ALLOC_ID_, &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(1475, &xctx->arc[c][i].prop_ptr);
my_free(_ALLOC_ID_, &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(1476, &xctx->poly[c][i].prop_ptr);
my_free(1477, &xctx->poly[c][i].x);
my_free(1478, &xctx->poly[c][i].y);
my_free(1479, &xctx->poly[c][i].selected_point);
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);
/*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(1480, &xctx->wire[i].prop_ptr);
my_free(1481, &xctx->wire[i].node);
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
my_free(_ALLOC_ID_, &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(1482, &xctx->text[i].prop_ptr);
my_free(1483, &xctx->text[i].font);
my_free(1484, &xctx->text[i].floater_instname);
my_free(1485, &xctx->text[i].floater_ptr);
my_free(1486, &xctx->text[i].txt_ptr);
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);
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(1487, &xctx->inst[i].prop_ptr);
my_free(_ALLOC_ID_, &xctx->inst[i].prop_ptr);
}
delete_inst_node(i);
my_free(1488, &xctx->inst[i].name);
my_free(1489, &xctx->inst[i].instname);
my_free(1490, &xctx->inst[i].lab);
my_free(_ALLOC_ID_, &xctx->inst[i].name);
my_free(_ALLOC_ID_, &xctx->inst[i].instname);
my_free(_ALLOC_ID_, &xctx->inst[i].lab);
++j;
continue;
}
@ -947,7 +947,7 @@ static int select_attached_floaters(int inst, const char *name)
char *attach = NULL;
char *att_save, *att_ptr;
if(!name || !name[0]) return found;
my_strdup2(1491, &attach, name);
my_strdup2(_ALLOC_ID_, &attach, name);
att_ptr = attach;
while( (name = my_strtok_r(att_ptr, " \n", "\"", 0, &att_save)) ) {
att_ptr = NULL;
@ -997,7 +997,7 @@ static int select_attached_floaters(int inst, const char *name)
}
}
}
my_free(1492, &attach);
my_free(_ALLOC_ID_, &attach);
return found;
}
@ -1424,7 +1424,7 @@ void select_inside(int stretch, double x1,double y1, double x2, double y2, int s
xctx->text[i].hcenter, xctx->text[i].vcenter,
xctx->text[i].x0, xctx->text[i].y0,
&xx1,&yy1, &xx2,&yy2, &tmpint, &dtmp);
my_free(1493, &estr);
my_free(_ALLOC_ID_, &estr);
#if HAS_CAIRO==1
if(customfont) {
cairo_restore(xctx->cairo_ctx);
@ -1634,7 +1634,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(1494, &estr);
my_free(_ALLOC_ID_, &estr);
#if HAS_CAIRO==1
if(customfont) {
cairo_restore(xctx->cairo_ctx);
@ -1757,9 +1757,9 @@ int floaters_from_selected_inst()
set_modify(1);
first = 0;
}
my_strdup2(1495, &xctx->inst[i].prop_ptr,
my_strdup2(_ALLOC_ID_, &xctx->inst[i].prop_ptr,
subst_token(xctx->inst[i].prop_ptr, "hide_texts", "true"));
my_strdup2(1496, &xctx->inst[i].prop_ptr,
my_strdup2(_ALLOC_ID_, &xctx->inst[i].prop_ptr,
subst_token(xctx->inst[i].prop_ptr, "attach", xctx->inst[i].instname));
set_inst_flags(&xctx->inst[i]);
for(t = 0; t < sym->texts; t++) {

View File

@ -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(1497, res, hier_psprint_mtime(xctx->sch[xctx->currsch]));
my_strcat(1498, res, " {");
my_strcat(1499, res, xctx->sch[xctx->currsch]);
my_strcat(1500, res, "}\n");
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");
}
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(1501, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(1502, &xctx->sch_path[xctx->currsch+1], "->netlisting");
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");
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(1503, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[i].name), ""));
my_strdup2(_ALLOC_ID_, &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(1504, &subckt_name, get_cell(xctx->sym[i].name, 0));
my_strdup(_ALLOC_ID_, &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, subckt_name, "", XINSERT_NOREPLACE)==NULL)
{
@ -109,10 +109,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(1505, res, hier_psprint_mtime(xctx->sch[xctx->currsch]));
my_strcat(1506, res, " {");
my_strcat(1507, res, xctx->sch[xctx->currsch]);
my_strcat(1508, res, "}\n");
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");
}
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 load_schematic() above may have loaded additional syms */
/* get_additional_symbols(0); */
my_free(1509, &abs_path);
my_free(_ALLOC_ID_, &abs_path);
str_hash_free(&subckt_table);
my_free(1510, &subckt_name);
my_free(1511, &xctx->sch[xctx->currsch]);
my_free(_ALLOC_ID_, &subckt_name);
my_free(_ALLOC_ID_, &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(1512, &m_lower, m);
my_strdup(_ALLOC_ID_, &m_lower, m);
strtolower(m_lower);
my_realloc(1513, &modelname, l);
my_realloc(1514, &model_name_result, l);
my_realloc(_ALLOC_ID_, &modelname, l);
my_realloc(_ALLOC_ID_, &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(1515, &model_name_result, modelname);
my_strcat(_ALLOC_ID_, &model_name_result, modelname);
}
my_free(1516, &modelname);
my_free(1517, &m_lower);
my_free(_ALLOC_ID_, &modelname);
my_free(_ALLOC_ID_, &m_lower);
return model_name_result;
}
@ -176,8 +176,8 @@ static int spice_netlist(FILE *fd, int spice_stop )
int lvs_netlist = tclgetboolvar("lvs_netlist");
int top_sub = lvs_netlist || tclgetboolvar("top_is_subckt");
int lvs_ignore = tclgetboolvar("lvs_ignore");
if(lvs_netlist) my_strdup(1518, &xctx->format, "lvs_format");
else my_strdup(1519, &xctx->format, xctx->custom_format);
if(lvs_netlist) my_strdup(_ALLOC_ID_, &xctx->format, "lvs_format");
else my_strdup(_ALLOC_ID_, &xctx->format, xctx->custom_format);
if(!spice_stop) {
dbg(1, "spice_netlist(): invoke prepare_netlist_structs for %s\n", xctx->current_name);
xctx->prep_net_structs = 0;
@ -225,21 +225,21 @@ static int spice_netlist(FILE *fd, int spice_stop )
fprintf(fd, "**** end_element\n");
}
/* hash device_model attribute if any */
my_strdup2(1520, &val, get_tok_value(xctx->inst[i].prop_ptr, "device_model", 2));
my_strdup2(_ALLOC_ID_, &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(1521, &val,
my_strdup2(_ALLOC_ID_, &val,
get_tok_value(xctx->sym[xctx->inst[i].ptr].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(1522, &model_name_result);
my_free(1523, &val);
my_free(_ALLOC_ID_, &model_name_result);
my_free(_ALLOC_ID_, &val);
}
}
}
@ -282,8 +282,8 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
int top_sub = lvs_netlist || tclgetboolvar("top_is_subckt");
int lvs_ignore = tclgetboolvar("lvs_ignore");
if(lvs_netlist) my_strdup(1524, &xctx->format, "lvs_format");
else my_strdup(1525, &xctx->format, xctx->custom_format);
if(lvs_netlist) my_strdup(_ALLOC_ID_, &xctx->format, "lvs_format");
else my_strdup(_ALLOC_ID_, &xctx->format, xctx->custom_format);
exit_code = 0; /* reset exit code */
split_f = tclgetboolvar("split_files");
dbg(1, "global_spice_netlist(): invoking push_undo()\n");
@ -322,10 +322,10 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
{
if(skip_instance(i, 1, lvs_ignore)) continue;
type = (xctx->inst[i].ptr+ xctx->sym)->type;
my_strdup(1526, &place,get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr,"place",0));
my_strdup(_ALLOC_ID_, &place,get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr,"place",0));
if( type && !strcmp(type,"netlist_commands") ) {
if(!place) {
my_strdup(1527, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
my_strdup(_ALLOC_ID_, &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");
@ -352,7 +352,7 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
pinnumber_list = sort_schematic_pins(&npins); /* sort pins according to sim_pinnumber attr */
/* print top subckt ipin/opins */
my_strdup2(1528, &top_symbol_name, abs_sym_path(add_ext(xctx->current_name, ".sym"), ""));
my_strdup2(_ALLOC_ID_, &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);
@ -368,7 +368,7 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
}
remove_symbol(xctx->symbols - 1);
}
my_free(1529, &top_symbol_name);
my_free(_ALLOC_ID_, &top_symbol_name);
if(found_top_symbol != 3) {
for(i=0;i<npins; ++i) {
int n = pinnumber_list[i].n;
@ -377,7 +377,7 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
fprintf(fd, " %s", str_tmp ? str_tmp : "<NULL>" );
}
}
my_free(1530, &pinnumber_list);
my_free(_ALLOC_ID_, &pinnumber_list);
fprintf(fd,"\n");
err |= spice_netlist(fd, 0);
@ -388,10 +388,10 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
{
if(skip_instance(i, 1, lvs_ignore)) continue;
type = (xctx->inst[i].ptr+ xctx->sym)->type;
my_strdup(1531, &place,get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr,"place",0));
my_strdup(_ALLOC_ID_, &place,get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr,"place",0));
if( type && !strcmp(type,"netlist_commands") ) {
if(!place) {
my_strdup(1532, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
my_strdup(_ALLOC_ID_, &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");
@ -435,7 +435,7 @@ int global_spice_netlist(int global, int alert) /* 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(1533, xctx->instances, sizeof(unsigned int));
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
for(i=0;i<xctx->instances; ++i) stored_flags[i] = xctx->inst[i].color;
if(global)
@ -444,7 +444,7 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
int web_url = is_from_web(xctx->current_dirname);
char *current_dirname_save = NULL;
my_strdup2(1534, &current_dirname_save, xctx->current_dirname);
my_strdup2(_ALLOC_ID_, &current_dirname_save, xctx->current_dirname);
unselect_all(1);
/* ensure all unused symbols purged before descending hierarchy */
if(!tclgetboolvar("keep_symbols")) remove_symbols();
@ -452,8 +452,8 @@ int global_spice_netlist(int global, int alert) /* 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(1535, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(1536, &xctx->sch_path[xctx->currsch+1], "->netlisting");
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");
xctx->sch_path_hash[xctx->currsch+1] = 0;
xctx->currsch++;
subckt_name=NULL;
@ -469,12 +469,12 @@ int global_spice_netlist(int global, int alert) /* 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(1537, &xctx->hier_attr[xctx->currsch - 1].templ,
my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch - 1].templ,
tcl_hook2(xctx->sym[i].templ));
/* only additional symbols (created with instance schematic=... attr) will have this attribute */
my_strdup(1538, &xctx->hier_attr[xctx->currsch - 1].prop_ptr,
my_strdup(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch - 1].prop_ptr,
tcl_hook2(xctx->sym[i].parent_prop_ptr));
my_strdup(1539, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
my_strdup(_ALLOC_ID_, &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) {
@ -482,7 +482,7 @@ int global_spice_netlist(int global, int alert) /* 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(1540, &subckt_name, get_cell(xctx->sym[i].name, 0));
my_strdup(_ALLOC_ID_, &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)
{
@ -501,14 +501,14 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
}
}
if(xctx->hier_attr[xctx->currsch - 1].templ)
my_free(1541, &xctx->hier_attr[xctx->currsch - 1].templ);
my_free(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch - 1].templ);
if(xctx->hier_attr[xctx->currsch - 1].prop_ptr)
my_free(1542, &xctx->hier_attr[xctx->currsch - 1].prop_ptr);
my_free(1543, &abs_path);
my_free(_ALLOC_ID_, &xctx->hier_attr[xctx->currsch - 1].prop_ptr);
my_free(_ALLOC_ID_, &abs_path);
/* get_additional_symbols(0); */
my_free(1544, &subckt_name);
my_free(_ALLOC_ID_, &subckt_name);
/*clear_drawing(); */
my_free(1545, &xctx->sch[xctx->currsch]);
my_free(_ALLOC_ID_, &xctx->sch[xctx->currsch]);
xctx->currsch--;
unselect_all(1);
dbg(1, "global_spice_netlist(): invoking pop_undo(0, 0)\n");
@ -527,13 +527,13 @@ int global_spice_netlist(int global, int alert) /* 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(1546, &current_dirname_save);
my_free(_ALLOC_ID_, &current_dirname_save);
}
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
for(i=0;i<xctx->instances; ++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(1547, &stored_flags);
my_free(_ALLOC_ID_, &stored_flags);
/* print globals nodes found in netlist 28032003 */
if(!split_f) {
@ -548,14 +548,14 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
{
if(skip_instance(i, 1, lvs_ignore)) continue;
type = (xctx->inst[i].ptr+ xctx->sym)->type;
my_strdup(1548, &place,get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr,"place",0));
my_strdup(_ALLOC_ID_, &place,get_tok_value(xctx->sym[xctx->inst[i].ptr].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(1549, &place,get_tok_value(xctx->inst[i].prop_ptr,"place",0));
my_strdup(_ALLOC_ID_, &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;
@ -599,7 +599,7 @@ int global_spice_netlist(int global, int alert) /* netlister driver */
}
if(!debug_var) xunlink(netl_filename);
}
my_free(1550, &place);
my_free(_ALLOC_ID_, &place);
xctx->netlist_count = 0;
tclvareval("show_infotext ", my_itoa(err), NULL); /* critical error: force ERC window showing */
exit_code = err ? 10 : 0;
@ -638,7 +638,7 @@ int spice_block_netlist(FILE *fd, int i, int alert)
if(!strcmp(default_schematic, "ignore")) {
return err;
}
my_strdup(1551, &name, tcl_hook2(xctx->sym[i].name));
my_strdup(_ALLOC_ID_, &name, tcl_hook2(xctx->sym[i].name));
dbg(1, "spice_block_netlist(): filename=%s\n", filename);
if(split_f) {
@ -656,15 +656,15 @@ int spice_block_netlist(FILE *fd, int i, int alert)
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(1552, &sym_def, get_tok_value(xctx->sym[i].prop_ptr,"spice_sym_def",0));
my_strdup(_ALLOC_ID_, &sym_def, get_tok_value(xctx->sym[i].prop_ptr,"spice_sym_def",0));
if(sym_def) {
char *symname_attr = NULL;
const char *translated_sym_def;
my_mstrcat(1553, &symname_attr, "symname=", get_cell(name, 0), NULL);
my_mstrcat(_ALLOC_ID_, &symname_attr, "symname=", get_cell(name, 0), NULL);
translated_sym_def = translate3(sym_def, 1, xctx->sym[i].templ, symname_attr, NULL, NULL);
my_free(1554, &symname_attr);
my_free(_ALLOC_ID_, &symname_attr);
fprintf(fd, "%s\n", translated_sym_def);
my_free(1555, &sym_def);
my_free(_ALLOC_ID_, &sym_def);
} else {
const char *s = get_cell(sanitize(name), 0);
fprintf(fd, "** sch_path: %s\n", sanitized_abs_sym_path(filename, ""));
@ -674,7 +674,7 @@ int spice_block_netlist(FILE *fd, int i, int alert)
fprintf(fd, ".subckt %s ", s);
print_spice_subckt_nodes(fd, i);
my_strdup(1556, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
my_strdup(_ALLOC_ID_, &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 : "" );
@ -682,7 +682,7 @@ int spice_block_netlist(FILE *fd, int i, int alert)
/* 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(1557, &extra);
my_free(_ALLOC_ID_, &extra);
fprintf(fd, "\n");
spice_stop ? load_schematic(0,filename, 0, alert) : load_schematic(1,filename, 0, alert);
@ -713,7 +713,7 @@ int spice_block_netlist(FILE *fd, int i, int alert)
}
err:
xctx->netlist_count++;
my_free(1558, &name);
my_free(_ALLOC_ID_, &name);
return err;
}
@ -748,12 +748,12 @@ Str_hashentry *str_hash_lookup(Str_hashtable *hashtable, const char *token, cons
{
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
{
Str_hashentry *entry = (Str_hashentry *)my_malloc(1559, sizeof( Str_hashentry ));
Str_hashentry *entry = (Str_hashentry *)my_malloc(_ALLOC_ID_, sizeof( Str_hashentry ));
entry->next=NULL;
entry->token=NULL;
entry->value=NULL;
my_strdup2(1560, &entry->token, token);
my_strdup2(1561, &entry->value, value);
my_strdup2(_ALLOC_ID_, &entry->token, token);
my_strdup2(_ALLOC_ID_, &entry->value, value);
entry->hash=hashcode;
*preventry=entry;
}
@ -765,13 +765,13 @@ Str_hashentry *str_hash_lookup(Str_hashtable *hashtable, const char *token, cons
{
Str_hashentry *saveptr;
saveptr=(*preventry)->next;
my_free(1562, &(*preventry)->token);
my_free(1563, &(*preventry)->value);
my_free(1564, &(*preventry));
my_free(_ALLOC_ID_, &(*preventry)->token);
my_free(_ALLOC_ID_, &(*preventry)->value);
my_free(_ALLOC_ID_, &(*preventry));
*preventry=saveptr;
}
else if(value && what == XINSERT ) {
my_strdup2(1565, &(*preventry)->value, value);
my_strdup2(_ALLOC_ID_, &(*preventry)->value, value);
}
return (*preventry); /* found matching entry, return the address */
}
@ -785,7 +785,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(1566, size, sizeof(Str_hashentry *));
hashtable->table = my_calloc(_ALLOC_ID_, size, sizeof(Str_hashentry *));
}
static void str_hash_free_entry(Str_hashentry *entry)
@ -793,9 +793,9 @@ static void str_hash_free_entry(Str_hashentry *entry)
Str_hashentry *tmp;
while( entry ) {
tmp = entry -> next;
my_free(1567, &(entry->token));
my_free(1568, &(entry->value));
my_free(1569, &entry);
my_free(_ALLOC_ID_, &(entry->token));
my_free(_ALLOC_ID_, &(entry->value));
my_free(_ALLOC_ID_, &entry);
entry = tmp;
}
}
@ -811,7 +811,7 @@ void str_hash_free(Str_hashtable *hashtable)
str_hash_free_entry( table[i] );
table[i] = NULL;
}
if(hashtable->table) my_free(1570, &(hashtable->table));
if(hashtable->table) my_free(_ALLOC_ID_, &(hashtable->table));
hashtable->size = 0;
}
}
@ -846,10 +846,10 @@ Int_hashentry *int_hash_lookup(Int_hashtable *hashtable, const char *token, cons
{
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
{
Int_hashentry *entry = (Int_hashentry *)my_malloc(1571, sizeof( Int_hashentry ));
Int_hashentry *entry = (Int_hashentry *)my_malloc(_ALLOC_ID_, sizeof( Int_hashentry ));
entry->next=NULL;
entry->token=NULL;
my_strdup2(1572, &entry->token, token);
my_strdup2(_ALLOC_ID_, &entry->token, token);
entry->value = value;
entry->hash=hashcode;
*preventry=entry;
@ -862,8 +862,8 @@ Int_hashentry *int_hash_lookup(Int_hashtable *hashtable, const char *token, cons
{
Int_hashentry *saveptr;
saveptr=(*preventry)->next;
my_free(1573, &(*preventry)->token);
my_free(1574, &(*preventry));
my_free(_ALLOC_ID_, &(*preventry)->token);
my_free(_ALLOC_ID_, &(*preventry));
*preventry=saveptr;
}
else if(what == XINSERT ) {
@ -881,7 +881,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(1575, size, sizeof(Int_hashentry *));
hashtable->table = my_calloc(_ALLOC_ID_, size, sizeof(Int_hashentry *));
}
static void int_hash_free_entry(Int_hashentry *entry)
@ -889,8 +889,8 @@ static void int_hash_free_entry(Int_hashentry *entry)
Int_hashentry *tmp;
while( entry ) {
tmp = entry -> next;
my_free(1576, &(entry->token));
my_free(1577, &entry);
my_free(_ALLOC_ID_, &(entry->token));
my_free(_ALLOC_ID_, &entry);
entry = tmp;
}
}
@ -906,7 +906,7 @@ void int_hash_free(Int_hashtable *hashtable)
int_hash_free_entry( table[i] );
table[i] = NULL;
}
my_free(1578, &(hashtable->table));
my_free(_ALLOC_ID_, &(hashtable->table));
hashtable->size = 0;
}
}
@ -943,10 +943,10 @@ Ptr_hashentry *ptr_hash_lookup(Ptr_hashtable *hashtable, const char *token, void
{
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
{
Ptr_hashentry *entry = (Ptr_hashentry *)my_malloc(1579, sizeof( Ptr_hashentry ));
Ptr_hashentry *entry = (Ptr_hashentry *)my_malloc(_ALLOC_ID_, sizeof( Ptr_hashentry ));
entry->next=NULL;
entry->token=NULL;
my_strdup2(1580, &entry->token, token);
my_strdup2(_ALLOC_ID_, &entry->token, token);
entry->value = value;
entry->hash=hashcode;
*preventry=entry;
@ -959,8 +959,8 @@ Ptr_hashentry *ptr_hash_lookup(Ptr_hashtable *hashtable, const char *token, void
{
Ptr_hashentry *saveptr;
saveptr=(*preventry)->next;
my_free(1581, &(*preventry)->token);
my_free(1582, &(*preventry));
my_free(_ALLOC_ID_, &(*preventry)->token);
my_free(_ALLOC_ID_, &(*preventry));
*preventry=saveptr;
}
else if(what == XINSERT ) {
@ -978,7 +978,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(1583, size, sizeof(Ptr_hashentry *));
hashtable->table = my_calloc(_ALLOC_ID_, size, sizeof(Ptr_hashentry *));
}
static void ptr_hash_free_entry(Ptr_hashentry *entry)
@ -986,8 +986,8 @@ static void ptr_hash_free_entry(Ptr_hashentry *entry)
Ptr_hashentry *tmp;
while( entry ) {
tmp = entry -> next;
my_free(1584, &(entry->token));
my_free(1585, &entry);
my_free(_ALLOC_ID_, &(entry->token));
my_free(_ALLOC_ID_, &entry);
entry = tmp;
}
}
@ -1003,7 +1003,7 @@ void ptr_hash_free(Ptr_hashtable *hashtable)
ptr_hash_free_entry( table[i] );
table[i] = NULL;
}
my_free(1586, &(hashtable->table));
my_free(_ALLOC_ID_, &(hashtable->table));
hashtable->size = 0;
}
}

View File

@ -28,7 +28,7 @@ void check_wire_storage(void)
if(xctx->wires >= xctx->maxw)
{
xctx->maxw=(1+xctx->wires / CADMAXWIRES)*CADMAXWIRES;
my_realloc(1587, &xctx->wire, sizeof(xWire)*xctx->maxw);
my_realloc(_ALLOC_ID_, &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(1588, &xctx->sel_array, sizeof(Selected)*xctx->maxsel);
my_realloc(_ALLOC_ID_, &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(1589, &xctx->text, sizeof(xText)*xctx->maxt);
my_realloc(_ALLOC_ID_, &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(1590, &xctx->sym, sizeof(xSymbol)*xctx->maxs);
my_realloc(_ALLOC_ID_, &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(1591, &xctx->inst, sizeof(xInstance)*xctx->maxi);
my_realloc(_ALLOC_ID_, &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(1592, &xctx->arc[c], sizeof(xArc)*xctx->maxa[c]);
my_realloc(_ALLOC_ID_, &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(1593, &xctx->rect[c], sizeof(xRect)*xctx->maxr[c]);
my_realloc(_ALLOC_ID_, &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(1594, &xctx->line[c], sizeof(xLine)*xctx->maxl[c]);
my_realloc(_ALLOC_ID_, &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(1595, &xctx->poly[c], sizeof(xPoly)*xctx->maxp[c]);
my_realloc(_ALLOC_ID_, &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(1596, &xctx->arc[rectc][n].prop_ptr, prop_ptr);
my_strdup(_ALLOC_ID_, &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(1597, points, sizeof(double));
xctx->poly[rectc][n].y= my_calloc(1598, points, sizeof(double));
xctx->poly[rectc][n].selected_point= my_calloc(1599, points, sizeof(unsigned short));
my_strdup(1600, &xctx->poly[rectc][n].prop_ptr, prop_ptr);
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);
for(j=0;j<points; ++j) {
xctx->poly[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(1601, &xctx->line[rectc][n].prop_ptr, prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->line[rectc][n].prop_ptr, prop_ptr);
xctx->line[rectc][n].sel=sel;
if(sel == SELECTED) set_first_sel(LINE, n, rectc);
xctx->line[rectc][n].bus = 0;
@ -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(1602, &xctx->rect[rectc][n].prop_ptr, prop_ptr);
my_strdup(_ALLOC_ID_, &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(1603, &xctx->wire[n].prop_ptr, prop_ptr);
my_strdup(_ALLOC_ID_, &xctx->wire[n].prop_ptr, prop_ptr);
xctx->wire[n].bus = 0;
if(prop_ptr) {
xctx->wire[n].bus = get_attr_val(get_tok_value(prop_ptr,"bus",0));

View File

@ -376,7 +376,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(1604, &estr);
my_free(_ALLOC_ID_, &estr);
return;
}
if(hcenter) {
@ -400,7 +400,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(1605, &sss, estr);
my_strdup2(_ALLOC_ID_, &sss, estr);
tt=ss=sss;
for(;;) {
c=*ss;
@ -418,8 +418,8 @@ static void svg_draw_string(int layer, const char *str, short rot, short flip, i
}
++ss;
}
my_free(1606, &sss);
my_free(1607, &estr);
my_free(_ALLOC_ID_, &sss);
my_free(_ALLOC_ID_, &estr);
}
@ -445,7 +445,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(1608, &estr);
my_free(_ALLOC_ID_, &estr);
return;
}
xscale*=tclgetdoublevar("nocairo_font_xscale") * cairo_font_scale;
@ -478,7 +478,7 @@ static void old_svg_draw_string(int layer, const char *str,
}
++pos;
}
my_free(1609, &estr);
my_free(_ALLOC_ID_, &estr);
}
@ -544,7 +544,7 @@ static int svg_embedded_image(xRect *r, double rx1, double ry1, double rx2, doub
alpha_str = get_tok_value(r->prop_ptr, "alpha", 0);
if(alpha_str[0]) alpha = atof(alpha_str);
attr_len = my_strdup2(1610, &attr, get_tok_value(r->prop_ptr, "image_data", 0));
attr_len = my_strdup2(_ALLOC_ID_, &attr, get_tok_value(r->prop_ptr, "image_data", 0));
buffer = base64_decode(attr, attr_len, &buffer_size);
filter = get_tok_value(r->prop_ptr, "filter", 0);
if(attr_len > 5) {
@ -562,8 +562,8 @@ static int svg_embedded_image(xRect *r, double rx1, double ry1, double rx2, doub
jpg = -1;
}
if(jpg == -1) {
my_free(1611, &buffer);
my_free(1612, &attr);
my_free(_ALLOC_ID_, &buffer);
my_free(_ALLOC_ID_, &attr);
return 0;
}
@ -604,8 +604,8 @@ static int svg_embedded_image(xRect *r, double rx1, double ry1, double rx2, doub
"xlink:href=\"data:image/svg+xml;base64,%s\"/>\n",
0.0, 0.0, w, h, transform, opacity, attr);
}
my_free(1613, &buffer);
my_free(1614, &attr);
my_free(_ALLOC_ID_, &buffer);
my_free(_ALLOC_ID_, &attr);
return 1;
}
@ -716,16 +716,16 @@ static void svg_draw_symbol(int c, int n,int layer,short tmp_flip, short rot,
dash = (disabled == 1) ? 3 : polygon->dash;
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
int k;
double *x = my_malloc(1615, sizeof(double) * polygon->points);
double *y = my_malloc(1616, sizeof(double) * polygon->points);
double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon->points);
for(k=0;k<polygon->points; ++k) {
ROTATION(rot, flip, 0.0,0.0,polygon->x[k],polygon->y[k],x[k],y[k]);
x[k]+= x0;
y[k] += y0;
}
svg_drawpolygon(c, NOW, x, y, polygon->points, polygon->fill, dash, bezier, bus);
my_free(1617, &x);
my_free(1618, &y);
my_free(_ALLOC_ID_, &x);
my_free(_ALLOC_ID_, &y);
}
}
for(j=0;j< symptr->arcs[layer]; ++j) {
@ -918,7 +918,7 @@ void svg_draw(void)
else return;
}
svg_restore_lw();
svg_colors=my_calloc(1619, cadlayers, sizeof(Svg_color));
svg_colors=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Svg_color));
if(svg_colors==NULL){
fprintf(errfp, "svg_draw(): calloc error\n");
return;
@ -945,7 +945,7 @@ void svg_draw(void)
}
my_strncpy(xctx->plotfile,"", S(xctx->plotfile));
unused_layer = my_calloc(1620, cadlayers, sizeof(int));
unused_layer = my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
#if 0
* /* Determine used layers. Disabled since we want hilight colors */
* for(c=0;c<cadlayers; ++c) unused_layer[c] = 1;
@ -1152,8 +1152,8 @@ void svg_draw(void)
fprintf(fd, "</svg>\n");
fclose(fd);
tclsetboolvar("draw_grid", old_grid);
my_free(1621, &svg_colors);
my_free(1622, &unused_layer);
my_free(_ALLOC_ID_, &svg_colors);
my_free(_ALLOC_ID_, &unused_layer);
Tcl_SetResult(interp,"",TCL_STATIC);
}

View File

@ -37,7 +37,7 @@ static int tedax_netlist(FILE *fd, int tedax_stop )
for(i=0;i<xctx->instances; ++i) /* print first ipin/opin defs ... */
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(1623, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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;i<xctx->instances; ++i) /* ... then print other lines */
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(1624, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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(1625, &type);
my_free(_ALLOC_ID_, &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, int alert)
fprintf(fd, "begin netlist v1 %s\n",get_cell(sanitize(xctx->sym[i].name), 0));
print_tedax_subckt(fd, i);
my_strdup(1626, &extra, get_tok_value(xctx->sym[i].prop_ptr,"extra",0) );
my_strdup(_ALLOC_ID_, &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, int alert)
/* 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(1627, &extra);
my_free(_ALLOC_ID_, &extra);
fprintf(fd, "\n");
load_schematic(1,filename, 0, alert);
get_additional_symbols(1);
@ -190,7 +190,7 @@ int global_tedax_netlist(int global, int alert) /* 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(1628, xctx->instances, sizeof(unsigned int));
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
for(i=0;i<xctx->instances; ++i) stored_flags[i] = xctx->inst[i].color;
if(global) /* was if(global) ... 20180901 no hierarchical tEDAx netlist for now */
@ -205,8 +205,8 @@ int global_tedax_netlist(int global, int alert) /* 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(1629, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(1630, &xctx->sch_path[xctx->currsch+1], "->netlisting");
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");
xctx->sch_path_hash[xctx->currsch+1] = 0;
xctx->currsch++;
subckt_name=NULL;
@ -217,7 +217,7 @@ int global_tedax_netlist(int global, int alert) /* 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(1631, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[i].name), ""));
my_strdup2(_ALLOC_ID_, &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, int alert) /* 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(1632, &subckt_name, get_cell(xctx->sym[i].name, 0));
my_strdup(_ALLOC_ID_, &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, int alert) /* netlister driver */
}
}
}
my_free(1633, &abs_path);
my_free(_ALLOC_ID_, &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(1634, &subckt_name);
my_free(_ALLOC_ID_, &subckt_name);
/*clear_drawing(); */
my_free(1635, &xctx->sch[xctx->currsch]);
my_free(_ALLOC_ID_, &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, int alert) /* 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(1636, &current_dirname_save);
my_free(_ALLOC_ID_, &current_dirname_save);
}
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
for(i=0;i<xctx->instances; ++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(1637, &stored_flags);
my_free(_ALLOC_ID_, &stored_flags);
/* print globals nodes found in netlist 28032003 */
record_global_node(0,fd,NULL);

File diff suppressed because it is too large Load Diff

View File

@ -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(2111, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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(2112, &type);
my_free(_ALLOC_ID_, &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, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2113, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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->sym[xctx->inst[i].ptr].prop_ptr , fmt_attr, 2);
if(!xctx->tok_size && strcmp(fmt_attr, "verilog_format"))
str_tmp = get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr, "verilog_format", 2);
my_strdup(2114, &tmp_string, str_tmp);
my_strdup(_ALLOC_ID_, &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, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2115, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2116, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2117, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2118, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"opin"))==0)
{
my_strdup(2119, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
my_strdup(2120, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(2121, &sig_type,"wire"); /* 20070720 changed reg to wire */
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 */
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, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2122, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"iopin"))==0)
{
my_strdup(2123, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
my_strdup(2124, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(2125, &sig_type,"wire");
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");
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, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2126, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"ipin"))==0)
{
my_strdup(2127, &port_value,get_tok_value(xctx->inst[i].prop_ptr,"value",0));
my_strdup(2128, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"verilog_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(2129, &sig_type,"wire");
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");
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
fprintf(fd, " input %s ;\n", str_tmp ? str_tmp : "<NULL>");
fprintf(fd, " %s %s ", sig_type, str_tmp ? str_tmp : "<NULL>");
@ -278,7 +278,7 @@ int global_verilog_netlist(int global, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i) {
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2130, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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, int alert) /* 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(2131, xctx->instances, sizeof(unsigned int));
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
for(i=0;i<xctx->instances; ++i) stored_flags[i] = xctx->inst[i].color;
if(global)
@ -322,8 +322,8 @@ int global_verilog_netlist(int global, int alert) /* 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(2132, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(2133, &xctx->sch_path[xctx->currsch+1], "->netlisting");
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");
xctx->sch_path_hash[xctx->currsch+1] = 0;
xctx->currsch++;
@ -335,14 +335,14 @@ int global_verilog_netlist(int global, int alert) /* 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(2134, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[i].name), ""));
my_strdup2(_ALLOC_ID_, &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(2135, &subckt_name, get_cell(xctx->sym[i].name, 0));
my_strdup(_ALLOC_ID_, &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, int alert) /* netlister driver */
}
}
}
my_free(2136, &abs_path);
my_free(_ALLOC_ID_, &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(2137, &subckt_name);
my_free(2138, &xctx->sch[xctx->currsch]);
my_free(_ALLOC_ID_, &subckt_name);
my_free(_ALLOC_ID_, &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, int alert) /* 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(2139, &current_dirname_save);
my_free(_ALLOC_ID_, &current_dirname_save);
}
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
for(i=0;i<xctx->instances; ++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(2140, &stored_flags);
my_free(_ALLOC_ID_, &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, int alert) /* netlister driver */
}
if(debug_var == 0 ) xunlink(netl_filename);
}
my_free(2141, &sig_type);
my_free(2142, &port_value);
my_free(2143, &tmp_string);
my_free(2144, &type);
my_free(_ALLOC_ID_, &sig_type);
my_free(_ALLOC_ID_, &port_value);
my_free(_ALLOC_ID_, &tmp_string);
my_free(_ALLOC_ID_, &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, int alert)
if(!strcmp(default_schematic, "ignore")) {
return err;
}
my_strdup(2145, &name, tcl_hook2(xctx->sym[i].name));
my_strdup(_ALLOC_ID_, &name, tcl_hook2(xctx->sym[i].name));
if(split_f) {
my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d",
@ -471,8 +471,8 @@ int verilog_block_netlist(FILE *fd, int i, int alert)
} else {
Int_hashtable table = {NULL, 0};
int_hash_init(&table, 37);
my_strdup(2146, &extra, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
my_strdup(2147, &extra2, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra", 0));
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));
fprintf(fd, "// sch_path: %s\n", sanitized_abs_sym_path(filename, ""));
verilog_stop? load_schematic(0,filename, 0, alert) : load_schematic(1,filename, 0, alert);
get_additional_symbols(1);
@ -481,32 +481,32 @@ int verilog_block_netlist(FILE *fd, int i, int alert)
for(j=0;j<xctx->instances; ++j)
{
if(skip_instance(j, 1, lvs_ignore)) continue;
my_strdup(2148, &type,(xctx->inst[j].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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->sym[xctx->inst[j].ptr].prop_ptr, fmt_attr, 2);
if(!xctx->tok_size && strcmp(fmt_attr, "verilog_format"))
str_tmp = get_tok_value(xctx->sym[xctx->inst[j].ptr].prop_ptr, "verilog_format", 2);
my_strdup(2149, &tmp_string, str_tmp);
my_strdup(_ALLOC_ID_, &tmp_string, str_tmp);
fprintf(fd, "%s\n", str_tmp ? translate(j, tmp_string) : "<NULL>");
}
}
my_strdup(2150, &verilogprefix,
my_strdup(_ALLOC_ID_, &verilogprefix,
get_tok_value(xctx->sym[i].prop_ptr, "verilogprefix", 0));
if(verilogprefix) {
my_strdup(2151, &symname, verilogprefix);
my_strcat(2152, &symname, get_cell(xctx->sym[i].name, 0));
my_strdup(_ALLOC_ID_, &symname, verilogprefix);
my_strcat(_ALLOC_ID_, &symname, get_cell(xctx->sym[i].name, 0));
} else {
my_strdup(2153, &symname, get_cell(xctx->sym[i].name, 0));
my_strdup(_ALLOC_ID_, &symname, get_cell(xctx->sym[i].name, 0));
}
my_free(2154, &verilogprefix);
my_free(_ALLOC_ID_, &verilogprefix);
fprintf(fd, "module %s (\n", sanitize(symname));
my_free(2155, &symname);
my_free(_ALLOC_ID_, &symname);
/*print_generic(fd, "entity", i); */
dbg(1, "verilog_block_netlist(): entity ports\n");
@ -545,15 +545,15 @@ int verilog_block_netlist(FILE *fd, int i, int alert)
for(j=0;j<xctx->sym[i].rects[PINLAYER]; ++j)
{
if(strboolcmp(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"verilog_ignore",0), "true")) {
my_strdup(2156, &sig_type,get_tok_value(
my_strdup(_ALLOC_ID_, &sig_type,get_tok_value(
xctx->sym[i].rect[PINLAYER][j].prop_ptr,"verilog_type",0));
my_strdup(2157, &port_value,
my_strdup(_ALLOC_ID_, &port_value,
get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"value", 0) );
my_strdup(2158, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",0) );
my_strdup(_ALLOC_ID_, &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(2159, &sig_type,"wire"); /* 20070720 changed reg to wire */
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &sig_type,"wire"); /* 20070720 changed reg to wire */
} else {
if(!sig_type || sig_type[0]=='\0') my_strdup(2160, &sig_type,"wire");
if(!sig_type || sig_type[0]=='\0') my_strdup(_ALLOC_ID_, &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)) {
@ -570,7 +570,7 @@ int verilog_block_netlist(FILE *fd, int i, int alert)
if(extra2) {
char *verilog_extra_dir = NULL;
const char *dir;
my_strdup2(2161, &verilog_extra_dir, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra_dir", 0));
my_strdup2(_ALLOC_ID_, &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);
@ -583,7 +583,7 @@ int verilog_block_netlist(FILE *fd, int i, int alert)
}
fprintf(fd, " wire %s ;\n", extra_token);
}
my_free(2162, &verilog_extra_dir);
my_free(_ALLOC_ID_, &verilog_extra_dir);
}
dbg(1, "verilog_block_netlist(): netlisting %s\n", get_cell( xctx->sch[xctx->currsch], 0));
err |= verilog_netlist(fd, verilog_stop);
@ -593,7 +593,7 @@ int verilog_block_netlist(FILE *fd, int i, int alert)
if(xctx->netlist_count &&
!strboolcmp(get_tok_value(xctx->inst[l].prop_ptr, "only_toplevel", 0), "true")) continue;
my_strdup(2163, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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));
}
@ -604,13 +604,13 @@ int verilog_block_netlist(FILE *fd, int i, int alert)
}
fprintf(fd,"---- end user architecture code\n");
fprintf(fd, "endmodule\n");
my_free(2164, &dir_tmp);
my_free(2165, &sig_type);
my_free(2166, &port_value);
my_free(2167, &type);
my_free(2168, &tmp_string);
my_free(2169, &extra);
my_free(2170, &extra2);
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);
} /* if(!sym_def[0]) */
if(split_f) {
int save;
@ -626,7 +626,7 @@ int verilog_block_netlist(FILE *fd, int i, int alert)
}
err:
xctx->netlist_count++;
my_free(2171, &name);
my_free(_ALLOC_ID_, &name);
return err;
}

View File

@ -56,7 +56,7 @@ static int vhdl_netlist(FILE *fd , int vhdl_stop)
for(l=0;l<xctx->instances; ++l)
{
if(skip_instance(l, 1, lvs_ignore)) continue;
my_strdup(2172, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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(2173, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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(2174, &type);
if(type) my_free(_ALLOC_ID_, &type);
dbg(1, "vhdl_netlist(): end\n");
if(!vhdl_stop && !xctx->netlist_count) redraw_hilights(0); /* draw_hilight_net(1); */
return err;
@ -156,7 +156,7 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2175, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
if( type && (strcmp(type,"package"))==0)
{
if(xctx->inst[i].prop_ptr) { /* */
@ -171,7 +171,7 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2176, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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);
@ -236,9 +236,9 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2177, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(2178, &sig_type,"std_logic");
my_strdup(2179, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
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);
if( type && (strcmp(type,"opin"))==0)
{
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
@ -253,9 +253,9 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2180, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(2181, &sig_type,"std_logic");
my_strdup(2182, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
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);
if( type && (strcmp(type,"iopin"))==0)
{
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
@ -270,9 +270,9 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2183, &sig_type,get_tok_value(xctx->inst[i].prop_ptr,"sig_type",0));
if(!sig_type || sig_type[0]=='\0') my_strdup(2184, &sig_type,"std_logic");
my_strdup(2185, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
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);
if( type && (strcmp(type,"ipin"))==0)
{
str_tmp = xctx->inst[i].lab ? xctx->inst[i].lab : "";
@ -288,7 +288,7 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i)
{
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2186, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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);
@ -311,7 +311,7 @@ int global_vhdl_netlist(int global, int alert) /* 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(2187, &abs_path, abs_sym_path(tcl_hook2(xctx->sym[j].name), ""));
my_strdup(_ALLOC_ID_, &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
@ -319,7 +319,7 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
)
{
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
my_strdup(2188, &subckt_name, get_cell(xctx->sym[j].name, 0));
my_strdup(_ALLOC_ID_, &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);
@ -332,12 +332,12 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
for(i=0;i<xctx->sym[j].rects[PINLAYER]; ++i)
{
if(strboolcmp(get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"vhdl_ignore",0), "true")) {
my_strdup(2189, &sig_type,
my_strdup(_ALLOC_ID_, &sig_type,
get_tok_value( xctx->sym[j].rect[PINLAYER][i].prop_ptr,"sig_type",0));
my_strdup(2190, &port_value,
my_strdup(_ALLOC_ID_, &port_value,
get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"value", 0) );
if(!sig_type || sig_type[0]=='\0') my_strdup(2191, &sig_type,"std_logic");
my_strdup(2192, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][i].prop_ptr,"dir",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) );
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");
@ -347,7 +347,7 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
fprintf(fd," := %s", port_value);
tmp=1;
}
my_free(2193, &dir_tmp);
my_free(_ALLOC_ID_, &dir_tmp);
}
}
int_hash_free(&table);
@ -355,11 +355,11 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
fprintf(fd, "end component ;\n\n");
}
}
my_free(2194, &abs_path);
my_free(_ALLOC_ID_, &abs_path);
}
get_additional_symbols(0);
str_hash_free(&subckt_table);
my_free(2195, &subckt_name);
my_free(_ALLOC_ID_, &subckt_name);
dbg(1, "global_vhdl_netlist(): netlisting top level\n");
err |= vhdl_netlist(fd, 0);
@ -367,7 +367,7 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
for(i=0;i<xctx->instances; ++i) {
if(skip_instance(i, 1, lvs_ignore)) continue;
my_strdup(2196, &type,(xctx->inst[i].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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));
}
@ -395,7 +395,7 @@ int global_vhdl_netlist(int global, int alert) /* 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(2197, xctx->instances, sizeof(unsigned int));
stored_flags = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned int));
for(i=0;i<xctx->instances; ++i) stored_flags[i] = xctx->inst[i].color;
if(global)
@ -411,8 +411,8 @@ int global_vhdl_netlist(int global, int alert) /* 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(2198, &xctx->sch_path[xctx->currsch+1], xctx->sch_path[xctx->currsch]);
my_strcat(2199, &xctx->sch_path[xctx->currsch+1], "->netlisting");
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");
xctx->sch_path_hash[xctx->currsch+1] = 0;
xctx->currsch++;
@ -424,7 +424,7 @@ int global_vhdl_netlist(int global, int alert) /* 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(2200, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
my_strdup(_ALLOC_ID_, &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) {
@ -432,7 +432,7 @@ int global_vhdl_netlist(int global, int alert) /* 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(2201, &subckt_name, get_cell(xctx->sym[i].name, 0));
my_strdup(_ALLOC_ID_, &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
@ -448,12 +448,12 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
}
}
}
my_free(2202, &abs_path);
my_free(_ALLOC_ID_, &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(2203, &subckt_name);
my_free(2204, &xctx->sch[xctx->currsch]);
my_free(_ALLOC_ID_, &subckt_name);
my_free(_ALLOC_ID_, &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 */
@ -470,14 +470,14 @@ int global_vhdl_netlist(int global, int alert) /* 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(2205, &current_dirname_save);
my_free(_ALLOC_ID_, &current_dirname_save);
}
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
for(i=0;i<xctx->instances; ++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(2206, &stored_flags);
my_free(_ALLOC_ID_, &stored_flags);
dbg(1, "global_vhdl_netlist(): starting awk on netlist!\n");
if(!split_f) {
fclose(fd);
@ -491,9 +491,9 @@ int global_vhdl_netlist(int global, int alert) /* netlister driver */
}
if(!debug_var) xunlink(netl_filename);
}
my_free(2207, &sig_type);
my_free(2208, &type);
my_free(2209, &port_value);
my_free(_ALLOC_ID_, &sig_type);
my_free(_ALLOC_ID_, &type);
my_free(_ALLOC_ID_, &port_value);
xctx->netlist_count = 0;
tclvareval("show_infotext ", my_itoa(err), NULL); /* critical error: force ERC window showing */
exit_code = err ? 10 : 0;
@ -588,12 +588,12 @@ int vhdl_block_netlist(FILE *fd, int i, int alert)
for(j=0;j<xctx->sym[i].rects[PINLAYER]; ++j)
{
if(strboolcmp(get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"vhdl_ignore",0), "true")) {
my_strdup(2210, &sig_type,
my_strdup(_ALLOC_ID_, &sig_type,
get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"sig_type",0));
my_strdup(2211, &port_value,
my_strdup(_ALLOC_ID_, &port_value,
get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"value", 0) );
if(!sig_type || sig_type[0]=='\0') my_strdup(2212, &sig_type,"std_logic");
my_strdup(2213, &dir_tmp, get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr,"dir",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) );
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");
@ -604,7 +604,7 @@ int vhdl_block_netlist(FILE *fd, int i, int alert)
fprintf(fd," := %s", port_value);
tmp=1;
}
my_free(2214, &dir_tmp);
my_free(_ALLOC_ID_, &dir_tmp);
}
}
int_hash_free(&table);
@ -614,7 +614,7 @@ int vhdl_block_netlist(FILE *fd, int i, int alert)
for(l=0;l<xctx->instances; ++l)
{
if(skip_instance(l, 1, lvs_ignore)) continue;
my_strdup(2215, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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);
@ -643,7 +643,7 @@ int vhdl_block_netlist(FILE *fd, int i, int alert)
if(!xctx->sym[j].type || (strcmp(xctx->sym[j].type,"primitive")!=0 &&
strcmp(xctx->sym[j].type,"subcircuit")!=0))
continue;
my_strdup2(2216, &abs_path, abs_sym_path(xctx->sym[i].name, ""));
my_strdup2(_ALLOC_ID_, &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)
) {
@ -667,19 +667,19 @@ int vhdl_block_netlist(FILE *fd, int i, int alert)
for(k=0;k<xctx->sym[j].rects[PINLAYER]; ++k)
{
if(strboolcmp(get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"vhdl_ignore",0), "true")) {
my_strdup(2217, &sig_type,
my_strdup(_ALLOC_ID_, &sig_type,
get_tok_value( xctx->sym[j].rect[PINLAYER][k].prop_ptr,"sig_type",0));
my_strdup(2218, &port_value,
my_strdup(_ALLOC_ID_, &port_value,
get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"value", 0) );
if(!sig_type || sig_type[0]=='\0') my_strdup(2219, &sig_type,"std_logic");
my_strdup(2220, &dir_tmp, get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"dir",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) );
str_tmp = get_tok_value(xctx->sym[j].rect[PINLAYER][k].prop_ptr,"name",0);
if(!int_hash_lookup(&table, str_tmp, 1, XINSERT_NOREPLACE)) {
if(!tmp) fprintf(fd, "port (\n");
if(tmp) fprintf(fd, " ;\n");
fprintf(fd," %s : %s %s",str_tmp, dir_tmp ? dir_tmp : "<NULL>", sig_type);
my_free(2221, &dir_tmp);
my_free(_ALLOC_ID_, &dir_tmp);
if(port_value &&port_value[0]) fprintf(fd," := %s", port_value);
tmp=1;
}
@ -692,7 +692,7 @@ int vhdl_block_netlist(FILE *fd, int i, int alert)
} /* for(j...) */
get_additional_symbols(0);
} /* if(!vhdl_stop) */
my_free(2222, &abs_path);
my_free(_ALLOC_ID_, &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");
@ -702,7 +702,7 @@ int vhdl_block_netlist(FILE *fd, int i, int alert)
if(xctx->netlist_count &&
!strboolcmp(get_tok_value(xctx->inst[l].prop_ptr, "only_toplevel", 0), "true")) continue;
my_strdup(2223, &type,(xctx->inst[l].ptr+ xctx->sym)->type);
my_strdup(_ALLOC_ID_, &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));
}
@ -710,9 +710,9 @@ int vhdl_block_netlist(FILE *fd, int i, int alert)
if(xctx->schvhdlprop && xctx->schvhdlprop[0]) fprintf(fd, "%s\n", xctx->schvhdlprop);
fprintf(fd, "end arch_%s ;\n\n", get_cell(sanitize(xctx->sym[i].name), 0) );
my_free(2224, &sig_type);
my_free(2225, &port_value);
my_free(2226, &type);
my_free(_ALLOC_ID_, &sig_type);
my_free(_ALLOC_ID_, &port_value);
my_free(_ALLOC_ID_, &type);
} /* if(!sym_def[0]) */
if(split_f) {
int save;

View File

@ -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(2227, &xctx->color_array[i], s);
my_strdup(_ALLOC_ID_, &xctx->color_array[i], s);
}
}
@ -375,55 +375,55 @@ static void free_xschem_data()
xctx->delete_undo();
free_simdata();
my_free(2228, &xctx->node_table);
my_free(2229, &xctx->hilight_table);
my_free(_ALLOC_ID_, &xctx->node_table);
my_free(_ALLOC_ID_, &xctx->hilight_table);
my_free(2230, &xctx->wire);
my_free(2231, &xctx->text);
my_free(2232, &xctx->inst);
my_free(_ALLOC_ID_, &xctx->wire);
my_free(_ALLOC_ID_, &xctx->text);
my_free(_ALLOC_ID_, &xctx->inst);
for(i=0;i<cadlayers; ++i) {
my_free(2233, &xctx->rect[i]);
my_free(2234, &xctx->line[i]);
my_free(2235, &xctx->poly[i]);
my_free(2236, &xctx->arc[i]);
my_free(_ALLOC_ID_, &xctx->rect[i]);
my_free(_ALLOC_ID_, &xctx->line[i]);
my_free(_ALLOC_ID_, &xctx->poly[i]);
my_free(_ALLOC_ID_, &xctx->arc[i]);
}
my_free(2237, &xctx->sym);
my_free(2238, &xctx->rect);
my_free(2239, &xctx->line);
my_free(2240, &xctx->poly);
my_free(2241, &xctx->arc);
my_free(2242, &xctx->rects);
my_free(2243, &xctx->polygons);
my_free(2244, &xctx->arcs);
my_free(2245, &xctx->lines);
my_free(2246, &xctx->maxr);
my_free(2247, &xctx->maxp);
my_free(2248, &xctx->maxa);
my_free(2249, &xctx->maxl);
my_free(2250, &xctx->sel_array);
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);
for(i=0;i<CADMAXHIER; ++i) {
if(xctx->portmap[i].table) str_hash_free(&xctx->portmap[i]);
if(xctx->sch[i]) my_free(2251, &xctx->sch[i]);
if(xctx->sch_path[i]) my_free(2252, &xctx->sch_path[i]);
if(xctx->hier_attr[i].templ) my_free(2253, &xctx->hier_attr[i].templ);
if(xctx->hier_attr[i].prop_ptr) my_free(2254, &xctx->hier_attr[i].prop_ptr);
if(xctx->hier_attr[i].symname) my_free(2255, &xctx->hier_attr[i].symname);
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);
}
my_free(2256, &xctx->gridpoint);
my_free(2257, &xctx->biggridpoint);
my_free(2258, &xctx->gc);
my_free(2259, &xctx->gcstipple);
for(i=0;i<cadlayers; ++i) my_free(2260, &xctx->color_array[i]);
my_free(2261, &xctx->color_array);
my_free(2262, &xctx->enable_layer);
my_free(2263, &xctx->active_layer);
my_free(2264, &xctx->top_path);
my_free(2265, &xctx->current_win_path);
my_free(2266, &xctx->fill_type);
my_free(2267, &xctx->format);
my_free(2268, &xctx->custom_format);
my_free(2269, &xctx);
my_free(_ALLOC_ID_, &xctx->gridpoint);
my_free(_ALLOC_ID_, &xctx->biggridpoint);
my_free(_ALLOC_ID_, &xctx->gc);
my_free(_ALLOC_ID_, &xctx->gcstipple);
for(i=0;i<cadlayers; ++i) my_free(_ALLOC_ID_, &xctx->color_array[i]);
my_free(_ALLOC_ID_, &xctx->color_array);
my_free(_ALLOC_ID_, &xctx->enable_layer);
my_free(_ALLOC_ID_, &xctx->active_layer);
my_free(_ALLOC_ID_, &xctx->top_path);
my_free(_ALLOC_ID_, &xctx->current_win_path);
my_free(_ALLOC_ID_, &xctx->fill_type);
my_free(_ALLOC_ID_, &xctx->format);
my_free(_ALLOC_ID_, &xctx->custom_format);
my_free(_ALLOC_ID_, &xctx);
}
void create_gc(void)
@ -453,7 +453,7 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
{
int i, j;
xctx = my_calloc(2270, 1, sizeof(Xschem_ctx));
xctx = my_calloc(_ALLOC_ID_, 1, sizeof(Xschem_ctx));
xctx->cur_undo_ptr = 0;
xctx->head_undo_ptr = 0;
xctx->tail_undo_ptr = 0;
@ -542,12 +542,12 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
}
}
xctx->n_hash_objects = 0;
xctx->node_table = my_calloc(2271, HASHSIZE, sizeof(Node_hashentry *));
xctx->node_table = my_calloc(_ALLOC_ID_, 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(2272, HASHSIZE, sizeof(Hilight_hashentry *));
xctx->hilight_table = my_calloc(_ALLOC_ID_, 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;
@ -601,21 +601,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(2273, &xctx->sch_path[0],".");
my_strdup(_ALLOC_ID_, &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(2274, xctx->maxt,sizeof(xText));
xctx->wire=my_calloc(2275, xctx->maxw,sizeof(xWire));
xctx->inst=my_calloc(2276, xctx->maxi , sizeof(xInstance) );
xctx->sym=my_calloc(2277, xctx->maxs , sizeof(xSymbol) );
xctx->maxr=my_calloc(2278, cadlayers, sizeof(int));
xctx->maxa=my_calloc(2279, cadlayers, sizeof(int));
xctx->maxp=my_calloc(2280, cadlayers, sizeof(int));
xctx->maxl=my_calloc(2281, cadlayers, sizeof(int));
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));
for(i=0;i<cadlayers; ++i)
{
xctx->maxr[i]=CADMAXOBJECTS;
@ -623,28 +623,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(2282, cadlayers, sizeof(xRect *));
xctx->line=my_calloc(2283, cadlayers, sizeof(xLine *));
xctx->poly=my_calloc(2284, cadlayers, sizeof(xPoly *));
xctx->arc=my_calloc(2285, cadlayers, sizeof(xArc *));
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 *));
for(i=0;i<cadlayers; ++i)
{
xctx->rect[i]=my_calloc(2286, xctx->maxr[i],sizeof(xRect));
xctx->arc[i]=my_calloc(2287, xctx->maxa[i],sizeof(xArc));
xctx->poly[i]=my_calloc(2288, xctx->maxp[i],sizeof(xPoly));
xctx->line[i]=my_calloc(2289, xctx->maxl[i],sizeof(xLine));
xctx->rect[i]=my_calloc(_ALLOC_ID_, xctx->maxr[i],sizeof(xRect));
xctx->arc[i]=my_calloc(_ALLOC_ID_, xctx->maxa[i],sizeof(xArc));
xctx->poly[i]=my_calloc(_ALLOC_ID_, xctx->maxp[i],sizeof(xPoly));
xctx->line[i]=my_calloc(_ALLOC_ID_, xctx->maxl[i],sizeof(xLine));
}
xctx->rects=my_calloc(2290, cadlayers, sizeof(int));
xctx->polygons=my_calloc(2291, cadlayers, sizeof(int));
xctx->arcs=my_calloc(2292, cadlayers, sizeof(int));
xctx->lines=my_calloc(2293, cadlayers, sizeof(int));
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->maxsel=MAXGROUP;
xctx->sel_array=my_calloc(2294, xctx->maxsel, sizeof(Selected));
xctx->sel_array=my_calloc(_ALLOC_ID_, xctx->maxsel, sizeof(Selected));
xctx->first_sel.n = -1;
xctx->first_sel.type = 0;
xctx->first_sel.col = 0;
xctx->biggridpoint=(XSegment*)my_calloc(2295, CADMAXGRIDPOINTS,sizeof(XSegment));
xctx->gridpoint=(XPoint*)my_calloc(2296, CADMAXGRIDPOINTS,sizeof(XPoint));
xctx->biggridpoint=(XSegment*)my_calloc(_ALLOC_ID_, CADMAXGRIDPOINTS,sizeof(XSegment));
xctx->gridpoint=(XPoint*)my_calloc(_ALLOC_ID_, CADMAXGRIDPOINTS,sizeof(XPoint));
xctx->enable_drill = 0;
xctx->prev_set_modify = -1;
xctx->prev_crossx = xctx->prev_crossy = 0.0;
@ -677,13 +677,13 @@ 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(2297, cadlayers, sizeof(GC));
xctx->gcstipple=my_calloc(2298, cadlayers, sizeof(GC));
xctx->color_array=my_calloc(2299, cadlayers, sizeof(char*));
xctx->enable_layer=my_calloc(2300, cadlayers, sizeof(int));
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->crosshair_layer = TEXTLAYER;
xctx->n_active_layers = 0;
xctx->active_layer=my_calloc(2301, cadlayers, sizeof(int));
xctx->active_layer=my_calloc(_ALLOC_ID_, cadlayers, sizeof(int));
xctx->hide_symbols = 0;
xctx->netlist_type = CAD_SPICE_NETLIST;
xctx->format = NULL; /* format string for netlist, (copied from custom_format) otherwise use
@ -692,9 +692,9 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
xctx->custom_format = NULL;
xctx->top_path = NULL;
xctx->current_win_path = NULL;
my_strdup2(2302, &xctx->top_path, top_path);
my_strdup2(2303, &xctx->current_win_path, win_path);
xctx->fill_type=my_calloc(2304, cadlayers, sizeof(int));
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));
xctx->case_insensitive = 0;
xctx->show_hidden_texts = 0;
xctx->x_strcmp = strcmp;
@ -765,7 +765,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(2305, &s, l);
my_realloc(_ALLOC_ID_, &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 : "");
@ -774,7 +774,7 @@ int compare_schematics(const char *f)
for(i=0;i<xctx->wires; ++i)
{
l =1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : "");
my_realloc(2306, &s, l);
my_realloc(_ALLOC_ID_, &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);
@ -827,7 +827,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(2307, &s, l);
my_realloc(_ALLOC_ID_, &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 : "");
@ -845,7 +845,7 @@ int compare_schematics(const char *f)
for(i=0;i<xctx->wires; ++i)
{
l =1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : "");
my_realloc(2308, &s, l);
my_realloc(_ALLOC_ID_, &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);
@ -875,7 +875,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(2309,&s, l);
my_realloc(_ALLOC_ID_,&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 : "");
@ -890,7 +890,7 @@ int compare_schematics(const char *f)
for(i=0;i<xctx->wires; ++i)
{
l = 1024 + strlen(xctx->wire[i].prop_ptr ? xctx->wire[i].prop_ptr : "");
my_realloc(2310, &s, l);
my_realloc(_ALLOC_ID_, &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);
@ -904,7 +904,7 @@ int compare_schematics(const char *f)
int_hash_free(&table2);
rebuild_selected_array();
draw_selection(xctx->gc[SELLAYER], 0);
my_free(2311, &s);
my_free(_ALLOC_ID_, &s);
return ret;
}
@ -917,7 +917,7 @@ static void xwin_exit(void)
dbg(0, "xwin_exit() double call, doing nothing...\n");
return;
}
if(xctx->infowindow_text) my_free(2312, &xctx->infowindow_text);
if(xctx->infowindow_text) my_free(_ALLOC_ID_, &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);
@ -936,18 +936,18 @@ static void xwin_exit(void)
#else
for(i = 0; i < cadlayers; ++i) Tk_FreePixmap(display, pixmap[i]);
#endif
my_free(2313, &pixmap);
my_free(_ALLOC_ID_, &pixmap);
}
dbg(1, "xwin_exit(): clearing drawing data structures\n");
/* global context - graphic preferences/settings */
for(i=0;i<cadlayers; ++i) {
my_free(2314, &pixdata[i]);
my_free(_ALLOC_ID_, &pixdata[i]);
}
my_free(2315, &pixdata);
my_free(2316, &cli_opt_tcl_command);
my_free(2317, &cli_opt_preinit_command);
my_free(2318, &cli_opt_tcl_post_command);
my_free(_ALLOC_ID_, &pixdata);
my_free(_ALLOC_ID_, &cli_opt_tcl_command);
my_free(_ALLOC_ID_, &cli_opt_preinit_command);
my_free(_ALLOC_ID_, &cli_opt_tcl_post_command);
clear_expandlabel_data();
get_sym_template(NULL, NULL); /* clear static data in function */
list_tokens(NULL, 0); /* clear static data in function */
@ -961,16 +961,16 @@ static void xwin_exit(void)
save_ascii_string(NULL, NULL, 0); /* clear static data in function */
eval_expr_clear_table(); /* clear expression parser data */
dbg(1, "xwin_exit(): removing font\n");
for(i=0;i<127; ++i) my_free(2319, &character[i]);
for(i=0;i<127; ++i) my_free(_ALLOC_ID_, &character[i]);
dbg(1, "xwin_exit(): closed display\n");
my_strncpy(cli_opt_filename, "", S(cli_opt_filename));
my_free(2320, &xschem_executable);
my_free(_ALLOC_ID_, &xschem_executable);
dbg(1, "xwin_exit(): deleted undo buffer\n");
/* delete cmdline stuff */
for(i = 0 ; i < cli_opt_argc; ++i) {
my_free(2321, &cli_opt_argv[i]);
my_free(_ALLOC_ID_, &cli_opt_argv[i]);
}
my_free(2322, &cli_opt_argv);
my_free(_ALLOC_ID_, &cli_opt_argv);
if(xschem_web_dirname[0]) tclvareval("file delete -force ", xschem_web_dirname, NULL);
if(errfp!=stderr) fclose(errfp);
errfp=stderr;
@ -1255,7 +1255,7 @@ int preview_window(const char *what, const char *win_path, const char *fname)
if(current_file[i]) {
delete_schematic_data(1);
}
my_strdup(2323, &current_file[i], fname);
my_strdup(_ALLOC_ID_, &current_file[i], fname);
xctx = NULL; /* reset for preview */
alloc_xschem_data(save_xctx->top_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 */
@ -1292,7 +1292,7 @@ int preview_window(const char *what, const char *win_path, const char *fname)
delete_schematic_data(1);
preview_xctx[i] = NULL;
}
my_free(2324, &current_file[i]);
my_free(_ALLOC_ID_, &current_file[i]);
xctx = save_xctx; /* restore schematic */
save_xctx = NULL;
/* set_modify(-1); */ /* no more needed as load_schematic() called with reset_undo=0 */
@ -1833,14 +1833,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(2325, &toplevel, tclresult());
my_strdup2(_ALLOC_ID_, &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(2326, &toplevel);
my_free(_ALLOC_ID_, &toplevel);
}
my_strncpy(window_path[n], "", S(window_path[n]));
(*window_count)--;
@ -1951,7 +1951,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(2327, &toplevel, tclresult());
my_strdup2(_ALLOC_ID_, &toplevel, tclresult());
}
/* set saved ctx to main window if previous is about to be destroyed */
if(savectx == save_xctx[i]) savectx = save_xctx[0];
@ -1960,7 +1960,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(2328, &toplevel);
my_free(_ALLOC_ID_, &toplevel);
}
/* delete Tcl context of deleted schematic window */
tclvareval("delete_ctx ", window_path[i], NULL);
@ -2472,31 +2472,31 @@ 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(2329, &up_hier, "../../..");
my_strdup(_ALLOC_ID_, &up_hier, "../../..");
}
else my_strdup(2330, &up_hier, "../share/xschem");
else my_strdup(_ALLOC_ID_, &up_hier, "../share/xschem");
tclsetintvar("running_in_src_dir", running_in_src_dir);
/* my_strcat(2331, &win_xschem_library_path, "."); */
/* my_strcat(_ALLOC_ID_, &win_xschem_library_path, "."); */
for (i = 0; i < WIN_XSCHEM_LIBRARY_PATH_NUM; ++i) {
if (i==2)
{
my_free(2332, &up_hier);
my_free(_ALLOC_ID_, &up_hier);
if (running_in_src_dir==0)
my_strdup(2333, &up_hier, "../share/doc/xschem");
my_strdup(_ALLOC_ID_, &up_hier, "../share/doc/xschem");
else
my_strdup(2334, &up_hier, "../../../xschem_library");
my_strdup(_ALLOC_ID_, &up_hier, "../../../xschem_library");
}
my_snprintf(tmp, S(tmp),"%s/%s/%s", install_dir, up_hier, WIN_XSCHEM_LIBRARY_PATH[i]);
if (i > 0) my_strcat(2335, &win_xschem_library_path, "\;");
my_strcat(2336, &win_xschem_library_path, tmp);
if (i > 0) my_strcat(_ALLOC_ID_, &win_xschem_library_path, "\;");
my_strcat(_ALLOC_ID_, &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(2337, &win_xschem_library_path);
my_free(2338, &up_hier);
my_free(_ALLOC_ID_, &win_xschem_library_path);
my_free(_ALLOC_ID_, &up_hier);
if ((xschem_sharedir=getenv("XSCHEM_SHAREDIR")) != NULL) {
if (!stat(xschem_sharedir, &buf)) {
tclsetvar("XSCHEM_SHAREDIR", xschem_sharedir);
@ -2705,7 +2705,7 @@ int Tcl_AppInit(Tcl_Interp *inter)
/* */
/* resolve absolute pathname of xschem (argv[0]) for future usage */
my_strdup(2339, &xschem_executable, get_file_path(xschem_executable));
my_strdup(_ALLOC_ID_, &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 */
@ -2742,19 +2742,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(2340, &xctx->sch[xctx->currsch], "");
my_strdup2(_ALLOC_ID_, &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(2341, cadlayers, sizeof(char*));
pixdata=my_calloc(_ALLOC_ID_, cadlayers, sizeof(char*));
for(i=0;i<cadlayers; ++i)
{
pixdata[i]=my_calloc(2342, 32, sizeof(char));
pixdata[i]=my_calloc(_ALLOC_ID_, 32, sizeof(char));
}
if(has_x) pixmap=my_calloc(2343, cadlayers, sizeof(Pixmap));
if(has_x) pixmap=my_calloc(_ALLOC_ID_, cadlayers, sizeof(Pixmap));
my_strncpy(xctx->plotfile, cli_opt_plotfile, S(xctx->plotfile));
xctx->draw_window = tclgetintvar("draw_window");
@ -2764,8 +2764,8 @@ int Tcl_AppInit(Tcl_Interp *inter)
/* set global variables fetching data from tcl code */
/* if lvs_netlist is set also use lvs_format for devices netlisting rule if existing */
if(tclgetboolvar("lvs_netlist")) my_strdup(2344, &xctx->format, "lvs_format");
else my_strdup(2345, &xctx->format, NULL);
if(tclgetboolvar("lvs_netlist")) my_strdup(_ALLOC_ID_, &xctx->format, "lvs_format");
else my_strdup(_ALLOC_ID_, &xctx->format, NULL);
if(cli_opt_netlist_type) {
xctx->netlist_type = cli_opt_netlist_type;

View File

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