Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7827
Modified Files: Tag: devel_0_39 m_class.c Log Message: oops in class_setfieldnames
Index: m_class.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_class.c,v retrieving revision 1.3.4.7.2.2 retrieving revision 1.3.4.7.2.3 diff -C2 -d -r1.3.4.7.2.2 -r1.3.4.7.2.3 *** m_class.c 6 Oct 2005 06:58:45 -0000 1.3.4.7.2.2 --- m_class.c 6 Oct 2005 10:15:46 -0000 1.3.4.7.2.3 *************** *** 931,934 **** --- 931,935 ----
/* ---------------------------------------------------------------- */ + /* desiredata-specific stuff */
/* must be called only once */ *************** *** 936,941 **** char foo[64]; while (*s) { ! int i = strchr(s,' '); ! if (i<0) return; memcpy(foo,s,i); foo[i]=0; --- 937,943 ---- char foo[64]; while (*s) { ! char *t = strchr(s,' '); ! int i = t-s; ! if (!t) return; memcpy(foo,s,i); foo[i]=0; *************** *** 944,945 **** --- 946,955 ---- } } + + int class_getfieldindex(t_class *x, const char *s) { + t_symbol *sy = gensym((char *)s); + int i; + for (i=0; i<x->c_nfields; i++) if (x->c_fields[i]==sy) return i; + return -1; + } +