[PD-cvs] externals/zexy/src symbol2list.c,1.3,1.4

IOhannes m zmölnig zmoelnig at users.sourceforge.net
Wed Jul 13 10:34:57 CEST 2005


Update of /cvsroot/pure-data/externals/zexy/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8227

Modified Files:
	symbol2list.c 
Log Message:
fixed 2 bugs: 
 -> tokens like "1-5" were parsed as float "1" instead of symbol "1-5"
 -> emtpy symbols became float "0" instead of "bang"
remaining issues: hex-tokens (e.g. "0x123") are parsed to floats and not to symbols; not sure whether this is good.


Index: symbol2list.c
===================================================================
RCS file: /cvsroot/pure-data/externals/zexy/src/symbol2list.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** symbol2list.c	9 Jun 2005 12:17:03 -0000	1.3
--- symbol2list.c	13 Jul 2005 08:34:55 -0000	1.4
***************
*** 45,51 ****
    strncpy(buffer, cp, clen);
    buffer[clen]=0;
-   //  post("converting buffer '%s' %d", buffer, clen);
    ftest=strtod(buffer, endptr);
!   if (*endptr == buffer){
      /* strtof() failed, we have a symbol */
      SETSYMBOL(ap, gensym(buffer));    
--- 45,55 ----
    strncpy(buffer, cp, clen);
    buffer[clen]=0;
    ftest=strtod(buffer, endptr);
!   /* what should we do with the special cases of hexadecimal values, "INF" and "NAN" ???
!    * strtod() parses them to numeric values:
!    * symbol "hallo 0x12" will become "list hallo 18"
!    * do we want this ??
!    */
!   if (buffer+clen!=*endptr){
      /* strtof() failed, we have a symbol */
      SETSYMBOL(ap, gensym(buffer));    
***************
*** 119,122 ****
--- 123,130 ----
  }
  static void symbol2list_bang(t_symbol2list *x){
+   if(!(x->s) || x->s==&s_){
+     outlet_bang(x->x_obj.ob_outlet);
+     return;
+   }
    symbol2list_process(x);
    if(x->argc)outlet_list(x->x_obj.ob_outlet, 0, x->argc, x->argv);





More information about the Pd-cvs mailing list