Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8076
Modified Files: Tag: devel_0_39 d_ctl.c d_fftroutine.c d_filter.c d_resample.c d_soundfile.c d_ugen.c Log Message: C++ support
Index: d_fftroutine.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_fftroutine.c,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -C2 -d -r1.2 -r1.2.8.1 *** d_fftroutine.c 6 Sep 2004 20:20:33 -0000 1.2 --- d_fftroutine.c 28 Oct 2005 11:34:14 -0000 1.2.8.1 *************** *** 931,937 ****
! BOOL power_of_two(n) ! ! int n;
/* effects: Returns TRUE if n is a power of two, otherwise FALSE. --- 931,935 ----
! BOOL power_of_two(int n)
/* effects: Returns TRUE if n is a power of two, otherwise FALSE.
Index: d_soundfile.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v retrieving revision 1.4.4.11.2.6 retrieving revision 1.4.4.11.2.7 diff -C2 -d -r1.4.4.11.2.6 -r1.4.4.11.2.7 *** d_soundfile.c 4 Oct 2005 22:23:55 -0000 1.4.4.11.2.6 --- d_soundfile.c 28 Oct 2005 11:34:14 -0000 1.4.4.11.2.7 *************** *** 2326,2330 **** static void *readsf_child_main(void *zz) { ! t_readsf *x = zz; #ifdef DEBUG_SOUNDFILE pute("1\n"); --- 2326,2330 ---- static void *readsf_child_main(void *zz) { ! t_readsf *x = (t_readsf *)zz; #ifdef DEBUG_SOUNDFILE pute("1\n"); *************** *** 2628,2632 **** else if (bufsize > MAXBUFSIZE) bufsize = MAXBUFSIZE; ! buf = getbytes(bufsize); if (!buf) return (0);
--- 2628,2632 ---- else if (bufsize > MAXBUFSIZE) bufsize = MAXBUFSIZE; ! buf = (char *)getbytes(bufsize); if (!buf) return (0);
*************** *** 2878,2882 **** static void *writesf_child_main(void *zz) { ! t_writesf *x = zz; #ifdef DEBUG_SOUNDFILE pute("1\n"); --- 2878,2882 ---- static void *writesf_child_main(void *zz) { ! t_writesf *x = (t_writesf*)zz; #ifdef DEBUG_SOUNDFILE pute("1\n"); *************** *** 3127,3131 **** else if (bufsize > MAXBUFSIZE) bufsize = MAXBUFSIZE; ! buf = getbytes(bufsize); if (!buf) return (0);
--- 3127,3131 ---- else if (bufsize > MAXBUFSIZE) bufsize = MAXBUFSIZE; ! buf = (char *)getbytes(bufsize); if (!buf) return (0);
Index: d_resample.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_resample.c,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.1.2.1 diff -C2 -d -r1.2.4.1 -r1.2.4.1.2.1 *** d_resample.c 10 Nov 2004 13:52:36 -0000 1.2.4.1 --- d_resample.c 28 Oct 2005 11:34:14 -0000 1.2.4.1.2.1 *************** *** 219,223 **** t_freebytes(x->buffer, x->bufsize*sizeof(*x->buffer)); x->bufsize = 1; ! x->buffer = t_getbytes(x->bufsize*sizeof(*x->buffer)); } dsp_add(upsampling_perform_linear, 5, x, in, out, outsize/insize, insize); --- 219,223 ---- t_freebytes(x->buffer, x->bufsize*sizeof(*x->buffer)); x->bufsize = 1; ! x->buffer = (t_float *)t_getbytes(x->bufsize*sizeof(*x->buffer)); } dsp_add(upsampling_perform_linear, 5, x, in, out, outsize/insize, insize);
Index: d_filter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_filter.c,v retrieving revision 1.3.4.3.2.3 retrieving revision 1.3.4.3.2.4 diff -C2 -d -r1.3.4.3.2.3 -r1.3.4.3.2.4 *** d_filter.c 2 Aug 2005 21:25:03 -0000 1.3.4.3.2.3 --- d_filter.c 28 Oct 2005 11:34:14 -0000 1.3.4.3.2.4 *************** *** 66,72 **** for (i = 0; i < n; i++) { ! float new = *in++ + coef * last; ! *out++ = new - last; ! last = new; } if (PD_BIGORSMALL(last)) --- 66,72 ---- for (i = 0; i < n; i++) { ! float noo = *in++ + coef * last; ! *out++ = noo - last; ! last = noo; } if (PD_BIGORSMALL(last))
Index: d_ugen.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_ugen.c,v retrieving revision 1.3.4.1.2.2 retrieving revision 1.3.4.1.2.3 diff -C2 -d -r1.3.4.1.2.2 -r1.3.4.1.2.3 *** d_ugen.c 22 Aug 2005 16:28:25 -0000 1.3.4.1.2.2 --- d_ugen.c 28 Oct 2005 11:34:14 -0000 1.3.4.1.2.3 *************** *** 291,295 **** va_list ap;
! dsp_chain = t_resizebytes(dsp_chain, dsp_chainsize * sizeof (t_int), newsize * sizeof (t_int)); dsp_chain[dsp_chainsize-1] = (t_int)f; --- 291,295 ---- va_list ap;
! dsp_chain = (t_int *)t_resizebytes(dsp_chain, dsp_chainsize * sizeof (t_int), newsize * sizeof (t_int)); dsp_chain[dsp_chainsize-1] = (t_int)f; *************** *** 307,311 **** int newsize = dsp_chainsize + n+1, i;
! dsp_chain = t_resizebytes(dsp_chain, dsp_chainsize * sizeof (t_int), newsize * sizeof (t_int)); dsp_chain[dsp_chainsize-1] = (t_int)f; --- 307,311 ---- int newsize = dsp_chainsize + n+1, i;
! dsp_chain = (t_int *)t_resizebytes(dsp_chain, dsp_chainsize * sizeof (t_int), newsize * sizeof (t_int)); dsp_chain[dsp_chainsize-1] = (t_int)f; *************** *** 635,643 **** x->u_obj = obj; x->u_nin = obj_nsiginlets(obj); ! x->u_in = getbytes(x->u_nin * sizeof (*x->u_in)); for (uin = x->u_in, i = x->u_nin; i--; uin++) uin->i_nconnect = 0; x->u_nout = obj_nsigoutlets(obj); ! x->u_out = getbytes(x->u_nout * sizeof (*x->u_out)); for (uout = x->u_out, i = x->u_nout; i--; uout++) uout->o_connections = 0, uout->o_nconnect = 0; --- 635,643 ---- x->u_obj = obj; x->u_nin = obj_nsiginlets(obj); ! x->u_in = (t_siginlet *)getbytes(x->u_nin * sizeof (*x->u_in)); for (uin = x->u_in, i = x->u_nin; i--; uin++) uin->i_nconnect = 0; x->u_nout = obj_nsigoutlets(obj); ! x->u_out = (t_sigoutlet *)getbytes(x->u_nout * sizeof (*x->u_out)); for (uout = x->u_out, i = x->u_nout; i--; uout++) uout->o_connections = 0, uout->o_nconnect = 0; *************** *** 704,708 **** t_siginlet *uin; t_sigoutconnect *oc, *oc2; ! t_class *class = pd_class(&u->u_obj->ob_pd); int i, n; /* suppress creating new signals for the outputs of signal --- 704,708 ---- t_siginlet *uin; t_sigoutconnect *oc, *oc2; ! t_class *klass = pd_class(&u->u_obj->ob_pd); int i, n; /* suppress creating new signals for the outputs of signal *************** *** 711,726 **** we delay new signal creation, which will be handled by calling signal_setborrowed in the ugen_done_graph routine below. */ ! int nonewsigs = (class == canvas_class || ! (class == vinlet_class) && !(dc->dc_reblock)); /* when we encounter a subcanvas or a signal outlet, suppress freeing the input signals as they may be "borrowed" for the super or sub patch; same exception as above, but also if we're "switched" we have to do a copy rather than a borrow. */ ! int nofreesigs = (class == canvas_class || ! (class == voutlet_class) && !(dc->dc_reblock || dc->dc_switched)); t_signal **insig, **outsig, **sig, *s1, *s2, *s3; t_ugenbox *u2;
! if (ugen_loud) post("doit %s %d %d", class_getname(class), nofreesigs, nonewsigs); for (i = 0, uin = u->u_in; i < u->u_nin; i++, uin++) --- 711,725 ---- we delay new signal creation, which will be handled by calling signal_setborrowed in the ugen_done_graph routine below. */ ! int nonewsigs = klass==canvas_class || klass==vinlet_class && !dc->dc_reblock; /* when we encounter a subcanvas or a signal outlet, suppress freeing the input signals as they may be "borrowed" for the super or sub patch; same exception as above, but also if we're "switched" we have to do a copy rather than a borrow. */ ! int nofreesigs = klass==canvas_class || klass==voutlet_class && ! !(dc->dc_reblock || dc->dc_switched); t_signal **insig, **outsig, **sig, *s1, *s2, *s3; t_ugenbox *u2;
! if (ugen_loud) post("doit %s %d %d", class_getname(klass), nofreesigs, nonewsigs); for (i = 0, uin = u->u_in; i < u->u_nin; i++, uin++)
Index: d_ctl.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_ctl.c,v retrieving revision 1.3.4.12 retrieving revision 1.3.4.12.2.1 diff -C2 -d -r1.3.4.12 -r1.3.4.12.2.1 *** d_ctl.c 10 Feb 2005 21:54:49 -0000 1.3.4.12 --- d_ctl.c 28 Oct 2005 11:34:14 -0000 1.3.4.12.2.1 *************** *** 303,307 **** x->x_ticksleft = x->x_retarget = 0; x->x_value = x->x_target = x->x_inletvalue = x->x_inletwas = 0; ! x->x_slopes = getalignedbytes(4*sizeof(t_float)); return (x); } --- 303,307 ---- x->x_ticksleft = x->x_retarget = 0; x->x_value = x->x_target = x->x_inletvalue = x->x_inletwas = 0; ! x->x_slopes = (t_float *)getalignedbytes(4*sizeof(t_float)); return (x); } *************** *** 656,661 **** { t_object x_obj; /* header */ ! void *x_outlet; /* a "float" outlet */ ! void *x_clock; /* a "clock" object */ float *x_buf; /* a Hanning window */ int x_phase; /* number of points since last output */ --- 656,661 ---- { t_object x_obj; /* header */ ! t_outlet *x_outlet; /* a "float" outlet */ ! t_clock *x_clock; /* a "clock" object */ float *x_buf; /* a Hanning window */ int x_phase; /* number of points since last output */ *************** *** 683,687 **** if (period < npoints / MAXOVERLAP + 1) period = npoints / MAXOVERLAP + 1; ! if (!(buf = getalignedbytes(sizeof(float) * (npoints + MAXVSTAKEN)))) { error("env: couldn't allocate buffer"); --- 683,687 ---- if (period < npoints / MAXOVERLAP + 1) period = npoints / MAXOVERLAP + 1; ! if (!(buf = (float *)getalignedbytes(sizeof(float) * (npoints + MAXVSTAKEN)))) { error("env: couldn't allocate buffer");