tmalloc usage, minor usage unification

This commit is contained in:
rlar 2010-10-24 13:06:23 +00:00
parent 5e8e44cc0a
commit 32a255f47c
4 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2010-10-24 Robert Larice
* src/frontend/com_display.c ,
* src/frontend/device.c ,
* src/frontend/help/x11disp.c :
tmalloc usage, minor usage unification
2010-10-24 Robert Larice
* src/frontend/com_sysinfo.c ,
* src/frontend/plotting/graf.c ,

View File

@ -61,7 +61,7 @@ com_display(wordlist *wl)
return;
}
out_printf("Here are the vectors currently active:\n\n");
dvs = (struct dvec **) tmalloc(len * (sizeof (struct dvec *)));
dvs = (struct dvec **) tmalloc(len * sizeof(struct dvec *));
for (d = plot_cur->pl_dvecs, i = 0; d; d = d->v_next, i++)
dvs[i] = d;
if (!cp_getvar("nosort", CP_BOOL, NULL))

View File

@ -917,8 +917,8 @@ com_alter_common(wordlist *wl, int do_model)
eqfound = TRUE;
arglist = (char**)tmalloc(4*sizeof(char*));
arglist[3] = NULL;
arglist[0] = (char*)tmalloc(i*sizeof(char) + 1);
arglist[2] = (char*)tmalloc(strlen(&argument[i+1])*sizeof(char) + 1);
arglist[0] = (char*)tmalloc(i + 1);
arglist[2] = (char*)tmalloc(strlen(&argument[i+1]) + 1);
/* copy argument */
strncpy(arglist[0],argument,i);
arglist[0][i] = '\0';

View File

@ -164,7 +164,7 @@ hlp_xdisplay(topic *top)
commandWidgetClass, top->subboxwidget, buttonargs,
XtNumber(buttonargs));
/* core leak XXX */
hand = (handle *) tmalloc(sizeof (struct handle));
hand = (handle *) tmalloc(sizeof (handle));
hand->result = tl;
hand->parent = top;
XtAddCallback(buttonwidget, XtNcallback, (XtCallbackProc) newtopic, hand);
@ -196,7 +196,7 @@ hlp_xdisplay(topic *top)
XtSetArg(buttonargs[0], XtNlabel, tl->button.text);
buttonwidget = XtCreateManagedWidget(tl->button.text,
commandWidgetClass, top->seeboxwidget, buttonargs, 1);
hand = (handle *) tmalloc(sizeof (struct handle));
hand = (handle *) tmalloc(sizeof (handle));
/* core leak XXX */
hand->result = tl;
hand->parent = top;