Ignore:
Timestamp:
Mar 26, 2008, 7:34:47 PM (17 years ago)
Author:
Adam Roben
Message:

Windows build fix

  • kjs/array_instance.cpp: Touched this.
  • wtf/HashFunctions.h: (WTF::intHash): Added 8- and 16-bit versions of intHash.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/HashFunctions.h

    r31335 r31343  
    3636
    3737    // integer hash function
     38
     39    // Thomas Wang's 32 Bit Mix Function: http://www.cris.com/~Ttwang/tech/inthash.htm
     40    inline unsigned intHash(uint8_t key8)
     41    {
     42        unsigned key = key8;
     43        key += ~(key << 15);
     44        key ^= (key >> 10);
     45        key += (key << 3);
     46        key ^= (key >> 6);
     47        key += ~(key << 11);
     48        key ^= (key >> 16);
     49        return key;
     50    }
     51
     52    // Thomas Wang's 32 Bit Mix Function: http://www.cris.com/~Ttwang/tech/inthash.htm
     53    inline unsigned intHash(uint16_t key16)
     54    {
     55        unsigned key = key16;
     56        key += ~(key << 15);
     57        key ^= (key >> 10);
     58        key += (key << 3);
     59        key ^= (key >> 6);
     60        key += ~(key << 11);
     61        key ^= (key >> 16);
     62        return key;
     63    }
    3864
    3965    // Thomas Wang's 32 Bit Mix Function: http://www.cris.com/~Ttwang/tech/inthash.htm
Note: See TracChangeset for help on using the changeset viewer.