[PD-cvs] externals/maxlib/src lifo.c,1.6,1.7
cyrille
nusmuk at users.sourceforge.net
Mon May 30 18:55:36 CEST 2005
Update of /cvsroot/pure-data/externals/maxlib/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28739
Modified Files:
lifo.c
Log Message:
bugfix of the lifo objects.
Index: lifo.c
===================================================================
RCS file: /cvsroot/pure-data/externals/maxlib/src/lifo.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** lifo.c 20 Mar 2004 05:56:30 -0000 1.6
--- lifo.c 30 May 2005 16:55:33 -0000 1.7
***************
*** 34,38 ****
t_object d_ob;
t_float *getal;
! t_int count, end, size, teller;
t_outlet *out;
--- 34,38 ----
t_object d_ob;
t_float *getal;
! t_int size, teller;
t_outlet *out;
***************
*** 42,58 ****
static void lifo_int(t_lifo *x, t_floatarg n)
! {
! x->getal[x->count] = n;
! x->end = x->count;
! if (x->teller < x->size) x->teller++;
! x->count = (x->count + 1) % x->size;
}
static void lifo_bang(t_lifo *x)
{
! if (x->teller > 0){
! outlet_float(x->out,x->getal[x->end]);
x->teller--;
- x->end = (x->end + x->size - 1) % x->size;
}
}
--- 42,62 ----
static void lifo_int(t_lifo *x, t_floatarg n)
! {
! if(x->teller < x->size )
! {
! x->getal[x->teller] = n;
! x->teller++;
! }
! else
! post("no more lifo memory");
!
}
static void lifo_bang(t_lifo *x)
{
! if (x->teller > 0)
! {
! outlet_float(x->out,x->getal[x->teller-1]);
x->teller--;
}
}
***************
*** 75,80 ****
x->size = (t_int)n;
x->teller = 0;
- x->end = 0;
- x->count = 0;
x->getal = (t_float *)getbytes(x->size * sizeof(t_float));
x->out = outlet_new(&x->d_ob, gensym("float"));
--- 79,82 ----
More information about the Pd-cvs
mailing list