Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32053
Modified Files: Tag: devel_0_39 m_binbuf.c m_class.c m_sched.c Log Message: C++ support
Index: m_class.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_class.c,v retrieving revision 1.3.4.7.2.5 retrieving revision 1.3.4.7.2.6 diff -C2 -d -r1.3.4.7.2.5 -r1.3.4.7.2.6 *** m_class.c 22 Oct 2005 19:51:24 -0000 1.3.4.7.2.5 --- m_class.c 28 Oct 2005 12:18:23 -0000 1.3.4.7.2.6 *************** *** 221,225 **** c->c_name = c->c_helpname = s; c->c_size = size; ! c->c_methods = t_getbytes(0); c->c_nmethod = 0; c->c_freemethod = (t_method)freemethod; --- 221,225 ---- c->c_name = c->c_helpname = s; c->c_size = size; ! c->c_methods = (t_methodentry *)t_getbytes(0); c->c_nmethod = 0; c->c_freemethod = (t_method)freemethod; *************** *** 235,239 **** c->c_firsttip = gensym("?"); #ifdef DESIRE ! c->c_fields = malloc(sizeof(t_symbol *)*31); c->c_nfields = 0; #endif --- 235,239 ---- c->c_firsttip = gensym("?"); #ifdef DESIRE ! c->c_fields = (t_symbol **)malloc(sizeof(t_symbol *)*31); c->c_nfields = 0; #endif *************** *** 351,355 **** else { ! c->c_methods = t_resizebytes(c->c_methods, c->c_nmethod * sizeof(*c->c_methods), (c->c_nmethod + 1) * sizeof(*c->c_methods)); --- 351,355 ---- else { ! c->c_methods = (t_methodentry *)t_resizebytes(c->c_methods, c->c_nmethod * sizeof(*c->c_methods), (c->c_nmethod + 1) * sizeof(*c->c_methods)); *************** *** 581,585 **** { sym2 = (t_symbol *)t_getbytes(sizeof(*sym2)); ! sym2->s_name = t_getbytes(length+1); sym2->s_next = 0; sym2->s_thing = 0; --- 581,585 ---- { sym2 = (t_symbol *)t_getbytes(sizeof(*sym2)); ! sym2->s_name = (char *)t_getbytes(length+1); sym2->s_next = 0; sym2->s_thing = 0; *************** *** 631,635 **** { tryingalready = 1; ! typedmess(dummy, s, argc, argv); tryingalready = 0; return; --- 631,635 ---- { tryingalready = 1; ! typedmess((t_pd *)dummy, s, argc, argv); tryingalready = 0; return;
Index: m_binbuf.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_binbuf.c,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.1.2.1 diff -C2 -d -r1.4.4.1 -r1.4.4.1.2.1 *** m_binbuf.c 5 Nov 2004 13:57:56 -0000 1.4.4.1 --- m_binbuf.c 28 Oct 2005 12:18:23 -0000 1.4.4.1.2.1 *************** *** 35,39 **** t_binbuf *x = (t_binbuf *)t_getbytes(sizeof(*x)); x->b_n = 0; ! x->b_vec = t_getbytes(0); return (x); } --- 35,39 ---- t_binbuf *x = (t_binbuf *)t_getbytes(sizeof(*x)); x->b_n = 0; ! x->b_vec = (t_atom *)t_getbytes(0); return (x); } *************** *** 49,53 **** t_binbuf *x = (t_binbuf *)t_getbytes(sizeof(*x)); x->b_n = y->b_n; ! x->b_vec = t_getbytes(x->b_n * sizeof(*x->b_vec)); memcpy(x->b_vec, y->b_vec, x->b_n * sizeof(*x->b_vec)); return (x); --- 49,53 ---- t_binbuf *x = (t_binbuf *)t_getbytes(sizeof(*x)); x->b_n = y->b_n; ! x->b_vec = (t_atom *)t_getbytes(x->b_n * sizeof(*x->b_vec)); memcpy(x->b_vec, y->b_vec, x->b_n * sizeof(*x->b_vec)); return (x); *************** *** 56,60 **** void binbuf_clear(t_binbuf *x) { ! x->b_vec = t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), 0); x->b_n = 0; } --- 56,60 ---- void binbuf_clear(t_binbuf *x) { ! x->b_vec = (t_atom *)t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), 0); x->b_n = 0; } *************** *** 73,77 ****
t_freebytes(x->b_vec, x->b_n * sizeof(*x->b_vec)); ! x->b_vec = t_getbytes(nalloc * sizeof(*x->b_vec)); ap = x->b_vec; x->b_n = 0; --- 73,77 ----
t_freebytes(x->b_vec, x->b_n * sizeof(*x->b_vec)); ! x->b_vec = (t_atom *)t_getbytes(nalloc * sizeof(*x->b_vec)); ap = x->b_vec; x->b_n = 0; *************** *** 198,202 **** if (natom == nalloc) { ! x->b_vec = t_resizebytes(x->b_vec, nalloc * sizeof(*x->b_vec), nalloc * (2*sizeof(*x->b_vec))); nalloc = nalloc * 2; --- 198,202 ---- if (natom == nalloc) { ! x->b_vec = (t_atom *)t_resizebytes(x->b_vec, nalloc * sizeof(*x->b_vec), nalloc * (2*sizeof(*x->b_vec))); nalloc = nalloc * 2; *************** *** 206,210 **** } /* reallocate the vector to exactly the right size */ ! x->b_vec = t_resizebytes(x->b_vec, nalloc * sizeof(*x->b_vec), natom * sizeof(*x->b_vec)); x->b_n = natom; --- 206,210 ---- } /* reallocate the vector to exactly the right size */ ! x->b_vec = (t_atom *)t_resizebytes(x->b_vec, nalloc * sizeof(*x->b_vec), natom * sizeof(*x->b_vec)); x->b_n = natom; *************** *** 214,218 **** void binbuf_gettext(t_binbuf *x, char **bufp, int *lengthp) { ! char *buf = getbytes(0), *newbuf; int length = 0; char string[MAXPDSTRING]; --- 214,218 ---- void binbuf_gettext(t_binbuf *x, char **bufp, int *lengthp) { ! char *buf = (char *)getbytes(0), *newbuf; int length = 0; char string[MAXPDSTRING]; *************** *** 227,231 **** atom_string(ap, string, MAXPDSTRING); newlength = length + strlen(string) + 1; ! if (!(newbuf = resizebytes(buf, length, newlength))) break; buf = newbuf; strcpy(buf + length, string); --- 227,231 ---- atom_string(ap, string, MAXPDSTRING); newlength = length + strlen(string) + 1; ! if (!(newbuf = (char *)resizebytes(buf, length, newlength))) break; buf = newbuf; strcpy(buf + length, string); *************** *** 236,240 **** if (length && buf[length-1] == ' ') { ! if (newbuf = t_resizebytes(buf, length, length-1)) { buf = newbuf; --- 236,240 ---- if (length && buf[length-1] == ' ') { ! if (newbuf = (char *)t_resizebytes(buf, length, length-1)) { buf = newbuf; *************** *** 253,257 **** int newsize = x->b_n + argc, i; t_atom *ap; ! if (ap = t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), newsize * sizeof(*x->b_vec))) x->b_vec = ap; --- 253,257 ---- int newsize = x->b_n + argc, i; t_atom *ap; ! if (ap = (t_atom *)t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), newsize * sizeof(*x->b_vec))) x->b_vec = ap; *************** *** 363,367 **** int newsize = x->b_n + argc, i; t_atom *ap; ! if (ap = t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), newsize * sizeof(*x->b_vec))) x->b_vec = ap; --- 363,367 ---- int newsize = x->b_n + argc, i; t_atom *ap; ! if (ap = (t_atom *)t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec), newsize * sizeof(*x->b_vec))) x->b_vec = ap; *************** *** 503,506 **** --- 503,512 ---- } else s = atom_getsymbol(at); + /* IMPD: allows messages to unbound objects, via pointers */ + /* target = s->s_thing; + if (!target) { + if (!sscanf(s->s_name,".x%x",&target)) target=0; + } + */ if (!(target = s->s_thing)) { *************** *** 652,656 **** } if ((length = lseek(fd, 0, SEEK_END)) < 0 || lseek(fd, 0, SEEK_SET) < 0 ! || !(buf = t_getbytes(length))) { fprintf(stderr, "lseek: "); --- 658,662 ---- } if ((length = lseek(fd, 0, SEEK_END)) < 0 || lseek(fd, 0, SEEK_SET) < 0 ! || !(buf = (char *)t_getbytes(length))) { fprintf(stderr, "lseek: "); *************** *** 919,923 **** { SETSYMBOL(outmess, gensym("#X")); ! SETSYMBOL(outmess + 1, gensym( (strcmp(second, "message") ? "text" : "msg"))); outmess[2] = nextmess[2]; --- 925,929 ---- { SETSYMBOL(outmess, gensym("#X")); ! SETSYMBOL(outmess + 1, gensym((char *) (strcmp(second, "message") ? "text" : "msg"))); outmess[2] = nextmess[2]; *************** *** 981,985 **** atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), ! gensym((natom > 5 ? "inlet~" : "inlet"))); nobj++; } --- 987,991 ---- atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), ! gensym((char *)(natom > 5 ? "inlet~" : "inlet"))); nobj++; } *************** *** 990,994 **** atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), ! gensym((natom > 5 ? "outlet~" : "outlet"))); nobj++; } --- 996,1000 ---- atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), ! gensym((char *)(natom > 5 ? "outlet~" : "outlet"))); nobj++; } *************** *** 1124,1128 **** { SETSYMBOL(outmess, gensym("#P")); ! SETSYMBOL(outmess + 1, gensym( (strcmp(second, "msg") ? "comment" : "message"))); outmess[2] = nextmess[2]; --- 1130,1134 ---- { SETSYMBOL(outmess, gensym("#P")); ! SETSYMBOL(outmess + 1, gensym((char *) (strcmp(second, "msg") ? "comment" : "message"))); outmess[2] = nextmess[2];
Index: m_sched.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v retrieving revision 1.5.4.35.2.5 retrieving revision 1.5.4.35.2.6 diff -C2 -d -r1.5.4.35.2.5 -r1.5.4.35.2.6 *** m_sched.c 16 Jul 2005 11:02:37 -0000 1.5.4.35.2.5 --- m_sched.c 28 Oct 2005 12:18:23 -0000 1.5.4.35.2.6 *************** *** 746,761 **** void sys_callback(t_int (*callback) (t_int* argv), t_int* argv, t_int argc) { ! t_sched_callback* new = (t_sched_callback*) getbytes (sizeof(t_sched_callback));
! new->function = callback; ! new->argv = (t_int*) copybytes (argv, argc * sizeof (t_int)); ! new->argc = argc; ! new->next = NULL;
if (callback_fifo == NULL) callback_fifo = fifo_init(); ! fifo_put(callback_fifo, new); }
--- 746,761 ---- void sys_callback(t_int (*callback) (t_int* argv), t_int* argv, t_int argc) { ! t_sched_callback* noo = (t_sched_callback*) getbytes (sizeof(t_sched_callback));
! noo->function = callback; ! noo->argv = (t_int*) copybytes (argv, argc * sizeof (t_int)); ! noo->argc = argc; ! noo->next = NULL;
if (callback_fifo == NULL) callback_fifo = fifo_init(); ! fifo_put(callback_fifo, noo); }