[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] Whoah. Bugs galore in hashing.



Matthias Andree wrote:

[Arnt's code snipped]

> a) name is char[], if that's signed or unsigned is implementation-dependent
> b) r is unsigned int
> c) name is cast to (signed) int.
> d) the hashing function is embedded. Wrong. Belongs into a separate function.

In other words, the function does not contain a single bug, although
it is certainly not an example of good programming.

OTOH, if (a) is valid, then changing the code may result in
incompatibilities between leafnode versions on the same machine
because the hash function will change. This should be avoided
under all circumstances.

--Cornelius.

-- 
/* Cornelius Krasel, U Wuerzburg, Dept. of Pharmacology, Versbacher Str. 9 */
/* D-97078 Wuerzburg, Germany   email: krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* "Science is the game we play with God to find out what His rules are."  */

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list