[PD-cvs] pd/src desire.c,1.1.2.217.2.178,1.1.2.217.2.179

Mathieu Bouchard matju at users.sourceforge.net
Tue Jul 31 07:54:18 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9752

Modified Files:
      Tag: desiredata
	desire.c 
Log Message:
better debugging for future feature of differential upload


Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.178
retrieving revision 1.1.2.217.2.179
diff -C2 -d -r1.1.2.217.2.178 -r1.1.2.217.2.179
*** desire.c	31 Jul 2007 01:20:29 -0000	1.1.2.217.2.178
--- desire.c	31 Jul 2007 05:54:13 -0000	1.1.2.217.2.179
***************
*** 66,73 ****
  t_symbol *s_empty, *s_pd, *s_Pd;
  
  //--------------------------------------------------------------------------
! // t_appendix: an extension to t_gobj made by matju so that
! // all t_gobj's may have new fields without sacrificing binary compat with
! // externals compiled for PureMSP.
  
  typedef t_hash<t_symbol *, t_arglist *> t_visual;
--- 66,83 ----
  t_symbol *s_empty, *s_pd, *s_Pd;
  
+ std::ostream &operator << (std::ostream &str, t_pd *self) {
+ 	t_binbuf *b;
+ 	if (self->_class->patchable && (b = ((t_text *)self)->binbuf)) {
+ 		char *buf; int bufn;
+ 		binbuf_gettext(b,&buf,&bufn);
+ 		str << "[" << buf << "]";
+ 		free(buf);
+ 	} else str << "<" << self->_class->name->name << ":" << std::hex << (long)self << ">";
+ 	return str;
+ }
+ 
  //--------------------------------------------------------------------------
! // t_appendix: an extension to t_gobj made by matju so that all t_gobj's may have new fields
! // without sacrificing binary compat with externals compiled for PureMSP.
  
  typedef t_hash<t_symbol *, t_arglist *> t_visual;
***************
*** 87,96 ****
  	t_visual *h = master->dix->visual;
  	//fprintf(stderr,"appendix_save %p size=%ld\n",master,hash_size(h));
! 	if (h->size()) {
! 	    t_symbol *k;
! 	    t_arglist *v;
! 	    int i=0;
! 	    binbuf_addv(b,"t","#V");
! 	    hash_foreach(k,v,h) {
  		t_arglist *al = (t_arglist *)v;
  		binbuf_addv(b,"s",k);
--- 97,106 ----
  	t_visual *h = master->dix->visual;
  	//fprintf(stderr,"appendix_save %p size=%ld\n",master,hash_size(h));
! 	if (!h->size()) return;
! 	t_symbol *k;
! 	t_arglist *v;
! 	int i=0;
! 	binbuf_addv(b,"t","#V");
! 	hash_foreach(k,v,h) {
  		t_arglist *al = (t_arglist *)v;
  		binbuf_addv(b,"s",k);
***************
*** 99,103 ****
  		else binbuf_addv(b,"t",",");
  		i++;
- 	    }
          }
  }
--- 109,112 ----
***************
*** 147,151 ****
  	t_atom argv[1];
  	SETFLOAT(argv,(float)dirty);
! 	gobj_changed3(self,self,1,argv);
  }
  
--- 156,160 ----
  	t_atom argv[1];
  	SETFLOAT(argv,(float)dirty);
! 	//gobj_changed3(self,self,1,argv); /* TRACE THE DIFFERENTIAL UPLOAD REQUESTS */
  }
  
***************
*** 158,162 ****
  void gobj_changed3 (t_gobj *self, t_gobj *origin, int argc, t_atom *argv) {
  	t_appendix *d = self->dix;
! 	//printf("gobj_changed3 self=%lx origin=%lx\n",(long)self,(long)origin);
  	if (!d) {post("gobj_changed3: no appendix in %p",self); return;}
  	for (int i=0; i<d->nobs; i++) {
--- 167,174 ----
  void gobj_changed3 (t_gobj *self, t_gobj *origin, int argc, t_atom *argv) {
  	t_appendix *d = self->dix;
! 	std::ostringstream s;
! 	for (int i=0; i<argc; i++) s << " " << &argv[i];
! 	//fprintf(stderr,"gobj_changed3 self=%lx origin=%lx args=%s\n",(long)self,(long)origin,s.str().data());
! 	std::cerr << "gobj_changed3 self=" << self << " origin=" << origin << " args={" << s.str().data()+(!!argc) << "}\n";
  	if (!d) {post("gobj_changed3: no appendix in %p",self); return;}
  	for (int i=0; i<d->nobs; i++) {
***************
*** 261,266 ****
  
  struct t_dirtyentry {
! 	t_symbol *a[4];
! 	t_dirtyentry() {a[0]=a[1]=a[2]=a[3]=0;}
  };
  
--- 273,279 ----
  
  struct t_dirtyentry {
! 	long fields;
! 	size_t start,end;
! 	t_dirtyentry() {}
  };
  
***************
*** 7273,7276 ****
--- 7286,7290 ----
  		if (x->_class->name == s___list) {lists++; continue;}
  		int nobs = x->_class->gobj ? ((t_gobj *)x)->dix->nobs : 0;
+ 		// this has been duplicated as the ostream operator of t_pd * (see above).
  		t_binbuf *b;
  		if (x->_class->patchable && (b = ((t_text *)x)->binbuf)) {





More information about the Pd-cvs mailing list