Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28235
Modified Files: Tag: desiredata m_obj.c Log Message: a bit more condensation
Index: m_obj.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_obj.c,v retrieving revision 1.2.4.3.2.10.2.5 retrieving revision 1.2.4.3.2.10.2.6 diff -C2 -d -r1.2.4.3.2.10.2.5 -r1.2.4.3.2.10.2.6 *** m_obj.c 13 Dec 2006 03:39:22 -0000 1.2.4.3.2.10.2.5 --- m_obj.c 13 Dec 2006 04:27:55 -0000 1.2.4.3.2.10.2.6 *************** *** 482,554 ****
int obj_nsiginlets(t_object *x) { ! int n; ! t_inlet *i; ! for (i = x->ob_inlet, n = 0; i; i = i->i_next) ! if (i->i_symfrom == &s_signal) n++; if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin) n++; ! return (n); }
/* get the index, among signal inlets, of the mth inlet overall */ ! int obj_siginletindex(t_object *x, int m) ! { ! int n = 0; ! t_inlet *i; ! if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin) ! { ! if (!m--) return (0); ! n++; } ! for (i = x->ob_inlet; i; i = i->i_next, m--) ! if (i->i_symfrom == &s_signal) ! { ! if (m == 0) return (n); ! n++; } ! return (-1); } ! ! int obj_issignalinlet(t_object *x, int m) ! { ! t_inlet *i; ! if (x->ob_pd->c_firstin) ! { ! if (!m) ! return (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin); ! else m--; } ! for (i = x->ob_inlet; i && m; i = i->i_next, m--) ! ; ! return (i && (i->i_symfrom == &s_signal)); ! } ! ! int obj_nsigoutlets(t_object *x) ! { ! int n; ! t_outlet *o; ! for (o = x->ob_outlet, n = 0; o; o = o->o_next) ! if (o->o_sym == &s_signal) n++; ! return (n); }
! int obj_sigoutletindex(t_object *x, int m) ! { ! int n; ! t_outlet *o2; ! for (o2 = x->ob_outlet, n = 0; o2; o2 = o2->o_next, m--) ! if (o2->o_sym == &s_signal) ! { ! if (m == 0) return (n); ! n++; } ! return (-1); } ! ! int obj_issignaloutlet(t_object *x, int m) ! { ! int n; t_outlet *o2; ! for (o2 = x->ob_outlet, n = 0; o2 && m--; o2 = o2->o_next); ! return (o2 && (o2->o_sym == &s_signal)); }
--- 482,528 ----
int obj_nsiginlets(t_object *x) { ! int n; t_inlet *i; ! for (i = x->ob_inlet, n = 0; i; i = i->i_next) if (i->i_symfrom == &s_signal) n++; if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin) n++; ! return n; ! } ! int obj_nsigoutlets(t_object *x) { ! int n; t_outlet *o; ! for (o = x->ob_outlet, n = 0; o; o = o->o_next) if (o->o_sym == &s_signal) n++; ! return n; }
/* get the index, among signal inlets, of the mth inlet overall */ ! int obj_siginletindex(t_object *x, int m) { ! int n=0; t_inlet *i; ! if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin) { ! if (!m--) return 0; else n++; } ! for (i = x->ob_inlet; i; i = i->i_next, m--) if (i->i_symfrom == &s_signal) { ! if (!m) return n; else n++; } ! return -1; } ! int obj_sigoutletindex(t_object *x, int m) { ! int n=0; t_outlet *o2; ! for (o2 = x->ob_outlet; o2; o2 = o2->o_next, m--) if (o2->o_sym == &s_signal) { ! if (m == 0) return n; else n++; } ! return -1; }
! int obj_issignalinlet(t_object *x, int m) { ! t_inlet *i; ! if (x->ob_pd->c_firstin) { ! if (!m) return x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin; ! else m--; } ! for (i = x->ob_inlet; i && m; i = i->i_next, m--) {} ! return i && i->i_symfrom==&s_signal; } ! int obj_issignaloutlet(t_object *x, int m) { t_outlet *o2; ! for (o2 = x->ob_outlet; o2 && m--; o2 = o2->o_next) {} ! return o2 && o2->o_sym==&s_signal; }
*************** *** 576,594 **** /* and these are only used in g_io.c... */
! int inlet_getsignalindex(t_inlet *x) ! { ! int n = 0; ! t_inlet *i; ! for (i = x->i_owner->ob_inlet, n = 0; i && i != x; i = i->i_next) ! if (i->i_symfrom == &s_signal) n++; ! return (n); } ! ! int outlet_getsignalindex(t_outlet *x) ! { ! int n = 0; ! t_outlet *o; ! for (o = x->o_owner->ob_outlet, n = 0; o && o != x; o = o->o_next) ! if (o->o_sym == &s_signal) n++; ! return (n); } --- 550,561 ---- /* and these are only used in g_io.c... */
! int inlet_getsignalindex(t_inlet *x) { ! int n=0; t_inlet *i; ! for (i = x->i_owner->ob_inlet, n = 0; i && i != x; i = i->i_next) if (i->i_symfrom == &s_signal) n++; ! return n; } ! int outlet_getsignalindex(t_outlet *x) { ! int n=0; t_outlet *o; ! for (o = x->o_owner->ob_outlet, n = 0; o && o != x; o = o->o_next) if (o->o_sym == &s_signal) n++; ! return n; }