[PD-cvs] pd/src builtins.c,1.1.2.38,1.1.2.39
Mathieu Bouchard
matju at users.sourceforge.net
Fri Jul 20 06:11:56 CEST 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14829
Modified Files:
Tag: desiredata
builtins.c
Log Message:
removed some MAXPDSTRING
Index: builtins.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v
retrieving revision 1.1.2.38
retrieving revision 1.1.2.39
diff -C2 -d -r1.1.2.38 -r1.1.2.39
*** builtins.c 20 Jul 2007 04:04:26 -0000 1.1.2.38
--- builtins.c 20 Jul 2007 04:11:53 -0000 1.1.2.39
***************
*** 2958,2963 ****
struct t_unpost_frame {
t_unpost *self;
! //ostringstream os;
! char buf[MAXPDSTRING];
};
static t_unpost_frame *current_unpost;
--- 2958,2962 ----
struct t_unpost_frame {
t_unpost *self;
! std::ostringstream buf;
};
static t_unpost_frame *current_unpost;
***************
*** 2971,2988 ****
extern t_printhook sys_printhook;
void unpost_printhook (const char *s) {
! char *b = current_unpost->buf;
! size_t n = strlen(b);
! snprintf(b+n,MAXPDSTRING-n,"%s",s);
! b[MAXPDSTRING-1]=0;
char *p;
for (;;) {
! p = strchr(b,'\n');
if (!p) break;
! outlet_symbol(current_unpost->self->o1,gensym2(b,p-b));
! b=p+1;
}
! if (b!=current_unpost->buf) {
! char *q = strdup(b); /* well i could use memmove, but i'm not supposed to use strcpy because of overlap */
! strcpy(current_unpost->buf,q);
free(q);
}
--- 2970,2987 ----
extern t_printhook sys_printhook;
void unpost_printhook (const char *s) {
! std::ostringstream &b = current_unpost->buf;
! b << s;
char *p;
+ const char *d=b.str().data(),*dd=d;
for (;;) {
! p = strchr(d,'\n');
if (!p) break;
! outlet_symbol(current_unpost->self->o1,gensym2(d,p-d));
! d=p+1;
}
! if (d!=dd) {
! char *q = strdup(d); /* well i could use memmove, but i'm not supposed to use strcpy because of overlap */
! current_unpost->buf.clear();
! current_unpost->buf << q;
free(q);
}
***************
*** 2994,2998 ****
current_unpost = new t_unpost_frame;
current_unpost->self = x;
- current_unpost->buf[0] = 0;
outlet_anything(x->o0,s,argc,argv);
sys_printhook = backup1;
--- 2993,2996 ----
More information about the Pd-cvs
mailing list