Browse Source

tmalloc usage, minor usage unification

pre-master-46
rlar 16 years ago
parent
commit
32a255f47c
  1. 6
      ChangeLog
  2. 2
      src/frontend/com_display.c
  3. 4
      src/frontend/device.c
  4. 4
      src/frontend/help/x11disp.c

6
ChangeLog

@ -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 2010-10-24 Robert Larice
* src/frontend/com_sysinfo.c , * src/frontend/com_sysinfo.c ,
* src/frontend/plotting/graf.c , * src/frontend/plotting/graf.c ,

2
src/frontend/com_display.c

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

4
src/frontend/device.c

@ -917,8 +917,8 @@ com_alter_common(wordlist *wl, int do_model)
eqfound = TRUE; eqfound = TRUE;
arglist = (char**)tmalloc(4*sizeof(char*)); arglist = (char**)tmalloc(4*sizeof(char*));
arglist[3] = NULL; 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 */ /* copy argument */
strncpy(arglist[0],argument,i); strncpy(arglist[0],argument,i);
arglist[0][i] = '\0'; arglist[0][i] = '\0';

4
src/frontend/help/x11disp.c

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

Loading…
Cancel
Save