--- parser3/src/include/pa_hash.h 2003/02/03 15:57:43 1.58.2.12 +++ parser3/src/include/pa_hash.h 2003/02/06 15:33:15 1.58.2.15 @@ -17,7 +17,7 @@ #ifndef PA_HASH_H #define PA_HASH_H -static const char* IDENT_HASH_H="$Date: 2003/02/03 15:57:43 $"; +static const char* IDENT_HASH_H="$Date: 2003/02/06 15:33:15 $"; #include "pa_pool.h" #include "pa_types.h" @@ -170,9 +170,9 @@ public: for(int index=0; indexlink) if(callback(pair->key, pair->value, info)) - return &pair->value; + return pair->value; - return 0;//V(0) + return V(0); } /// remove all elements @@ -283,7 +283,7 @@ template int Hash::allocates_count=sizeof(allocates)/sizeof(uint); /// useful generic hash function -inline uint generic_hash_code(uint aresult, const char* start, uint allocated) { +inline uint generic_hash_code(uint aresult, const char* start, size_t allocated) { uint result=aresult, g; const char* end=start+allocated; @@ -297,6 +297,12 @@ inline uint generic_hash_code(uint aresu return result; } +/// simple hash code of int. used by EXIF mapping +inline uint hash_code(int self) { + uint result=0; + return generic_hash_code(result, (const char*)self, sizeof(self)); +} + /// Auto-object used to temporarily substituting/removing hash values template class Temp_hash_value {