[PD-cvs] pd/src desire.c, 1.1.2.217.2.171, 1.1.2.217.2.172 desire.h, 1.1.2.49.2.32, 1.1.2.49.2.33

Mathieu Bouchard matju at users.sourceforge.net
Fri Jul 20 00:37:45 CEST 2007


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

Modified Files:
      Tag: desiredata
	desire.c desire.h 
Log Message:
renamed DT_LIST to DT_CANVAS


Index: desire.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v
retrieving revision 1.1.2.49.2.32
retrieving revision 1.1.2.49.2.33
diff -C2 -d -r1.1.2.49.2.32 -r1.1.2.49.2.33
*** desire.h	18 Jul 2007 20:23:15 -0000	1.1.2.49.2.32
--- desire.h	19 Jul 2007 22:37:43 -0000	1.1.2.49.2.33
***************
*** 187,191 ****
  #define DT_FLOAT 0
  #define DT_SYMBOL 1
! #define DT_LIST 2
  #define DT_ARRAY 3
  
--- 187,191 ----
  #define DT_FLOAT 0
  #define DT_SYMBOL 1
! #define DT_CANVAS 2
  #define DT_ARRAY 3
  
***************
*** 293,297 ****
  /* -------------------- TO BE SORTED OUT --------------------- */
  EXTERN void canvas_redrawallfortemplatecanvas(t_canvas *x, int action);
- EXTERN t_array *array_new(t_symbol *templatesym, t_gpointer *parent);
  EXTERN void array_resize(t_array *x, int n);
  EXTERN void word_init(t_word *wp, t_template *tmpl, t_gpointer *gp);
--- 293,296 ----

Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.171
retrieving revision 1.1.2.217.2.172
diff -C2 -d -r1.1.2.217.2.171 -r1.1.2.217.2.172
*** desire.c	19 Jul 2007 21:47:34 -0000	1.1.2.217.2.171
--- desire.c	19 Jul 2007 22:37:40 -0000	1.1.2.217.2.172
***************
*** 1287,1291 ****
  t_class *array_class;
  
! t_array *array_new(t_symbol *templatesym, t_gpointer *parent) {
      t_array *x = (t_array *)pd_new(array_class);
      t_template *t = template_findbyname(templatesym);
--- 1287,1291 ----
  t_class *array_class;
  
! static t_array *array_new(t_symbol *templatesym, t_gpointer *parent) {
      t_array *x = (t_array *)pd_new(array_class);
      t_template *t = template_findbyname(templatesym);
***************
*** 1295,1301 ****
      /* aligned allocation */
      x->vec = (char *)getalignedbytes(x->elemsize);
!     /* note here we blithely copy a gpointer instead of "setting" a
!        new one; this gpointer isn't accounted for and needn't be since
!        we'll be deleted before the thing pointed to gets deleted anyway; see array_free. */
      x->gp = *parent;
      word_init((t_word *)x->vec, t, parent);
--- 1295,1300 ----
      /* aligned allocation */
      x->vec = (char *)getalignedbytes(x->elemsize);
!     /* note here we blithely copy a gpointer instead of "setting" a new one; this gpointer isn't accounted for
!        and needn't be since we'll be deleted before the thing pointed to gets deleted anyway; see array_free. */
      x->gp = *parent;
      word_init((t_word *)x->vec, t, parent);
***************
*** 2492,2496 ****
                  nitems++;
              }
!         } else if (t->vec[i].type == DT_LIST) {
              while (1) {
                  if (!canvas_readscalar(w->w_canvas, natoms, vec, p_nextmsg, 0)) break;
--- 2491,2495 ----
                  nitems++;
              }
!         } else if (t->vec[i].type == DT_CANVAS) {
              while (1) {
                  if (!canvas_readscalar(w->w_canvas, natoms, vec, p_nextmsg, 0)) break;
***************
*** 2691,2695 ****
                  canvas_writescalar(arraytemplatesym, (t_word *)&a->vec[elemsize*j], b, 1);
              binbuf_addsemi(b);
!         } else if (t->vec[i].type == DT_LIST) {
              canvas_writelist(w->w_canvas->list, b);
              binbuf_addsemi(b);
--- 2690,2694 ----
                  canvas_writescalar(arraytemplatesym, (t_word *)&a->vec[elemsize*j], b, 1);
              binbuf_addsemi(b);
!         } else if (t->vec[i].type == DT_CANVAS) {
              canvas_writelist(w->w_canvas->list, b);
              binbuf_addsemi(b);
***************
*** 2720,2724 ****
              for (int j=0; j<nitems; j++)
                  canvas_addtemplatesforscalar(arraytemplatesym, (t_word *)&a->vec[elemsize*j], p_ntemplates, p_templatevec);
!         } else if (ds->type == DT_LIST)
              canvas_addtemplatesforlist(w->w_canvas->list, p_ntemplates, p_templatevec);
      }
