aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/pool
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2004-02-23 03:32:54 +0000
committerThomas Grill <xovo@users.sourceforge.net>2004-02-23 03:32:54 +0000
commitd5f3af34344340c718d07c9c84d562785443747e (patch)
tree87ca39a07f491898c292c2900a6bd3aee8134f77 /externals/grill/pool
parent95bf21f70657b8acada4120e51207d64c97445cd (diff)
""
svn path=/trunk/; revision=1350
Diffstat (limited to 'externals/grill/pool')
-rw-r--r--externals/grill/pool/pool.vcproj1
-rw-r--r--externals/grill/pool/source/pool.cpp17
-rw-r--r--externals/grill/pool/source/pool.h3
3 files changed, 19 insertions, 2 deletions
diff --git a/externals/grill/pool/pool.vcproj b/externals/grill/pool/pool.vcproj
index 59b8bd60..494c67c2 100644
--- a/externals/grill/pool/pool.vcproj
+++ b/externals/grill/pool/pool.vcproj
@@ -36,6 +36,7 @@
ProgramDataBaseFileName=".\pd-msvc/r/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
+ DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
diff --git a/externals/grill/pool/source/pool.cpp b/externals/grill/pool/source/pool.cpp
index 4d6d100e..dcb16237 100644
--- a/externals/grill/pool/source/pool.cpp
+++ b/externals/grill/pool/source/pool.cpp
@@ -878,6 +878,19 @@ BL pooldir::SvDirXML(ostream &os,I depth,const AtomList &dir,I ind)
return true;
}
+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;
+}
diff --git a/externals/grill/pool/source/pool.h b/externals/grill/pool/source/pool.h
index 99e271b3..1874d334 100644
--- a/externals/grill/pool/source/pool.h
+++ b/externals/grill/pool/source/pool.h
@@ -103,6 +103,9 @@ protected:
pooldir *parent;
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; };