prevent degenerated hash values with 64bit pointer

SVN revision: 35146
This commit is contained in:
Peter Wehrfritz 2008-07-17 22:58:28 +00:00
parent ac88597078
commit 2ab5747a80
1 changed files with 7 additions and 1 deletions

View File

@ -56,7 +56,13 @@ ecore_print_warning(const char *function, const char *sparam)
EAPI unsigned int
ecore_direct_hash(const void *key)
{
return ((unsigned int) key);
#ifdef __LP64__
unsigned long int val = (unsigned long int)key;
return (unsigned int) ((val >> 32) ^ val);
#else
return (unsigned int) key;
#endif
}
/**