Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1:/tmp/cvs-serv26673
Modified Files: Tag: devel_0_37 d_math.c Log Message: fixed typo and changed clip~ perform function
Index: d_math.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_math.c,v retrieving revision 1.1.1.1.16.1 retrieving revision 1.1.1.1.16.2 diff -C2 -d -r1.1.1.1.16.1 -r1.1.1.1.16.2 *** d_math.c 28 Dec 2003 12:32:03 -0000 1.1.1.1.16.1 --- d_math.c 28 Dec 2003 14:22:10 -0000 1.1.1.1.16.2 *************** *** 37,54 **** }
static t_int *clip_perform(t_int *w) { ! t_clip *x = (t_clip *)(w[1]); ! t_float *in = (t_float *)(w[2]); ! t_float *out = (t_float *)(w[3]); ! int n = (int)(w[4]); while (n--) { float f = *in++; ! if (f < x->x_lo) f = x->x_lo; ! if (f > x->x_hi) f = x->x_hi; *out++ = f; } ! return (w+5); }
--- 37,55 ---- }
+ /* T.Grill - changed function interface so that class pointer needn't be passed */ static t_int *clip_perform(t_int *w) { ! t_float *in = (t_float *)(w[1]); ! t_float *out = (t_float *)(w[2]); ! const t_float lo = *(t_float *)(w[3]),hi = *(t_float *)(w[4]); ! int n = (int)(w[5]); while (n--) { float f = *in++; ! if (f < lo) f = lo; ! if (f > hi) f = hi; *out++ = f; } ! return (w+6); }
*************** *** 56,62 **** { if(SIMD_CHECK2(sp[0]->s_n,sp[0]->s_vec,sp[1]->s_vec)) ! dsp_add(clip_perf_simd, 3, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); else ! dsp_add(clip_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); }
--- 57,63 ---- { if(SIMD_CHECK2(sp[0]->s_n,sp[0]->s_vec,sp[1]->s_vec)) ! dsp_add(clip_perf_simd, 5, sp[0]->s_vec, sp[1]->s_vec, &x->x_lo, &x->x_hi, sp[0]->s_n); else ! dsp_add(clip_perform, 5, sp[0]->s_vec, sp[1]->s_vec, &x->x_lo, &x->x_hi, sp[0]->s_n); }