diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-02-11 04:37:35 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-02-11 04:37:35 +0000 |
commit | 97926eb08cf74f277e522ffb8c7f985457822de3 (patch) | |
tree | 680b0e4c564057340a0b528ea6468d4e381a907d /externals/grill/flext/source/flsupport.cpp | |
parent | 06f62d1168209ca6b9e2c3c5264c96a0a4c7cc98 (diff) |
""
svn path=/trunk/; revision=388
Diffstat (limited to 'externals/grill/flext/source/flsupport.cpp')
-rw-r--r-- | externals/grill/flext/source/flsupport.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp index 3c6ab8f3..f3309ab0 100644 --- a/externals/grill/flext/source/flsupport.cpp +++ b/externals/grill/flext/source/flsupport.cpp @@ -128,13 +128,22 @@ void flext::GetAString(const t_atom &a,char *buf,int szbuf) #endif } +unsigned long flext::AtomHash(const t_atom &a) +{ +#if FLEXT_SYS == FLEXT_SYS_MAX || FLEXT_SYS == FLEXT_SYS_PD + return ((unsigned long)a.a_type<<28)^*(unsigned long *)&a.a_w; +#else +#error Not implemented +#endif +} + unsigned int flext::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 = ret^((h>>i)&hmax); + ret ^= (h>>i)&hmax; return ret; } |