[PD-cvs] pd/src desire.c, 1.1.2.199, 1.1.2.200 desire.h, 1.1.2.43, 1.1.2.44

Mathieu Bouchard matju at users.sourceforge.net
Thu Nov 23 21:06:54 CET 2006


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

Modified Files:
      Tag: devel_0_39
	desire.c desire.h 
Log Message:
put variable decl in for()


Index: desire.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v
retrieving revision 1.1.2.43
retrieving revision 1.1.2.44
diff -C2 -d -r1.1.2.43 -r1.1.2.44
*** desire.h	23 Nov 2006 05:52:52 -0000	1.1.2.43
--- desire.h	23 Nov 2006 20:06:52 -0000	1.1.2.44
***************
*** 217,221 ****
  
  /* structure for traversing all the connections in a canvas */
! typedef struct _linetraverser {
      t_canvas *canvas;
      t_object *from; int nout; int outlet; t_outlet *outletp;
--- 217,221 ----
  
  /* structure for traversing all the connections in a canvas */
! typedef struct t_linetraverser {
      t_canvas *canvas;
      t_object *from; int nout; int outlet; t_outlet *outletp;
***************
*** 223,226 ****
--- 223,230 ----
      t_outconnect *next;
      int nextoutno;
+ #ifdef __cplusplus
+     t_linetraverser() {}
+     t_linetraverser(t_canvas *canvas);
+ #endif
  } t_linetraverser;
  

Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.199
retrieving revision 1.1.2.200
diff -C2 -d -r1.1.2.199 -r1.1.2.200
*** desire.c	23 Nov 2006 06:44:54 -0000	1.1.2.199
--- desire.c	23 Nov 2006 20:06:50 -0000	1.1.2.200
***************
*** 68,72 ****
  #define canvases_each(CANVAS) for(t_canvas *CANVAS=canvas_list; CANVAS; CANVAS=CANVAS->gl_next)
  #define canvas_wires_each(WIRE,TRAV,CANVAS) \
! 	for (linetraverser_start(&TRAV,CANVAS); (WIRE=linetraverser_next(&TRAV)); )
  
  #define CLAMP(_var,_min,_max) do { if (_var<_min) _var=_min; else if (_var>_max) _var=_max; } while(0)
--- 68,73 ----
  #define canvases_each(CANVAS) for(t_canvas *CANVAS=canvas_list; CANVAS; CANVAS=CANVAS->gl_next)
  #define canvas_wires_each(WIRE,TRAV,CANVAS) \
! 	for (t_outconnect *WIRE=(t_outconnect *)666; WIRE==(t_outconnect *)666; ) \
! 		for (t_linetraverser TRAV(CANVAS); (WIRE=linetraverser_next(&TRAV)); )
  
  #define CLAMP(_var,_min,_max) do { if (_var<_min) _var=_min; else if (_var>_max) _var=_max; } while(0)
***************
*** 435,438 ****
--- 436,441 ----
  }
  
+ t_linetraverser::t_linetraverser(t_canvas *canvas) {linetraverser_start(this,canvas);}
+ 
  void linetraverser_start(t_linetraverser *t, t_canvas *x) {
      t->from = 0;
***************
*** 735,739 ****
  
  static void canvas_drawlines(t_canvas *x) {
-     t_linetraverser t; t_outconnect *oc;
      canvas_wires_each(oc,t,x) gobj_changed(oc,0);
  }
--- 738,741 ----
***************
*** 741,745 ****
  /* kill all lines for one inlet or outlet */
  void canvas_deletelinesforio(t_canvas *x, t_text *text, t_inlet *inp, t_outlet *outp) {
-     t_linetraverser t; t_outconnect *oc;
      canvas_wires_each(oc,t,x)
          if ((t.from == text && t.outletp == outp) ||
--- 743,746 ----
***************
*** 749,753 ****
  
  void canvas_deletelinesfor(t_canvas *x, t_text *text) {
-     t_linetraverser t; t_outconnect *oc;
      canvas_wires_each(oc,t,x)
          if (t.from == text || t.to == text)
--- 750,753 ----
***************
*** 961,965 ****
  
  static void canvas_dodsp(t_canvas *x, int toplevel, t_signal **sp) {
-     t_linetraverser t; t_outconnect *oc;
      t_object *ob;
      t_symbol *dspsym = gensym("dsp");
--- 961,964 ----
***************
*** 1141,1145 ****
  
  void canvas_disconnect(t_canvas *x, float from_, float outlet, float to_, float inlet) {
-     t_linetraverser t; t_outconnect *oc;
      canvas_wires_each(oc,t,x) {
          int from = canvas_getindex(x, (t_gobj *)t.from);
--- 1140,1143 ----
***************
*** 1246,1250 ****
  /* keep me */
  static int canvas_isconnected (t_canvas *x, t_text *ob1, int n1, t_text *ob2, int n2) {
-     t_linetraverser t; t_outconnect *oc;
      canvas_wires_each(oc,t,x)
          if (t.from == ob1 && t.outlet == n1 &&
--- 1244,1247 ----
***************
*** 1352,1357 ****
  static void canvas_stowconnections(t_canvas *x, t_gobj *o) {
      t_gobj *selhead = 0, *seltail = 0, *nonhead = 0, *nontail = 0;
-     t_linetraverser t; t_outconnect *oc;
- 
      /* split list to "selected" and "unselected" parts */
      for (t_gobj *y2,*y = x->list; y; y = y2) {
--- 1349,1352 ----
***************
*** 3180,3184 ****
  
  static void canvas_saveto(t_canvas *x, t_binbuf *b) {
-     t_linetraverser t; t_outconnect *oc;
      canvas_savecontainerto(x,b);
      canvas_each(y,x) gobj_save(y, b);
--- 3175,3178 ----
***************
*** 6746,6750 ****
  		char foo[4096];
  		t_canvas *can = (t_canvas *)self;
- 		t_linetraverser t; t_outconnect *oc;
  		char *bar=foo; *foo=0;
  		canvas_each(y,can) bar+=sprintf(bar,"x%lx ",(long)y);
--- 6740,6743 ----





More information about the Pd-cvs mailing list