[PD-cvs] pd/src desire.c,1.1.2.103,1.1.2.104

Mathieu Bouchard matju at users.sourceforge.net
Thu Aug 17 01:09:21 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.c 
Log Message:
fixed bug with empty send/receive in iemguis


Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.103
retrieving revision 1.1.2.104
diff -C2 -d -r1.1.2.103 -r1.1.2.104
*** desire.c	16 Aug 2006 17:28:43 -0000	1.1.2.103
--- desire.c	16 Aug 2006 23:09:18 -0000	1.1.2.104
***************
*** 169,174 ****
--- 169,176 ----
  	char *buf; int bufn;
  	t_binbuf *b = ((t_text *)stuff)->te_binbuf;
+ 	/*
  	if (b) {char *buf; int bufn; binbuf_gettext(b,&buf,&bufn); printf("queue_put [%.*s]\n",bufn,buf);}
  	else {printf("queue_put (%s)\n",(*(t_pd*)stuff)->c_name->s_name);}
+ 	*/
  	if (self->len==QUEUE_SIZE) {bug("queue full"); return;}
  	self->o[(self->start+self->len)%QUEUE_SIZE] = stuff;
***************
*** 184,192 ****
  	//post("queue_get: items in queue: %d",self->len);
  	b = ((t_text *)stuff)->te_binbuf;
! 	if (b) {
  		char *buf; int bufn;
  		binbuf_gettext(b,&buf,&bufn);
  		printf("queue_get [%.*s] %p\n",bufn,buf,stuff);}
! 	else {printf("queue_get (%s)\n",(*(t_pd*)stuff)->c_name->s_name);}
  	return stuff;
  }
--- 186,194 ----
  	//post("queue_get: items in queue: %d",self->len);
  	b = ((t_text *)stuff)->te_binbuf;
! 	/*if (b) {
  		char *buf; int bufn;
  		binbuf_gettext(b,&buf,&bufn);
  		printf("queue_get [%.*s] %p\n",bufn,buf,stuff);}
! 	else {printf("queue_get (%s)\n",(*(t_pd*)stuff)->c_name->s_name);}*/
  	return stuff;
  }
***************
*** 11394,11398 ****
  static void iemgui_send(t_iemgui *x, t_symbol *s) {
      x->snd = canvas_realizedollar(x->glist, s);
!     if (x->snd==s_empty) {x->snd=0; gobj_changed(x,"snd");}
  }
  
--- 11396,11401 ----
  static void iemgui_send(t_iemgui *x, t_symbol *s) {
      x->snd = canvas_realizedollar(x->glist, s);
!     if (x->snd==s_empty) x->snd=0;
!     gobj_changed(x,"snd");
  }
  
***************
*** 11414,11418 ****
  
  static void iemgui_label(t_iemgui *x, t_symbol *s) {
!     x->lab = s;
      gobj_changed(x,"lab");
  }
--- 11417,11421 ----
  
  static void iemgui_label(t_iemgui *x, t_symbol *s) {
!     x->lab = s==s_empty ? 0 : s;
      gobj_changed(x,"lab");
  }
***************
*** 11465,11469 ****
  		if (!IS_A_FLOAT(argv,i)) goto err; break;
  	    case 'S': case 's': if (!IS_A_SYMBOL(argv,i)) goto err; break;
! 	    case '?': case 'a': break; /* skip */
  	    case ';': optional=1; break;
  	    default: post("WARNING: bug using pd_scanargs()"); goto err; /* WHAT? */
--- 11468,11473 ----
  		if (!IS_A_FLOAT(argv,i)) goto err; break;
  	    case 'S': case 's': if (!IS_A_SYMBOL(argv,i)) goto err; break;
! 	    case '?': break;
! 	    case 'a': if (!IS_A_FLOAT(argv,i) && !IS_A_SYMBOL(argv,i)) goto err; break;
  	    case ';': optional=1; break;
  	    default: post("WARNING: bug using pd_scanargs()"); goto err; /* WHAT? */
