~ubuntu-branches/ubuntu/lucid/blender/lucid

« back to all changes in this revision

Viewing changes to source/kernel/gen_system/GEN_HashedPtr.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2009-08-06 22:32:19 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090806223219-8z4eej1u8levu4pz
Tags: 2.49a+dfsg-0ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control: Build-depend on python-2.6 rather than python-2.5.
  - debian/misc/*.desktop: Add Spanish translation to .desktop 
    files.
  - debian/pyversions: 2.6.
  - debian/rules: Clean *.o of source/blender/python/api2_2x/
* New upstream release (LP: #382153).
* Refreshed patches:
  - 01_sanitize_sys.patch
  - 02_tmp_in_HOME
  - 10_use_systemwide_ftgl
  - 70_portability_platform_detection
* Removed patches merged upstream:
  - 30_fix_python_syntax_warning
  - 90_ubuntu_ffmpeg_52_changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: GEN_HashedPtr.cpp 16147 2008-08-17 17:08:00Z genscher $
 
2
 * $Id: GEN_HashedPtr.cpp 20094 2009-05-07 09:13:01Z ben2610 $
3
3
 *
4
4
 * ***** BEGIN GPL LICENSE BLOCK *****
5
5
 *
40
40
// is a 32-bit integer, use all the bits of the pointer as long
41
41
// as possible.
42
42
//
43
 
 
 
43
#if 1
44
44
unsigned int GEN_Hash(void * inDWord)
45
45
{
46
46
        uintptr_t key = (uintptr_t)inDWord;
47
 
 
 
47
#if 0
 
48
        // this is way too complicated
48
49
        key += ~(key << 16);
49
50
        key ^=  (key >>  5);
50
51
        key +=  (key <<  3);
53
54
        key ^=  (key >> 17);
54
55
 
55
56
        return (unsigned int)(key & 0xffffffff);
 
57
#else
 
58
        return (unsigned int)(key ^ (key>>4));
 
59
#endif
56
60
}
 
61
#endif
 
 
b'\\ No newline at end of file'