--- 2719,2723 ----
              for (int j=0; j<nitems; j++)
                  canvas_addtemplatesforscalar(arraytemplatesym, (t_word *)&a->vec[elemsize*j], p_ntemplates, p_templatevec);
!         } else if (ds->type == DT_CANVAS)
              canvas_addtemplatesforlist(w->w_canvas->list, p_ntemplates, p_templatevec);
      }
***************
*** 2752,2756 ****
                  case DT_SYMBOL: type = &s_symbol; break;
                  case DT_ARRAY:  type = gensym("array"); break;
!                 case DT_LIST:   type = &s_list; break;
                  default: type = &s_float; bug("canvas_write");
              }
--- 2751,2755 ----
                  case DT_SYMBOL: type = &s_symbol; break;
                  case DT_ARRAY:  type = gensym("array"); break;
!                 case DT_CANVAS: type = &s_list; break;
                  default: type = &s_float; bug("canvas_write");
              }
***************
*** 2862,2866 ****
                  case DT_SYMBOL: type = &s_symbol; break;
                  case DT_ARRAY:  type = gensym("array"); break;
!                 case DT_LIST:   type = &s_list; break;
                  default:        type = &s_float; bug("canvas_write");
              }
--- 2861,2865 ----
                  case DT_SYMBOL: type = &s_symbol; break;
                  case DT_ARRAY:  type = gensym("array"); break;
!                 case DT_CANVAS: type = &s_list; break;
                  default:        type = &s_float; bug("canvas_write");
              }
***************
*** 3356,3360 ****
          else if (type == DT_SYMBOL) wp->w_symbol = &s_symbol;
          else if (type == DT_ARRAY)  wp->w_array = array_new(datatypes->arraytemplate, gp);
!         else if (type == DT_LIST) {
              /* LATER test this and get it to work */
              wp->w_canvas = canvas_new(0,0,0,0);
--- 3355,3359 ----
          else if (type == DT_SYMBOL) wp->w_symbol = &s_symbol;
          else if (type == DT_ARRAY)  wp->w_array = array_new(datatypes->arraytemplate, gp);
!         else if (type == DT_CANVAS) {
              /* LATER test this and get it to work */
              wp->w_canvas = canvas_new(0,0,0,0);
***************
*** 3383,3388 ****
      t_dataslot *dt = t->vec;
      for (int i=0; i<t->n; i++, dt++) {
!         if      (dt->type == DT_ARRAY) pd_free(wp[i].w_array);
!         else if (dt->type == DT_LIST)  pd_free(wp[i].w_canvas);
      }
  }
--- 3382,3387 ----
      t_dataslot *dt = t->vec;
      for (int i=0; i<t->n; i++, dt++) {
!         if      (dt->type == DT_ARRAY)  pd_free(wp[i].w_array);
!         else if (dt->type == DT_CANVAS) pd_free(wp[i].w_canvas);
      }
  }
***************
*** 3586,3590 ****
          if (newtypesym == &s_float)       newtype = DT_FLOAT;
          else if (newtypesym == &s_symbol) newtype = DT_SYMBOL;
