nesasm/source/symbol.c
/* ----
 * symhash()
 * ----
 * calculate the hash value of a symbol
 */
symhash()

calculate the hash value of a symbol
symhash () calculate the hash value of a symbol
int
symhash(void)
{
	int i;
	char c;
	int hash = 0;
	for (i = 1; i <= symbol[0]; i++) {
		c = symbol[i];
		hash += c;
		hash  = (hash << 3) + (hash >> 5) + c;
	}
	return (hash & 0xFF);
}
int symhash ( void ) { int i ; char c ; int hash = 0 ; for ( i = 1 ; i <= symbol [ 0 ] ; i ++ ) { c = symbol [ i ] ; hash += c ; hash = ( hash << 3 ) + ( hash >> 5 ) + c ; } return ( hash & 0xFF ) ; }
symhash()
 
 calculate the hash value of a symbol
symhash () calculate the hash value of a symbol
/* hash value */ /* ok */