/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to src/hash.c

  • Committer: Gustav Hartvigsson
  • Date: 2015-04-10 15:24:35 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150410152435-uumooulvwmn02rxb
* Renamed DynamicArray to SDynamicArray.
* Renamed dynamic_array_*() functions to s_dynamic_array_*()
* Fixed indentation problem in Error.h and defs.h
* Removed dependency on stdbool.h
* Added sboolean
* Addad sconstpointer
* Reverted SMap back no not depending on SObject.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 * this is the SDBM hash function from:
9
9
 * http://en.literateprograms.org/Hash_function_comparison_%28C,_sh%29
10
10
 */
11
 
long sdbm_hash (const unsigned char *key) {
 
11
hash_t sdbm_hash (const unsigned char *key) {
12
12
  hash_t h=0;
13
13
  while(*key) h=*key++ + (h<<6) + (h<<16) - h;
14
14
  return h;