!         else if (newtypesym == &s_list)   newtype = DT_LIST;
          else if (newtypesym == gensym("array")) {
              if (argc < 3 || argv[2].a_type != A_SYMBOL) {error("array lacks element template or name"); goto bad;}
--- 3585,3589 ----
          if (newtypesym == &s_float)       newtype = DT_FLOAT;
          else if (newtypesym == &s_symbol) newtype = DT_SYMBOL;
!         else if (newtypesym == &s_list)   newtype = DT_CANVAS;
          else if (newtypesym == gensym("array")) {
              if (argc < 3 || argv[2].a_type != A_SYMBOL) {error("array lacks element template or name"); goto bad;}
***************
*** 3656,3660 ****
      if (x1->n < x2->n) return 0;
      for (int i=x2->n; i < x1->n; i++)
!         if (x1->vec[i].type == DT_ARRAY || x1->vec[i].type == DT_LIST) return 0;
      if (x2->n > x1->n) post("add elements...");
      for (int i=0; i < x2->n; i++) if (!dataslot_matches(&x1->vec[i], &x2->vec[i], 1)) return 0;
--- 3655,3659 ----
      if (x1->n < x2->n) return 0;
      for (int i=x2->n; i < x1->n; i++)
!         if (x1->vec[i].type == DT_ARRAY || x1->vec[i].type == DT_CANVAS) return 0;
      if (x2->n > x1->n) post("add elements...");
      for (int i=0; i < x2->n; i++) if (!dataslot_matches(&x1->vec[i], &x2->vec[i], 1)) return 0;
***************
*** 3721,3726 ****
      for (int i=0; i < scalartemplate->n; i++) {
          t_dataslot *ds = scalartemplate->vec + i;
!         if (ds->type == DT_LIST) template_conformcanvas(tfrom, tto, conformaction, x->v[i].w_canvas);
!         if (ds->type == DT_ARRAY) template_conformarray(tfrom, tto, conformaction, x->v[i].w_array);
      }
      return x;
--- 3720,3725 ----
      for (int i=0; i < scalartemplate->n; i++) {
          t_dataslot *ds = scalartemplate->vec + i;
!         if (ds->type == DT_CANVAS) template_conformcanvas(tfrom, tto, conformaction, x->v[i].w_canvas);
!         if (ds->type == DT_ARRAY)  template_conformarray( tfrom, tto, conformaction, x->v[i].w_array);
      }
      return x;
***************
*** 3752,3757 ****
          for (int j=0; j < scalartemplate->n; j++) {
              t_dataslot *ds = scalartemplate->vec + j;
!             if (ds->type == DT_LIST)  template_conformcanvas(tfrom, tto, conformaction, wp[j].w_canvas);
!             if (ds->type == DT_ARRAY) template_conformarray( tfrom, tto, conformaction, wp[j].w_array);
          }
      }
--- 3751,3756 ----
          for (int j=0; j < scalartemplate->n; j++) {
              t_dataslot *ds = scalartemplate->vec + j;
!             if (ds->type == DT_CANVAS) template_conformcanvas(tfrom, tto, conformaction, wp[j].w_canvas);
!             if (ds->type == DT_ARRAY)  template_conformarray( tfrom, tto, conformaction, wp[j].w_array);
          }
      }
***************
*** 5233,5237 ****
          return;
      }
!     if (type != DT_LIST) {error("field %s not of type list", x->fieldsym->name); return;}
      t_word *w = gpointer_word(gp);
      gpointer_setcanvas(&x->gp, *(t_canvas **)(((char *)w) + onset), 0);
--- 5232,5236 ----
          return;
      }
!     if (type != DT_CANVAS) {error("field %s not of type list", x->fieldsym->name); return;}
      t_word *w = gpointer_word(gp);
      gpointer_setcanvas(&x->gp, *(t_canvas **)(((char *)w) + onset), 0);





More information about the Pd-cvs mailing list