Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22972
Modified Files: Tag: desiredata builtins.c builtins_dsp.c desire.c Log Message: replace freebytes by free.
Index: builtins.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -C2 -d -r1.1.2.10 -r1.1.2.11 *** builtins.c 9 Jan 2007 15:03:38 -0000 1.1.2.10 --- builtins.c 9 Jan 2007 15:07:39 -0000 1.1.2.11 *************** *** 10,13 **** --- 10,14 ---- #include "desire.h" #include "s_stuff.h" + #include <stdlib.h> #include <math.h> #include <stdio.h>
Index: builtins_dsp.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins_dsp.c,v retrieving revision 1.1.2.16 retrieving revision 1.1.2.17 diff -C2 -d -r1.1.2.16 -r1.1.2.17 *** builtins_dsp.c 7 Jan 2007 00:34:18 -0000 1.1.2.16 --- builtins_dsp.c 9 Jan 2007 15:07:39 -0000 1.1.2.17 *************** *** 18,21 **** --- 18,22 ---- #include <stdio.h> #include <string.h> + #include <stdlib.h> extern "C" int ugen_getsortno(void); #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ *************** *** 1217,1221 **** x->targettime = s->s_targettime; x->list = s->s_next; ! t_freebytes(s, sizeof(*s)); s = x->list; goto checknext; --- 1218,1222 ---- x->targettime = s->s_targettime; x->list = s->s_next; ! free(s); s = x->list; goto checknext; *************** *** 1234,1238 **** t_vseg *s1, *s2; for (s1 = x->list; s1; s1 = s2) ! s2 = s1->s_next, t_freebytes(s1, sizeof(*s1)); x->list = 0; x->inc = 0; --- 1235,1239 ---- t_vseg *s1, *s2; for (s1 = x->list; s1; s1 = s2) ! s2 = s1->s_next, free(s1); x->list = 0; x->inc = 0; *************** *** 1280,1284 **** while (deletefrom) { s1 = deletefrom->s_next; ! t_freebytes(deletefrom, sizeof(*deletefrom)); deletefrom = s1; } --- 1281,1285 ---- while (deletefrom) { s1 = deletefrom->s_next; ! free(deletefrom); deletefrom = s1; } *************** *** 1382,1386 **** int n = sp[0]->n; if (n != x->n) { ! if (x->vec) t_freebytes(x->vec, x->n * sizeof(t_sample)); x->vec = (t_sample *)getbytes(n * sizeof(t_sample)); x->gotone = 0; --- 1383,1387 ---- int n = sp[0]->n; if (n != x->n) { ! if (x->vec) free(x->vec); x->vec = (t_sample *)getbytes(n * sizeof(t_sample)); x->gotone = 0; *************** *** 1399,1403 **** } static void vsnapshot_tilde_ff(t_vsnapshot *x) { ! if (x->vec) t_freebytes(x->vec, x->n * sizeof(t_sample)); } static void vsnapshot_tilde_setup() { --- 1400,1404 ---- } static void vsnapshot_tilde_ff(t_vsnapshot *x) { ! if (x->vec) free(x->vec); } static void vsnapshot_tilde_setup() { *************** *** 1701,1705 **** } } ! static void dac_free(t_dac *x) {freebytes(x->vec, x->n * sizeof(*x->vec));} static void dac_setup() { dac_class = class_new2("dac~",dac_new,dac_free,sizeof(t_dac),0,"*"); --- 1702,1706 ---- } } ! static void dac_free(t_dac *x) {free(x->vec);} static void dac_setup() { dac_class = class_new2("dac~",dac_new,dac_free,sizeof(t_dac),0,"*"); *************** *** 1772,1776 **** } } ! static void adc_free(t_adc *x) {freebytes(x->vec, x->n * sizeof(*x->vec));} static void adc_setup() { adc_class = class_new2("adc~",adc_new,adc_free,sizeof(t_adc),0,"*"); --- 1773,1777 ---- } } ! static void adc_free(t_adc *x) {free(x->vec);} static void adc_setup() { adc_class = class_new2("adc~",adc_new,adc_free,sizeof(t_adc),0,"*");
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.115 retrieving revision 1.1.2.217.2.116 diff -C2 -d -r1.1.2.217.2.115 -r1.1.2.217.2.116 *** desire.c 5 Jan 2007 01:53:25 -0000 1.1.2.217.2.115 --- desire.c 9 Jan 2007 15:07:40 -0000 1.1.2.217.2.116 *************** *** 2,6 ****
This file is part of DesireData. ! Copyright (c) 2004-2006 by Mathieu Bouchard.
Copyright (c) 1997-2005 Miller Puckette. --- 2,6 ----
This file is part of DesireData. ! Copyright (c) 2004-2007 by Mathieu Bouchard.
Copyright (c) 1997-2005 Miller Puckette. *************** *** 410,414 **** as calling canvas_new(). */ void canvas_setargs(int argc, t_atom *argv) { ! if (canvas_newargv) freebytes(canvas_newargv, canvas_newargc * sizeof(t_atom)); canvas_newargc = argc; canvas_newargv = (t_atom *)copybytes(argv, argc * sizeof(t_atom)); --- 410,414 ---- as calling canvas_new(). */ void canvas_setargs(int argc, t_atom *argv) { ! if (canvas_newargv) free(canvas_newargv); canvas_newargc = argc; canvas_newargv = (t_atom *)copybytes(argv, argc * sizeof(t_atom)); *************** *** 746,755 **** if (x->name != s_Pd) pd_unbind(x,canvas_makebindsym(x->name)); if (x->env) { ! freebytes(x->env->argv, x->env->argc * sizeof(t_atom)); ! freebytes(x->env, sizeof(*x->env)); } canvas_resume_dsp(dspstate); ! freebytes(x->xlabel, x->nxlabels * sizeof(*(x->xlabel))); ! freebytes(x->ylabel, x->nylabels * sizeof(*(x->ylabel))); if (!x->owner) canvas_takeofflist(x); } --- 746,755 ---- if (x->name != s_Pd) pd_unbind(x,canvas_makebindsym(x->name)); if (x->env) { ! free(x->env->argv); ! free(x->env); } canvas_resume_dsp(dspstate); ! free(x->xlabel); ! free(x->ylabel); if (!x->owner) canvas_takeofflist(x); } *************** *** 2016,2020 **** for (int i=0; i < argc; i++) svec[i] = atom_getfloatarg(i, argc, argv); garray_dofo(x, npoints, 0, argc, svec, 1); ! t_freebytes(svec, sizeof(t_float) * argc); } static void garray_cosinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) { --- 2016,2020 ---- for (int i=0; i < argc; i++) svec[i] = atom_getfloatarg(i, argc, argv); garray_dofo(x, npoints, 0, argc, svec, 1); ! free(svec); } static void garray_cosinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) { *************** *** 2029,2033 **** for (int i=0; i < argc; i++) svec[i] = atom_getfloatarg(i, argc, argv); garray_dofo(x, npoints, 0, argc, svec, 0); ! t_freebytes(svec, sizeof(t_float) * argc); }
--- 2029,2033 ---- for (int i=0; i < argc; i++) svec[i] = atom_getfloatarg(i, argc, argv); garray_dofo(x, npoints, 0, argc, svec, 0); ! free(svec); }
*************** *** 2359,2363 **** obj_moveinletfirst(x,ip); } ! freebytes(vec, n*sizeof(*vec)); } static void canvas_resortoutlets(t_canvas *x) { --- 2359,2363 ---- obj_moveinletfirst(x,ip); } ! free(vec); } static void canvas_resortoutlets(t_canvas *x) { *************** *** 2380,2384 **** obj_moveoutletfirst(x,ip); } ! freebytes(vec, n*sizeof(*vec)); }
--- 2380,2384 ---- obj_moveoutletfirst(x,ip); } ! free(vec); }
*************** *** 2734,2738 **** } newtemplate = template_new(templatesym, ntemplateargs, templateargs); ! t_freebytes(templateargs, sizeof (*templateargs) * ntemplateargs); if (!(existtemplate = template_findbyname(templatesym))) { pd_error(x,"%s: template not found in current patch", templatesym->s_name); --- 2734,2738 ---- } newtemplate = template_new(templatesym, ntemplateargs, templateargs); ! free(templateargs); if (!(existtemplate = template_findbyname(templatesym))) { pd_error(x,"%s: template not found in current patch", templatesym->s_name); *************** *** 2862,2866 **** binbuf_add(b, natom, a); binbuf_addsemi(b); ! t_freebytes(a, natom * sizeof(*a)); for (int i=0; i<n; i++) { if (t->vec[i].type == DT_ARRAY) { --- 2862,2866 ---- binbuf_add(b, natom, a); binbuf_addsemi(b); ! free(a); for (int i=0; i<n; i++) { if (t->vec[i].type == DT_ARRAY) { *************** *** 2993,2998 **** static void canvas_savecoordsto(t_canvas *x, t_binbuf *b) { /* if everything is the default, skip saving this line */ ! /*if (!x->isgraph && x->x1==0 && x->y1==0 && ! x->x2==1 && x->y2==1 && x->pixwidth==0 && x->pixheight==0) return;*/
/* if we have a graph-on-parent rectangle, we're new style. The format is arranged so --- 2993,2998 ---- static void canvas_savecoordsto(t_canvas *x, t_binbuf *b) { /* if everything is the default, skip saving this line */ ! if (!x->isgraph && x->x1==0 && x->y1==0 && ! x->x2==1 && x->y2==1 && x->pixwidth==0 && x->pixheight==0) return;
/* if we have a graph-on-parent rectangle, we're new style. The format is arranged so *************** *** 3764,3768 **** sys_gui(buf); sys_gui("}\n"); ! t_freebytes(buf, bufsize+1); } */ --- 3764,3768 ---- sys_gui(buf); sys_gui("}\n"); ! free(buf); } */ *************** *** 3775,3779 **** /* the "size" field in the class is zero, so Pd doesn't try to free us automatically (see pd_free()) */ ! freebytes(x, sizeof(t_scalar) + (t->n - 1) * sizeof(*x->v)); }
--- 3775,3779 ---- /* the "size" field in the class is zero, so Pd doesn't try to free us automatically (see pd_free()) */ ! free(x); }
*************** *** 4012,4016 **** scalartemplate = tto; a->vec = newarray; ! freebytes(oldarray, oldelemsize * a->n); } else scalartemplate = template_findbyname(a->templatesym); /* convert all arrays and sublist fields in each element of the array */ --- 4012,4016 ---- scalartemplate = tto; a->vec = newarray; ! free(oldarray); } else scalartemplate = template_findbyname(a->templatesym); /* convert all arrays and sublist fields in each element of the array */ *************** *** 4071,4076 **** canvases_each(gl) template_conformcanvas(tfrom, tto, conformaction, gl); } ! freebytes(conformaction, sizeof(int) * nto); ! freebytes(conformedfrom, sizeof(int) * nfrom); }
--- 4071,4076 ---- canvases_each(gl) template_conformcanvas(tfrom, tto, conformaction, gl); } ! free(conformaction); ! free(conformedfrom); }
*************** *** 4136,4140 **** void template_free(t_template *x) { if (*x->sym->s_name) pd_unbind(x,x->sym); ! t_freebytes(x->vec, x->n * sizeof(*x->vec));
} --- 4136,4140 ---- void template_free(t_template *x) { if (*x->sym->s_name) pd_unbind(x,x->sym); ! free(x->vec);
} *************** *** 4233,4237 **** for (x2=t->list; (x3=x2->next); x2=x3) if (x==x3) {x2->next=x3->next; break;} } ! freebytes(x->argv, sizeof(t_atom) * x->argc); }
--- 4233,4237 ---- for (x2=t->list; (x3=x2->next); x2=x3) if (x==x3) {x2->next=x3->next; break;} } ! free(x->argv); }
*************** *** 4563,4567 ****
static void curve_free(t_curve *x) { ! t_freebytes(x->vec, 2 * x->npoints * sizeof(*x->vec)); }
--- 4563,4567 ----
static void curve_free(t_curve *x) { ! free(x->vec); }
*************** *** 5066,5070 **** static void gstub_dis(t_gstub *gs) { int refcount = --gs->gs_refcount; ! if (!refcount && gstub_which(gs) == GP_NONE) t_freebytes(gs, sizeof (*gs)); else if (refcount < 0) bug("gstub_dis"); } --- 5066,5070 ---- static void gstub_dis(t_gstub *gs) { int refcount = --gs->gs_refcount; ! if (!refcount && gstub_which(gs) == GP_NONE) free(gs); else if (refcount < 0) bug("gstub_dis"); } *************** *** 5223,5227 ****
static void ptrobj_free(t_ptrobj *x) { ! freebytes(x->typedout, x->ntypedout * sizeof (*x->typedout)); gpointer_unset(&x->gp); } --- 5223,5227 ----
static void ptrobj_free(t_ptrobj *x) { ! free(x->typedout); gpointer_unset(&x->gp); } *************** *** 5278,5282 ****
static void get_free(t_get *x) { ! freebytes(x->variables, x->nout * sizeof (*x->variables)); }
--- 5278,5282 ----
static void get_free(t_get *x) { ! free(x->variables); }
*************** *** 5354,5358 ****
static void set_free(t_set *x) { ! freebytes(x->variables, x->nin * sizeof (*x->variables)); gpointer_unset(&x->gp); } --- 5354,5358 ----
static void set_free(t_set *x) { ! free(x->variables); gpointer_unset(&x->gp); } *************** *** 5586,5590 ****
static void append_free(t_append *x) { ! freebytes(x->variables, x->nin * sizeof (*x->variables)); gpointer_unset(&x->gp); } --- 5586,5590 ----
static void append_free(t_append *x) { ! free(x->variables); gpointer_unset(&x->gp); } *************** *** 6387,6391 **** binbuf_addv(b, "ttii", "#X","restore", (t_int)x->x, (t_int)x->y); if (x->binbuf) { ! pd_print(x,"pd_upload"); binbuf_addbinbuf(b, x->binbuf); } else { --- 6387,6391 ---- binbuf_addv(b, "ttii", "#X","restore", (t_int)x->x, (t_int)x->y); if (x->binbuf) { ! //pd_print(x,"pd_upload"); binbuf_addbinbuf(b, x->binbuf); } else {