Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4751
Modified Files: Tag: desiredata builtins.c Log Message: removing some MAXPDSTRING
Index: builtins.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v retrieving revision 1.1.2.17 retrieving revision 1.1.2.18 diff -C2 -d -r1.1.2.17 -r1.1.2.18 *** builtins.c 28 Jun 2007 05:24:18 -0000 1.1.2.17 --- builtins.c 28 Jun 2007 07:10:42 -0000 1.1.2.18 *************** *** 9,12 **** --- 9,13 ---- #include "s_stuff.h" #include <stdlib.h> + #include <stdarg.h> #include <math.h> #include <stdio.h> *************** *** 1931,1943 **** return x; } static void makefilename_float(t_makefilename *x, t_floatarg f) { ! char buf[MAXPDSTRING]; ! sprintf(buf, x->format->name, (int)f); outlet_symbol(x->outlet, gensym(buf)); } static void makefilename_symbol(t_makefilename *x, t_symbol *s) { ! char buf[MAXPDSTRING]; ! sprintf(buf, x->format->name, s->name); outlet_symbol(x->outlet, gensym(buf)); }
--- 1932,1961 ---- return x; } + + /* untested */ + /* + extern "C" char *masprintf (const char *s, ...) { + va_list args; + va_start(args,s); + int n = vsnprintf(0,0,s,args); + va_end(args); + char *buf = (char *)malloc(n+1); + va_start(args,s); + vsnprintf(buf,n+1,s,args); + va_end(args); + return buf; + } + */ + + /* doesn't do any typechecking or even counting the % signs properly */ static void makefilename_float(t_makefilename *x, t_floatarg f) { ! char *buf; asprintf(&buf, x->format->name, (int)f); outlet_symbol(x->outlet, gensym(buf)); + free(buf); } static void makefilename_symbol(t_makefilename *x, t_symbol *s) { ! char *buf; asprintf(&buf, x->format->name, s->name); outlet_symbol(x->outlet, gensym(buf)); + free(buf); }