[PD-cvs] externals/grill/pool/source pool.cpp,1.1,1.2 pool.h,1.1,1.2
xovo at users.sourceforge.net
xovo at users.sourceforge.net
Mon Feb 23 04:32:57 CET 2004
Update of /cvsroot/pure-data/externals/grill/pool/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3358/source
Modified Files:
pool.cpp pool.h
Log Message:
""
Index: pool.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/pool/source/pool.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pool.cpp 8 Jan 2004 03:38:35 -0000 1.1
--- pool.cpp 23 Feb 2004 03:32:53 -0000 1.2
***************
*** 879,883 ****
}
!
!
--- 879,896 ----
}
+ unsigned int pooldir::FoldBits(unsigned long h,int bits)
+ {
+ if(!bits) return 0;
+ const int hmax = (1<<bits)-1;
+ unsigned int ret = 0;
+ for(unsigned int i = 0; i < sizeof(h)*8; i += bits)
+ ret ^= (h>>i)&hmax;
+ return ret;
+ }
! int pooldir::Int2Bits(unsigned long n)
! {
! int b;
! for(b = 0; n; ++b) n >>= 1;
! return b;
! }
Index: pool.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/pool/source/pool.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pool.h 8 Jan 2004 03:38:35 -0000 1.1
--- pool.h 23 Feb 2004 03:32:54 -0000 1.2
***************
*** 104,107 ****
--- 104,110 ----
const I vbits,dbits,vsize,dsize;
+ static unsigned int FoldBits(unsigned long h,int bits);
+ static int Int2Bits(unsigned long n);
+
struct valentry { int cnt; poolval *v; };
struct direntry { int cnt; pooldir *d; };
More information about the Pd-cvs
mailing list