| 557 | //char primes[16] = {1, 3, 5, 7, 11, 13, 17, 19, 23, 27, 29, 31, 37, 41, 43, 47}; |
| 558 | |
| 559 | int PC_NameHash(char *name) |
| 560 | { |
| 561 | int hash, i; |
| 562 | |
| 563 | hash = 0; |
| 564 | for (i = 0; name[i] != '\0'; i++) |
| 565 | { |
| 566 | hash += name[i] * (119 + i); |
| 567 | //hash += (name[i] << 7) + i; |
| 568 | //hash += (name[i] << (i&15)); |
| 569 | } //end while |
| 570 | hash = (hash ^ (hash >> 10) ^ (hash >> 20)) & (DEFINEHASHSIZE-1); |
| 571 | return hash; |
| 572 | } //end of the function PC_NameHash |
| 573 | //============================================================================ |
| 574 | // |
| 575 | // Parameter: - |
no outgoing calls
no test coverage detected