Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10684
Modified Files: Tag: desiredata kernel.c Log Message: remove ob_ prefixes
Index: kernel.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/kernel.c,v retrieving revision 1.1.2.47 retrieving revision 1.1.2.48 diff -C2 -d -r1.1.2.47 -r1.1.2.48 *** kernel.c 10 Jul 2007 16:48:25 -0000 1.1.2.47 --- kernel.c 11 Jul 2007 19:04:50 -0000 1.1.2.48 *************** *** 304,309 **** if (c->gobj) ((t_gobj *)x)->g_adix = appendix_new((t_gobj *)x); if (c->patchable) { ! ((t_object *)x)->ob_inlet = 0; ! ((t_object *)x)->ob_outlet = 0; } return x; --- 304,309 ---- if (c->gobj) ((t_gobj *)x)->g_adix = appendix_new((t_gobj *)x); if (c->patchable) { ! ((t_object *)x)->inlet = 0; ! ((t_object *)x)->outlet = 0; } return x; *************** *** 322,328 **** if (c->patchable) { t_object *y = (t_object *)x; ! while (y->ob_outlet) outlet_free(y->ob_outlet); ! while (y->ob_inlet) inlet_free(y->ob_inlet); ! if (y->ob_binbuf) binbuf_free(y->ob_binbuf); } /* schedule for deletion if need to keep the allocation around */ --- 322,328 ---- if (c->patchable) { t_object *y = (t_object *)x; ! while (y->outlet) outlet_free(y->outlet); ! while (y->inlet) inlet_free(y->inlet); ! if (y->binbuf) binbuf_free(y->binbuf); } /* schedule for deletion if need to keep the allocation around */ *************** *** 520,528 ****
static void object_append_inlet(t_object *owner, t_inlet *x) { ! t_inlet *y = owner->ob_inlet, *y2; if (y) { while ((y2 = y->next)) y = y2; y->next = x; ! } else owner->ob_inlet = x; }
--- 520,528 ----
static void object_append_inlet(t_object *owner, t_inlet *x) { ! t_inlet *y = owner->inlet, *y2; if (y) { while ((y2 = y->next)) y = y2; y->next = x; ! } else owner->inlet = x; }
*************** *** 599,604 **** t_object *y = x->owner; t_inlet *x2; ! if (y->ob_inlet == x) y->ob_inlet = x->next; ! else for (x2 = y->ob_inlet; x2; x2 = x2->next) if (x2->next == x) { x2->next = x->next; break; --- 599,604 ---- t_object *y = x->owner; t_inlet *x2; ! if (y->inlet == x) y->inlet = x->next; ! else for (x2 = y->inlet; x2; x2 = x2->next) if (x2->next == x) { x2->next = x->next; break; *************** *** 647,651 **** t_atom *ap; int count; ! t_inlet *ip = ((t_object *)x)->ob_inlet; if (!argc) return; for (count = argc-1, ap = argv+1; ip && count--; ap++, ip = ip->next) { --- 647,651 ---- t_atom *ap; int count; ! t_inlet *ip = ((t_object *)x)->inlet; if (!argc) return; for (count = argc-1, ap = argv+1; ip && count--; ap++, ip = ip->next) { *************** *** 716,724 **** x->owner = owner; x->next = 0; ! y = owner->ob_outlet; if (y) { while ((y2 = y->next)) y = y2; y->next = x; ! } else owner->ob_outlet = x; x->connections = 0; x->sym = s; --- 716,724 ---- x->owner = owner; x->next = 0; ! y = owner->outlet; if (y) { while ((y2 = y->next)) y = y2; y->next = x; ! } else owner->outlet = x; x->connections = 0; x->sym = s; *************** *** 754,759 **** void outlet_free(t_outlet *x) { t_object *y = x->owner; ! if (y->ob_outlet == x) y->ob_outlet = x->next; ! else for (t_outlet *x2 = y->ob_outlet; x2; x2 = x2->next) if (x2->next == x) { x2->next = x->next; break; --- 754,759 ---- void outlet_free(t_outlet *x) { t_object *y = x->owner; ! if (y->outlet == x) y->outlet = x->next; ! else for (t_outlet *x2 = y->outlet; x2; x2 = x2->next) if (x2->next == x) { x2->next = x->next; break; *************** *** 762,770 **** }
! #define each_inlet(i,obj) for ( t_inlet *i=obj->ob_inlet; i; i=i->next) ! #define each_outlet(o,obj) for (t_outlet *o=obj->ob_outlet; o; o=o->next)
static t_pd *find_inlet(t_object *to, int inlet) { ! if (to->ob_pd->firstin) {if (inlet) inlet--; else return (t_pd *)to;} each_inlet(i,to) if (inlet) inlet--; else return (t_pd *)i; return 0; --- 762,770 ---- }
! #define each_inlet(i,obj) for ( t_inlet *i=obj->inlet; i; i=i->next) ! #define each_outlet(o,obj) for (t_outlet *o=obj->outlet; o; o=o->next)
static t_pd *find_inlet(t_object *to, int inlet) { ! if (to->_class->firstin) {if (inlet) inlet--; else return (t_pd *)to;} each_inlet(i,to) if (inlet) inlet--; else return (t_pd *)i; return 0; *************** *** 827,831 ****
int obj_ninlets(t_object *x) { ! int n=!!x->ob_pd->firstin; each_inlet(i,x) n++; return n; --- 827,831 ----
int obj_ninlets(t_object *x) { ! int n=!!x->_class->firstin; each_inlet(i,x) n++; return n; *************** *** 833,837 ****
t_outconnect *obj_starttraverseoutlet(t_object *x, t_outlet **op, int nout) { ! t_outlet *o = x->ob_outlet; while (nout-- && o) o = o->next; *op = o; --- 833,837 ----
t_outconnect *obj_starttraverseoutlet(t_object *x, t_outlet **op, int nout) { ! t_outlet *o = x->outlet; while (nout-- && o) o = o->next; *op = o; *************** *** 844,848 **** t_inlet *i = (t_inlet *)y; t_object *dest = i->owner; ! int n = dest->ob_pd->firstin; each_inlet(i2,dest) if (i2==i) break; else n++; *whichp = n; --- 844,848 ---- t_inlet *i = (t_inlet *)y; t_object *dest = i->owner; ! int n = dest->_class->firstin; each_inlet(i2,dest) if (i2==i) break; else n++; *whichp = n; *************** *** 866,883 **** /* this code is not safe with the latest additions in t_outconnect ! */ void obj_moveinletfirst(t_object *x, t_inlet *i) { ! if (x->ob_inlet == i) return; each_inlet(i2,x) if (i2->next == i) { i2->next = i->next; ! i->next = x->ob_inlet; ! x->ob_inlet = i; return; } } void obj_moveoutletfirst(t_object *x, t_outlet *o) { ! if (x->ob_outlet == o) return; each_outlet(o2,x) if (o2->next == o) { o2->next = o->next; ! o->next = x->ob_outlet; ! x->ob_outlet = o; return; } --- 866,883 ---- /* this code is not safe with the latest additions in t_outconnect ! */ void obj_moveinletfirst(t_object *x, t_inlet *i) { ! if (x->inlet == i) return; each_inlet(i2,x) if (i2->next == i) { i2->next = i->next; ! i->next = x->inlet; ! x->inlet = i; return; } } void obj_moveoutletfirst(t_object *x, t_outlet *o) { ! if (x->outlet == o) return; each_outlet(o2,x) if (o2->next == o) { o2->next = o->next; ! o->next = x->outlet; ! x->outlet = o; return; } *************** *** 890,894 **** int n=0; each_inlet(i,x) if (i->symfrom == &s_signal) n++; ! if (x->ob_pd->firstin && x->ob_pd->floatsignalin) n++; return n; } --- 890,894 ---- int n=0; each_inlet(i,x) if (i->symfrom == &s_signal) n++; ! if (x->_class->firstin && x->_class->floatsignalin) n++; return n; } *************** *** 902,906 **** int obj_siginletindex(t_object *x, int m) { int n=0; ! if (x->ob_pd->firstin && x->ob_pd->floatsignalin) { if (!m--) return 0; else n++; } --- 902,906 ---- int obj_siginletindex(t_object *x, int m) { int n=0; ! if (x->_class->firstin && x->_class->floatsignalin) { if (!m--) return 0; else n++; } *************** *** 921,935 ****
int obj_issignalinlet(t_object *x, int m) { ! t_inlet *i; ! if (x->ob_pd->firstin) { ! if (!m) return x->ob_pd->firstin && x->ob_pd->floatsignalin; else m--; } ! for (i = x->ob_inlet; i && m; i = i->next, m--) {} return 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->next) {} return o2 && o2->sym==&s_signal; } --- 921,935 ----
int obj_issignalinlet(t_object *x, int m) { ! if (x->_class->firstin) { ! if (!m) return x->_class->firstin && x->_class->floatsignalin; else m--; } ! t_inlet *i; ! for (i = x->inlet; i && m; i = i->next, m--) {} return i && i->symfrom==&s_signal; } int obj_issignaloutlet(t_object *x, int m) { t_outlet *o2; ! for (o2 = x->outlet; o2 && m--; o2 = o2->next) {} return o2 && o2->sym==&s_signal; } *************** *** 938,946 **** int n = 0; t_inlet *i; ! if (x->ob_pd->firstin && x->ob_pd->floatsignalin) { ! if (!m--) return x->ob_pd->floatsignalin > 0 ? (t_sample *)(((char *)x) + x->ob_pd->floatsignalin) : 0; n++; } ! for (i = x->ob_inlet; i; i = i->next, m--) if (i->symfrom == &s_signal) { if (m == 0) return &i->u.floatsignalvalue; n++; --- 938,946 ---- int n = 0; t_inlet *i; ! if (x->_class->firstin && x->_class->floatsignalin) { ! if (!m--) return x->_class->floatsignalin > 0 ? (t_sample *)(((char *)x) + x->_class->floatsignalin) : 0; n++; } ! for (i = x->inlet; i; i = i->next, m--) if (i->symfrom == &s_signal) { if (m == 0) return &i->u.floatsignalvalue; n++; *************** *** 952,961 **** int inlet_getsignalindex(t_inlet *x) { int n=0; t_inlet *i; ! for (i = x->owner->ob_inlet; i && i != x; i = i->next) if (i->symfrom == &s_signal) n++; return n; } int outlet_getsignalindex(t_outlet *x) { int n=0; t_outlet *o; ! for (o = x->owner->ob_outlet; o && o != x; o = o->next) if (o->sym == &s_signal) n++; return n; } --- 952,961 ---- int inlet_getsignalindex(t_inlet *x) { int n=0; t_inlet *i; ! for (i = x->owner->inlet; i && i != x; i = i->next) if (i->symfrom == &s_signal) n++; return n; } int outlet_getsignalindex(t_outlet *x) { int n=0; t_outlet *o; ! for (o = x->owner->outlet; o && o != x; o = o->next) if (o->sym == &s_signal) n++; return n; }