aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-01-17 19:05:58 +0000
committerMike Buland <eichlan@xagasoft.com>2007-01-17 19:05:58 +0000
commit22c526f708c433bfdf7833970eaf0a8d27050ea9 (patch)
tree97b79d3a1ddf6a40c491e0e64bab2f9adb1147cc /src
parent6e94731fd92d86e74f8c2fa9f679d0e2911fe9c3 (diff)
downloadlibbu++-22c526f708c433bfdf7833970eaf0a8d27050ea9.tar.gz
libbu++-22c526f708c433bfdf7833970eaf0a8d27050ea9.tar.bz2
libbu++-22c526f708c433bfdf7833970eaf0a8d27050ea9.tar.xz
libbu++-22c526f708c433bfdf7833970eaf0a8d27050ea9.zip
Added more hash functions, yay hash functions!
Diffstat (limited to 'src')
-rw-r--r--src/hash.cpp20
-rw-r--r--src/hash.h6
2 files changed, 26 insertions, 0 deletions
diff --git a/src/hash.cpp b/src/hash.cpp
index 3fb4f52..d428dd6 100644
--- a/src/hash.cpp
+++ b/src/hash.cpp
@@ -22,6 +22,26 @@ template<> bool __cmpHashKeys<int>( int a, int b )
22 return a == b; 22 return a == b;
23} 23}
24 24
25template<> uint32_t __calcHashCode<const unsigned int>( const unsigned int k )
26{
27 return k;
28}
29
30template<> bool __cmpHashKeys<const unsigned int>( const unsigned int a, const unsigned int b )
31{
32 return a == b;
33}
34
35template<> uint32_t __calcHashCode<unsigned int>( unsigned int k )
36{
37 return k;
38}
39
40template<> bool __cmpHashKeys<unsigned int>( unsigned int a, unsigned int b )
41{
42 return a == b;
43}
44
25template<> 45template<>
26uint32_t __calcHashCode<const char *>( const char * k ) 46uint32_t __calcHashCode<const char *>( const char * k )
27{ 47{
diff --git a/src/hash.h b/src/hash.h
index cd21a29..fa82cc3 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -534,6 +534,12 @@ template<> bool __cmpHashKeys<const int>( const int a, const int b );
534template<> uint32_t __calcHashCode<int>( int k ); 534template<> uint32_t __calcHashCode<int>( int k );
535template<> bool __cmpHashKeys<int>( int a, int b ); 535template<> bool __cmpHashKeys<int>( int a, int b );
536 536
537template<> uint32_t __calcHashCode<const unsigned int>( const unsigned int k );
538template<> bool __cmpHashKeys<const unsigned int>( const unsigned int a, const unsigned int b );
539
540template<> uint32_t __calcHashCode<unsigned int>( unsigned int k );
541template<> bool __cmpHashKeys<unsigned int>( unsigned int a, unsigned int b );
542
537template<> uint32_t __calcHashCode<const char *>( const char *k ); 543template<> uint32_t __calcHashCode<const char *>( const char *k );
538template<> bool __cmpHashKeys<const char *>( const char *a, const char *b ); 544template<> bool __cmpHashKeys<const char *>( const char *a, const char *b );
539 545