[PD-cvs] pd/src builtins.c,1.1.2.15,1.1.2.16

Mathieu Bouchard matju at users.sourceforge.net
Thu Jan 11 21:32:09 CET 2007


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

Modified Files:
      Tag: desiredata
	builtins.c 
Log Message:
added macros select_each, a_float, a_symbol


Index: builtins.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v
retrieving revision 1.1.2.15
retrieving revision 1.1.2.16
diff -C2 -d -r1.1.2.15 -r1.1.2.16
*** builtins.c	9 Jan 2007 22:13:01 -0000	1.1.2.15
--- builtins.c	11 Jan 2007 20:32:06 -0000	1.1.2.16
***************
*** 5,10 ****
     see the file "LICENSE.txt" in this distribution.  */
  
- /* misc. */
- 
  #define PD_PLUSPLUS_FACE
  #include "desire.h"
--- 5,8 ----
***************
*** 49,52 ****
--- 47,53 ----
  #endif
  
+ #define a_float  a_w.w_float
+ #define a_symbol a_w.w_symbol
+ 
  #define LIST_NGETBYTE 100 /* bigger that this we use alloc, not alloca */
  
***************
*** 332,338 ****
              if (at[msg].a_type == A_FLOAT) {
                  if (emsg > msg + 1) outlet_list(x->msgout, 0, emsg-msg, at + msg);
!                 else outlet_float(x->msgout, at[msg].a_w.w_float);
              } else if (at[msg].a_type == A_SYMBOL)
!                 outlet_anything(x->msgout, at[msg].a_w.w_symbol, emsg-msg-1, at + msg + 1);
          }
      nodice:
--- 333,339 ----
              if (at[msg].a_type == A_FLOAT) {
                  if (emsg > msg + 1) outlet_list(x->msgout, 0, emsg-msg, at + msg);
!                 else outlet_float(x->msgout, at[msg].a_float);
              } else if (at[msg].a_type == A_SYMBOL)
!                 outlet_anything(x->msgout, at[msg].a_symbol, emsg-msg-1, at + msg + 1);
          }
      nodice:
***************
*** 477,481 ****
              x->onset = onset2;
              if (automatic) {
!                 clock_delay(x->clock, x->clockdelay = ap->a_w.w_float * x->tempo);
                  x->whenclockset = clock_getsystime();
              } else outlet_list(x->outlet, 0, onset2-onset, ap);
--- 478,482 ----
              x->onset = onset2;
              if (automatic) {
!                 clock_delay(x->clock, x->clockdelay = ap->a_float * x->tempo);
                  x->whenclockset = clock_getsystime();
              } else outlet_list(x->outlet, 0, onset2-onset, ap);
