[PD-cvs] pd/src x_connective.c,1.3.4.1,1.3.4.1.2.1

IOhannes m zmölnig zmoelnig at users.sourceforge.net
Fri Jun 3 13:02:22 CEST 2005


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

Modified Files:
      Tag: devel_0_39
	x_connective.c 
Log Message:
fixed the "vanishing bang bug" in float-mode of [route]
reject [route]-creation when arguments are of mixed types


Index: x_connective.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/x_connective.c,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.1.2.1
diff -C2 -d -r1.3.4.1 -r1.3.4.1.2.1
*** x_connective.c	11 Nov 2004 22:30:43 -0000	1.3.4.1
--- x_connective.c	3 Jun 2005 11:02:13 -0000	1.3.4.1.2.1
***************
*** 506,510 ****
      {
          float f;
!         if (!argc) return;
          f = atom_getfloat(argv);
          for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++)
--- 506,514 ----
      {
          float f;
!         if (!argc) {
! 	  /* JMZ: no args: treat as "bang" and thus reject */
! 	  outlet_bang(x->x_rejectout);
! 	  return;
! 	}
          f = atom_getfloat(argv);
          for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++)
***************
*** 591,594 ****
--- 595,619 ----
      x->x_type = argv[0].a_type;
      x->x_nelement = argc;
+ 
+    /* JMZ: type checking: arguments must bei either floats xor symbols */
+     if (x->x_type == A_FLOAT) 
+       {
+ 	for(n=0; n<argc; n++)
+ 	  if (argv[n].a_type!=A_FLOAT)
+ 	    {
+ 	      pd_error(x, "route: cannot route floats and symbols at the same time");
+ 	      return 0;
+ 	    }
+       }
+     else
+       {
+ 	for(n=0; n<argc; n++)
+ 	  if(argv[n].a_type==A_FLOAT)
+ 	    {
+ 	      pd_error(x, "route: cannot route symbols and floats at the same time");
+ 	      return 0;
+ 	    }
+       }
+ 
      x->x_vec = (t_routeelement *)getbytes(argc * sizeof(*x->x_vec));
      for (n = 0, e = x->x_vec; n < argc; n++, e++)





More information about the Pd-cvs mailing list