[PD-cvs] pd/src desire.c, 1.1.2.38, 1.1.2.39 g_rtext.c, 1.4.8.3, 1.4.8.4

Mathieu Bouchard matju at users.sourceforge.net
Fri Oct 28 14:53:09 CEST 2005


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

Modified Files:
      Tag: devel_0_39
	desire.c g_rtext.c 
Log Message:
C++ support


Index: g_rtext.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_rtext.c,v
retrieving revision 1.4.8.3
retrieving revision 1.4.8.4
diff -C2 -d -r1.4.8.3 -r1.4.8.4
*** g_rtext.c	16 Sep 2005 19:20:04 -0000	1.4.8.3
--- g_rtext.c	28 Oct 2005 12:53:07 -0000	1.4.8.4
***************
*** 440,444 ****
              x->x_buf[i- ndel] = x->x_buf[i];
          newsize = x->x_bufsize - ndel;
!         x->x_buf = resizebytes(x->x_buf, x->x_bufsize, newsize);
          x->x_bufsize = newsize;
  
--- 440,444 ----
              x->x_buf[i- ndel] = x->x_buf[i];
          newsize = x->x_bufsize - ndel;
!         x->x_buf = (char *)resizebytes(x->x_buf, x->x_bufsize, newsize);
          x->x_bufsize = newsize;
  
***************
*** 446,450 ****
          {
              newsize = x->x_bufsize+1;
!             x->x_buf = resizebytes(x->x_buf, x->x_bufsize, newsize);
              for (i = x->x_bufsize; i > x->x_selstart; i--)
                  x->x_buf[i] = x->x_buf[i-1];
--- 446,450 ----
          {
              newsize = x->x_bufsize+1;
!             x->x_buf = (char *)resizebytes(x->x_buf, x->x_bufsize, newsize);
              for (i = x->x_bufsize; i > x->x_selstart; i--)
                  x->x_buf[i] = x->x_buf[i-1];

Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.38
retrieving revision 1.1.2.39
diff -C2 -d -r1.1.2.38 -r1.1.2.39
*** desire.c	27 Oct 2005 14:19:50 -0000	1.1.2.38
--- desire.c	28 Oct 2005 12:53:07 -0000	1.1.2.39
***************
*** 31,37 ****
  	sys_vgui(args); } while(0)
  
  //--------------------------------------------------------------------------
  t_appendix *appendix_new (t_gobj *master) {
! 	t_appendix *self = malloc(sizeof(t_appendix));
  	self->master = master;
  	self->next = 0;
--- 31,43 ----
  	sys_vgui(args); } while(0)
  
+ #define template templaet
+ 
  //--------------------------------------------------------------------------
+ // t_appendix: an extension to t_gobj written by Mathieu Bouchard so that
+ // all t_gobj's may have new fields without sacrificing binary compat with
+ // externals compiled for PureMSP.
+ 
  t_appendix *appendix_new (t_gobj *master) {
! 	t_appendix *self = (t_appendix *)malloc(sizeof(t_appendix));
  	self->master = master;
  	self->next = 0;
***************
*** 46,50 ****
  	int i;
  	for (i=0; i<d->nobs; i++) if (d->obs[i]) return;
! 	d->obs=realloc(d->obs,sizeof(t_gobj *)*(1+d->nobs));
  	d->obs[d->nobs++] = observer;
  }
--- 52,56 ----
  	int i;
  	for (i=0; i<d->nobs; i++) if (d->obs[i]) return;
! 	d->obs=(t_gobj **)realloc(d->obs,sizeof(t_gobj *)*(1+d->nobs));
  	d->obs[d->nobs++] = observer;
  }
