Browse Source

everywhere, use `TMALLOC()' instead of `alloc()'

pre-master-46
rlar 10 years ago
parent
commit
4c1c95e20f
  1. 2
      src/frontend/aspice.c
  2. 6
      src/frontend/breakp.c
  3. 2
      src/frontend/breakp2.c
  4. 6
      src/frontend/com_alias.c
  5. 4
      src/frontend/com_history.c
  6. 6
      src/frontend/control.c
  7. 2
      src/frontend/define.c
  8. 6
      src/frontend/help/readhelp.c
  9. 4
      src/frontend/inp.c
  10. 2
      src/frontend/measure.c
  11. 18
      src/frontend/options.c
  12. 2
      src/frontend/outitf.c
  13. 2
      src/frontend/parse.c
  14. 8
      src/frontend/parser/complete.c
  15. 2
      src/frontend/parser/unixcom.c
  16. 2
      src/frontend/rawfile.c
  17. 4
      src/frontend/spiceif.c
  18. 6
      src/frontend/subckt.c
  19. 12
      src/frontend/variable.c
  20. 2
      src/frontend/vectors.c
  21. 1
      src/include/ngspice/memory.h
  22. 4
      src/misc/wlist.c
  23. 2
      src/ngsconvert.c
  24. 4
      src/xspice/enh/enhtrans.c

2
src/frontend/aspice.c

@ -131,7 +131,7 @@ com_aspice(wordlist *wl)
} }
/* Add this one to the job list. */ /* Add this one to the job list. */
p = alloc(struct proc);
p = TMALLOC(struct proc, 1);
p->pr_pid = pid; p->pr_pid = pid;
p->pr_name = copy(s); p->pr_name = copy(s);
p->pr_rawfile = copy(raw); p->pr_rawfile = copy(raw);

6
src/frontend/breakp.c