***************
*** 489,494 ****
          if (!target) {
              if (ap->a_type != A_SYMBOL) continue;
!             else if (!(target = ap->a_w.w_symbol->thing)) {
!                 error("qlist: %s: no such object", ap->a_w.w_symbol->name);
                  continue;
              }
--- 490,495 ----
          if (!target) {
              if (ap->a_type != A_SYMBOL) continue;
!             else if (!(target = ap->a_symbol->thing)) {
!                 error("qlist: %s: no such object", ap->a_symbol->name);
                  continue;
              }
***************
*** 505,509 ****
          if (!drop) {
              if      (ap->a_type == A_FLOAT)  typedmess(target, &s_list, count, ap);
!             else if (ap->a_type == A_SYMBOL) typedmess(target, ap->a_w.w_symbol, count-1, ap+1);
          }
          if (x->reentered) return;
--- 506,510 ----
          if (!drop) {
              if      (ap->a_type == A_FLOAT)  typedmess(target, &s_list, count, ap);
!             else if (ap->a_type == A_SYMBOL) typedmess(target, ap->a_symbol, count-1, ap+1);
          }
          if (x->reentered) return;
***************
*** 603,607 ****
          x->onset = onset2;
          if (ap->a_type == A_SYMBOL)
!             outlet_anything(x->outlet, ap->a_w.w_symbol, onset2-onset-1, ap+1);
          else outlet_list(x->outlet, 0, onset2-onset, ap);
      } else {
--- 604,608 ----
          x->onset = onset2;
          if (ap->a_type == A_SYMBOL)
!             outlet_anything(x->outlet, ap->a_symbol, onset2-onset-1, ap+1);
          else outlet_list(x->outlet, 0, onset2-onset, ap);
      } else {
***************
*** 795,799 ****
  static void list_trim_list(t_list_trim *x, t_symbol *s, int argc, t_atom *argv) {
      if (argc < 1 || argv[0].a_type != A_SYMBOL) outlet_list(x->outlet, &s_list, argc, argv);
!     else outlet_anything(x->outlet, argv[0].a_w.w_symbol, argc-1, argv+1);
  }
  static void list_trim_anything(t_list_trim *x, t_symbol *s, int argc, t_atom *argv) {
--- 796,800 ----
  static void list_trim_list(t_list_trim *x, t_symbol *s, int argc, t_atom *argv) {
      if (argc < 1 || argv[0].a_type != A_SYMBOL) outlet_list(x->outlet, &s_list, argc, argv);
!     else outlet_anything(x->outlet, argv[0].a_symbol, argc-1, argv+1);
  }
  static void list_trim_anything(t_list_trim *x, t_symbol *s, int argc, t_atom *argv) {
***************
*** 831,835 ****
      if (!argc || argv[0].a_type != A_SYMBOL) newest = list_append_new(s, argc, argv);
      else {
!         t_symbol *s2 = argv[0].a_w.w_symbol;
          if      (s2 == gensym("append"))  newest = list_append_new(s, argc-1, argv+1);
          else if (s2 == gensym("prepend")) newest = list_prepend_new(s, argc-1, argv+1);
--- 832,836 ----
      if (!argc || argv[0].a_type != A_SYMBOL) newest = list_append_new(s, argc, argv);
      else {
!         t_symbol *s2 = argv[0].a_symbol;
          if      (s2 == gensym("append"))  newest = list_append_new(s, argc-1, argv+1);
          else if (s2 == gensym("prepend")) newest = list_prepend_new(s, argc-1, argv+1);
***************
*** 1280,1284 ****
  static void pdsymbol_list(t_pdsymbol *x, t_symbol *s, int ac, t_atom *av) {
      if (!ac) pdsymbol_bang(x);
!     else if (av->a_type == A_SYMBOL) pdsymbol_symbol(x, av->a_w.w_symbol);
      else pdsymbol_anything(x, s, ac, av);
  }
--- 1281,1285 ----
  static void pdsymbol_list(t_pdsymbol *x, t_symbol *s, int ac, t_atom *av) {
      if (!ac) pdsymbol_bang(x);
!     else if (av->a_type == A_SYMBOL) pdsymbol_symbol(x, av->a_symbol);
      else pdsymbol_anything(x, s, ac, av);
  }
***************
*** 1388,1400 ****
  };
  static void sel1_float(t_sel1 *x, t_float f) {
!     if (x->atom.a_type==A_FLOAT && f == x->atom.a_w.w_float) outlet_bang(x->out(0)); else outlet_float(x->out(1),f);
  }
  static void sel1_symbol(t_sel1 *x, t_symbol *s) {
!     if (x->atom.a_type==A_SYMBOL && s == x->atom.a_w.w_symbol) outlet_bang(x->out(0)); else outlet_symbol(x->out(1),s);
  }
  static t_class *sel2_class;
  struct t_selectelement {
      t_word e_w;
!     t_outlet *e_outlet;
  };
  struct t_sel2 : t_object {
--- 1389,1401 ----
  };
  static void sel1_float(t_sel1 *x, t_float f) {
!     if (x->atom.a_type==A_FLOAT && f == x->atom.a_float) outlet_bang(x->out(0)); else outlet_float(x->out(1),f);
  }
  static void sel1_symbol(t_sel1 *x, t_symbol *s) {
!     if (x->atom.a_type==A_SYMBOL && s == x->atom.a_symbol) outlet_bang(x->out(0)); else outlet_symbol(x->out(1),s);
  }
  static t_class *sel2_class;
  struct t_selectelement {
      t_word e_w;
!     t_outlet *out;
  };
  struct t_sel2 : t_object {
***************
*** 1404,1425 ****
      t_outlet *rejectout;
  };
  static void sel2_float(t_sel2 *x, t_float f) {
!     if (x->type == A_FLOAT) {
!         t_selectelement *e = x->vec;
!         for (int nelement = x->nelement; nelement--; e++) if (e->e_w.w_float == f) {
!             outlet_bang(e->e_outlet);
!             return;
!         }
!     }
      outlet_float(x->rejectout, f);
  }
  static void sel2_symbol(t_sel2 *x, t_symbol *s) {
!     if (x->type == A_SYMBOL) {
!         t_selectelement *e = x->vec;
!         for (int nelement = x->nelement; nelement--; e++) if (e->e_w.w_symbol == s) {
!             outlet_bang(e->e_outlet);
!             return;
!         }
!     }
      outlet_symbol(x->rejectout, s);
  }
--- 1405,1416 ----
      t_outlet *rejectout;
  };
+ #define select_each(e,x) for (t_selectelement *e = x->vec;e;e=0) for (int nelement = x->nelement; nelement--; e++)
+ 
  static void sel2_float(t_sel2 *x, t_float f) {
!     if (x->type == A_FLOAT) {select_each(e,x) if (e->e_w.w_float==f) {outlet_bang(e->out); return;}}
      outlet_float(x->rejectout, f);
  }
  static void sel2_symbol(t_sel2 *x, t_symbol *s) {
!     if (x->type == A_SYMBOL) {select_each(e,x) if (e->e_w.w_symbol==s) {outlet_bang(e->out); return;}}
      outlet_symbol(x->rejectout, s);
  }
***************
*** 1437,1443 ****
          outlet_new(x, &s_bang);
          if (argv->a_type == A_FLOAT) {
!             floatinlet_new(x, &x->atom.a_w.w_float); outlet_new(x, &s_float);
          } else {
!             symbolinlet_new(x, &x->atom.a_w.w_symbol); outlet_new(x, &s_symbol);
          }
          return x;
--- 1428,1434 ----
          outlet_new(x, &s_bang);
          if (argv->a_type == A_FLOAT) {
!             floatinlet_new(x, &x->atom.a_float); outlet_new(x, &s_float);
          } else {
!             symbolinlet_new(x, &x->atom.a_symbol); outlet_new(x, &s_symbol);
          }
          return x;
***************
*** 1449,1453 ****
          t_selectelement *e = x->vec;
          for (int n = 0; n < argc; n++, e++) {
!             e->e_outlet = outlet_new(x, &s_bang);
              if ((x->type = argv->a_type) == A_FLOAT)
                  e->e_w.w_float = atom_getfloatarg(n, argc, argv);
--- 1440,1444 ----
          t_selectelement *e = x->vec;
          for (int n = 0; n < argc; n++, e++) {
!             e->out = outlet_new(x, &s_bang);
              if ((x->type = argv->a_type) == A_FLOAT)
                  e->e_w.w_float = atom_getfloatarg(n, argc, argv);
***************
*** 1474,1478 ****
  struct t_routeelement {
      t_word e_w;
!     t_outlet *e_outlet;
  };
  struct t_route : t_object {
--- 1465,1469 ----
  struct t_routeelement {
      t_word e_w;
!     t_outlet *out;
  };
  struct t_route : t_object {
***************
*** 1487,1497 ****
          for (int n = x->n; n--; e++) if (e->e_w.w_symbol == sel) {
              if (argc > 0 && argv[0].a_type == A_SYMBOL)
!                 outlet_anything(e->e_outlet, argv[0].a_w.w_symbol, argc-1, argv+1);
              else { /* tb {: avoid 1 element lists */
! 		if (argc > 1) outlet_list(e->e_outlet, 0, argc, argv);
! 		else if (argc == 0) outlet_bang(e->e_outlet);
! 		else if (argv[0].a_type == A_FLOAT)   outlet_float(   e->e_outlet, argv[0].a_w.w_float);
! 		else if (argv[0].a_type == A_SYMBOL)  outlet_symbol(  e->e_outlet, argv[0].a_w.w_symbol);
! 		else if (argv[0].a_type == A_POINTER)  outlet_pointer(e->e_outlet, argv[0].a_w.w_gpointer);
  	    } /* tb } */
              return;
--- 1478,1488 ----
          for (int n = x->n; n--; e++) if (e->e_w.w_symbol == sel) {
              if (argc > 0 && argv[0].a_type == A_SYMBOL)
!                 outlet_anything(e->out, argv[0].a_symbol, argc-1, argv+1);
              else { /* tb {: avoid 1 element lists */
! 		if (argc > 1) outlet_list(e->out, 0, argc, argv);
! 		else if (argc == 0) outlet_bang(e->out);
! 		else if (argv[0].a_type == A_FLOAT)   outlet_float(   e->out, argv[0].a_float);
! 		else if (argv[0].a_type == A_SYMBOL)  outlet_symbol(  e->out, argv[0].a_symbol);
! 		else if (argv[0].a_type == A_POINTER)  outlet_pointer(e->out, argv[0].a_w.w_gpointer);
  	    } /* tb } */
              return;
***************
*** 1509,1520 ****
          for (int n = x->n; n--; e++) if (e->e_w.w_float == f) {
              if (argc > 1 && argv[1].a_type == A_SYMBOL)
!                 outlet_anything(e->e_outlet, argv[1].a_w.w_symbol, argc-2, argv+2);
!             else /* outlet_list(e->e_outlet, 0, argc-1, argv+1); */ { /* tb {: avoid 1 element lists */
  		argc -= 1, argv+=1;
! 		if (argc > 1) outlet_list(e->e_outlet, 0, argc, argv);
! 		else if (argc == 0) outlet_bang(e->e_outlet);
! 		else if (argv[0].a_type == A_FLOAT)   outlet_float(  e->e_outlet, argv[0].a_w.w_float);
! 		else if (argv[0].a_type == A_SYMBOL)  outlet_symbol( e->e_outlet, argv[0].a_w.w_symbol);
! 		else if (argv[0].a_type == A_POINTER) outlet_pointer(e->e_outlet, argv[0].a_w.w_gpointer);
  	    } /* tb } */
              return;
--- 1500,1511 ----
          for (int n = x->n; n--; e++) if (e->e_w.w_float == f) {
              if (argc > 1 && argv[1].a_type == A_SYMBOL)
!                 outlet_anything(e->out, argv[1].a_symbol, argc-2, argv+2);
!             else /* outlet_list(e->out, 0, argc-1, argv+1); */ { /* tb {: avoid 1 element lists */
  		argc -= 1, argv+=1;
! 		if (argc > 1) outlet_list(e->out, 0, argc, argv);
! 		else if (argc == 0) outlet_bang(e->out);
! 		else if (argv[0].a_type == A_FLOAT)   outlet_float(  e->out, argv[0].a_float);
! 		else if (argv[0].a_type == A_SYMBOL)  outlet_symbol( e->out, argv[0].a_symbol);
! 		else if (argv[0].a_type == A_POINTER) outlet_pointer(e->out, argv[0].a_w.w_gpointer);
  	    } /* tb } */
              return;
***************
*** 1524,1529 ****
  	    route_eachr(e,x) {
                  if (e->e_w.w_symbol == &s_list) {
!                     if (argv[0].a_type==A_SYMBOL) outlet_anything(e->e_outlet, argv[0].a_w.w_symbol, argc-1, argv+1);
!                     else outlet_list(e->e_outlet, 0, argc, argv);
                      return;
                  }
--- 1515,1520 ----
  	    route_eachr(e,x) {
                  if (e->e_w.w_symbol == &s_list) {
!                     if (argv[0].a_type==A_SYMBOL) outlet_anything(e->out, argv[0].a_symbol, argc-1, argv+1);
!                     else outlet_list(e->out, 0, argc, argv);
                      return;
                  }
***************
*** 1531,1543 ****
          } else if (argc == 0) {
  	    route_eachr(e,x) {
!                 if (e->e_w.w_symbol == &s_bang) {outlet_bang(e->e_outlet); return;}
              }
          } else if (argv[0].a_type == A_FLOAT) {
  	    route_eachr(e,x) {
!                 if (e->e_w.w_symbol == &s_float) {outlet_float(e->e_outlet, argv[0].a_w.w_float); return;}
              }
          } else {
  	    route_eachr(e,x) {
!                 if (e->e_w.w_symbol == &s_symbol) {outlet_symbol(e->e_outlet, argv[0].a_w.w_symbol); return;}
              }
          }
--- 1522,1534 ----
          } else if (argc == 0) {
  	    route_eachr(e,x) {
!                 if (e->e_w.w_symbol == &s_bang) {outlet_bang(e->out); return;}
              }
          } else if (argv[0].a_type == A_FLOAT) {
  	    route_eachr(e,x) {
!                 if (e->e_w.w_symbol == &s_float) {outlet_float(e->out, argv[0].a_float); return;}
              }
          } else {
  	    route_eachr(e,x) {
!                 if (e->e_w.w_symbol == &s_symbol) {outlet_symbol(e->out, argv[0].a_symbol); return;}
              }
          }
***************
*** 1560,1564 ****
      t_routeelement *e = x->vec;
      for (int n = 0; n < argc; n++, e++) {
!         e->e_outlet = outlet_new(x, &s_list);
          if (x->type == A_FLOAT) e->e_w.w_float  = atom_getfloatarg( n, argc, argv);
          else                    e->e_w.w_symbol = atom_getsymbolarg(n, argc, argv);
--- 1551,1555 ----
      t_routeelement *e = x->vec;
      for (int n = 0; n < argc; n++, e++) {
!         e->out = outlet_new(x, &s_list);
          if (x->type == A_FLOAT) e->e_w.w_float  = atom_getfloatarg( n, argc, argv);
          else                    e->e_w.w_symbol = atom_getsymbolarg(n, argc, argv);
***************
*** 1596,1600 ****
      int i;
      for (i = argc, ap = argv; i--; ap++)
!         if (ap->a_type == A_SYMBOL && *ap->a_w.w_symbol->name == 'p')
              nptr++;
      t_gpointer *gp = x->gpointer = (t_gpointer *)t_getbytes(nptr * sizeof (*gp));
--- 1587,1591 ----
      int i;
      for (i = argc, ap = argv; i--; ap++)
!         if (ap->a_type == A_SYMBOL && *ap->a_symbol->name == 'p')
              nptr++;
      t_gpointer *gp = x->gpointer = (t_gpointer *)t_getbytes(nptr * sizeof (*gp));
***************
*** 1603,1612 ****
          if (ap->a_type == A_FLOAT) {
              *vp = *ap;
!             if (i) floatinlet_new(x, &vp->a_w.w_float);
          } else if (ap->a_type == A_SYMBOL) {
!             char c = *ap->a_w.w_symbol->name;
              if (c == 's') {
                  SETSYMBOL(vp, &s_symbol);
!                 if (i) symbolinlet_new(x, &vp->a_w.w_symbol);
              } else if (c == 'p') {
                  vp->a_type = A_POINTER;
--- 1594,1603 ----
          if (ap->a_type == A_FLOAT) {
              *vp = *ap;
!             if (i) floatinlet_new(x, &vp->a_float);
          } else if (ap->a_type == A_SYMBOL) {
!             char c = *ap->a_symbol->name;
              if (c == 's') {
                  SETSYMBOL(vp, &s_symbol);
!                 if (i) symbolinlet_new(x, &vp->a_symbol);
              } else if (c == 'p') {
                  vp->a_type = A_POINTER;
***************
*** 1616,1622 ****
                  gp++;
              } else {
!                 if (c != 'f') pd_error(x, "pack: %s: bad type", ap->a_w.w_symbol->name);
                  SETFLOAT(vp, 0);
!                 if (i) floatinlet_new(x, &vp->a_w.w_float);
              }
          }
--- 1607,1613 ----
                  gp++;
              } else {
!                 if (c != 'f') pd_error(x, "pack: %s: bad type", ap->a_symbol->name);
                  SETFLOAT(vp, 0);
!                 if (i) floatinlet_new(x, &vp->a_float);
              }
          }
***************
*** 1660,1664 ****
  static void pack_float(t_pack *x, t_float f) {
      if (x->vec->a_type == A_FLOAT) {
!         x->vec->a_w.w_float = f;
          pack_bang(x);
      } else pd_error(x, "pack_float: wrong type");
--- 1651,1655 ----
  static void pack_float(t_pack *x, t_float f) {
      if (x->vec->a_type == A_FLOAT) {
!         x->vec->a_float = f;
          pack_bang(x);
      } else pd_error(x, "pack_float: wrong type");
***************
*** 1666,1670 ****
  static void pack_symbol(t_pack *x, t_symbol *s) {
      if (x->vec->a_type == A_SYMBOL) {
!         x->vec->a_w.w_symbol = s;
          pack_bang(x);
      } else pd_error(x, "pack_symbol: wrong type");
--- 1657,1661 ----
  static void pack_symbol(t_pack *x, t_symbol *s) {
      if (x->vec->a_type == A_SYMBOL) {
!         x->vec->a_symbol = s;
          pack_bang(x);
      } else pd_error(x, "pack_symbol: wrong type");
***************
*** 1721,1725 ****
          t_atomtype type = ap->a_type;
          if (type == A_SYMBOL) {
!             char c = *ap->a_w.w_symbol->name;
              if (c == 's') {
                  u->type = A_SYMBOL;
--- 1712,1716 ----
          t_atomtype type = ap->a_type;
          if (type == A_SYMBOL) {
!             char c = *ap->a_symbol->name;
              if (c == 's') {
                  u->type = A_SYMBOL;
***************
*** 1729,1733 ****
                  u->outlet = outlet_new(x, &s_pointer);
              } else {
!                 if (c != 'f') pd_error(x, "unpack: %s: bad type", ap->a_w.w_symbol->name);
                  u->type = A_FLOAT;
                  u->outlet = outlet_new(x, &s_float);
--- 1720,1724 ----
                  u->outlet = outlet_new(x, &s_pointer);
              } else {
!                 if (c != 'f') pd_error(x, "unpack: %s: bad type", ap->a_symbol->name);
                  u->type = A_FLOAT;
                  u->outlet = outlet_new(x, &s_float);
***************
*** 1747,1752 ****
          t_atomtype type = u->type;
          if (type != ap->a_type)   pd_error(x, "unpack: type mismatch");
!         else if (type == A_FLOAT) outlet_float(  u->outlet, ap->a_w.w_float);
!         else if (type == A_SYMBOL)outlet_symbol( u->outlet, ap->a_w.w_symbol);
          else                      outlet_pointer(u->outlet, ap->a_w.w_gpointer);
      }
--- 1738,1743 ----
          t_atomtype type = u->type;
          if (type != ap->a_type)   pd_error(x, "unpack: type mismatch");
!         else if (type == A_FLOAT) outlet_float(  u->outlet, ap->a_float);
!         else if (type == A_SYMBOL)outlet_symbol( u->outlet, ap->a_symbol);
          else                      outlet_pointer(u->outlet, ap->a_w.w_gpointer);
      }
***************
*** 1797,1801 ****
          t_atomtype thistype = ap->a_type;
          char c;
!         if (thistype == TR_SYMBOL) c = ap->a_w.w_symbol->name[0];
          else if (thistype == TR_FLOAT) c = 'f';
          else c = 0;
--- 1788,1792 ----
          t_atomtype thistype = ap->a_type;
          char c;
!         if (thistype == TR_SYMBOL) c = ap->a_symbol->name[0];
          else if (thistype == TR_FLOAT) c = 'f';
          else c = 0;
***************
*** 1807,1811 ****
          else if (c == 'a') u->type = TR_ANYTHING, u->outlet = outlet_new(x, &s_symbol);
          else {
!             pd_error(x, "trigger: %s: bad type", ap->a_w.w_symbol->name);
              u->type = TR_FLOAT, u->outlet = outlet_new(x, &s_float);
          }
--- 1798,1802 ----
          else if (c == 'a') u->type = TR_ANYTHING, u->outlet = outlet_new(x, &s_symbol);
          else {
!             pd_error(x, "trigger: %s: bad type", ap->a_symbol->name);
              u->type = TR_FLOAT, u->outlet = outlet_new(x, &s_float);
          }
***************
*** 2989,2993 ****
              post("pipe: %s: bad time delay value", stupid);
              deltime = 0;
!         } else deltime = argv[argc-1].a_w.w_float;
          argc--;
      }
--- 2980,2984 ----
              post("pipe: %s: bad time delay value", stupid);
              deltime = 0;
!         } else deltime = argv[argc-1].a_float;
          argc--;
      }
***************
*** 3001,3005 ****
      vec = x->vec = (t_pipeout *)getbytes(argc * sizeof(*x->vec));
      for (i = argc, ap = argv; i--; ap++)
!         if (ap->a_type == A_SYMBOL && *ap->a_w.w_symbol->name == 'p')
              nptr++;
      gp = x->gp = (t_gpointer *)t_getbytes(nptr * sizeof (*gp));
--- 2992,2996 ----
      vec = x->vec = (t_pipeout *)getbytes(argc * sizeof(*x->vec));
      for (i = argc, ap = argv; i--; ap++)
!         if (ap->a_type == A_SYMBOL && *ap->a_symbol->name == 'p')
              nptr++;
      gp = x->gp = (t_gpointer *)t_getbytes(nptr * sizeof (*gp));
***************
*** 3009,3019 ****
              vp->a = *ap;
              outlet_new(x, &s_float);
!             if (i) floatinlet_new(x, &vp->a.a_w.w_float);
          } else if (ap->a_type == A_SYMBOL) {
!             char c = *ap->a_w.w_symbol->name;
              if (c == 's') {
                  SETSYMBOL(&vp->a, &s_symbol);
                  outlet_new(x, &s_symbol);
!                 if (i) symbolinlet_new(x, &vp->a.a_w.w_symbol);
              } else if (c == 'p') {
                  vp->a.a_type = A_POINTER;
--- 3000,3010 ----
              vp->a = *ap;
              outlet_new(x, &s_float);
!             if (i) floatinlet_new(x, &vp->a.a_float);
          } else if (ap->a_type == A_SYMBOL) {
!             char c = *ap->a_symbol->name;
              if (c == 's') {
                  SETSYMBOL(&vp->a, &s_symbol);
                  outlet_new(x, &s_symbol);
!                 if (i) symbolinlet_new(x, &vp->a.a_symbol);
              } else if (c == 'p') {
                  vp->a.a_type = A_POINTER;
***************
*** 3024,3031 ****
                  gp++;
              } else {
!                 if (c != 'f') error("pack: %s: bad type", ap->a_w.w_symbol->name);
                  SETFLOAT(&vp->a, 0);
                  outlet_new(x, &s_float);
!                 if (i) floatinlet_new(x, &vp->a.a_w.w_float);
              }
          }
--- 3015,3022 ----
                  gp++;
              } else {
!                 if (c != 'f') error("pack: %s: bad type", ap->a_symbol->name);
                  SETFLOAT(&vp->a, 0);
                  outlet_new(x, &s_float);
!                 if (i) floatinlet_new(x, &vp->a.a_float);
              }
          }
***************
*** 3081,3086 ****
      for (i = 0, gp = x->gp, p = x->vec, ap = av; i < ac; i++, p++, ap++) {
          switch (p->a.a_type) {
!         case A_FLOAT: p->a.a_w.w_float = atom_getfloat(ap); break;
!         case A_SYMBOL: p->a.a_w.w_symbol = atom_getsymbol(ap); break;
          case A_POINTER:
              gpointer_unset(gp);
--- 3072,3077 ----
      for (i = 0, gp = x->gp, p = x->vec, ap = av; i < ac; i++, p++, ap++) {
          switch (p->a.a_type) {
!         case A_FLOAT: p->a.a_float = atom_getfloat(ap); break;
!         case A_SYMBOL: p->a.a_symbol = atom_getsymbol(ap); break;
          case A_POINTER:
              gpointer_unset(gp);





More information about the Pd-cvs mailing list