***************
*** 11476,11494 ****
  	switch (fmt[i]) {
  	    case '*': case ';': goto break2;
! 	    case '?': case 'F': case 'S': break; /* skip */
  	    case 'd': NEXT; *(double*)p = atom_getfloatarg(i,argc,argv); break;
  	    case 'f': NEXT;  *(float*)p = atom_getfloatarg(i,argc,argv); break;
  	    case 'i': NEXT;    *(int*)p =   atom_getintarg(i,argc,argv); break;
  	    case 'b': NEXT;    *(int*)p = !!atom_getintarg(i,argc,argv); break; /* 0 or 1 */
! 	    case 'c': NEXT; *(int*)p    = convert_color(atom_getintarg(i,argc,argv)); break; /* IEM-style 8:8:8 colour */
  	    case 's': NEXT; *(t_symbol**)p=atom_getsymbolarg(i,argc,argv); break;
! 	    case 'a': NEXT;
  		if (IS_A_SYMBOL(argv,i))
  			*(t_symbol**)p = atom_getsymbolarg(i,argc,argv);
  		else if (IS_A_FLOAT(argv,i)) {
  			char str[80];
  			sprintf(str, "%d", (int)atom_getintarg(i,argc,argv));
  			*(t_symbol**)p = gensym(str);
! 		} else *(t_symbol**)p = gensym("empty");
  	    break;
  	    default: post("WARNING: bug using pd_scanargs()"); goto err; /* WHAT? */
--- 11480,11499 ----
  	switch (fmt[i]) {
  	    case '*': case ';': goto break2;
! 	    case '?': case 'F': case 'S': break; /* skip */ /* what are those for, again? */
  	    case 'd': NEXT; *(double*)p = atom_getfloatarg(i,argc,argv); break;
  	    case 'f': NEXT;  *(float*)p = atom_getfloatarg(i,argc,argv); break;
  	    case 'i': NEXT;    *(int*)p =   atom_getintarg(i,argc,argv); break;
  	    case 'b': NEXT;    *(int*)p = !!atom_getintarg(i,argc,argv); break; /* 0 or 1 */
! 	    case 'c': NEXT;    *(int*)p = convert_color(atom_getintarg(i,argc,argv)); break; /* IEM-style 8:8:8 colour */
  	    case 's': NEXT; *(t_symbol**)p=atom_getsymbolarg(i,argc,argv); break;
! 	    case 'a': NEXT; /* send-symbol, receive-symbol, or IEM-style label */
  		if (IS_A_SYMBOL(argv,i))
  			*(t_symbol**)p = atom_getsymbolarg(i,argc,argv);
+ 			if (*(t_symbol**)p == s_empty) *(t_symbol**)p = 0;
  		else if (IS_A_FLOAT(argv,i)) {
  			char str[80];
  			sprintf(str, "%d", (int)atom_getintarg(i,argc,argv));
  			*(t_symbol**)p = gensym(str);
! 		}
  	    break;
  	    default: post("WARNING: bug using pd_scanargs()"); goto err; /* WHAT? */
***************
*** 11524,11528 ****
  	    case 'a': 
  	    case 's': { t_symbol *s = *(va_arg(val,t_symbol**));
! 		SETSYMBOL(&a,s?s:gensym("empty")); } break;
  	    default: post("WARNING: bug using pd_saveargs()"); goto err; /* WHAT? */
  	}
--- 11529,11533 ----
  	    case 'a': 
  	    case 's': { t_symbol *s = *(va_arg(val,t_symbol**));
! 		SETSYMBOL(&a,s?s:s_empty); } break;
  	    default: post("WARNING: bug using pd_saveargs()"); goto err; /* WHAT? */
  	}
***************
*** 11706,11710 ****
  	x->snd = 0;
  	x->rcv = 0;
! 	x->lab = gensym("empty");
  	x->bcol = 0xffffff;
  	x->fcol = 0x000000;
--- 11711,11715 ----
  	x->snd = 0;
  	x->rcv = 0;
! 	x->lab = s_empty;
  	x->bcol = 0xffffff;
  	x->fcol = 0x000000;
***************
*** 11969,11974 ****
  static void radio_send(t_radio *x, float a) {
      	outlet_float(x->obj.ob_outlet,a);
! 	if(x->snd && x->snd->s_thing)
! 	    pd_float(x->snd->s_thing,a);
  }
  
--- 11974,11978 ----
  static void radio_send(t_radio *x, float a) {
      	outlet_float(x->obj.ob_outlet,a);
! 	if(x->snd && x->snd->s_thing) pd_float(x->snd->s_thing,a);
  }
  





More information about the Pd-cvs mailing list