[PD-cvs] pd/src desire.c,1.1.2.217.2.48,1.1.2.217.2.49

Mathieu Bouchard matju at users.sourceforge.net
Fri Dec 8 18:03:22 CET 2006


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

Modified Files:
      Tag: desiredata
	desire.c 
Log Message:
fix for optional args in pd_vscanargs (and thus for "steady" in slider)


Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.48
retrieving revision 1.1.2.217.2.49
diff -C2 -d -r1.1.2.217.2.48 -r1.1.2.217.2.49
*** desire.c	8 Dec 2006 10:06:04 -0000	1.1.2.217.2.48
--- desire.c	8 Dec 2006 17:03:18 -0000	1.1.2.217.2.49
***************
*** 547,554 ****
--- 547,556 ----
          static long dollarzero = 1000;
          t_canvasenvironment *env = x->env = (t_canvasenvironment *)getbytes(sizeof(*x->env));
+         if (!canvas_newargv) canvas_newargv = (t_atom *)getbytes(0);
          env->dir = canvas_newdirectory;
          env->argc = canvas_newargc;
          env->argv = canvas_newargv;
          env->dollarzero = dollarzero++;
+         env->path = 0;
          canvas_newdirectory = &s_;
          canvas_newargc = 0;
***************
*** 6301,6305 ****
  
  static void gatom_free(t_gatom *x) {
!     if (*x->rcv->s_name) pd_unbind(x, canvas_realizedollar(x->canvas, x->rcv));
      gfxstub_deleteforkey(x);
  }
--- 6303,6307 ----
  
  static void gatom_free(t_gatom *x) {
!     if (x->rcv) pd_unbind(x, canvas_realizedollar(x->canvas, x->rcv));
      gfxstub_deleteforkey(x);
  }
***************
*** 6546,6553 ****
      if (fmt[i]!=0 && !optional) goto err; /* not enough args */
  break1:
!     for (i=0; i<argc; i++) {
  	void *p;
! 	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;
--- 6548,6557 ----
      if (fmt[i]!=0 && !optional) goto err; /* not enough args */
  break1:
!     i=0;
!     for (int j=0; fmt[j] || i<argc; j++) {
  	void *p;
! 	switch (fmt[j]) {
! 	    case ';': continue; /*ignore*/
! 	    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;
***************
*** 6569,6572 ****
--- 6573,6577 ----
  	    default: post("WARNING: bug using pd_scanargs()"); goto err; /* WHAT? */
  	}
+ 	i++;
      }
  break2:
***************
*** 7186,7191 ****
--- 7191,7199 ----
      binbuf_update(x,gensym((char *)(isvert(x)?"vsl":"hsl")),argc,argv);
      if (!slider_pickle(x,&foo)) return;
+ //    fprintf(stderr,"STEADY=%d\n",x->steady);
+ //this is wrong because it should happen when loading a file but not when loading from properties:
      SET(val,x->isa&1 ? x->val : 0);
      SET(pos,x->val);
+ //end wrong.
      iemgui_constrain(x);
      slider_check_minmax(x);





More information about the Pd-cvs mailing list