From 22c526f708c433bfdf7833970eaf0a8d27050ea9 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 17 Jan 2007 19:05:58 +0000 Subject: Added more hash functions, yay hash functions! --- src/hash.cpp | 20 ++++++++++++++++++++ src/hash.h | 6 ++++++ 2 files changed, 26 insertions(+) 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 a, int b ) return a == b; } +template<> uint32_t __calcHashCode( const unsigned int k ) +{ + return k; +} + +template<> bool __cmpHashKeys( const unsigned int a, const unsigned int b ) +{ + return a == b; +} + +template<> uint32_t __calcHashCode( unsigned int k ) +{ + return k; +} + +template<> bool __cmpHashKeys( unsigned int a, unsigned int b ) +{ + return a == b; +} + template<> uint32_t __calcHashCode( const char * k ) { 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 a, const int b ); template<> uint32_t __calcHashCode( int k ); template<> bool __cmpHashKeys( int a, int b ); +template<> uint32_t __calcHashCode( const unsigned int k ); +template<> bool __cmpHashKeys( const unsigned int a, const unsigned int b ); + +template<> uint32_t __calcHashCode( unsigned int k ); +template<> bool __cmpHashKeys( unsigned int a, unsigned int b ); + template<> uint32_t __calcHashCode( const char *k ); template<> bool __cmpHashKeys( const char *a, const char *b ); -- cgit v1.2.3