Index: apps/plugins/pdbox/PDa/src/d_ugen.c =================================================================== --- apps/plugins/pdbox/PDa/src/d_ugen.c (revision 21272) +++ apps/plugins/pdbox/PDa/src/d_ugen.c (working copy) @@ -21,11 +21,17 @@ * */ - +#ifdef ROCKBOX +#include "plugin.h" +#include "pdbox.h" #include "m_pd.h" #include "m_imp.h" +#else /* ROCKBOX */ +#include "m_pd.h" +#include "m_imp.h" #include #include +#endif /* ROCKBOX */ extern t_class *vinlet_class, *voutlet_class, *canvas_class; t_sample *obj_findsignalscalar(t_object *x, int m); @@ -258,6 +264,10 @@ static void block_dsp(t_block *x, t_signal **sp) { +#ifdef ROCKBOX + (void) x; + (void) sp; +#endif /* do nothing here */ } @@ -330,9 +340,13 @@ /* call this when DSP is stopped to free all the signals */ void signal_cleanup(void) { +#ifdef ROCKBOX + t_signal *sig; +#else t_signal **svec, *sig, *sig2; +#endif int i; - while (sig = signal_usedlist) + while((sig = signal_usedlist)) { signal_usedlist = sig->s_nextused; if (!sig->s_isborrowed) @@ -397,9 +411,15 @@ t_signal *signal_new(int n, float sr) { +#ifdef ROCKBOX + int logn; +#else int logn, n2; +#endif t_signal *ret, **whichlist; +#ifndef ROCKBOX t_sample *fp; +#endif logn = ilog2(n); if (n) { @@ -413,7 +433,7 @@ whichlist = &signal_freeborrowed; /* first try to reclaim one from the free list */ - if (ret = *whichlist) + if((ret = *whichlist)) *whichlist = ret->s_nextfree; else { @@ -520,8 +540,10 @@ void ugen_stop(void) { +#ifndef ROCKBOX t_signal *s; int i; +#endif if (dsp_chain) { freebytes(dsp_chain, dsp_chainsize * sizeof (t_int)); @@ -577,8 +599,10 @@ int ninlets, int noutlets) { t_dspcontext *dc = (t_dspcontext *)getbytes(sizeof(*dc)); +#ifndef ROCKBOX float parent_srate, srate; int parent_vecsize, vecsize; +#endif if (ugen_loud) post("ugen_start_graph..."); @@ -672,7 +696,11 @@ { t_sigoutlet *uout; t_siginlet *uin; +#ifdef ROCKBOX + t_sigoutconnect *oc; +#else t_sigoutconnect *oc, *oc2; +#endif t_class *class = pd_class(&u->u_obj->ob_pd); int i, n; /* suppress creating new signals for the outputs of signal @@ -681,13 +709,13 @@ 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)); + ((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)); + ((class == voutlet_class) && !(dc->dc_reblock || dc->dc_switched))); t_signal **insig, **outsig, **sig, *s1, *s2, *s3; t_ugenbox *u2; @@ -701,7 +729,7 @@ s3 = signal_new(dc->dc_vecsize, dc->dc_srate); /* post("%s: unconnected signal inlet set to zero", class_getname(u->u_obj->ob_pd)); */ - if (scalar = obj_findsignalscalar(u->u_obj, i)) + if((scalar = obj_findsignalscalar(u->u_obj, i))) dsp_add_scalarcopy(scalar, s3->s_vec, s3->s_n); else dsp_add_zero(s3->s_vec, s3->s_n); @@ -781,7 +809,7 @@ u2 = oc->oc_who; uin = &u2->u_in[oc->oc_inno]; /* if there's already someone here, sum the two */ - if (s2 = uin->i_signal) + if((s2 = uin->i_signal)) { s1->s_refcount--; s2->s_refcount--; @@ -825,7 +853,11 @@ void ugen_done_graph(t_dspcontext *dc) { +#ifdef ROCKBOX + t_ugenbox *u; +#else t_ugenbox *u, *u2; +#endif t_sigoutlet *uout; t_siginlet *uin; t_sigoutconnect *oc, *oc2; @@ -966,7 +998,11 @@ for (u = dc->dc_ugenlist; u; u = u->u_next) { t_pd *zz = &u->u_obj->ob_pd; +#ifdef ROCKBOX + t_signal **outsigs = dc->dc_iosigs; +#else t_signal **insigs = dc->dc_iosigs, **outsigs = dc->dc_iosigs; +#endif if (outsigs) outsigs += dc->dc_ninlets; if (pd_class(zz) == vinlet_class)