Update of /cvsroot/pure-data/externals/zexy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9676
Modified Files: fifop.c lifop.c Log Message: simplified the stack counter
Index: fifop.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/fifop.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** fifop.c 4 Dec 2005 12:44:33 -0000 1.7 --- fifop.c 4 Dec 2005 12:58:29 -0000 1.8 *************** *** 45,49 **** t_fifop_list *fifo_end; struct _fifop_prioritylist *next; - unsigned long counter; } t_fifop_prioritylist;
--- 45,48 ---- *************** *** 53,56 **** --- 52,56 ---- t_fifop_prioritylist *fifo_list; t_float priority; /* current priority */ + unsigned long counter; t_outlet *x_out, *x_infout; } t_fifop; *************** *** 84,88 **** result->fifo_end=0; result->next=0; - result->counter=0;
/* insert it into the list of priority lists */ --- 84,87 ---- *************** *** 140,144 **** fifoprio->fifo_end =entry; } - fifoprio->counter++; return 0; } --- 139,142 ---- *************** *** 158,162 **** return; } ! add2fifo(pfifo, argc, argv); } static void fifop_bang(t_fifop *x) --- 156,163 ---- return; } ! if(!add2fifo(pfifo, argc, argv)) ! { ! x->counter++; ! } } static void fifop_bang(t_fifop *x) *************** *** 176,180 **** }
! pfifo->counter--;
pfifo->fifo_start=fifo->next; --- 177,181 ---- }
! x->counter--;
pfifo->fifo_start=fifo->next; *************** *** 201,215 **** static void fifop_query(t_fifop*x) { ! unsigned long counter=0; ! t_fifop_prioritylist*pfifo=x->fifo_list; ! ! while(pfifo!=NULL){ ! counter+=pfifo->counter; ! pfifo=pfifo->next; ! } ! ! verbose(1, "%d elements in fifo", (int)counter);
! outlet_float(x->x_infout, (t_float)counter); } static void fifop_free(t_fifop *x) --- 202,208 ---- static void fifop_query(t_fifop*x) { ! verbose(1, "%d elements in fifo", (int)x->counter);
! outlet_float(x->x_infout, (t_float)x->counter); } static void fifop_free(t_fifop *x)
Index: lifop.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/lifop.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** lifop.c 4 Dec 2005 12:44:33 -0000 1.5 --- lifop.c 4 Dec 2005 12:58:29 -0000 1.6 *************** *** 44,48 **** t_lifop_list *lifo_start; struct _lifop_prioritylist *next; - unsigned long counter; } t_lifop_prioritylist; typedef struct _lifop --- 44,47 ---- *************** *** 50,53 **** --- 49,53 ---- t_object x_obj; t_lifop_prioritylist *lifo_list; + unsigned long counter; t_float priority; /* current priority */ t_outlet *x_out, *x_infout; *************** *** 79,83 **** result->priority=priority; result->lifo_start=0; - result->counter=0;
/* insert it into the list of priority lists */ --- 79,82 ---- *************** *** 123,127 **** entry->next=lifoprio->lifo_start; lifoprio->lifo_start=entry; - lifoprio->counter++;
return 0; --- 122,125 ---- *************** *** 142,146 **** return; } ! add2lifo(plifo, argc, argv); } static void lifop_bang(t_lifop *x) --- 140,148 ---- return; } ! if(!add2lifo(plifo, argc, argv)) ! { ! x->counter++; ! } ! } static void lifop_bang(t_lifop *x) *************** *** 160,164 **** }
! plifo->counter--;
plifo->lifo_start=lifo->next; --- 162,166 ---- }
! x->counter--;
plifo->lifo_start=lifo->next; *************** *** 182,197 **** } static void lifop_query(t_lifop*x) ! { ! unsigned long counter=0; ! t_lifop_prioritylist*plifo=x->lifo_list; ! ! while(plifo!=NULL){ ! counter+=plifo->counter; ! plifo=plifo->next; ! } ! ! verbose(1, "%d elements in lifo", (int)counter);
! outlet_float(x->x_infout, (t_float)counter); } static void lifop_free(t_lifop *x) --- 184,191 ---- } static void lifop_query(t_lifop*x) ! { ! verbose(1, "%d elements in lifo", (int)x->counter);
! outlet_float(x->x_infout, (t_float)x->counter); } static void lifop_free(t_lifop *x) *************** *** 235,238 **** --- 229,233 ---- x->lifo_list = 0; x->priority=0; + x->counter=0;
return (x);