***************
*** 75,80 ****
  	int i;
  	for (i=0; i<d->nobs; i++) {
! 		t_notice ice = self->g_pd->c_notice;
! 		if (ice) ice(d->obs[i],self,argc,argv);
  		else post("null func ptr for class %s",self->g_pd->c_name->s_name);
  	
--- 81,87 ----
  	int i;
  	for (i=0; i<d->nobs; i++) {
! 		t_gobj *obs = d->obs[i];
! 		t_notice ice = obs->g_pd->c_notice;
! 		if (ice) ice(obs,self,argc,argv);
  		else post("null func ptr for class %s",self->g_pd->c_name->s_name);
  	
***************
*** 83,86 ****
--- 90,96 ----
  
  //--------------------------------------------------------------------------
+ // update manager:
+ 
+ //--------------------------------------------------------------------------
  /* the "glist" class is also known as "canvas" (the two used
  to be different but are now unified except for some fossilized names.).
***************
*** 192,196 ****
          freebytes(canvas_newargv, canvas_newargc * sizeof(t_atom));
      canvas_newargc = argc;
!     canvas_newargv = copybytes(argv, argc * sizeof(t_atom));
  }
  
--- 202,206 ----
          freebytes(canvas_newargv, canvas_newargc * sizeof(t_atom));
      canvas_newargc = argc;
!     canvas_newargv = (t_atom *)copybytes(argv, argc * sizeof(t_atom));
  }
  
***************
*** 1737,1741 ****
  static void canvas_undo_disconnect(t_canvas *x, void *z, int action)
  {
!     t_undo_connect *buf = z;
      if (action == UNDO_UNDO)
      {
--- 1747,1751 ----
  static void canvas_undo_disconnect(t_canvas *x, void *z, int action)
  {
!     t_undo_connect *buf = (t_undo_connect *)z;
      if (action == UNDO_UNDO)
      {
***************
*** 1830,1834 ****
  static void canvas_undo_cut(t_canvas *x, void *z, int action)
  {
!     t_undo_cut *buf = z;
      int mode = buf->u_mode;
      if (action == UNDO_UNDO)
--- 1840,1844 ----
  static void canvas_undo_cut(t_canvas *x, void *z, int action)
  {
!     t_undo_cut *buf = (t_undo_cut *)z;
      int mode = buf->u_mode;
      if (action == UNDO_UNDO)
***************
*** 1943,1947 ****
  static void canvas_undo_move(t_canvas *x, void *z, int action)
  {
!     t_undo_move *buf = z;
      if (action == UNDO_UNDO || action == UNDO_REDO)
      {
--- 1953,1957 ----
  static void canvas_undo_move(t_canvas *x, void *z, int action)
  {
!     t_undo_move *buf = (t_undo_move *)z;
      if (action == UNDO_UNDO || action == UNDO_REDO)
      {
***************
*** 1986,1990 ****
  static void canvas_undo_paste(t_canvas *x, void *z, int action)
  {
!     t_undo_paste *buf = z;
      if (action == UNDO_UNDO)
      {
--- 1996,2000 ----
  static void canvas_undo_paste(t_canvas *x, void *z, int action)
  {
!     t_undo_paste *buf = (t_undo_paste *)z;
      if (action == UNDO_UNDO)
      {
***************
*** 6515,6519 ****
          t_template *newtemplate, *existtemplate;
          t_symbol *templatesym;
!         t_atom *templateargs = getbytes(0);
          int ntemplateargs = 0, newnargs;
          nline = canvas_scanbinbuf(natoms, vec, &message, &nextmsg);
--- 6525,6529 ----
          t_template *newtemplate, *existtemplate;
          t_symbol *templatesym;
!         t_atom *templateargs = (t_atom *)getbytes(0);
          int ntemplateargs = 0, newnargs;
          nline = canvas_scanbinbuf(natoms, vec, &message, &nextmsg);
***************
*** 6806,6810 ****
  {
      int i;
!     t_symbol **templatevec = getbytes(0);
      int ntemplates = 0;
      t_gobj *y;
--- 6816,6820 ----
  {
      int i;
!     t_symbol **templatevec = (t_symbol **)getbytes(0);
      int ntemplates = 0;
      t_gobj *y;
***************
*** 6970,6974 ****
  static void canvas_savetemplatesto(t_canvas *x, t_binbuf *b, int wholething)
  {
!     t_symbol **templatevec = getbytes(0);
      int i, ntemplates = 0;
      canvas_collecttemplatesfor(x, &ntemplates, &templatevec, wholething);
--- 6980,6984 ----
  static void canvas_savetemplatesto(t_canvas *x, t_binbuf *b, int wholething)
  {
!     t_symbol **templatevec = (t_symbol **)getbytes(0);
      int i, ntemplates = 0;
      canvas_collecttemplatesfor(x, &ntemplates, &templatevec, wholething);
***************
*** 8035,8039 ****
      binbuf_gettext(b, &buf, &bufsize);
      binbuf_free(b);
!     buf = t_resizebytes(buf, bufsize, bufsize+1);
      buf[bufsize] = 0;
      sprintf(buf2, "pdtk_data_dialog %%s {");
--- 8045,8049 ----
      binbuf_gettext(b, &buf, &bufsize);
      binbuf_free(b);
!     buf = (char *)t_resizebytes(buf, bufsize, bufsize+1);
      buf[bufsize] = 0;
      sprintf(buf2, "pdtk_data_dialog %%s {");
***************
*** 8417,8421 ****
          int oldelemsize = sizeof(t_word) * tfrom->t_n,
              newelemsize = sizeof(t_word) * tto->t_n;
!         char *newarray = getbytes(newelemsize * a->a_n);
          char *oldarray = a->a_vec;
          if (a->a_elemsize != oldelemsize)
--- 8427,8431 ----
          int oldelemsize = sizeof(t_word) * tfrom->t_n,
              newelemsize = sizeof(t_word) * tto->t_n;
!         char *newarray = (char *)getbytes(newelemsize * a->a_n);
          char *oldarray = a->a_vec;
          if (a->a_elemsize != oldelemsize)
***************
*** 10274,10278 ****
  t_gstub *gstub_new(t_glist *gl, t_array *a)
  {
!     t_gstub *gs = t_getbytes(sizeof(*gs));
      if (gl)
      {
--- 10284,10288 ----
  t_gstub *gstub_new(t_glist *gl, t_array *a)
  {
!     t_gstub *gs = (t_gstub *)t_getbytes(sizeof(*gs));
      if (gl)
      {
***************
*** 11453,11458 ****
      float    fr;
      int      scale;
!     void     *out_rms;
!     void     *out_peak;
  } t_vu;
  
--- 11463,11468 ----
      float    fr;
      int      scale;
!     t_outlet *out_rms;
!     t_outlet *out_peak;
  } t_vu;
  
***************
*** 11644,11649 ****
  } t_message;
  
- static t_class *message_class, *mresp_class;
- 
  static void message_bang(t_message *x)
  {binbuf_eval(x->m_text.te_binbuf, &x->m_mresp.mr_pd, 0, 0);}
--- 11654,11657 ----
***************
*** 11684,11688 ****
  {
      t_message *x = (t_message *)pd_new(message_class);
!     x->m_mresp.mr_pd = mresp_class;
      x->m_mresp.mr_outlet = outlet_new(&x->m_text, &s_float);
      x->m_text.te_width = 0;	    	    	    	/* don't know it yet. */
--- 11692,11696 ----
  {
      t_message *x = (t_message *)pd_new(message_class);
!     x->m_mresp.mr_pd = 0; /* was mresp_class */
      x->m_mresp.mr_outlet = outlet_new(&x->m_text, &s_float);
      x->m_text.te_width = 0;	    	    	    	/* don't know it yet. */
***************
*** 12905,12909 ****
      t_foo foo = {0,0,b};
      if (!b) return;
!     pd_savehead(b,x,isvert(x)?"vsl":"hsl");
      slider_pickle(x,&foo);
  }
--- 12913,12917 ----
      t_foo foo = {0,0,b};
      if (!b) return;
!     pd_savehead(b,x,(char *)(isvert(x)?"vsl":"hsl"));
      slider_pickle(x,&foo);
  }
***************
*** 12912,12916 ****
  {
      t_foo foo = { argc, argv, 0 };
!     binbuf_update((t_iemgui *)x,gensym(isvert(x)?"vsl":"hsl"),argc,argv);
      if (!slider_pickle(x,&foo)) return;
      x->pos = x->val = x->isa&1 ? x->val : 0;
--- 12920,12924 ----
  {
      t_foo foo = { argc, argv, 0 };
!     binbuf_update((t_iemgui *)x,gensym((char *)(isvert(x)?"vsl":"hsl")),argc,argv);
      if (!slider_pickle(x,&foo)) return;
      x->pos = x->val = x->isa&1 ? x->val : 0;





More information about the Pd-cvs mailing list