/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-07-12 19:04:18 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150712190418-yi9rfito5ovnf6dy
* Made the code more easy to read.

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
 
hash_t sdbm_hash (const char * key) {
 
11
hash_t
 
12
sdbm_hash (const char * key) {
12
13
  hash_t h=0;
13
14
  while(*key) h=*key++ + (h<<6) + (h<<16) - h;
14
15
  return h;
15
16
}
16
17
 
17
 
hash_t s_hash_object (const spointer obj) {
 
18
hash_t
 
19
s_hash_object (const spointer obj) {
18
20
  /* We take the address of the pointer. */
19
21
  hash_t tmp_val = S_POINTER_TO_HASH_T(obj);
20
22
  /* Scrable it up a bit */