@ -44,9 +44,9 @@ com_stop(wordlist *wl)
while (wl) { while (wl) {
if (thisone == NULL) { if (thisone == NULL) {
thisone = d = alloc(struct dbcomm);
thisone = d = TMALLOC(struct dbcomm, 1);
} else { } else {
d->db_also = alloc(struct dbcomm);
d->db_also = TMALLOC(struct dbcomm, 1);
d = d->db_also; d = d->db_also;
} }
@ -180,7 +180,7 @@ com_iplot(wordlist *wl)
separate iplot commands. */ separate iplot commands. */
while (wl) { while (wl) {
s = cp_unquote(wl->wl_word); s = cp_unquote(wl->wl_word);
d = alloc(struct dbcomm);
d = TMALLOC(struct dbcomm, 1);
d->db_analysis = NULL; d->db_analysis = NULL;
d->db_number = debugnumber++; d->db_number = debugnumber++;
if (eq(s, "all")) { if (eq(s, "all")) {

2
src/frontend/breakp2.c

@ -54,7 +54,7 @@ settrace(wordlist *wl, int what, char *name)
while (wl) { while (wl) {
s = cp_unquote(wl->wl_word); s = cp_unquote(wl->wl_word);
d = alloc(struct dbcomm);
d = TMALLOC(struct dbcomm, 1);
d->db_number = debugnumber++; d->db_number = debugnumber++;
d->db_analysis = name; d->db_analysis = name;
if (eq(s, "all")) { if (eq(s, "all")) {

6
src/frontend/com_alias.c

@ -123,7 +123,7 @@ cp_setalias(char *word, wordlist *wlist)
cp_addkword(CT_ALIASES, word); cp_addkword(CT_ALIASES, word);
if (cp_aliases == NULL) { if (cp_aliases == NULL) {
al = cp_aliases = alloc(struct alias);
al = cp_aliases = TMALLOC(struct alias, 1);
al->al_next = NULL; al->al_next = NULL;
al->al_prev = NULL; al->al_prev = NULL;
} else { } else {
@ -135,13 +135,13 @@ cp_setalias(char *word, wordlist *wlist)
if (al->al_prev) { if (al->al_prev) {
al = al->al_prev; al = al->al_prev;
ta = al->al_next; ta = al->al_next;
al->al_next = alloc(struct alias);
al->al_next = TMALLOC(struct alias, 1);
al->al_next->al_prev = al; al->al_next->al_prev = al;
al = al->al_next; al = al->al_next;
al->al_next = ta; al->al_next = ta;
ta->al_prev = al; ta->al_prev = al;
} else { } else {
cp_aliases = alloc(struct alias);
cp_aliases = TMALLOC(struct alias, 1);
cp_aliases->al_next = al; cp_aliases->al_next = al;
cp_aliases->al_prev = NULL; cp_aliases->al_prev = NULL;
al->al_prev = cp_aliases; al->al_prev = cp_aliases;

4
src/frontend/com_history.c

@ -364,10 +364,10 @@ cp_addhistent(int event, wordlist *wlist)
/* MW. the begging - initialize histlength */ /* MW. the begging - initialize histlength */
histlength = 1; histlength = 1;
cp_lastone = histlist = alloc(struct histent);
cp_lastone = histlist = TMALLOC(struct histent, 1);
cp_lastone->hi_prev = NULL; cp_lastone->hi_prev = NULL;
} else { } else {
cp_lastone->hi_next = alloc(struct histent);
cp_lastone->hi_next = TMALLOC(struct histent, 1);
cp_lastone->hi_next->hi_prev = cp_lastone; cp_lastone->hi_next->hi_prev = cp_lastone;
cp_lastone = cp_lastone->hi_next; cp_lastone = cp_lastone->hi_next;
} }

6
src/frontend/control.c

@ -620,7 +620,7 @@ cp_evloop(char *string)
#define newblock \ #define newblock \
do { \ do { \
cend[stackp]->co_children = alloc(struct control); \
cend[stackp]->co_children = TMALLOC(struct control, 1); \
ZERO(cend[stackp]->co_children, struct control); \ ZERO(cend[stackp]->co_children, struct control); \
cend[stackp]->co_children->co_parent = cend[stackp]; \ cend[stackp]->co_children->co_parent = cend[stackp]; \
cend[stackp] = cend[stackp]->co_children; \ cend[stackp] = cend[stackp]->co_children; \
@ -663,13 +663,13 @@ cp_evloop(char *string)
*/ */
/* va: TODO: free old structure and its content, before overwriting */ /* va: TODO: free old structure and its content, before overwriting */
if (cend[stackp] && (cend[stackp]->co_type != CO_UNFILLED)) { if (cend[stackp] && (cend[stackp]->co_type != CO_UNFILLED)) {
cend[stackp]->co_next = alloc(struct control);
cend[stackp]->co_next = TMALLOC(struct control, 1);
ZERO(cend[stackp]->co_next, struct control); ZERO(cend[stackp]->co_next, struct control);
cend[stackp]->co_next->co_prev = cend[stackp]; cend[stackp]->co_next->co_prev = cend[stackp];
cend[stackp]->co_next->co_parent = cend[stackp]->co_parent; cend[stackp]->co_next->co_parent = cend[stackp]->co_parent;
cend[stackp] = cend[stackp]->co_next; cend[stackp] = cend[stackp]->co_next;
} else if (!cend[stackp]) { } else if (!cend[stackp]) {
control[stackp] = cend[stackp] = alloc(struct control);
control[stackp] = cend[stackp] = TMALLOC(struct control, 1);
ZERO(cend[stackp], struct control); ZERO(cend[stackp], struct control);
} }

2
src/frontend/define.c

@ -135,7 +135,7 @@ com_define(wordlist *wlist)
break; break;
if (udf == NULL) { if (udf == NULL) {
udf = alloc(struct udfunc);
udf = TMALLOC(struct udfunc, 1);
udf->ud_next = udfuncs; udf->ud_next = udfuncs;
udfuncs = udf; udfuncs = udf;
} }

6
src/frontend/help/readhelp.c

@ -60,7 +60,7 @@ topic *
hlp_read(fplace *place) hlp_read(fplace *place)
{ {
char buf[BSIZE_SP]; char buf[BSIZE_SP];
topic *top = alloc(topic);
topic *top = TMALLOC(topic, 1);
toplink *topiclink; toplink *topiclink;
toplink *tl, *tend = NULL; toplink *tl, *tend = NULL;
wordlist *end = NULL; wordlist *end = NULL;
@ -180,9 +180,9 @@ getsubtoplink(char **ss)
s = *ss; s = *ss;
tl = alloc(toplink);
tl = TMALLOC(toplink, 1);
if ((tmp =strchr(s, ':')) != NULL) { if ((tmp =strchr(s, ':')) != NULL) {
tl->place = alloc(fplace);
tl->place = TMALLOC(fplace, 1);
tl->place->filename = tl->place->filename =
strncpy(TMALLOC(char, tmp - s + 1), s, (size_t) (tmp - s)); strncpy(TMALLOC(char, tmp - s + 1), s, (size_t) (tmp - s));
tl->place->filename[tmp - s] = '\0'; tl->place->filename[tmp - s] = '\0';

4
src/frontend/inp.c

@ -793,7 +793,7 @@ inp_dodeck(
ft_curckt->ci_nodes = cp_kwswitch(CT_NODENAMES, NULL); ft_curckt->ci_nodes = cp_kwswitch(CT_NODENAMES, NULL);
} }
/* create new circuit structure */ /* create new circuit structure */
ft_curckt = ct = alloc(struct circ);
ft_curckt = ct = TMALLOC(struct circ, 1);
/*PN FTESTATS*/ /*PN FTESTATS*/
ft_curckt->FTEstats = TMALLOC(FTESTATistics, 1); ft_curckt->FTEstats = TMALLOC(FTESTATistics, 1);
@ -1631,7 +1631,7 @@ static void inp_savecurrents(struct line *deck, struct line *options, wordlist *
/* if we neither have 'save' nor '.save', add '.save all' /* if we neither have 'save' nor '.save', add '.save all'
or if we do not have wl_first, add at least a wordline '*' to allow wl_append_word() */ or if we do not have wl_first, add at least a wordline '*' to allow wl_append_word() */
if (!(*wl) || !havesave) { if (!(*wl) || !havesave) {
*wl = alloc(wordlist);
*wl = TMALLOC(wordlist, 1);
(*wl)->wl_next = NULL; (*wl)->wl_next = NULL;
(*wl)->wl_prev = NULL; (*wl)->wl_prev = NULL;
if (havesave) if (havesave)

2
src/frontend/measure.c

@ -330,7 +330,7 @@ do_measure(
} }
if (!chk_only) { if (!chk_only) {
newcard = alloc(struct line);
newcard = TMALLOC(struct line, 1);
newcard->li_line = strdup(out_line); newcard->li_line = strdup(out_line);
newcard->li_next = NULL; newcard->li_next = NULL;

18
src/frontend/options.c

@ -51,7 +51,7 @@ cp_enqvar(char *word)
return (NULL); return (NULL);
if (d->v_length == 1) { if (d->v_length == 1) {
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_next = NULL; vv->va_next = NULL;
vv->va_name = copy(word); vv->va_name = copy(word);
vv->va_type = CP_REAL; vv->va_type = CP_REAL;
@ -60,13 +60,13 @@ cp_enqvar(char *word)
else else
vv->va_real = realpart(d->v_compdata[0]); vv->va_real = realpart(d->v_compdata[0]);
} else { } else {
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_next = NULL; vv->va_next = NULL;
vv->va_name = copy(word); vv->va_name = copy(word);
vv->va_type = CP_LIST; vv->va_type = CP_LIST;
vv->va_vlist = NULL; vv->va_vlist = NULL;
for (i = d->v_length - 1; i >= 0; i--) { for (i = d->v_length - 1; i >= 0; i--) {
tv = alloc(struct variable);
tv = TMALLOC(struct variable, 1);
tv->va_type = CP_REAL; tv->va_type = CP_REAL;
if (isreal(d)) if (isreal(d))
tv->va_real = d->v_realdata[i]; tv->va_real = d->v_realdata[i];
@ -89,37 +89,37 @@ cp_enqvar(char *word)
if (eq(vv->va_name, word)) if (eq(vv->va_name, word))
return (vv); return (vv);
if (eq(word, "curplotname")) { if (eq(word, "curplotname")) {
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_next = NULL; vv->va_next = NULL;
vv->va_name = word; vv->va_name = word;
vv->va_type = CP_STRING; vv->va_type = CP_STRING;
vv->va_string = copy(plot_cur->pl_name); vv->va_string = copy(plot_cur->pl_name);
} else if (eq(word, "curplottitle")) { } else if (eq(word, "curplottitle")) {
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_next = NULL; vv->va_next = NULL;
vv->va_name = word; vv->va_name = word;
vv->va_type = CP_STRING; vv->va_type = CP_STRING;
vv->va_string = copy(plot_cur->pl_title); vv->va_string = copy(plot_cur->pl_title);
} else if (eq(word, "curplotdate")) { } else if (eq(word, "curplotdate")) {
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_next = NULL; vv->va_next = NULL;
vv->va_name = word; vv->va_name = word;
vv->va_type = CP_STRING; vv->va_type = CP_STRING;
vv->va_string = copy(plot_cur->pl_date); vv->va_string = copy(plot_cur->pl_date);
} else if (eq(word, "curplot")) { } else if (eq(word, "curplot")) {
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_next = NULL; vv->va_next = NULL;
vv->va_name = word; vv->va_name = word;
vv->va_type = CP_STRING; vv->va_type = CP_STRING;
vv->va_string = copy(plot_cur->pl_typename); vv->va_string = copy(plot_cur->pl_typename);
} else if (eq(word, "plots")) { } else if (eq(word, "plots")) {
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_next = NULL; vv->va_next = NULL;
vv->va_name = word; vv->va_name = word;
vv->va_type = CP_LIST; vv->va_type = CP_LIST;
vv->va_vlist = NULL; vv->va_vlist = NULL;
for (pl = plot_list; pl; pl = pl->pl_next) { for (pl = plot_list; pl; pl = pl->pl_next) {
tv = alloc(struct variable);
tv = TMALLOC(struct variable, 1);
tv->va_type = CP_STRING; tv->va_type = CP_STRING;
tv->va_string = copy(pl->pl_typename); tv->va_string = copy(pl->pl_typename);
tv->va_next = vv->va_vlist; tv->va_next = vv->va_vlist;

2
src/frontend/outitf.c

@ -161,7 +161,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
fprintf(cp_out, "Warning: Interpolated raw file data!\n\n"); fprintf(cp_out, "Warning: Interpolated raw file data!\n\n");
} }
*runp = run = alloc(struct runDesc);
*runp = run = TMALLOC(struct runDesc, 1);
/* First fill in some general information. */ /* First fill in some general information. */
run->analysis = analysisPtr; run->analysis = analysisPtr;

2
src/frontend/parse.c

@ -397,7 +397,7 @@ PP_mksnode(const char *string)
struct pnode * struct pnode *
alloc_pnode(void) alloc_pnode(void)
{ {
struct pnode *pn = alloc(struct pnode);
struct pnode *pn = TMALLOC(struct pnode, 1);
pn->pn_use = 0; pn->pn_use = 0;
pn->pn_name = NULL; pn->pn_name = NULL;

8
src/frontend/parser/complete.c

@ -594,7 +594,7 @@ clookup(register char *word, struct ccom **dd, bool pref, bool create)
if (!create) { if (!create) {
return (NULL); return (NULL);
} else { } else {
*dd = place = alloc(struct ccom);
*dd = place = TMALLOC(struct ccom, 1);
ZERO(place, struct ccom); ZERO(place, struct ccom);
buf[0] = *word; buf[0] = *word;
buf[1] = '\0'; buf[1] = '\0';
@ -617,7 +617,7 @@ clookup(register char *word, struct ccom **dd, bool pref, bool create)
if (place->cc_name[ind] < word[ind]) { if (place->cc_name[ind] < word[ind]) {
/* This line doesn't go out that far... */ /* This line doesn't go out that far... */
if (create) { if (create) {
place->cc_sibling = alloc(struct ccom);
place->cc_sibling = TMALLOC(struct ccom, 1);
ZERO(place->cc_sibling, struct ccom); ZERO(place->cc_sibling, struct ccom);
place->cc_sibling->cc_ysibling = place; place->cc_sibling->cc_ysibling = place;
place->cc_sibling->cc_parent = place->cc_parent; place->cc_sibling->cc_parent = place->cc_parent;
@ -633,7 +633,7 @@ clookup(register char *word, struct ccom **dd, bool pref, bool create)
} else if (place->cc_name[ind] > word[ind]) { } else if (place->cc_name[ind] > word[ind]) {
if (create) { if (create) {
/* Put this one between place and its pred. */ /* Put this one between place and its pred. */
tmpc = alloc(struct ccom);
tmpc = TMALLOC(struct ccom, 1);
ZERO(tmpc, struct ccom); ZERO(tmpc, struct ccom);
tmpc->cc_parent = place->cc_parent; tmpc->cc_parent = place->cc_parent;
tmpc->cc_sibling = place; tmpc->cc_sibling = place;
@ -663,7 +663,7 @@ clookup(register char *word, struct ccom **dd, bool pref, bool create)
if (!place->cc_child) { if (!place->cc_child) {
/* No children, maybe make one and go on. */ /* No children, maybe make one and go on. */
if (create) { if (create) {
tmpc = alloc(struct ccom);
tmpc = TMALLOC(struct ccom, 1);
ZERO(tmpc, struct ccom); ZERO(tmpc, struct ccom);
tmpc->cc_parent = place; tmpc->cc_parent = place;
place->cc_child = tmpc; place->cc_child = tmpc;

2
src/frontend/parser/unixcom.c

@ -118,7 +118,7 @@ cp_rehash(char *pathlist, bool docc)
* executable, but that is too slow * executable, but that is too slow
* (as if "we" really cared). * (as if "we" really cared).
*/ */
hh = alloc(struct hashent);
hh = TMALLOC(struct hashent, 1);
hh->h_name = copy(entry->d_name); hh->h_name = copy(entry->d_name);
hh->h_path = curpath; hh->h_path = curpath;
i = hash(entry->d_name); i = hash(entry->d_name);

2
src/frontend/rawfile.c

@ -352,7 +352,7 @@ raw_read(char *name) {
curpl->pl_commands = wl; curpl->pl_commands = wl;
} }
} }
curpl = alloc(struct plot);
curpl = TMALLOC(struct plot, 1);
curpl->pl_next = plots; curpl->pl_next = plots;
plots = curpl; plots = curpl;
curpl->pl_name = copy(s); curpl->pl_name = copy(s);

4
src/frontend/spiceif.c

@ -958,7 +958,7 @@ if_setparam(CKTcircuit *ckt, char **name, char *param, struct dvec *val, int do_
static struct variable * static struct variable *
parmtovar(IFvalue *pv, IFparm *opt) parmtovar(IFvalue *pv, IFparm *opt)
{ {
struct variable *vv = alloc(struct variable);
struct variable *vv = TMALLOC(struct variable, 1);
struct variable *nv; struct variable *nv;
int i = 0; int i = 0;
@ -983,7 +983,7 @@ parmtovar(IFvalue *pv, IFparm *opt)
case IF_REALVEC: case IF_REALVEC:
vv->va_type = CP_LIST; vv->va_type = CP_LIST;
for (i = 0; i < pv->v.numValue; i++) { for (i = 0; i < pv->v.numValue; i++) {
nv = alloc(struct variable);
nv = TMALLOC(struct variable, 1);
nv->va_next = vv->va_vlist; nv->va_next = vv->va_vlist;
vv->va_vlist = nv; vv->va_vlist = nv;
nv->va_type = CP_REAL; nv->va_type = CP_REAL;

6
src/frontend/subckt.c

@ -484,7 +484,7 @@ doit(struct line *deck, wordlist *modnames) {
{ {
char *s = c->li_line; char *s = c->li_line;
sss = alloc(struct subs);
sss = TMALLOC(struct subs, 1);
txfree(gettok(&s)); txfree(gettok(&s));
@ -707,10 +707,10 @@ inp_deckcopy(struct line *deck) {
while (deck) { while (deck) {
if (nd) { if (nd) {
d->li_next = alloc(struct line);
d->li_next = TMALLOC(struct line, 1);
d = d->li_next; d = d->li_next;
} else { } else {
nd = d = alloc(struct line);
nd = d = TMALLOC(struct line, 1);
} }
d->li_linenum = deck->li_linenum; d->li_linenum = deck->li_linenum;
d->li_line = copy(deck->li_line); d->li_line = copy(deck->li_line);

12
src/frontend/variable.c

@ -104,7 +104,7 @@ cp_vset(char *varname, enum cp_types type, void *value)
} }
if (!v) { if (!v) {
v = alloc(struct variable);
v = TMALLOC(struct variable, 1);
v->va_name = copy(copyvarname); v->va_name = copy(copyvarname);
v->va_next = NULL; v->va_next = NULL;
v_free = TRUE; v_free = TRUE;
@ -282,7 +282,7 @@ cp_setparse(wordlist *wl)
wl = wl->wl_next; wl = wl->wl_next;
if ((!wl || (*wl->wl_word != '=')) && !strchr(name, '=')) { if ((!wl || (*wl->wl_word != '=')) && !strchr(name, '=')) {
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_name = copy(name); vv->va_name = copy(name);
vv->va_type = CP_BOOL; vv->va_type = CP_BOOL;
vv->va_bool = TRUE; vv->va_bool = TRUE;
@ -346,7 +346,7 @@ cp_setparse(wordlist *wl)
if (!--balance) if (!--balance)
break; break;
} }
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_next = NULL; vv->va_next = NULL;
copyval = ss = cp_unquote(wl->wl_word); copyval = ss = cp_unquote(wl->wl_word);
td = ft_numparse(&ss, FALSE); td = ft_numparse(&ss, FALSE);
@ -374,7 +374,7 @@ cp_setparse(wordlist *wl)
return (NULL); return (NULL);
} }
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_name = copy(name); vv->va_name = copy(name);
vv->va_type = CP_LIST; vv->va_type = CP_LIST;
vv->va_vlist = listv; vv->va_vlist = listv;
@ -387,7 +387,7 @@ cp_setparse(wordlist *wl)
copyval = ss = cp_unquote(val); copyval = ss = cp_unquote(val);
td = ft_numparse(&ss, FALSE); td = ft_numparse(&ss, FALSE);
vv = alloc(struct variable);
vv = TMALLOC(struct variable, 1);
vv->va_name = copy(name); vv->va_name = copy(name);
vv->va_next = vars; vv->va_next = vars;
vars = vv; vars = vv;
@ -461,7 +461,7 @@ cp_remvar(char *varname)
} }
if (!v) { if (!v) {
/* Gotta make up a var struct for cp_usrset()... */ /* Gotta make up a var struct for cp_usrset()... */
v = alloc(struct variable);
v = TMALLOC(struct variable, 1);
ZERO(v, struct variable); ZERO(v, struct variable);
v->va_name = copy(varname); v->va_name = copy(varname);
v->va_type = CP_NUM; v->va_type = CP_NUM;

2
src/frontend/vectors.c

@ -732,7 +732,7 @@ vec_copy(struct dvec *v)
struct plot * struct plot *
plot_alloc(char *name) plot_alloc(char *name)
{ {
struct plot *pl = alloc(struct plot), *tp;
struct plot *pl = TMALLOC(struct plot, 1), *tp;
char *s; char *s;
struct ccom *ccom; struct ccom *ccom;
char buf[BSIZE_SP]; char buf[BSIZE_SP];

1
src/include/ngspice/memory.h

@ -29,7 +29,6 @@ extern void txfree(void *ptr);
#include "ngspice/stringutil.h" /* va: spice3 internally bzero */ #include "ngspice/stringutil.h" /* va: spice3 internally bzero */
#define alloc(TYPE) TMALLOC(TYPE, 1)
#define MALLOC(x) tmalloc((size_t) (x)) #define MALLOC(x) tmalloc((size_t) (x))
#define FREE(x) do { if(x) { txfree(x); (x) = NULL; } } while(0) #define FREE(x) do { if(x) { txfree(x); (x) = NULL; } } while(0)
#define REALLOC(x, y) trealloc(x, (size_t) (y)) #define REALLOC(x, y) trealloc(x, (size_t) (y))

4
src/misc/wlist.c

@ -275,7 +275,7 @@ wl_range(wordlist *wl, int low, int up)
wordlist * wordlist *
wl_cons(char *word, wordlist *wlist) wl_cons(char *word, wordlist *wlist)
{ {
wordlist *w = alloc(wordlist);
wordlist *w = TMALLOC(wordlist, 1);
w->wl_next = wlist; w->wl_next = wlist;
w->wl_prev = NULL; w->wl_prev = NULL;
w->wl_word = word; w->wl_word = word;
@ -297,7 +297,7 @@ wl_cons(char *word, wordlist *wlist)
void void
wl_append_word(wordlist **first, wordlist **last, char *word) wl_append_word(wordlist **first, wordlist **last, char *word)
{ {
wordlist *w = alloc(wordlist);
wordlist *w = TMALLOC(wordlist, 1);
w->wl_next = NULL; w->wl_next = NULL;
w->wl_prev = (*last); w->wl_prev = (*last);
w->wl_word = word; w->wl_word = word;

2
src/ngsconvert.c

@ -95,7 +95,7 @@ oldread(char *name)
perror(name); perror(name);
return (NULL); return (NULL);
} }
pl = alloc(struct plot);
pl = TMALLOC(struct plot, 1);
tfread(buf, 1, 80, fp); tfread(buf, 1, 80, fp);
buf[80] = '\0'; buf[80] = '\0';
for (i = (int) strlen(buf) - 1; (i > 1) && (buf[i] == ' '); i--) for (i = (int) strlen(buf) - 1; (i > 1) && (buf[i] == ' '); i--)

4
src/xspice/enh/enhtrans.c

@ -115,8 +115,8 @@ struct line * ENHtranslate_poly(
#endif #endif
/* Create two new line structs and splice into deck */ /* Create two new line structs and splice into deck */
l1 = alloc(struct line);
l2 = alloc(struct line);
l1 = TMALLOC(struct line, 1);
l2 = TMALLOC(struct line, 1);
l2->li_next = d->li_next; l2->li_next = d->li_next;
l1->li_next = l2; l1->li_next = l2;
d->li_next = l1; d->li_next = l1;

Loading…
Cancel
Save