[PD-cvs] pd/src kernel.c, 1.1.2.70, 1.1.2.71 desire.h, 1.1.2.49.2.35, 1.1.2.49.2.36

Mathieu Bouchard matju at users.sourceforge.net
Mon Jul 30 18:23:09 CEST 2007


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

Modified Files:
      Tag: desiredata
	kernel.c desire.h 
Log Message:
added voprintf()


Index: kernel.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/kernel.c,v
retrieving revision 1.1.2.70
retrieving revision 1.1.2.71
diff -C2 -d -r1.1.2.70 -r1.1.2.71
*** kernel.c	30 Jul 2007 02:59:58 -0000	1.1.2.70
--- kernel.c	30 Jul 2007 16:23:07 -0000	1.1.2.71
***************
*** 201,207 ****
  }
  
! /* convenience routines for checking and getting values of
!    atoms.  There's no "pointer" version since there's nothing
!    safe to return if there's an error. */
  
  t_float     atom_getfloat( t_atom *a) {return a->a_type==A_FLOAT ? a->a_float : 0;}
--- 201,206 ----
  }
  
! /* convenience routines for checking and getting values of atoms.
!    There's no "pointer" version since there's nothing safe to return if there's an error. */
  
  t_float     atom_getfloat( t_atom *a) {return a->a_type==A_FLOAT ? a->a_float : 0;}
***************
*** 210,214 ****
  const char *atom_getstring(t_atom *a) {return atom_getsymbol(a)->name;}
  
! t_symbol *atom_gensym(t_atom *a) { /* this works  better for graph labels */
      if (a->a_type == A_SYMBOL) return a->a_symbol;
      if (a->a_type == A_FLOAT) {char buf[30]; sprintf(buf, "%g", a->a_float); return gensym(buf);}
--- 209,213 ----
  const char *atom_getstring(t_atom *a) {return atom_getsymbol(a)->name;}
  
! t_symbol *atom_gensym(t_atom *a) { /* this works better for graph labels */
      if (a->a_type == A_SYMBOL) return a->a_symbol;
      if (a->a_type == A_FLOAT) {char buf[30]; sprintf(buf, "%g", a->a_float); return gensym(buf);}
***************
*** 1729,1741 ****
  }
  
! void oprintf(ostream &buf, const char *s, ...) {
      char *b;
-     va_list args;
-     va_start(args,s);
      vasprintf(&b,s,args);
-     va_end(args);
      buf << b;
      free(b);
  }
  
  /* convert a binbuf to text; no null termination. */
--- 1728,1743 ----
  }
  
! void voprintf(ostream &buf, const char *s, va_list args) {
      char *b;
      vasprintf(&b,s,args);
      buf << b;
      free(b);
  }
+ void oprintf(ostream &buf, const char *s, ...) {
+     va_list args;
+     va_start(args,s);
+     voprintf(buf,s,args);
+     va_end(args);
+ }
  
  /* convert a binbuf to text; no null termination. */

Index: desire.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v
retrieving revision 1.1.2.49.2.35
retrieving revision 1.1.2.49.2.36
diff -C2 -d -r1.1.2.49.2.35 -r1.1.2.49.2.36
*** desire.h	24 Jul 2007 20:47:24 -0000	1.1.2.49.2.35
--- desire.h	30 Jul 2007 16:23:07 -0000	1.1.2.49.2.36
***************
*** 330,334 ****
  template <class T> static T max(T a, T b) {return a>b?a:b;}
  template <class T> T clip(T a, T b, T c) {return min(max(a,b),c);}
! void oprintf(std::ostream &buf, const char *s, ...);
  #endif
  
--- 330,335 ----
  template <class T> static T max(T a, T b) {return a>b?a:b;}
  template <class T> T clip(T a, T b, T c) {return min(max(a,b),c);}
! void  oprintf(std::ostream &buf, const char *s, ...);
! void voprintf(std::ostream &buf, const char *s, va_list args);
  #endif
  





More information about the Pd-cvs mailing list