components/prboom/w_wad.c
// Hash function used for lump names.
// Must be mod'ed with table size.
// Can be used for any 8-character names.
// by Lee Killough
Hash function used for lump names.
Must be mod'ed with table size.
Can be used for any 8-character names.
by Lee Killough
Hash function used for lump names . Must be mod ' ed with table size . Can be used for any 8 - character names . by Lee Killough
unsigned W_LumpNameHash(const char *s)
{
  unsigned hash;
  (void) ((hash =        toupper(s[0]), s[1]) &&
          (hash = hash*3+toupper(s[1]), s[2]) &&
          (hash = hash*2+toupper(s[2]), s[3]) &&
          (hash = hash*2+toupper(s[3]), s[4]) &&
          (hash = hash*2+toupper(s[4]), s[5]) &&
          (hash = hash*2+toupper(s[5]), s[6]) &&
          (hash = hash*2+toupper(s[6]),
           hash = hash*2+toupper(s[7]))
         );
  return hash;
}
unsigned W_LumpNameHash ( const char * s ) { unsigned hash ; ( void ) ( ( hash = toupper ( s [ 0 ] ) , s [ 1 ] ) && ( hash = hash * 3 + toupper ( s [ 1 ] ) , s [ 2 ] ) && ( hash = hash * 2 + toupper ( s [ 2 ] ) , s [ 3 ] ) && ( hash = hash * 2 + toupper ( s [ 3 ] ) , s [ 4 ] ) && ( hash = hash * 2 + toupper ( s [ 4 ] ) , s [ 5 ] ) && ( hash = hash * 2 + toupper ( s [ 5 ] ) , s [ 6 ] ) && ( hash = hash * 2 + toupper ( s [ 6 ] ) , hash = hash * 2 + toupper ( s [ 7 ] ) ) ) ; return hash ; }
Hash function used for lump names.
Hash function used for lump names .